]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix assertion violations when clicking on Info bread-crumbs.
[gnu-emacs] / src / ChangeLog
1 2012-11-24 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4 highlighting on the frame was cleared. Prevents assertion
5 violations when repeatedly clicking on the "Top" link of the
6 "bread-crumbs" in Info buffers.
7
8 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
9 Eli Zaretskii <eliz@gnu.org>
10
11 Fix a race condition with glib (Bug#8855).
12 The symptom is a diagnostic "GLib-WARNING **: In call to
13 g_spawn_sync(), exit status of a child process was requested but
14 SIGCHLD action was set to SIG_IGN and ECHILD was received by
15 waitpid(), so exit status can't be returned." The diagnostic
16 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
17 The real bug is a race condition between Emacs and glib: Emacs
18 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
19 so that glib can't find it. Work around the bug by invoking
20 waitpid only on subprocesses that Emacs itself creates.
21
22 This is a backport from the trunk, consisting of:
23
24 * w32proc.c (create_child): Don't clip the PID of the child
25 process to fit into an Emacs integer, as this is no longer a
26 restriction.
27 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
28 reaping only the process specified by PID argument, if that is
29 positive. Use PID instead of dead_child to know which process to
30 reap. Wait for the child to die only if WNOHANG is not in
31 OPTIONS.
32 (sys_select): Don't set dead_child.
33
34 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
35 as it is no longer needed.
36
37 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
38 no longer needed.
39 (create_process, record_child_status_change): Don't use special
40 value -1 in pid field, as the caller now must know the pid rather
41 than having the callee infer it. The inference was sometimes
42 incorrect anyway, due to another race.
43 (create_process): Set new 'alive' member if child is created.
44 (process_status_retrieved): New function.
45 (record_child_status_change): Use it.
46 Accept negative 1st argument, which means to wait for the
47 processes that Emacs already knows about. Move special-case code
48 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
49 processes that have already been waited for, by testing and
50 clearing new 'alive' member. Remove the setting of
51 record_at_most_one_child for the !WNOHANG case.
52 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
53 now does this internally.
54 (handle_child_signal): Let record_child_status_change do all
55 the work, since we do not want to reap all exited child processes,
56 only the child processes that Emacs itself created.
57 * process.h (Lisp_Process): New boolean member 'alive'.
58
59 2012-11-23 Eli Zaretskii <eliz@gnu.org>
60
61 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
62 between bpos_covered and bpos_max. This fixes cursor display when
63 several display strings follow each other.
64
65 * .gdbinit (pgx): If the glyph's object is a string, display the
66 pointer to string data, rather than the value of the string object
67 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
68
69 2012-11-21 Eli Zaretskii <eliz@gnu.org>
70
71 * indent.c (Fvertical_motion): If the starting position is covered
72 by a display string, return to one position before that, to avoid
73 overshooting it inside move_it_to. (Bug#12930)
74
75 2012-11-20 Daniel Colascione <dancol@dancol.org>
76
77 * w32fns.c (Fx_file_dialog):
78 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
79 cygwin_convert_file_name*.
80
81 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
82 Rename cygwin_convert_path* to cygwin_convert_file_name*.
83
84 2012-11-20 Ken Brown <kbrown@cornell.edu>
85
86 * emacs.c (main): Set the G_SLICE environment variable for all
87 Cygwin builds, not just GTK builds. See
88 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
89
90 2012-11-19 Eli Zaretskii <eliz@gnu.org>
91
92 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
93 w32_note_current_window with code. (Backport from trunk.)
94
95 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
96 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
97 Define for the MSVC compiler.
98
99 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
100 semi-colon.
101
102 2012-11-18 Eli Zaretskii <eliz@gnu.org>
103
104 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
105 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
106 dostounix_filename. Prevents crashes down the road, because
107 dostounix_filename assumes it gets a unibyte string. Reported by
108 Michel de Ruiter <michel@sentient.nl>, see
109 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
110
111 2012-11-17 Eli Zaretskii <eliz@gnu.org>
112
113 * w32select.c: Include w32common.h before w32term.h, so that
114 windows.h gets included before w32term.h uses some of its
115 features, see below.
116
117 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
118 typedefs.
119 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
120 prototypes.
121 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
122
123 2012-11-17 Jan Djärv <jan.h.d@swipnet.se>
124
125 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
126 (ns_select): Return at once if events are held (Bug#12834).
127
128 2012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
129
130 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
131 Needed following 2012-10-20 change. (Bug#12902)
132
133 2012-11-16 Glenn Morris <rgm@gnu.org>
134
135 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
136
137 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
138
139 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
140
141 2012-11-14 Eli Zaretskii <eliz@gnu.org>
142
143 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
144 use the same value of thread handle.
145 (start_timer_thread): If the timer thread exited (due to error),
146 clean up by closing the two handles it used. Duplicate the caller
147 thread's handle here, so it gets duplicated only once, when
148 launching the timer thread. Set priority of the timer thread, not
149 the caller thread.
150 (getitimer): Don't duplicate the caller thread's handle here.
151 (Bug#12832)
152
153 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
154
155 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
156 called (Bug#12834).
157
158 2012-11-12 Eli Zaretskii <eliz@gnu.org>
159
160 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
161 passed to pint2str and pint2hrstr to be at most the size of the
162 frame's decode_mode_spec_buffer. This avoids crashes with very
163 large values of FIELD_WIDTH argument to decode_mode_spec.
164 (Bug#12867)
165
166 2012-11-07 Martin Rudalics <rudalics@gmx.at>
167
168 * window.c (Fsplit_window_internal): Set combination limit of
169 new parent window to t iff Vwindow_combination_limit is t;
170 fixing a regression introduced with the change from 2012-09-22.
171 (Fwindow_combination_limit, Fset_window_combination_limit):
172 Fix doc-strings.
173
174 2012-11-06 Eli Zaretskii <eliz@gnu.org>
175
176 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
177 amount when the scroll margins are too large. When scrolling
178 backwards in the buffer, give up if cannot reach point or the
179 scroll margin within a reasonable number of screen lines.
180 Fixes point position in window under scroll-up/down-aggressively when
181 point is positioned many lines beyond the window top/bottom.
182 (Bug#12811)
183
184 2012-11-05 Eli Zaretskii <eliz@gnu.org>
185
186 * ralloc.c (relinquish): If real_morecore fails to return memory
187 to the system, don't crash; instead, leave the last heap
188 unchanged and return. (Bug#12774)
189
190 2012-11-03 Eli Zaretskii <eliz@gnu.org>
191
192 * lisp.mk: Adjust comments to the fact that term/internal is now
193 loaded from loadup.el.
194
195 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
196 (msdos_fatal_signal): New function.
197 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
198 its argument list.
199
200 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
201 for GCC versions before 4.
202 (emacs_raise): Define to call msdos_fatal_signal.
203
204 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
205 iterator when starting in the middle of a display or overlay
206 string. (Bug#12745)
207
208 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
209
210 * widget.c (resize_cb): New function.
211 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
212 (EmacsFrameResize): Check if all is up to date before changing frame
213 size.
214
215 2012-11-01 Eli Zaretskii <eliz@gnu.org>
216
217 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
218
219 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
220
221 Fix crash when using Emacs as commit editor for git (Bug#12697).
222 * callproc.c (setpgrp): Remove macro, as we now use setpgid
223 and it is configured in conf_post.h.
224 (Fcall_process): Don't invoke both setsid and setpgid; the former
225 is enough, if it exists.
226 * callproc.c (Fcall_process, child_setup):
227 * process.c (create_process): Use setpgid.
228 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
229 for the real thing.
230 * dispnew.c (init_display): Initialize the foreground group
231 if we are running a tty display.
232 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
233 * lisp.h (init_foreground_group): New decl.
234 * sysdep.c (inherited_pgroup): New static var.
235 (init_foreground_group, tcsetpgrp_without_stopping)
236 (narrow_foreground_group, widen_foreground_group): New functions.
237 (init_sys_modes): Narrow foreground group.
238 (reset_sys_modes): Widen foreground group.
239
240 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
241
242 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
243
244 2012-10-31 Martin Rudalics <rudalics@gmx.at>
245
246 * minibuf.c (read_minibuf): Restore current buffer since
247 choose_minibuf_frame calling Fset_frame_selected_window may
248 change it (Bug#12766).
249
250 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
251
252 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
253
254 2012-10-30 Kenichi Handa <handa@gnu.org>
255
256 * font.c (Ffont_at): If WINDOW is specified and it is not
257 displaying the current buffer, signal an error.
258
259 2012-10-29 Daniel Colascione <dancol@dancol.org>
260
261 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
262 In preparation for fixing bug#12739, move these functions from
263 here...
264
265 * coding.h, coding.c: ... to here, and compile them only when
266 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
267 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
268
269 2012-10-28 Eli Zaretskii <eliz@gnu.org>
270
271 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
272 (timer_loop, getitimer, setitimer): Use it instead of
273 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
274 'clock'.
275 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
276 literal 10000.
277
278 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
279
280 * nsterm.m (NO_APPDEFINED_DATA): New define.
281 (last_appdefined_event_data): New variable
282 (last_appdefined_event): Remove.
283 (ns_select): Initialize t from last_appdefined_event_data instead
284 of [last_appdefined_event data1].
285 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
286 remove last_appdefined_event (Bug#12698).
287
288 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
289
290 * frame.c (x_set_font): Catch internal error.
291
292 2012-10-27 Eli Zaretskii <eliz@gnu.org>
293
294 Avoid overflow in w32 implementation of interval timers.
295 When possible, for ITIMER_PROF count only times the main thread
296 actually executes.
297 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
298 'volatile ULONGLONG' types. All the other data which was
299 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
300 (GetThreadTimes_Proc): New typedef.
301 (w32_get_timer_time): New function, returns a suitable time value
302 for the timer.
303 (timer_loop): Enter critical section when accessing ULONGLONG
304 values of the itimer_data struct, as these accesses are no longer
305 atomic. Call 'w32_get_timer_time' instead of 'clock'.
306 Remove unused variable.
307 (init_timers): Initialize s_pfn_Get_Thread_Times.
308 (start_timer_thread): Don't assign itimer->caller_thread here.
309 (getitimer): Assign itimer->caller_thread here.
310 (setitimer): Always call getitimer to get the value of ticks_now.
311 (sys_spawnve): Avoid compiler warning about format mismatch.
312
313 2012-10-26 Eli Zaretskii <eliz@gnu.org>
314
315 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
316 mouse movement events if the menu bar is active. This avoids
317 producing a busy "hour-glass" cursor by Windows if the mouse
318 pointer is positioned over a tooltip shown for some menu item.
319
320 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
321
322 Don't assume process IDs fit in int.
323 * emacs.c (shut_down_emacs) [!DOS_NT]:
324 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
325 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
326 Use pid_t, not int, to store process IDs, as 'int'
327 is not wide enough on a few platforms (e.g., AIX and IRIX).
328
329 2012-10-23 Kenichi Handa <handa@gnu.org>
330
331 The following change is to make face-font-rescale-alist work
332 correctly for non-ASCII fonts.
333
334 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
335 (font_open_for_lface): Handle Vface_font_rescale_alist.
336
337 2012-10-23 Chong Yidong <cyd@gnu.org>
338
339 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
340
341 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
342
343 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
344 for screen font.
345 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
346
347 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
348 event (Bug#12681).
349
350 2012-10-21 Glenn Morris <rgm@gnu.org>
351
352 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
353
354 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
355
356 Port to OpenBSD 5.1.
357 * frame.c (Fmouse_position, Fmouse_pixel_position):
358 * xdisp.c (produce_stretch_glyph):
359 Declare local vars only when they're needed.
360 This is clearer and avoids a warning on OpenBSD about unused vars.
361 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
362 This is safer, and avoids OpenBSD warnings about unused vars.
363 * keyboard.c (record_menu_key): Remove unnecessary decl.
364 (poll_timer): Define only if POLL_FOR_INPUT is defined.
365 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
366 as our definition clashes with OpenBSD's.
367 * xfaces.c (load_face_colors, check_lface_attrs)
368 (get_lface_attributes_no_remap, get_lface_attributes)
369 (lface_fully_specified_p, x_supports_face_attributes_p)
370 (tty_supports_face_attributes_p, face_fontset, realize_face)
371 (realize_x_face, realize_tty_face):
372 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
373 merely Lisp_Object *. This is more informative and avoids
374 a warning on OpenBSD about accessing beyond an object's size.
375
376 2012-10-20 Chong Yidong <cyd@gnu.org>
377
378 * lread.c (Fload): Doc fix (Bug#12592).
379
380 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
381
382 * font.c (Ffont_at): Fix previous change.
383
384 2012-10-19 Eli Zaretskii <eliz@gnu.org>
385
386 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
387 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
388 for the reasons.
389
390 * alloc.c (NSTATICS): Decrease to 0x800.
391
392 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
393
394 * fns.c (Fnreverse): Include the problem element when signalling an
395 error (bug#12677).
396
397 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
398
399 * nsterm.m (ns_select): Check writefds before call to
400 FD_ISSET (Bug#12668).
401
402 2012-10-18 Daniel Colascione <dancol@dancol.org>
403
404 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
405 (staticpro): If we run out of staticpro slots, die with an
406 informative error instead of just calling emacs_abort.
407
408 2012-10-18 Martin Rudalics <rudalics@gmx.at>
409
410 Fix two flaws reported by Dmitry Antipov.
411 * window.c (Ftemp_output_buffer_show): Remove.
412 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
413 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
414
415 2012-10-17 Eli Zaretskii <eliz@gnu.org>
416
417 * makefile.w32-in ($(BLD)/w32.$(O)):
418 ($(BLD)/vm-limit.$(O)):
419 ($(BLD)/term.$(O)):
420 ($(BLD)/unexw32.$(O)):
421 ($(BLD)/fileio.$(O)):
422 ($(BLD)/dispnew.$(O)): Update dependencies.
423
424 * w32term.h (w32_initialize_display_info, initialize_w32_display):
425 Add prototypes.
426
427 * w32proc.c: Include ctype.h.
428
429 * w32.h (init_environment, check_windows_init_file)
430 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
431 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
432 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
433 (sys_link): Add prototypes.
434
435 * w32.c: Include w32select.h.
436 (sys_access, e_malloc, sys_select): Add prototypes.
437 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
438
439 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
440
441 * unexw32.c: Include lisp.h and w32.h.
442
443 * term.c [WINDOWSNT]: Include w32term.h.
444
445 * process.c [WINDOWSNT]: Add prototype of sys_select.
446
447 * fileio.c [WINDOWSNT]: Include w32.h.
448
449 * dispnew.c [WINDOWSNT]: Include w32.h.
450
451 * cygw32.c (Fcygwin_convert_path_to_windows)
452 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
453 Lisp_Object values. (Bug#12661)
454
455 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
456 to Lisp_Object. (Bug#12661)
457
458 2012-10-17 Kenichi Handa <handa@gnu.org>
459
460 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
461 invalidate.
462
463 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
464
465 * buffer.c (Fkill_buffer): When unchaining the marker,
466 reset its buffer pointer to NULL (Bug#12652).
467
468 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
469
470 Do not verify indirection counters of killed buffers (Bug#12579).
471 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
472 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
473
474 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
475
476 * alloc.c (Fmake_byte_code): Fix typo in comment.
477 * print.c (print_interval): Define as static to match prototype.
478 * indent.c (disptab_matches_widthtab, recompute_width_table):
479 Convert to eassert.
480
481 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
482
483 * editfns.c (get_system_name): Remove.
484 * lisp.h (get_system_name): Remove prototype.
485 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
486 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
487
488 2012-10-15 Daniel Colascione <dancol@dancol.org>
489
490 * dbusbind.c: Add comment explaining reason for previous change.
491
492 2012-10-15 Martin Rudalics <rudalics@gmx.at>
493
494 * window.c (Fwindow_end): Rewrite check whether cached position
495 can be used (Bug#12600).
496 (resize_frame_windows, grow_mini_window, shrink_mini_window):
497 Set windows_or_buffers_changed.
498
499 2012-10-15 Daniel Colascione <dancol@dancol.org>
500
501 * dbusbind.c: Fix cygw32 build break when compiling with dbus
502 enabled by undefining the symbol "interface", which the platform
503 headers define to something incompatible.
504
505 2012-10-14 Daniel Colascione <dancol@dancol.org>
506
507 * image.c (init_tiff_functions, init_imagemagick_functions)
508 (init_svg_functions): Fix cygw32 build break by using these
509 functions only when WINDOWSNT _and_ HAVE_NTGUI.
510
511 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
512
513 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
514
515 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
516
517 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
518
519 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
520
521 * coding.c (detect_coding): Set coding->id before calling
522 this->detector.
523
524 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
525
526 * fileio.c: Formatting fixes.
527
528 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
529
530 Fix some stat-related races.
531 * fileio.c (Fwrite_region): Avoid race condition if a file is
532 removed or renamed by some other process immediately after Emacs
533 writes it but before Emacs stats it. Do not assume that stat (or
534 fstat) succeeds.
535 * image.c (slurp_file): Resolve the file name with fopen + fstat
536 rather than stat + fopen.
537 (pbm_read_file) [0]: Remove unused code with stat race.
538 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
539 Remove ineffective code with stat race.
540
541 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
542
543 * doc.c (get_doc_string): Don't signal an error if the file is missing.
544
545 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
546
547 * nsterm.m (hold_event_q): New static variable.
548 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
549 ! q_event_ptr.
550 (hold_event): New function.
551 (ns_read_socket): If hold_event_q have events, store them and
552 return (Bug#12384).
553 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
554 is zero (Bug#12384).
555
556 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
557
558 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
559
560 2012-10-12 Eli Zaretskii <eliz@gnu.org>
561
562 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
563
564 * fileio.c (check_existing): New function.
565 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
566 instead of calling 'stat', when what's needed is to check whether
567 a file exists. This avoids expensive system calls on MS-Windows.
568 (Bug#12587)
569
570 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
571
572 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
573 determine whether a file exists and is not a directory.
574
575 * lisp.h (check_existing): Add prototype.
576
577 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
578
579 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
580
581 2012-10-12 Glenn Morris <rgm@gnu.org>
582
583 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
584
585 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
586
587 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
588
589 * eval.c (Fautoload): Remember previous autoload status in load-history.
590
591 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
592
593 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
594 * lread.c (load_each_byte, new_backquote_flag, readchar)
595 (read_filtered_event, lisp_file_lexically_bound_p)
596 (safe_to_load_version, Fload, complete_filename_p, openp)
597 (build_load_history, readevalloop, read_escape, read1)
598 (string_to_number, read_vector, read_list):
599 * macros.c (Fstart_kbd_macro):
600 * marker.c (CONSIDER):
601 * menu.c (parse_single_submenu, digest_single_submenu)
602 (find_and_return_menu_selection, Fx_popup_menu):
603 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
604 (Ftry_completion):
605 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
606 (ns_menu_show):
607 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
608 (xmenu_show, xdialog_show):
609 Use bool for booleans.
610 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
611 as it's not a predicate. All uses changed. Omit unnecessary
612 buffer termination.
613
614 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
615
616 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
617 (save_excursion_restore): Do not restore mark if it was not saved.
618
619 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
620
621 * marker.c (cached_modiff): EMACS_INT, not int.
622
623 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
624 instead of having a wrong decl.
625 * nsmenu.m (waiting_for_input): Remove wrong decl.
626
627 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
628
629 keyboard.c, keymap.c: Use bool for booleans.
630 * dispnew.c (sit_for): Distinguish between 3-way display_option
631 and boolean do_display.
632 * keyboard.c (single_kboard, this_command_key_count_reset)
633 (waiting_for_input, echoing, immediate_quit, input_pending)
634 (interrupt_input, interrupts_deferred, pop_kboard)
635 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
636 (command_loop_1, adjust_point_for_property)
637 (safe_run_hooks_error, input_polling_used, read_char):
638 (help_char_p, readable_events, kbd_buffer_events_waiting)
639 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
640 (lucid_event_type_list_p, get_input_pending):
641 (gobble_input, menu_separator_name_p, menu_bar_item)
642 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
643 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
644 (keyremap_step, test_undefined, read_key_sequence)
645 (detect_input_pending, detect_input_pending_ignore_squeezables)
646 (detect_input_pending_run_timers, requeued_events_pending_p)
647 (quit_throw_to_read_char, Fset_input_interrupt_mode):
648 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
649 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
650 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
651 (accessible_keymaps_1, Fkey_description, push_key_description):
652 (shadow_lookup, struct where_is_internal_data)
653 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
654 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
655 (describe_map, describe_vector):
656 * menu.c (single_menu_item):
657 * nsmenu.m (ns_update_menubar):
658 * process.c (wait_reading_process_output):
659 * search.c (scan_buffer, scan_newline):
660 Use bool for boolean.
661 * keyboard.c (timers_run, swallow_events)
662 (detect_input_pending_run_timers):
663 * process.c (wait_reading_process_output):
664 Use unsigned for counter where wraparound-on-overflow is desired,
665 since unsigned is guaranteed to have that behavior and signed is not.
666 (read_char): Use ptrdiff_t for string length.
667 (get_input_pending): Remove first argument, since it was always
668 the same pointer-to-int (now pointer-to-boolean) &input_pending,
669 and behave as if it had that value. Return new value of
670 input_pending. All callers changed.
671 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
672 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
673 a string length.
674 * keymap.c (push_key_description): Omit last arg, which was always 1.
675 All callers changed.
676
677 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
678
679 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
680
681 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
682 ($(BLD)/term.$(O)): Update dependencies.
683
684 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
685
686 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
687 * lisp.h (enum pvec_type): Adjust comments and omit explicit
688 initializer for PVEC_NORMAL_VECTOR.
689
690 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
691
692 Clean out old termopts cruft.
693 * termopts.h (flow_control, meta_key): Remove unused decls.
694 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
695 Don't include termopts.h.
696
697 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
698
699 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
700
701 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
702
703 * commands.h (immediate_quit): Remove duplicate decl.
704
705 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
706
707 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
708 caching.
709 (nsfont_open): Remove setting of Vfonts_in_cache.
710 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
711
712 2012-10-09 Eli Zaretskii <eliz@gnu.org>
713
714 * w32fns.c (w32_last_error): Change the return value to DWORD, to
715 match what GetLastError returns. Explain why the function is
716 needed.
717
718 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
719 'is_tooltip_frame', to avoid confusion with its global namesake.
720
721 2012-10-08 Daniel Colascione <dancol@dancol.org>
722
723 * xdisp.c (start_hourglass): Call w32_note_current_window when
724 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
725 build that caused Emacs to display the hourglass cursor forever.
726
727 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
728 which is broken under remote desktop, calculate the number of
729 colors available for a display based on the display's number of
730 planes and number of bits per pixel per plane. (bug#10397).
731
732 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
733
734 * nsfont.m (Vfonts_in_cache): New variable.
735 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
736 are used. Add cached fonts to Vfonts_in_cache.
737 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
738
739 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
740
741 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
742 in nt/config.nt.
743 (FONT_H): Define after FRAME_H.
744 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
745 Update dependencies.
746
747 * w32term.c: Remove leftover declaration of keyboard_codepage.
748
749 2012-10-08 Eli Zaretskii <eliz@gnu.org>
750
751 * makefile.w32-in (FONT_H): Add $(FRAME_H).
752 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
753 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
754 (GLOBAL_SOURCES): Add cygw32.c.
755 ($(BLD)/unexw32.$(O)):
756 ($(BLD)/w32.$(O)):
757 ($(BLD)/w32console.$(O)):
758 ($(BLD)/w32fns.$(O)):
759 ($(BLD)/w32heap.$(O)):
760 ($(BLD)/w32menu.$(O)):
761 ($(BLD)/w32proc.$(O)): Add w32common.h.
762
763 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
764 'const char *'.
765 (x_to_w32_color): Don't modify the argument, modify a copy instead.
766
767 2012-10-08 Daniel Colascione <dancol@dancol.org>
768
769 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
770 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
771 accidental message numbering hole. Change other messages to
772 match.
773
774 * w32select.h (HAVE_W32SELECT): Remove.
775
776 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
777 w32common.h instead of w32heap.h.
778
779 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
780 (get_allocation_unit, get_processor_type, get_w32_major_version)
781 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
782 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
783 (OS_NT, os_subtype, cache_system_info): Move declarations to
784 w32common.
785
786 * w32heap.c: Include w32common.h.
787 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
788 (w32_minor_version, w32_build_number, w32_subtype):
789 Remove duplicate definitions.
790
791 * w32fns.c: Include w32common.h; include w32heap.h only in
792 WINDOWSNT.
793
794 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
795 Use `report_file_error' instead of `error' in order to better
796 inform users of what went wrong. Increase NTGUI_UNICODE file
797 dialog box file name length to 32k, the maximum allowed by the NT
798 kernel.
799
800 * w32common.h: New file.
801 (ROUND_UP, ROUND_DOWN, get_page_size)
802 (get_allocation_unit, get_processor_type, get_w32_major_version)
803 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
804 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
805 (OS_NT, os_subtype, cache_system_info): Move here.
806
807 * unexw32.c, unexcw.c: Include w32common.h.
808
809 * emacs.c (main): Use (defined (WINDOWSNT) || defined
810 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
811 to call syms_of_w32select.
812
813 * cygw32.h: Remove obsolete EXFUN declarations.
814
815 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
816
817 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
818 of w32inevt.o from SOME_MACHINE_OBJECTS.
819
820 2012-10-08 Daniel Colascione <dancol@dancol.org>
821
822 * image.c: Permanent fix for JPEG compilation issue --- limit
823 jpeglib `boolean' redefinition to Cygwin builds.
824
825 2012-10-08 Eli Zaretskii <eliz@gnu.org>
826
827 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
828
829 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
830 Cygwin.
831
832 2012-10-08 Daniel Colascione <dancol@dancol.org>
833
834 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
835 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
836 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
837 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
838 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
839 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
840 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
841 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
842 now a supported configuration.
843
844 * Makefile.in: consolidate image variables into LIBIMAGE; add
845 W32_OBJ and W32_LIBS. Compile new files.
846
847 * conf_post.h:
848 (_DebPrint) declare tracing facility for W32 debugging. We need
849 to unify tracing later.
850
851 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
852 unconditional use of W32 Unicode functions. Cygwin runs only on
853 100% Unicode operating systems.
854
855 * cygw32.c: New file. Define Cygwin-specific facilities.
856 (Fcygwin_convert_path_to_windows)
857 (Fcygwin_convert_path_from_windows): New user functions for
858 accessing Cygwin path-munging routines.
859
860 * cygw32.h: New file.
861 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
862 UTF-16LE strings temporarily inside non-Lisp-visible string
863 objects.
864
865 (w32_strerror): Just what it says on the tin.
866
867 * emacs.c: Make the NS fork-then-exec code for daemon-launching
868 also run for Cygwin; both systems have the same problem with using
869 GUI facilities in a forked child. Also call syms_of_cygw32,
870 syms_of_w32select in correct places.
871
872 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
873 needs fork-then-exec for daemon launching.
874
875 * font.h: Include frame.h.
876
877 * image.c: Use the image library cache machinery only when we're
878 compiling for native WINDOWSNT; Cygwin can use shared libraries
879 like any other Unixlike system.
880
881 * keyboard.c: Clarify a comment regarding the input loop.
882
883 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
884 functions directly instead of trying to detect at runtime that our
885 host operating system supports them. We make this change for two
886 reasons: Cygwin lacks support for the multibyte character
887 conversion functions used by the legacy menu code, and Cygwin
888 never needs to rely on non-Unicode APIs.
889
890 * unexw32.c (hinst): Declare extern.
891
892 * w32.c: Change header order;
893 (w32_strerror): Move to w32fns.c because we need it for
894 non-WINDOWSNT builds.
895
896 * w32.h: Add #error macro to make sure we don't include w32.h for
897 Cygwin builds. Remove w32select declarations.
898
899 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
900 w32fns.c. w32console.c is WINDOWSNT-only.
901
902 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
903 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
904 POSIXy alternative.
905 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
906 (w32_major_version, w32_minor_version, w32_build_number)
907 (os_subtype, sound_type): Define here
908 (w32_defined_color): Make color parameter const for consistency
909 with other _defined_color functions.
910 (w32_createwindow): Unconditionally call w32_init_class instead of
911 doing so only when hprevinst is non-NULL. Plumbing hprevinst
912 through the code is complex and unnecessary because class
913 registration is practically free.
914 (w32_name_of_message): New EMACSDEBUG-only function.
915 (Fset_message_beep): Move here
916 (Fx_open_connection): Require that the display name for Windows be
917 "w32" for consistency, emacsclient disambiguation, and maybe, one
918 day, multi-window-system support.
919 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
920 Cygwin files for W32 GUI facilities, since these clearly don't
921 expect Cygwin names.
922 (_DebPrint): Define.
923 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
924 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
925 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
926 (w32_last_error): Remove.
927
928 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
929
930 * w32heap.c (syspage_mask): Declare here.
931 (cache_system_info): Remove.
932
933 * w32inevt.c (faked_key): Define globally, not statically.
934 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
935 (w32_console_toggle_lock_key): Move to w32fns.c.
936
937 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
938
939 * w32proc.c (_DebPrint): Move to w32fns.c.
940 * w32select.c: Include string.h, stdio.h for Cygwin.
941 * w32select.h: New File.
942
943 * w32term.c: Include io.h for non-CYGWIN builds; needed for
944 get_osfhandle.
945 (w32_message_fd): New variable. Under Cygwin, holds the file
946 descriptor the system used to tell us about pending thread
947 messages.
948
949 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
950 that prevented compilation under non-WINDOWSNT systems.
951
952 (w32_initialize): Open /dev/windows and assign it to
953 w32_message_fd. Provide w32 feature.
954
955 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
956 (WM_EMACS_INPUT_READY): add.
957 (prepend_msg, w32_message_fd): Declare globally.
958
959 * w32xfns.c:
960 (keyboard_handle): Use only when WINDOWSNT.
961 (notify_msg_ready): New function. Posts a message to the main
962 thread's message queue under CYGWIN, which wakes up the main
963 thread from select(2) by making the /dev/windows file descriptor
964 ready. Under WINDOWSNT, it sets an event the same way the old
965 code did.
966
967 (post, prepend_msg): Actually call notify_msg_ready instead of
968 setting the input event directly.
969
970 2012-10-07 Eli Zaretskii <eliz@gnu.org>
971
972 * ralloc.c (relinquish): If a heap is ready to be relinquished,
973 but it still has blocs in it, don't return it to the system,
974 instead of aborting. (Bug#12402)
975
976 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
977
978 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
979
980 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
981 MAC_OS_X_VERSION_10_6.
982 (syms_of_nsterm): Remove comment about Panther and above for
983 ns-antialias-text.
984 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
985 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
986 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
987
988 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
989 MAC_OS_X_VERSION_10_4.
990
991 * nsmenu.m (fillWithWidgetValue:): Remove code for <
992 MAC_OS_X_VERSION_10_2.
993
994 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
995
996 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
997 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
998
999 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1000 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
1001 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1002 Remove ns_in_resize check.
1003 (ns_clear_frame_area): Remove resize handle code.
1004
1005 * nsfns.m (ns_in_resize): Remove.
1006 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1007 Remove ns_in_resize check.
1008
1009 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1010
1011 Improve sys_siglist detection.
1012 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1013 defined as a macro, as is done in Solaris.
1014 (sys_siglist_entries): New macro.
1015 (save_strsignal): Use it.
1016 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1017 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1018
1019 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1020
1021 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1022 fullscreen/Fullscreen.
1023
1024 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1025 tobar_height is new.
1026
1027 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1028 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1029 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1030 (windowDidResize:): Check for correct window if old style fullscreen.
1031 Capitalize word in comment. Remove incorrect comment.
1032 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1033 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1034 error in drawing background.
1035 (toggleFullScreen:): Remove comment. Rearrange calls.
1036 Set toolbar values to zero, save old height in tobar_height.
1037 Restore tool bar height when leaving fullscreen.
1038 (canBecomeMainWindow): New function.
1039
1040 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1041
1042 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1043
1044 2012-10-05 Eli Zaretskii <eliz@gnu.org>
1045
1046 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1047
1048 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
1049 that time stamps of directories could also be changed.
1050 Don't request the too broad GENERIC_WRITE, only the more restrictive
1051 FILE_WRITE_ATTRIBUTES access rights.
1052
1053 * fileio.c (Fset_file_times): Special-case ignoring errors for
1054 directories only on MSDOS, not on MS-Windows.
1055
1056 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
1057
1058 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1059
1060 2012-10-04 Eli Zaretskii <eliz@gnu.org>
1061
1062 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1063 see whether CreateFile failed.
1064
1065 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1068 to avoid similar races.
1069 * keyboard.c (pending_signals): Now bool, not int.
1070
1071 Port timers to OpenBSD, plus check for timer failures.
1072 OpenBSD problem reported by Han Boetes.
1073 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1074 and/or setitimer.
1075 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1076 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1077 like OpenBSD, which has timer_settime but does not declare it.
1078 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1079 whether to use itimerspec-related primitives. All uses of
1080 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1081
1082 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1083
1084 * profiler.c (handle_profiler_signal): Fix a malloc race
1085 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1086
1087 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1088
1089 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1090
1091 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1092
1093 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1094 consistent with the change in return value of 'safe_strsignal'.
1095
1096 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1097
1098 Prefer plain 'static' to 'static inline' (Bug#12541).
1099 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1100 (bidi_set_sor_type, bidi_push_embedding_level)
1101 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1102 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1103 (bidi_cache_search, bidi_cache_ensure_space)
1104 (bidi_cache_iterator_state, bidi_cache_find)
1105 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1106 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1107 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1108 Now 'static', not 'static inline'.
1109
1110 Count overruns when profiling; change units to ns.
1111 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1112 Give extra weight to samples after overruns, to attempt to count
1113 the time more accurately.
1114 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1115 the underlying primitives nominally do ns.
1116 (Fprofiler_cpu_start): Document the change. Mention that
1117 the sampling intervals are only approximate.
1118
1119 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1120
1121 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1122
1123 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1124 case for the special 0 coding-system.
1125
1126 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1127 (Fmake_overlay): Remove redundant tests.
1128 (fix_start_end_in_overlays): Remove redundant recentering.
1129
1130 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1131
1132 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1133 Update dependencies.
1134
1135 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1136
1137 Fix a malloc race condition involving strsignal.
1138 A signal can arrive in the middle of a malloc, and Emacs's signal
1139 handler can invoke strsignal, which can invoke malloc, which is
1140 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1141 Fix it by altering the signal handler so that it does not invoke
1142 strsignal.
1143 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1144 * process.c (status_message): Use const pointer, in case strsignal
1145 is #defined to safe_strsignal.
1146 * sysdep.c (sys_siglist, init_signals): Always define and
1147 initialize a substitute sys_siglist if the system does not define
1148 one, even if HAVE_STRSIGNAL.
1149 (safe_strsignal): Rename from strsignal. Always define,
1150 using sys_siglist. Return a const pointer.
1151 * syssignal.h (safe_strsignal): New decl.
1152 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1153
1154 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1155
1156 * w32proc.c (timer_loop): Fix code that waits for timer
1157 expiration, to avoid high CPU usage.
1158
1159 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1160
1161 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1162 (sweep_weak_table): Remove redundant prototypes.
1163
1164 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1165
1166 * emacs.c: Move the inclusion of TERM_HEADER after including
1167 windows.h on WINDOWSNT. This avoids compilation problems with
1168 MSVC.
1169
1170 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1171
1172 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1173 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1174 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1175 as the previous version used 'void *'.
1176
1177 * ralloc.c (ROUNDUP): Fix last change.
1178 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1179 'size_t'.
1180
1181 * w32proc.c <disable_itimers>: New static flag.
1182 (init_timers): Initialize it to zero, after creating the critical
1183 sections used by the timer threads.
1184 (term_timers): Set to 1 before deleting the critical sections.
1185 (getitimer, setitimer): If disable_itimers is non-zero, return an
1186 error indication without doing anything. Reported by Fabrice
1187 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1188 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1189 return results.
1190 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1191 support timers.
1192
1193 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1194 term_ntproc after all the other bookkeeping, to get timers working
1195 as long as possible.
1196
1197 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1198
1199 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1200 Suggested by Juri Linkov in
1201 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1202
1203 Prefer plain 'static' to 'static inline' (Bug#12541).
1204 With static functions, modern compilers inline pretty well by
1205 themselves; advice from programmers often hurts as much as it helps.
1206 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1207 this change shrinks the text size of the Emacs executable by 1.1%
1208 without affecting CPU significantly in my benchmark.
1209 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1210 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1211 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1212 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1213 (bset_auto_fill_function, bset_auto_save_file_format)
1214 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1215 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1216 (bset_cache_long_line_scans, bset_case_fold_search)
1217 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1218 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1219 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1220 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1221 (bset_header_line_format, bset_indicate_buffer_boundaries)
1222 (bset_indicate_empty_lines, bset_invisibility_spec)
1223 (bset_left_fringe_width, bset_major_mode, bset_mark)
1224 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1225 (bset_name, bset_overwrite_mode, bset_pt_marker)
1226 (bset_right_fringe_width, bset_save_length)
1227 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1228 (bset_scroll_up_aggressively, bset_selective_display)
1229 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1230 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1231 (set_buffer_overlays_after):
1232 * category.c (bset_category_table):
1233 * charset.c (read_hex):
1234 * coding.c (produce_composition, produce_charset)
1235 (handle_composition_annotation, handle_charset_annotation)
1236 (char_encodable_p):
1237 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1238 (assign_row, set_frame_matrix_frame, make_current)
1239 (add_row_entry):
1240 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1241 * fns.c (maybe_resize_hash_table):
1242 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1243 * gmalloc.c (register_heapinfo):
1244 * image.c (lookup_image_type):
1245 * intervals.c (set_interval_object, set_interval_left)
1246 (set_interval_right, copy_interval_parent, rotate_right)
1247 (rotate_left, balance_possible_root_interval):
1248 * keyboard.c (kset_echo_string, kset_kbd_queue)
1249 (kset_keyboard_translate_table, kset_last_prefix_arg)
1250 (kset_last_repeatable_command, kset_local_function_key_map)
1251 (kset_overriding_terminal_local_map, kset_real_last_command)
1252 (kset_system_key_syms, clear_event, set_prop):
1253 * lread.c (digit_to_number):
1254 * marker.c (attach_marker, live_buffer, set_marker_internal):
1255 * nsterm.m (ns_compute_glyph_string_overhangs):
1256 * process.c (pset_buffer, pset_command)
1257 (pset_decode_coding_system, pset_decoding_buf)
1258 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1259 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1260 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1261 * syntax.c (bset_syntax_table, dec_bytepos):
1262 * terminal.c (tset_param_alist):
1263 * textprop.c (interval_has_some_properties)
1264 (interval_has_some_properties_list):
1265 * window.c (wset_combination_limit, wset_dedicated)
1266 (wset_display_table, wset_hchild, wset_left_fringe_width)
1267 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1268 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1269 (wset_right_fringe_width, wset_right_margin_cols)
1270 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1271 (wset_vertical_scroll_bar_type, wset_window_parameters):
1272 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1273 (wset_column_number_displayed, wset_region_showing)
1274 (window_box_edges, run_window_scroll_functions)
1275 (append_glyph_string_lists, prepend_glyph_string_lists)
1276 (append_glyph_string, set_glyph_string_background_width)
1277 (append_glyph, append_composite_glyph)
1278 (take_vertical_position_into_account):
1279 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1280 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1281 (lface_hash, lface_same_font_attributes_p, lookup_face):
1282 * xml.c (libxml2_loaded_p):
1283 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1284 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1285 Now 'static', not 'static inline'.
1286
1287 * bidi.c: Tune.
1288 (bidi_copy_it): Do the whole copy with a single memcpy.
1289 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1290
1291 Revert the FOLLOW-SYMLINKS change for file-attributes.
1292 Doing it right would require several changes to Tramp, and there's
1293 not enough time to get that tested before the freeze today.
1294 * dired.c (directory_files_internal, Ffile_attributes):
1295 Undo last change.
1296
1297 * frame.c (x_report_frame_params): Port better to wider ints.
1298 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1299 or that pointers can be printed in 15 decimal digits.
1300 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1301
1302 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1303
1304 Support x64 build on MS-Windows.
1305 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1306 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1307 compatibility with x64.
1308 (x_get_focus_frame): Add prototype.
1309
1310 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1311 defining an XRectangle structure.
1312
1313 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1314 arithmetics for compatibility with x64.
1315
1316 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1317 compatibility with x64.
1318
1319 * w32heap.h: Adjust prototypes and declarations.
1320
1321 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1322 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1323 DWORD, long, and unsigned long, for compatibility with x64.
1324 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1325 (sbrk): Argument is now of type ptrdiff_t.
1326
1327 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1328 less than 0x0500.
1329 (w32_msg_pump): Use WPARAM type for 'result'.
1330
1331 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1332 architecture.
1333 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1334 compatibility with x64.
1335
1336 * vm-limit.c (lim_data): Now size_t.
1337 (check_memory_limits): Adjust prototypes of real_morecore and
1338 __morecore to receive argument of type ptrdiff_t. Use size_t for
1339 five_percent and data_size.
1340
1341 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1342 variables, for compatibility with x64.
1343 (rva_to_section, offset_to_section, relocate_offset)
1344 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1345 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1346 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1347 for compatibility with x64.
1348
1349 * sysdep.c (STDERR_FILENO): Define if not already defined.
1350
1351 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1352 (__morecore): Argument type is now ptrdiff_t.
1353 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1354 (relinquish): Use ptrdiff_t type for 'excess'.
1355 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1356
1357 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1358 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1359 instead of a literal number.
1360
1361 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1362 (min): Define only if not already defined.
1363
1364 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1365 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1366 hosts.
1367
1368 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1369 'bitmaps' is a pointer.
1370
1371 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1372
1373 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1374
1375 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1376
1377 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1378 * dired.c (directory_files_internal, Ffile_attributes):
1379 New arg follow_symlinks. All uses changed.
1380
1381 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1382
1383 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1384
1385 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1386
1387 Support atimers and CPU profiler via profile.c on MS-Windows.
1388 * w32proc.c (sig_mask, crit_sig): New static variables.
1389 (sys_signal): Support SIGALRM and SIGPROF.
1390 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1391 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1392 sigfillset, and sigprocmask are no longer no-ops.
1393 (sigismember): New function.
1394 (struct itimer_data): New definition.
1395 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1396 (crit_prof): New static variables.
1397 (MAX_SINGLE_SLEEP): New definition.
1398 (timer_loop, stop_timer_thread, term_timers, init_timers)
1399 (start_timer_thread, getitimer, setitimer): New functions.
1400 (alarm): No longer a no-op, calls setitimer.
1401
1402 * w32.c (term_ntproc): Call term_timers.
1403 (init_ntproc): Make sure all signals are unblocked at startup, to
1404 erase any traces of dumping. Call init_timers.
1405
1406 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1407 Windows-specific code to display the hourglass mouse pointer is no
1408 longer used.
1409 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1410 to hourglass timer expiration.
1411 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1412 Remove, no longer used.
1413 (w32_note_current_window, show_hourglass, hide_hourglass):
1414 New functions, in support of hourglass cursor display similar to other
1415 window systems.
1416 (syms_of_w32fns): Don't initialize hourglass_timer.
1417
1418 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1419 WINDOWSNT as well.
1420 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1421
1422 * w32.h (init_timers, term_timers): Add prototypes.
1423
1424 2012-09-30 Kenichi Handa <handa@gnu.org>
1425
1426 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1427 to the buffer relocation which may be caused by ccl_driver.
1428
1429 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1430
1431 * xfns.c (Fx_file_dialog): Update comment.
1432
1433 * w32fns.c (Fx_file_dialog): Update comment.
1434
1435 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1436 Initialize panel name field if OSX >= 10.6.
1437
1438 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1439
1440 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1441
1442 * nsterm.m (NEW_STYLE_FS): New define.
1443 (ns_fullscreen_hook, windowWillEnterFullScreen)
1444 (windowDidEnterFullScreen, windowWillExitFullScreen)
1445 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1446 (setFSValue): New functions.
1447 (EmacsFSWindow): New implementation.
1448 (canBecomeKeyWindow): New function for EmacsFSWindow.
1449 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1450 (dealloc): Release nonfs_window if in fullscreen.
1451 (updateFrameSize:): Call windowDidMove to update top/left.
1452 (windowWillResize:toSize:): Check if frame is still maximized.
1453 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1454 next_maximized, maximized_width, maximized_height and nonfs_window.
1455 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1456 tbar_height.
1457 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1458 fullscreen. Set maximized_width/height. Act on next_maximized.
1459
1460 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1461 (EmacsView): Add variables for fullscreen.
1462 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1463 (EmacsFSWindow): New interface for fullscreen.
1464
1465 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1466
1467 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1468
1469 2012-09-30 Chong Yidong <cyd@gnu.org>
1470
1471 * fns.c (Frandom): Doc fix.
1472
1473 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1474
1475 * window.c (Vwindow_combination_limit): New default value.
1476 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1477
1478 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1479
1480 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1481 Suggested by Eli Zaretskii in
1482 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1483
1484 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1485
1486 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1487 HAVE_TIMER_SETTIME is defined.
1488
1489 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1490
1491 Profiler improvements: more-accurate timers, overflow checks.
1492 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1493 signal.h, setjmp.h. Include systime.h instead.
1494 (saturated_add): New function.
1495 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1496 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1497 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1498 New static vars.
1499 (enum profiler_cpu_running): New enum.
1500 (profiler_cpu_running): Now of that enum type, not bool.
1501 All uses changed to store the new value.
1502 (handle_profiler_signal): Rename from sigprof_handler_1,
1503 for consistency with other handlers. Do not check whether
1504 cpu_log is a hash-table if garbage collecting, since it
1505 doesn't matter in that case.
1506 (deliver_profiler_signal): Rename from sigprof_handler,
1507 for consistency with other handlers.
1508 (setup_cpu_timer): New function, with much of what used to be in
1509 Fprofiler_cpu_start. Check for out-of-range argument.
1510 Prefer timer_settime if available, and prefer
1511 thread cputime clocks, then process cputime clocks, then
1512 monotonic clocks, to the old realtime clock. Use make_timeval
1513 to round more-correctly when falling back to setitimer.
1514 (Fprofiler_cpu_start): Use it.
1515 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1516 Don't assume that passing NULL as the 2nd argument of setitimer
1517 is the same as passing a pointer to all-zero storage.
1518 Ignore SIGPROF afterwards.
1519 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1520 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1521 non-fatal signal handlers. Ignore SIGPROF on startup.
1522 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1523 in profiler.c, since sysdep.c now uses it.
1524
1525 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1526 Suggested by Eli Zaretskii in
1527 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1528
1529 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1530
1531 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1532
1533 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1534
1535 * lisp.h (struct backtrace): Remove indirection for `function' field.
1536 * xdisp.c (redisplay_internal):
1537 * profiler.c (record_backtrace, sigprof_handler_1):
1538 * alloc.c (Fgarbage_collect):
1539 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1540 (Fbacktrace_frame): Adjust accordingly.
1541
1542 2012-09-28 Glenn Morris <rgm@gnu.org>
1543
1544 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1545 (Frun_hook_with_args_until_failure): Doc fixes.
1546
1547 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1548
1549 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1550 Qautomatic_redisplay and change the symbol name. All users changed.
1551
1552 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1553
1554 * profiler.c (sigprof_handler): Fix race condition.
1555
1556 2012-09-28 Glenn Morris <rgm@gnu.org>
1557
1558 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1559
1560 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1561
1562 Check more robustly for timer_settime.
1563 * Makefile.in (LIB_TIMER_TIME): New macro.
1564 (LIBES): Add it.
1565 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1566 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1567 call timer_settime.
1568
1569 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1570
1571 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1572
1573 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1574
1575 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1576
1577 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 * character.h (MAYBE_UNIFY_CHAR): Remove.
1580 * charset.c, charset.h (maybe_unify_char): Now static.
1581 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1582 Since this stuff is now private to charset.c, there's no need for
1583 a public macro and no need to inline by hand.
1584
1585 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1586 Stefan Monnier <monnier@iro.umontreal.ca>
1587 Juanma Barranquero <lekktu@gmail.com>
1588
1589 * profiler.c: New file.
1590 * Makefile.in (base_obj): Add profiler.o.
1591 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1592 ($(BLD)/profiler.$(O)): New target.
1593 * emacs.c (main): Call syms_of_profiler.
1594 * alloc.c (Qautomatic_gc): New constant.
1595 (MALLOC_PROBE): New macro.
1596 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1597 (total_bytes_of_live_objects): New function.
1598 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1599 Call malloc_probe for the memory profiler.
1600 (syms_of_alloc): Define Qautomatic_gc.
1601 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1602 race condition.
1603 (struct backtrace): Move definition...
1604 * lisp.h (struct backtrace): ..here.
1605 (Qautomatic_gc, profiler_memory_running): Declare vars.
1606 (malloc_probe, syms_of_profiler): Declare functions.
1607 * xdisp.c (Qautomatic_redisplay): New constant.
1608 (redisplay_internal): Record itself in backtrace_list.
1609 (syms_of_xdisp): Define Qautomatic_redisplay.
1610
1611 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1612 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1613
1614 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1615
1616 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1617
1618 Prefer POSIX timers if available.
1619 They avoid a race if the timer is too close to the current time.
1620 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1621 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1622 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1623
1624 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1625
1626 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1627 CHAR_STRING_ADVANCE.
1628 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1629 STRING_CHAR_ADVANCE.
1630
1631 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1632
1633 Move Vlibrary_cache to emacs.c and reset before dumping.
1634
1635 * lisp.h (reset_image_types): Declare.
1636 [WINDOWSNT] (Vlibrary_cache): Declare.
1637
1638 * image.c (reset_image_types): New function.
1639
1640 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1641 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1642 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1643
1644 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1645 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1646
1647 * w32.h (Vlibrary_cache): Do not declare.
1648
1649 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1650
1651 * w32proc.c (sys_signal): Handle all signals defined by the
1652 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1653 handlers for signals supported by Windows. Don't override
1654 term_ntproc as the handler for SIGABRT.
1655 (sigaction): Rewrite to call sys_signal instead of duplicating its
1656 code.
1657 (sys_kill): Improve commentary.
1658
1659 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1660 consistency with a signature of a signal handler. All callers
1661 changed.
1662 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1663 install term_ntproc as a signal handler for SIGABRT, as that
1664 should be done by the dumped Emacs.
1665
1666 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1667
1668 * w32select.c (term_w32select): Protect against repeated
1669 invocation by setting clipboard_owner to NULL after calling
1670 DestroyWindow.
1671
1672 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1673 and term_ntproc to their modified signatures.
1674
1675 * character.c (char_string, string_char): Remove calls to
1676 MAYBE_UNIFY_CHAR. See the discussion starting at
1677 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1678 for the details.
1679
1680 2012-09-25 Chong Yidong <cyd@gnu.org>
1681
1682 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1683
1684 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1685
1686 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1687 when encountering an unknown bytecode.
1688
1689 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1690
1691 image.c, indent.c: Use bool for booleans.
1692 * dispextern.h (struct image_type): Members valid_p, load, init
1693 now return bool, not int. All uses changed.
1694 * image.c: Omit unnecessary static decls.
1695 (x_create_bitmap_mask, x_build_heuristic_mask):
1696 Return void, not int, since callers don't care about the return value.
1697 (x_create_bitmap_mask, define_image_type, valid_image_p)
1698 (struct image_keyword, parse_image_spec, image_spec_value)
1699 (check_image_size, image_background)
1700 (image_background_transparent, x_clear_image_1)
1701 (postprocess_image, lookup_image, x_check_image_size)
1702 (x_create_x_image_and_pixmap, xbm_image_p)
1703 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1704 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1705 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1706 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1707 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1708 (png_image_p, init_png_functions, png_load_body, png_load)
1709 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1710 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1711 (init_gif_functions, gif_load, imagemagick_image_p)
1712 (imagemagick_load_image, imagemagick_load, svg_image_p)
1713 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1714 (gs_load):
1715 * nsimage.m (ns_load_image):
1716 * nsterm.m (ns_defined_color):
1717 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1718 * xfns.c (x_defined_color):
1719 * xterm.c (x_alloc_lighter_color_for_widget)
1720 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1721 (x_alloc_lighter_color):
1722 * indent.c (disptab_matches_widthtab, current_column)
1723 (scan_for_column, string_display_width, indented_beyond_p)
1724 (compute_motion, vmotion, Fvertical_motion):
1725 Use bool for booleans.
1726
1727 2012-09-24 Chong Yidong <cyd@gnu.org>
1728
1729 * chartab.c (Fset_char_table_default): Obsolete function removed.
1730
1731 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1732
1733 Move pid_t related decls out of lisp.h.
1734 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1735 (interruptible_wait_for_termination):
1736 Move these decls from lisp.h to syswait.h, since they use pid_t.
1737 Needed on FreeBSD; see Herbert J. Skuhra in
1738 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1739 * callproc.c: Include syswait.h.
1740
1741 gnutls.c, gtkutil.c: Use bool for boolean.
1742 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1743 (emacs_gnutls_handle_error):
1744 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1745 (xg_hide_tooltip, xg_create_frame_widgets)
1746 (create_dialog, xg_uses_old_file_dialog)
1747 (xg_get_file_with_chooser, xg_get_file_with_selection)
1748 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1749 (xg_item_label_same_p, xg_update_menubar)
1750 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1751 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1752 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1753 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1754 (update_frame_tool_bar, free_frame_tool_bar):
1755 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1756 * nsmenu.m (ns_update_menubar):
1757 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1758 * xfns.c (Fx_show_tip) [USE_GTK]:
1759 Use bool for boolean.
1760 * gtkutil.c (xg_update_frame_menubar):
1761 * xmenu.c (update_frame_menubar):
1762 Return void, not int, since caller ignores return value.
1763 * gtkutil.c (xg_change_toolbar_position):
1764 Return void, not 1.
1765
1766 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1767
1768 * makefile.w32-in (BLOCKINPUT_H): Remove.
1769 (SYSSIGNAL_H): New macro.
1770 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1771 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1772 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1773 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1774 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1775 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1776 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1777 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1778 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1779 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1780 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1781 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1782 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1783 ($(BLD)/w32xfns.$(O)): Update dependencies.
1784
1785 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1786
1787 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1788 fatal_error_backtrace.
1789
1790 * w32proc.c (sys_kill): Undo last change: don't do anything when
1791 invoked to deliver SIGABRT to our own process. This is now
1792 handled by emacs_raise.
1793
1794 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1795
1796 * w32term.c (w32_read_socket): Remove leftover reference to
1797 interrupt_input_pending.
1798
1799 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 Do not use SA_NODEFER.
1802 Problem reported by Dani Moncayo in
1803 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1804 * alloc.c (die):
1805 * sysdep.c (emacs_abort): Do not reset signal handler.
1806 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1807 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1808 wanted even on POSIXish hosts, and it doesn't work on Windows.
1809
1810 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1811
1812 * xterm.c (x_term_init): Call fixup_locale before and after calling
1813 gtk_init (Bug#12392).
1814
1815 2012-09-23 Chong Yidong <cyd@gnu.org>
1816
1817 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1818 Vdynamic_library_alist.
1819
1820 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1821 (Fgnutls_available_p): Caller changed.
1822
1823 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1824 (Flibxml_parse_xml_region): Likewise.
1825
1826 * dispextern.h (struct image_type): Remove arg from init function.
1827
1828 * image.c (Finit_image_library, lookup_image_type)
1829 (define_image_type): Remove now-unneeded second arg.
1830 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1831 (init_tiff_functions, init_gif_functions, init_svg_functions):
1832 Arglist and w32_delayed_load calling convention changed.
1833 (gs_type): Remove init_gs_functions; there is no such function.
1834 (valid_image_p, make_image): Fix caller to lookup_image_type.
1835
1836 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1837
1838 Simplify and avoid signal-handling races (Bug#12471).
1839 * alloc.c (die):
1840 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1841 Avoid recursive loop if there's a fatal error in the function itself.
1842 * atimer.c (pending_atimers):
1843 * blockinput.h: Don't include "atimer.h"; no longer needed.
1844 (interrupt_input_pending): Remove. All uses removed.
1845 pending_signals now counts both atimers and ordinary interrupts.
1846 This is less racy than having three separate pending-signal flags.
1847 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1848 (input_blocked_p):
1849 Rename from their upper-case counterparts BLOCK_INPUT,
1850 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1851 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1852 This makes it easier to access volatile variables more accurately.
1853 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1854 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1855 that's more reliable if the code is buggy and sets
1856 interrupt_input_blocked to a negative value. All uses changed.
1857 * atimer.c (deliver_alarm_signal):
1858 Remove. No need to deliver this to the parent; any thread can
1859 handle this signal now. All uses replaced by underlying handler.
1860 * atimer.c (turn_on_atimers):
1861 * dispnew.c (handle_window_change_signal):
1862 * emacs.c (handle_danger_signal):
1863 * keyboard.c (kbd_buffer_get_event):
1864 Don't reestablish signal handler; not needed with sigaction.
1865 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1866 (UNBLOCK_INPUT_TO):
1867 Rework to avoid unnecessary accesses to volatile variables.
1868 (UNBLOCK_INPUT_TO): Now a function.
1869 (totally_unblock_input, unblock_input): New decls.
1870 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1871 (init_data): Remove. Necessary stuff now done in init_signal.
1872 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1873 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1874 (fatal_error_code): Remove; no longer needed.
1875 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1876 it doesn't always backtrace. All uses changed. No need to reset
1877 signal to default, since sigaction and/or die does that for us now.
1878 Use emacs_raise (FOO), not kill (getpid (), FOO).
1879 (main): Check more-accurately whether we're dumping.
1880 Move fatal-error setup to sysdep.c
1881 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1882 * gtkutil.c (xg_get_file_name, xg_get_font):
1883 Remove no-longer-needed signal-mask manipulation.
1884 * keyboard.c, process.c (POLL_FOR_INPUT):
1885 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1886 * keyboard.c (read_avail_input): Remove.
1887 All uses replaced by gobble_input.
1888 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1889 (kbd_buffer_store_event_hold, gobble_input):
1890 (record_asynch_buffer_change) [USABLE_SIGIO]:
1891 (store_user_signal_events):
1892 No need to mess with signal mask.
1893 (gobble_input): If blocking input and there are terminals, simply
1894 set pending_signals to 1 and return. All hooks changed to not
1895 worry about whether input is blocked.
1896 (process_pending_signals): Clear pending_signals before processing
1897 them, in case a signal comes in while we're processing.
1898 By convention callers now test pending_signals before calling us.
1899 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1900 New functions, to support changes to blockinput.h.
1901 (handle_input_available_signal): Now extern.
1902 (reinvoke_input_signal): Remove. All uses replaced by
1903 handle_async_input.
1904 (quit_count): Now volatile, since a signal handler uses it.
1905 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1906 All callers changed. Block SIGINT only if not already blocked.
1907 Clear sigmask reliably, even if Fsignal returns, which it can.
1908 Omit unnecessary accesses to volatile var.
1909 (quit_throw_to_read_char): No need to restore sigmask.
1910 * keyboard.c (gobble_input, handle_user_signal):
1911 * process.c (wait_reading_process_output):
1912 Call signal-handling code rather than killing ourselves.
1913 * lisp.h: Include <float.h>, for...
1914 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1915 (pending_signals): Now volatile.
1916 (syms_of_data): Now const if IEEE floating point.
1917 (handle_input_available_signal) [USABLE_SIGIO]:
1918 (terminate_due_to_signal, record_child_status_change): New decls.
1919 * process.c (create_process): Avoid disaster if memory is exhausted
1920 while we're processing a vfork, by tightening the critical section
1921 around the vfork.
1922 (send_process_frame, process_sent_to, handle_pipe_signal)
1923 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1924 ignores SIGPIPE.
1925 (send_process): No need for setjmp/longjmp any more, since the
1926 SIGPIPE stuff is now gone. Instead, report an error if errno
1927 is EPIPE.
1928 (record_child_status_change): Now extern. PID and W are now args.
1929 Return void, not bool. All callers changed.
1930 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1931 Remove. All uses removed. This bug should be fixed now in a
1932 different way.
1933 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1934 and record the child status change directly. This avoids the
1935 need to futz with the signal mask.
1936 (process_fatal_action): Move here from emacs.c.
1937 (emacs_sigaction_flags): New function, containing
1938 much of what used to be in emacs_sigaction_init.
1939 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1940 caught by emacs, to make races less likely.
1941 (deliver_process_signal): Rename from handle_on_main_thread.
1942 All uses changed.
1943 (BACKTRACE_LIMIT_MAX): Now at top level.
1944 (thread_backtrace_buffer, threadback_backtrace_pointers):
1945 New static vars.
1946 (deliver_thread_signal, deliver_fatal_thread_signal):
1947 New functions, for more-accurate delivery of thread-specific signals.
1948 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1949 (deliver_arith_signal): Handle in this thread, not
1950 in the main thread, since it's triggered by this thread.
1951 (maybe_fatal_sig): New function.
1952 (init_signals): New arg DUMPING so that we can be more accurate
1953 about whether we're dumping. Caller changed.
1954 Treat thread-specific signals differently from process-general signals.
1955 Block all signals while handling fatal error; that's safer.
1956 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1957 on IEEE hosts.
1958 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1959 Ignore SIGPIPE unless batch.
1960 (emacs_backtrace): Output backtrace for the appropriate thread,
1961 which is not necessarily the main thread.
1962 * syssignal.h: Include <stdbool.h>.
1963 (emacs_raise): New macro.
1964 * xterm.c (x_connection_signal): Remove; no longer needed
1965 now that we use sigaction.
1966 (x_connection_closed): No need to mess with sigmask now.
1967 (x_initialize): No need to reset SIGPIPE handler here, since
1968 init_signals does this for us now.
1969
1970 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1971
1972 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1973 background rect may be larger (Bug#12245).
1974
1975 2012-09-23 Chong Yidong <cyd@gnu.org>
1976
1977 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1978
1979 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1980
1981 * .gdbinit: Just stop at fatal_error_backtrace.
1982 See Stefan Monnier's request in
1983 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1984 Remove no-longer-used query of system type.
1985
1986 2012-09-22 Chong Yidong <cyd@gnu.org>
1987
1988 * search.c (Freplace_match): Doc fix (Bug#12325).
1989
1990 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1991
1992 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1993 (Fline_end_position): Doc fix.
1994
1995 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1996
1997 2012-09-22 Chong Yidong <cyd@gnu.org>
1998
1999 * dispextern.h (struct image_type): Add new slot, storing a type
2000 initialization function.
2001
2002 * image.c (define_image_type): Call the image initializer function
2003 if it is defined. Arguments and return value changed.
2004 (valid_image_p, make_image): Callers changed.
2005 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
2006 (gif_type, imagemagick_type, svg_type, gs_type):
2007 Add initialization functions.
2008 (Finit_image_library): Call lookup_image_type.
2009 (CHECK_LIB_AVAILABLE): Macro deleted.
2010 (lookup_image_type): Call define_image_type here, rather than via
2011 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2012 (syms_of_image): Move define_image_type calls for xbm_type and
2013 pbm_type to lookup_image_type.
2014
2015 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2016
2017 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2018 'idle_timers' from here ...
2019 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2020 lists, to avoid infloops when the timer does something stupid,
2021 like reinvoke itself with the same or smaller time-out.
2022 (Bug#12447)
2023
2024 2012-09-22 Martin Rudalics <rudalics@gmx.at>
2025
2026 * window.c (Fsplit_window_internal): Handle only Qt value of
2027 Vwindow_combination_limit separately.
2028 (Qtemp_buffer_resize): New symbol.
2029 (Vwindow_combination_limit): New default value.
2030 Rewrite doc-string.
2031
2032 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2033
2034 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2035 the new overlay string. (Bug#10159)
2036
2037 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2038
2039 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2040 or that fprintf is async-signal-safe. POSIX doesn't require
2041 either assumption.
2042
2043 2012-09-22 Chong Yidong <cyd@gnu.org>
2044
2045 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2046 (Bug#8207).
2047
2048 2012-09-22 Kenichi Handa <handa@gnu.org>
2049
2050 * composite.c (composition_reseat_it): Handle the case that a
2051 grapheme cluster is not covered by a single font (Bug#12352).
2052
2053 2012-09-21 Chong Yidong <cyd@gnu.org>
2054
2055 * image.c (define_image_type): Avoid adding duplicate types to
2056 image_types (Bug#12463). Suggested by Jörg Walter.
2057
2058 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2059
2060 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2061 (print_load_command_name): Add case LC_DATA_IN_CODE.
2062 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2063
2064 2012-09-21 Glenn Morris <rgm@gnu.org>
2065
2066 * eval.c (Frun_hook_with_args_until_success)
2067 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2068
2069 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
2070
2071 * fileio.c (Ffile_selinux_context): Only call freecon when
2072 lgetfilecon succeeded.
2073 (Fset_file_selinux_context): Likewise. (Bug#12444)
2074
2075 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2076
2077 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2078 reordering, locate the cursor by calling set_cursor_from_row; if
2079 that fails, clear the desired glyph matrix before returning a
2080 failure indication to the caller. Fixes leaving garbled display
2081 when fast scrolling with a down-key. (Bug#12403)
2082 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2083 scrolling through multibyte text.
2084
2085 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2086
2087 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2088 calling mark_vectorlike since that's the one that marks the window.
2089 (mark_discard_killed_buffers): Mark the final cdr.
2090 * window.h (struct window): Move prev/next_buffers to the
2091 non-standard fields.
2092 * window.c (make_window): Initialize prev/next_buffers manually.
2093
2094 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2095
2096 Omit unused arg EXPECTED from socket hooks.
2097 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2098 * nsterm.m (ns_term_init):
2099 * termhooks.h (struct terminal.read_socket_hook):
2100 * w32inevt.c (w32_console_read_socket):
2101 * w32term.c (w32_read_socket):
2102 * xterm.c (XTread_socket):
2103 Omit unused arg EXPECTED. All callers changed.
2104 (store_user_signal_events): Return void, not int, since callers no
2105 longer care about the return value. All uses changed.
2106
2107 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2108
2109 * w32gui.h (XParseGeometry): Do not declare.
2110
2111 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2112
2113 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2114 Ignore 'expected'. See Eli Zaretskii in
2115 <http://bugs.gnu.org/12471#8> (last line).
2116
2117 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2118 (XParseGeometry): Now static. Substitute extremal values for
2119 values that are out of range.
2120
2121 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2122
2123 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2124
2125 * nsfns.m (XParseGeometry): Remove.
2126 (Fx_create_frame): Call x_set_offset to correctly interpret
2127 top_pos in geometry.
2128
2129 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2130 (Fx_parse_geometry): If there is a space in string, call
2131 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2132
2133 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2134
2135 * search.c (scan_buffer): Use character positions in calls to
2136 region_cache_forward and region_cache_backward, not byte
2137 positions. (Bug#12196)
2138
2139 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2140 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2141
2142 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2143 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2144 emacs_blocked_malloc, now deleted.
2145
2146 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2147
2148 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2149 The workaround was for improving performance on Solaris 2.4, but
2150 is getting in the way now. Emacs will still work if someone is
2151 still running Solaris 2.4 in a museum somewhere; Sun dropped
2152 support for Solaris 2.4 in 2003.
2153 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2154 * process.c (create_process) [HAVE_WORKING_VFORK]:
2155 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2156 since Emacs no longer uses vfork on that platform.
2157
2158 2012-09-17 Glenn Morris <rgm@gnu.org>
2159
2160 * emacs.c: Use COPYRIGHT.
2161
2162 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2163
2164 Remove configure's --without-sync-input option (Bug#12450).
2165 When auditing signal-handling in preparation for cleaning it up,
2166 I found that SYNC_INPUT has race conditions and would be a real
2167 pain to fix. Since it's an undocumented and deprecated
2168 configure-time option, now seems like a good time to remove it.
2169 Also see <http://bugs.gnu.org/11080#16>.
2170 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2171 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2172 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2173 (malloc_hysteresis):
2174 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2175 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2176 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2177 (dont_register_blocks, bytes_used_when_reconsidered)
2178 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2179 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2180 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2181 Remove. All uses removed.
2182 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2183 implementation, one that depends on whether the new macro
2184 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2185 is defined.
2186 * atimer.c (run_timers, handle_alarm_signal):
2187 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2188 (handle_async_input, process_pending_signals)
2189 (handle_input_available_signal, init_keyboard):
2190 * nsterm.m (ns_read_socket):
2191 * process.c (wait_reading_process_output):
2192 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2193 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2194 (emacs_write):
2195 * xterm.c (XTread_socket):
2196 Assume SYNC_INPUT.
2197 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2198 * eval.c (handling_signal): Remove. All uses removed.
2199 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2200 All uses replaced with the SYNC_INPUT version.
2201 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2202 Remove decls.
2203 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2204 Now static.
2205
2206 * font.c (Ffont_shape_gstring): Remove unused local.
2207
2208 2012-09-16 Glenn Morris <rgm@gnu.org>
2209
2210 * Makefile.in (clean): No longer run nextstep's clean.
2211
2212 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2213 (ns_frag): Remove.
2214 (ns-app): Move here from ns.mk, and simplify.
2215 (clean): Simplify nextstep entry.
2216 * ns.mk: Remove file.
2217
2218 2012-09-17 Kenichi Handa <handa@gnu.org>
2219
2220 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2221 not covert the last few charactes.
2222
2223 2012-09-16 Kenichi Handa <handa@gnu.org>
2224
2225 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2226 here, but just check the validity of glyphs in the glyph-string.
2227
2228 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2229
2230 * window.c (Fwindow_parameter, Fset_window_parameter):
2231 Accept any window as argument (Bug#12452).
2232
2233 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2234
2235 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2236 to ns_term_init to avoid memory leak.
2237
2238 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2239 explicit retain/release.
2240 (ns_term_init): Only allow one display. Initialize outerpool and
2241 ns_*_types.
2242
2243 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2244
2245 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2246 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2247 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2248 the Microsoft problem in a different way, by altering ../nt/config.nt.
2249
2250 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2251
2252 * w32xfns.c:
2253 * w32uniscribe.c:
2254 * w32term.c:
2255 * w32select.c:
2256 * w32reg.c:
2257 * w32proc.c:
2258 * w32menu.c:
2259 * w32inevt.c:
2260 * w32heap.c:
2261 * w32font.c:
2262 * w32fns.c:
2263 * w32console.c:
2264 * w32.c:
2265 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2266 by lisp.h. This completes removal of setjmp.h inclusion
2267 erroneously announced in the previous commit. (Bug#12446)
2268
2269 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2270 more accurate.
2271
2272 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2273 not defined as a macro. The latter happens on MS-Windows.
2274 (Bug#12446)
2275
2276 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2277
2278 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2279 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2280 Some instances of '#include <setjmp.h>' removed, if the
2281 only reason for the instance was because "lisp.h" was included.
2282 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2283 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2284 and _longjmp with the new symbols. Emacs already uses _setjmp if
2285 available, so this change affects only POSIXish hosts that have
2286 sigsetjmp but not _setjmp, such as some versions of Solaris and
2287 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2288 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2289 (png_load_body) [HAVE_PNG]:
2290 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2291 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2292 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2293 since PNG requires jmp_buf. This is the only exception to the
2294 general rule that we now use sys_setjmp and sys_longjmp.
2295 This exception is OK since this code does not change the signal
2296 mask or longjmp out of a signal handler.
2297
2298 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2299
2300 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2301 Include "syssignal.h", for 'main_thread'.
2302
2303 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2304
2305 Avoid out-of-range marker position (Bug#12426).
2306 * insdel.c (replace_range, replace_range_2):
2307 Adjust markers before overlays, as suggested by comments.
2308 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2309 Remove redundant check before calling offset_intervals.
2310
2311 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2312
2313 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2314 current buffer (Bug#12387).
2315
2316 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2317
2318 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2319
2320 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2321
2322 Use a more backwards-compatible timer format (Bug#12430).
2323 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2324 vector element, not from the 4th, since PSECS is now at the end.
2325 (Fcurrent_idle_time): Doc fix.
2326
2327 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2328
2329 Function to mark objects and remove killed buffers at once.
2330 * alloc.c (discard_killed_buffers): Rename to ...
2331 (mark_discard_killed buffers) ... new name. Add marking
2332 of remaining objects. Fix comment. Adjust users.
2333 (mark_object): Do not touch frame buffer lists here.
2334 * frame.c (delete_frame): Reset frame buffer lists here.
2335
2336 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2337
2338 Better workaround for GNOME bug when --enable-gcc-warnings.
2339 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2340 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2341 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2342
2343 Simplify SIGIO usage (Bug#12408).
2344 The code that dealt with SIGIO was crufty and confusing, e.g., it
2345 played tricks like "#undef SIGIO" but these tricks were not used
2346 consistently. Simplify mostly by not #undeffing standard symbols,
2347 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2348 or not as we please) rather than "defined SIGIO" (standard symbol
2349 that we probably shouldn't #undef).
2350 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2351 Modules that need it can include it.
2352 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2353 * dispextern.h (ignore_sigio): New decl.
2354 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2355 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2356 * emacs.c (shut_down_emacs):
2357 * keyboard.c (kbd_buffer_store_event_hold):
2358 Use ignore_sigio rather than invoking 'signal' directly.
2359 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2360 for FIONREAD.
2361 (FIONREAD, SIGIO): Do not #undef.
2362 (tty_read_avail_input): Use #error rather than a syntax error.
2363 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2364 for I_PIPE, used by SETUP_SLAVE_PTY.
2365 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2366 * sysdep.c (croak): Remove; no longer needed. This bit of
2367 temporary code, with Fred N. Fish's comment that it's temporary,
2368 has been in Emacs since at least 1992!
2369 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2370 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2371 * syssignal.h (croak): Remove decl.
2372 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2373 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2374 now that we're termios-only.
2375 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2376 * term.c (dissociate_if_controlling_tty): Use #error rather than
2377 a run-time error.
2378
2379 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2380 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2381 to work around GNOME bug 683906.
2382 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2383 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2384 This works around GCC bug 54561.
2385
2386 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2387
2388 More fixes for 'volatile' and setjmp/longjmp.
2389 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2390 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2391 (png_load_body) [HAVE_PNG]:
2392 (jpeg_load_body) [HAVE_JPEG]:
2393 New function, with most of the old parent function's body.
2394 (png_load) [HAVE_PNG]:
2395 (jpeg_load) [HAVE_JPEG]:
2396 Invoke the new function, to avoid longjmp munging our locals.
2397 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2398 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2399 longjmp is passed 2, as the C standard doesn't guarantee this.
2400 Instead, store the failure code into mgr->failure_code.
2401
2402 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2403
2404 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2405 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2406 (syms_of_keyboard): Remove support for unread-command-char.
2407
2408 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2409
2410 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2411 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2412 violation. (Bug#12426)
2413
2414 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2415
2416 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2417
2418 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2419
2420 * eval.c: Add `inhibit-debugger'.
2421 (Qinhibit_debugger): New symbol.
2422 (call_debugger): Bind it instead of Qdebug_on_error.
2423 (maybe_call_debugger): Test Vinhibit_debugger.
2424 (syms_of_eval): Define inhibit-debugger.
2425 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2426 (syms_of_xdisp): Remove inhibit-debug-on-message.
2427
2428 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2429
2430 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2431 If a nonvolatile local variable is written before a _longjmp to
2432 the frame containing the variable, and is read after the _longjmp,
2433 the value read is indeterminate. Some local variables of type
2434 'struct handler' and 'struct catchtag' are used in this way, so
2435 mark each of their slots as volatile if the slot can be set before
2436 _longjmp and read afterwards.
2437 * lisp.h (struct handler): var and chosen_clause are now volatile.
2438 (struct catchtag): val, next, and pdlcount are now volatile.
2439
2440 * bidi.c (bidi_push_it, bidi_pop_it):
2441 * fns.c (copy_hash_table):
2442 * image.c (define_image_type):
2443 * keyboard.c (kbd_buffer_store_event_hold):
2444 * process.c (Fprocess_send_eof):
2445 * xfaces.c (x_create_gc) [HAVE_NS]:
2446 * xgselect.c (xg_select):
2447 Prefer assignment to memcpy when either will do.
2448
2449 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2450 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2451 time an item is removed. No need to mark this function 'inline';
2452 the compiler knows better than we do.
2453
2454 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2455
2456 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2457 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2458 to change_frame_size (Bug#12388).
2459 (windowDidResize:): Pass YES to updateFrameSize.
2460
2461 * nsterm.h: Add delay parameter to updateFrameSize.
2462
2463 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2464
2465 Discard killed buffers from deleted window and frame objects.
2466 This reduces an amount of references to killed buffers and
2467 helps GC to reclaim them faster.
2468 * alloc.c (discard_killed_buffers): New function.
2469 (mark_object): Use it for deleted windows and frames.
2470 (mark_object): If symbol's value is set up for a killed buffer
2471 or deleted frame, restore its global binding.
2472 * data.c (swap_in_global_binding): Add GC notice.
2473 (swap_in_symval_forwarding): Use convenient set_blv_where.
2474 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2475 * window.h: ... to here.
2476
2477 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 Convenient macro to check whether the buffer is live.
2480 * buffer.h (BUFFER_LIVE_P): New macro.
2481 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2482 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2483
2484 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2485
2486 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2487 composition cases (Bug#12364).
2488
2489 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2490 overhang of succeeding glyphs overlapping box cursor.
2491
2492 * w32term.c (x_draw_glyph_string): Likewise.
2493
2494 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 Simplify, document, and port floating-point (Bug#12381).
2497 The porting part of this patch fixes bugs on non-IEEE platforms
2498 with frexp, ldexp, logb.
2499 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2500 Now static.
2501 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2502 support, by removing commented-out code and briefly listing the
2503 C89 functions excluded. The commented-out stuff was confusing
2504 maintenance, e.g., we thought we needed cbrt but it was commented out.
2505 (logb): Remove decl; no longer needed.
2506 (isfinite): New macro, if not already supplied.
2507 (isnan): Don't replace any existing macro.
2508 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2509 are present on all C89 platforms.
2510 (Ffrexp): Do not special-case zero, as frexp does the right thing
2511 for that case.
2512 (Flogb): Do not use logb, as it doesn't have the desired meaning
2513 on hosts that use non-base-2 floating point. Instead, stick with
2514 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2515 frexp, to avoid getting an unspecified result.
2516
2517 * xdisp.c (Qinhibit_debug_on_message): Now static.
2518
2519 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2520
2521 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2522 NSBezierPath (Bug#12131).
2523
2524 2012-09-10 Chong Yidong <cyd@gnu.org>
2525
2526 * fns.c (Fdelq, Fdelete): Doc fix.
2527
2528 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2529
2530 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2531 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2532
2533 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2534
2535 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2536 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2537 Use it.
2538
2539 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2540
2541 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2542 left fringe if the window has a left margin. This avoids leaving
2543 traces of the cursor because its leftmost pixel is not drawn over.
2544
2545 * dispnew.c (update_window_line): When the left margin area of a
2546 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2547 that screen line. (Bug#12277)
2548
2549 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2550
2551 Assume C89 or later for math functions (Bug#12381).
2552 This simplifies the code, and makes it a bit smaller and faster,
2553 and (most important) makes it easier to clean up signal handling
2554 since we can stop worring about floating-point exceptions in
2555 library code. That was a problem before C89, but the problem
2556 went away many years ago on all practical Emacs targets.
2557 * data.c, image.c, lread.c, print.c:
2558 Don't include <math.h>; no longer needed.
2559 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2560 might be autoconfigured, as that never happens.
2561 * data.c (fmod):
2562 * doprnt.c (DBL_MAX_10_EXP):
2563 * print.c (DBL_DIG):
2564 Remove. C89 or later always defines these.
2565 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2566 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2567 (arith_error, domain_error, domain_error2):
2568 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2569 no longer needed -- we simply return what C returns. All uses removed.
2570 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2571 the wrapped code.
2572 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2573 Remove. All uses expanded, as these macros are no longer used
2574 more than once and are now more trouble than they're worth.
2575 (Ftan): Use tan, not sin / cos.
2576 (Flogb): Assume C89 frexp.
2577 (fmod_float): Assume C89 fmod.
2578 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2579 (init_floatfns): Remove. All uses removed.
2580
2581 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2582
2583 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2584 compositeToPoint for OSX < 10.6 (Bug#12390).
2585
2586 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2589 This produces more-accurate results.
2590
2591 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2592
2593 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2594 changes (Bug#12088).
2595
2596 2012-09-08 Chong Yidong <cyd@gnu.org>
2597
2598 * syntax.c (Fstring_to_syntax): Doc fix.
2599
2600 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2601
2602 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2603 in the internal border.
2604 (x_set_window_size): Remove static variables and their usage.
2605 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2606 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2607 Remove fringe/internal border adjustment (Bug#11052).
2608 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2609 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2610 (ns_fix_rect_ibw): Remove.
2611 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2612 (ns_dumpglyphs_box_or_relief): Ditto.
2613 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2614 adjustment.
2615 (ns_dumpglyphs_image): Ditto.
2616 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2617 border adjustment.
2618 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2619 their usage. Add fringe_extended_p and its use as in other terms.
2620 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2621 scroll bar was removed.
2622 (updateFrameSize): New function.
2623 (windowDidResize): Move code to updateFrameSize and call it.
2624
2625 * nsterm.h (EmacsView): Add updateFrameSize.
2626
2627 2012-09-07 Chong Yidong <cyd@gnu.org>
2628
2629 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2630
2631 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2632
2633 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2634
2635 More signal-handler cleanup (Bug#12327).
2636 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2637 Problem introduced when merging patches. Noted by Eli Zaretskii in
2638 <http://bugs.gnu.org/12327#67>.
2639 * floatfns.c: Comment fix.
2640 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2641 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2642 and anyway the declaration is harmless even if SIGDANGER is not defined.
2643 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2644 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2645 source files not surprisingly expected syssignal.h to define, or
2646 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2647 Include <sys/ioctl.h>, for FIONREAD.
2648 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2649 This eliminates a problem whereby other files mysteriously had
2650 to include "syssignal.h" before including "systty.h" if they
2651 wanted to use "#ifdef SIGIO".
2652
2653 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2654
2655 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2656
2657 * w32.c (sigemptyset): Empty the set.
2658 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2659
2660 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2661
2662 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2663
2664 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2665 (mark_object): Likewise for frame objects.
2666
2667 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2668
2669 * syssignal.h (handle_on_main_thread): Always declare,
2670 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2671 This ports to platforms without HAVE_PTHREAD.
2672
2673 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2674
2675 Signal-handler cleanup (Bug#12327).
2676 Emacs's signal handlers were written in the old 4.2BSD style with
2677 sigblock and sigmask and so forth, and this led to some
2678 inefficiencies and confusion. Rewrite these to use
2679 pthread_sigmask etc. without copying signal sets around. Also,
2680 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2681 'signal', and instead use functions that do not attempt to take
2682 over the system name space. This patch causes Emacs's text
2683 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2684 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2685 Do not include <signal.h> or "syssignal.h", as these
2686 modules do not use signals.
2687 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2688 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2689 Do not include <signal.h>, as "syssignal.h" does that for us now.
2690 * atimer.c (sigmask_atimers): New function.
2691 (block_atimers, unblock_atimers): New functions,
2692 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2693 All uses replaced.
2694 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2695 no longer needed here.
2696 * emacs.c (main): Inspect existing signal handler with sigaction,
2697 so that there's no need to block and unblock SIGHUP.
2698 * sysdep.c (struct save_signal): New member 'action', replacing
2699 old member 'handler'.
2700 (save_signal_handlers, restore_signal_handlers):
2701 Use sigaction instead of 'signal' to save and restore.
2702 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2703 New function. All users of 'signal' modified to use set_sighandler
2704 if they're writeonly, and to use sys_signal if they're read+write.
2705 (emacs_sigaction_init, forwarded_signal): New functions.
2706 (sys_signal): Remove. All uses replaced by calls to sigaction
2707 and emacs_sigaction_init, or by direct calls to 'signal'.
2708 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2709 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2710 all uses replaced by pthread_sigmask etc. calls.
2711 * syssignal.h: Include <signal.h>.
2712 (emacs_sigaction_init, forwarded_signal): New decls.
2713 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2714 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2715 (sigmask, sys_sigmask): Remove; no longer needed.
2716 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2717 (sigblock, sigunblock, sigfree):
2718 (sigsetmask) [!defined sigsetmask]:
2719 Remove. All uses replaced by pthread_sigmask.
2720 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2721 no longer need to be replaced, and its typical old uses
2722 are now done via emacs_sigaction_init and sigaction.
2723 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2724 (sys_sigdel): Remove; unused.
2725 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2726
2727 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2728
2729 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2730 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2731
2732 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2733
2734 Explicitly mark buffer_defaults and buffer_local_symbols.
2735 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2736 mark_local_symbols here.
2737 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2738 since special buffers aren't marked here any more.
2739 (allocate_buffer): Chain new buffer with all_buffers here...
2740 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2741 not here.
2742 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2743 (syms_of_buffer): Remove staticpro of the above.
2744 (init_buffer_once): Set names for buffer_defaults and
2745 buffer_local_symbols.
2746
2747 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2748
2749 Use bool for booleans in font-related modules.
2750 * font.c (font_intern_prop, font_style_to_value)
2751 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2752 (generate_otf_features, font_check_otf_features, font_check_otf)
2753 (font_match_p, font_list_entities, font_at):
2754 * fontset.c (fontset_id_valid_p, reorder_font_vector
2755 (fontset_find_font, Fset_fontset_font)
2756 (face_suitable_for_char_p) [0]:
2757 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2758 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2759 (m17n_flt_initialized, ftfont_shape_by_flt):
2760 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2761 * nsfont.m (nsfont_draw):
2762 * w32font.c (w32font_draw):
2763 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2764 Use bool for booleans.
2765 * font.h: Adjust to above API changes.
2766 (struct font, struct font_driver, struct font_driver_list):
2767 Use bool for booleans.
2768 (struct font): Remove useless member encoding_type.
2769 All users removed.
2770 * fontset.c, xftfont.c: Omit unnecessary static decls.
2771
2772 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2773
2774 * alloc.c (mark_object): Revert window marking code
2775 since it's unsafe for the Fset_window_configuration.
2776
2777 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2778
2779 Fix race conditions with signal handlers and errno (Bug#12327).
2780 Be more systematic about preserving errno whenever a signal
2781 handler returns, even if it's not in the main thread. Do this by
2782 renaming signal handlers to distinguish between signal delivery
2783 and signal handling. All uses changed.
2784 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2785 * data.c (deliver_arith_signal): Rename from arith_error.
2786 * dispnew.c (deliver_window_change_signal): Rename from
2787 window_change_signal.
2788 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2789 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2790 * keyboard.c (deliver_input_available_signal): Rename from
2791 input_available_signal.
2792 (deliver_user_signal): Rename from handle_user_signal.
2793 (deliver_interrupt_signal): Rename from interrupt_signal.
2794 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2795 (deliver_child_signal): Rename from sigchld_handler.
2796 * atimer.c (handle_alarm_signal):
2797 * data.c (handle_arith_signal):
2798 * dispnew.c (handle_window_change_signal):
2799 * emacs.c (handle_fatal_signal, handle_danger_signal):
2800 * keyboard.c (handle_input_available_signal):
2801 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2802 * process.c (handle_pipe_signal, handle_child_signal):
2803 New functions, with the actual signal-handling code taken from the
2804 original respective signal handlers, sans the sporadic attempts to
2805 preserve errno, since that's now done by handle_on_main_thread.
2806 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2807 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2808 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2809 Move to sysdep.c.
2810 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2811 Move initialization of main_thread to sysdep.c's init_signals.
2812 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2813 our usage, and simplifies the mainline code.
2814 (record_child_status_change): New static function, as a helper
2815 for handle_child_signal, and with most of the old child handler's
2816 contents.
2817 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2818 (handle_child_signal): Use the above.
2819 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2820 Moved here from emacs.c.
2821 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2822 code moved here from emacs.c's main function.
2823 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2824 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2825 This lets callers save and restore errno properly.
2826
2827 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2828
2829 Remove redundant or unused things here and there.
2830 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2831 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2832 * editfns.c (Fcompare_buffer_substrings): Likewise.
2833 * frame.h (struct terminal, struct font_driver_list):
2834 Remove redundant declarations.
2835 * window.h (Qleft, Qright): Likewise.
2836
2837 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2838
2839 Do not mark objects from deleted buffers, windows and frames.
2840 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2841 (mark_object): Likewise for windows and frames.
2842
2843 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2844
2845 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2846 buffer_defaults and buffer_local_symbols as valid objects.
2847 Return special value to denote them.
2848
2849 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2850
2851 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2852 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2853 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2854 (file_name_absolute_p, Fsubstitute_in_file_name):
2855 (check_executable, check_writable, Ffile_accessible_directory_p)
2856 (Fset_file_selinux_context, Fdefault_file_modes)
2857 (Finsert_file_contents, choose_write_coding_system)
2858 (Fwrite_region, build_annotations, a_write, e_write)
2859 (Fdo_auto_save):
2860 * filelock.c (boot_time_initialized, get_boot_time)
2861 (get_boot_time_1, lock_file_1, within_one_second):
2862 * floatfns.c (in_float):
2863 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2864 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2865 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2866 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2867 * window.c (compare_window_configurations):
2868 Use bool for booleans.
2869 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2870 (Fdefault_file_modes): Now mode_t, not int, for modes.
2871 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2872 (internal_delete_file): Now returns void, not a (boolean) int,
2873 since nobody was looking at the return value.
2874 * lisp.h, window.h: Adjust to above API changes.
2875
2876 * xdisp.c (set_message): Simplify and reindent last change.
2877
2878 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2879
2880 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2881
2882 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2883
2884 * eval.c (call_debugger): Make the function non-static so that we
2885 can call it from set_message.
2886
2887 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2888 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2889
2890 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2891
2892 Give more-useful info on a fatal error (Bug#12328).
2893 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2894 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2895 of doing the work ourselves.
2896 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2897 do most of the work.
2898 (fatal_error_backtrace): New function, taken from the guts
2899 of the old fatal_error_signal, but with a new option to output
2900 a backtrace.
2901 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2902 info about the signal than just its number.
2903 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2904 * sysdep.c: Include <execinfo.h>
2905 (emacs_backtrace): New function, taken partly from the previous
2906 code of the 'die' function.
2907 (emacs_abort): Call fatal_error_backtrace rather than abort.
2908
2909 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2910
2911 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2912 eager (load-time) macro-expansion.
2913 * lisp.mk (lisp): Add macroexp.
2914
2915 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2916
2917 Simplify redefinition of 'abort' (Bug#12316).
2918 Do not try to redefine the 'abort' function. Instead, redo
2919 the code so that it calls 'emacs_abort' rather than 'abort'.
2920 This removes the need for the NO_ABORT configure-time macro
2921 and makes it easier to change the abort code to do a backtrace.
2922 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2923 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2924 Remove; sysdep.c's emacs_abort now takes its place.
2925 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2926 'abort' changed to use 'emacs_abort'.
2927 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2928 (abort) [!defined abort]: Rename to ...
2929 (emacs_abort): ... new name.
2930 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2931 the place of the old 'abort' in emacs.c.
2932 * w32.c, w32fns.c (abort): Do not #undef.
2933 * w32.c (emacs_abort): Rename from w32_abort.
2934
2935 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2936
2937 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2938 offsets[j].dv, since the y axis of the screen coordinates points
2939 down, while the y axis of the font definition coordinates points
2940 up. This fixes display of Arabic diacritics such as KASRA and
2941 KASRATAN. (Bug#11860)
2942
2943 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 Be more systematic about _setjmp vs setjmp.
2946 * alloc.c (test_setjmp, mark_stack):
2947 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2948 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2949 (png_load, my_error_exit, jpeg_load):
2950 * process.c (send_process_trap, send_process):
2951 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2952 The underscored versions are up to 30x faster on some hosts.
2953 Formerly, the code used setjmp+longjmp sometimes and
2954 _setjmp+_longjmp at other times, with no particular reason to
2955 prefer setjmp+longjmp.
2956
2957 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2958
2959 Fix minor problem found by static checking.
2960 * buffer.c (Fdelete_all_overlays): Return nil.
2961
2962 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2963
2964 * buffer.c (Fdelete_all_overlays): New function.
2965
2966 2012-09-03 Chong Yidong <cyd@gnu.org>
2967
2968 * gtkutil.c: Add extern decl for Qxft.
2969
2970 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2971
2972 * emacs.c, eval.c: Use bool for boolean.
2973 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2974 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2975 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2976 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2977 (main, decode_env_path, Fdaemon_initialized):
2978 * eval.c (call_debugger, Finteractive_p, interactive_p):
2979 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2980 (maybe_call_debugger, Fbacktrace):
2981 * process.c (read_process_output, exec_sentinel):
2982 Use bool for booleans.
2983 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2984 All callers changed.
2985 * eval.c (interactive_p): Omit always-true boolean argument
2986 EXCLUDE_SUBRS_P. All callers changed.
2987 * dispextern.h, lisp.h: Reflect above API changes.
2988 * firstfile.c (dummy): Use the address of 'main', whose signature
2989 won't change, instead of the address of 'initialize', whose
2990 signature just changed from int to bool.
2991 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2992 * msdos.c (fatal_error_in_progress): ... from here.
2993 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2994 of incrementing it.
2995 (redisplay_internal, unwind_redisplay): Simply clear
2996 REDISPLAYING_P when unwinding, instead of saving its previous,
2997 always-false value and then restoring it.
2998
2999 Clean up some extern decls.
3000 Mostly, this hoists extern decls out of .c files and into .h files.
3001 That way, we're more likely to catch errors if the interfaces change.
3002 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3003 declare xg_mark_data.
3004 * dispextern.h (x_frame_parm_handlers):
3005 * font.h (Qxft):
3006 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3007 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3008 (Qultra_bold, Qoblique, Qitalic):
3009 Move extern decl here from .c file.
3010 * alloc.c (xg_mark_data) [USE_GTK]:
3011 * doc.c (Qclosure):
3012 * eval.c (Qlexical_binding):
3013 * fns.c (time) [!HAVE_UNISTD_H]:
3014 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3015 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3016 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3017 * lread.c (Qinternal_interpreter_environment):
3018 * minibuf.c (Qbuffer):
3019 * process.c (QCfamily, QCfilter):
3020 * widget.c (free_frame_faces):
3021 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3022 * xfont.c (x_clear_errors):
3023 * xterm.c (x_frame_parm_handlers):
3024 Remove now-redundant extern decls.
3025 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3026 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3027 Now static.
3028 * xfaces.c: Remove unnecessary static decls.
3029 * xterm.c (updating_frame): Remove decl of nonexistent object.
3030
3031 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3032 when building globals.h, as the objects that are not built on
3033 this host are not needed to compile C files on this host.
3034
3035 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3036
3037 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3038
3039 * frame.h: Add missing prototype for x_wm_set_size_hint.
3040
3041 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3044 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3045 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3046 (Fsubstitute_command_keys):
3047 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3048 (save_excursion_save, save_excursion_restore)
3049 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3050 (format_time_string, general_insert_function)
3051 (make_buffer_string, make_buffer_string_both)
3052 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3053 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3054 (copy_text, insert_1, insert_1_both, insert_from_string)
3055 (insert_from_string_before_markers, insert_from_string_1)
3056 (insert_from_buffer, insert_from_buffer_1, replace_range)
3057 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3058 (del_range_2, modify_region):
3059 * intervals.c (intervals_equal, balance_possible_root_interval)
3060 (adjust_intervals_for_insertion, merge_properties_sticky)
3061 (graft_intervals_into_buffer, lookup_char_property)
3062 (adjust_for_invis_intang, set_point_both)
3063 (get_property_and_range, compare_string_intervals)
3064 (set_intervals_multibyte_1, set_intervals_multibyte):
3065 * keyboard.c (decode_timer):
3066 Use bool for boolean.
3067 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3068 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3069
3070 2012-09-02 Chong Yidong <cyd@gnu.org>
3071
3072 * keymap.c (push_key_description): Print M-TAB as C-M-i
3073 (Bug#11758).
3074
3075 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3076
3077 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3078 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3079 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3080 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3081 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3082 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3083 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3084
3085 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3086
3087 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3088 more than one grapheme cluster passed to the shaper: compute the
3089 offset adjustment values separately for each cluster. (Bug#11860)
3090
3091 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3092 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3093 about implicit conversions from integer to pointer.
3094
3095 2012-09-01 Daniel Colascione <dancol@dancol.org>
3096
3097 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3098 system used too early.
3099
3100 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 Better seed support for (random).
3103 * emacs.c (main): Call init_random.
3104 * fns.c (Frandom): Set the seed from a string argument, if given.
3105 Remove long-obsolete Gentzel cruft.
3106 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3107 (init_random): New function.
3108
3109 2012-09-01 Daniel Colascione <dancol@dancol.org>
3110
3111 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3112 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3113 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3114 x_wm_set_size_hint, x_query_colors, x_real_positions,
3115 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3116 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3117 all of which have been moved to common code.
3118
3119 * xfaces.c: Include TERM_HEADER instead of listing all possible
3120 window-system headers.
3121
3122 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3123 to match header.
3124
3125 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3126 directly accessing frame internals.
3127
3128 * w32font.h: Include font.h. Define syms_of_w32font and
3129 globals_of_w32font.
3130
3131 * process.c: Include TERM_HEADER instead of listing all possible
3132 window-system headers.
3133
3134 * nsterm.h: Remove declarations now in frame.h.
3135 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3136
3137 * menu.c: Include TERM_HEADER instead of listing all possible
3138 window-system headers.
3139
3140 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3141 window system.
3142
3143 * keyboard.c: Include TERM_HEADER instead of listing all possible
3144 window-system headers.
3145
3146 * image.c: Include TERM_HEADER instead of listing all possible
3147 window-system headers. Declare Vlibrary_cache when compiling for
3148 Windows.
3149
3150 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3151 window system declarations.
3152
3153 * frame.h: Move common functions here: set_frame_menubar,
3154 x_set_window_size, x_sync, x_get_focus_frame,
3155 x_set_mouse_position, x_set_mouse_pixel_position,
3156 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3157 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3158 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3159 x_activate_menubar, x_real_positions, x_bitmap_icon,
3160 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3161 and x_query_colors.
3162
3163 * frame.c: Include TERM_HEADER instead of listing all possible
3164 window-system headers.
3165
3166 * font.c: Include TERM_HEADER instead of listing all possible
3167 window-system headers.
3168
3169 * emacs.c: Include TERM_HEADER.
3170
3171 * dispnew.c: Include TERM_HEADER instead of listing all possible
3172 window-system headers.
3173
3174 * ccl.h: Include character.h.
3175
3176 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3177 the current window system; include in list of objects to link into
3178 Emacs.
3179
3180 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3181
3182 Remove mark_ttys function and fix tty_display_info initialization.
3183 * lisp.h (mark_ttys): Remove prototype.
3184 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3185 to mark_ttys because all possible values of 'top_frame' slot are
3186 the frames which are reachable from Vframe_list.
3187 * term.c (mark_ttys): Remove.
3188 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3189
3190 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3191
3192 Change struct frame bitfields from unsigned char to unsigned.
3193 * frame.h (struct frame): Change type of 'display_preempted',
3194 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3195 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3196 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3197 bitfields from unsigned char to unsigned.
3198
3199 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3200
3201 Remove unused member of struct x_output and struct w32_output.
3202 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3203 * w32term.h (struct w32_output): Likewise.
3204
3205 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3206
3207 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3208 does not become zero (Bug#12234).
3209
3210 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3211
3212 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3213 for GCC 4.7.1 x86-64.
3214
3215 2012-08-30 Glenn Morris <rgm@gnu.org>
3216
3217 * lread.c (init_lread): For out-of-tree builds, only add the
3218 source directory's site-lisp dir to the load-path if it exists,
3219 consistent with in-tree builds. (Bug#12302)
3220
3221 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3222
3223 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3224 button_values to NULL. Call setStykeMask so dialogs get a close button.
3225 (windowShouldClose:): Set window_closed.
3226 (dealloc): New member, free button_values.
3227 (process_dialog:): Make member function. Remove window argument,
3228 replace window with self. Count buttons and allocate and store values
3229 in button_values.
3230 (addButton:value:row:): value is int with the name tag. Call setTag
3231 with tag. Remove return self, declare return value as void.
3232 (addString:row:): Remove return self, declare return value as void.
3233 (addSplit): Remove return self, declare return value as void.
3234 (clicked:): Remove return self, declare return value as void.
3235 Set dialog_return to button_values[seltag]. Code formatting change.
3236 (initFromContents:isQuestion:): Adjust call to process_dialog.
3237 Code formatting change.
3238 (timeout_handler:): Set timer_fired to YES.
3239 (runDialogAt:): Set timer_fired to NO.
3240 Handle click on close button as quit.
3241
3242 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3243 Add window_closed and button_values. Add void as return value for
3244 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3245 Add process_dialog as new member.
3246
3247 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3248
3249 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3250 is not one of the heaps we manage. (Bug#12242)
3251
3252 2012-08-28 Glenn Morris <rgm@gnu.org>
3253
3254 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3255
3256 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3257
3258 * window.c (Fset_window_configuration): Remove handling of
3259 auto-buffer-name window parameter. Install revision of reverted
3260 fix.
3261
3262 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3263
3264 Do not allow to set major mode for a dead buffer.
3265 * buffer.c (Fset_buffer_major_mode): Signal an error
3266 if the buffer is dead.
3267 (Fother_buffer, other_buffer_safely): Remove redundant
3268 nested declaration.
3269
3270 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3271
3272 Always use set_buffer_if_live to restore original buffer at unwind.
3273 * buffer.h (record_unwind_current_buffer): New function.
3274 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3275 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3276 * undo.c, window.c: Adjust users.
3277 * buffer.c (set_buffer_if_live): Fix comment.
3278
3279 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3280
3281 Fix usage of set_buffer_internal.
3282 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3283 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3284 * coding.c (decode_coding): Omit redundant test.
3285 * fileio.c (decide_coding_unwind): Likewise.
3286 * fns.c (secure_hash): Likewise.
3287 * insdel.c (modify_region): Likewise.
3288 * keyboard.c (command_loop_1): Likewise.
3289 * print.c (PRINTFINISH): Likewise.
3290 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3291
3292 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3293
3294 * dispnew.c: Use bool for boolean.
3295 (frame_garbaged, display_completed, delayed_size_change)
3296 (fonts_changed_p, add_window_display_history)
3297 (add_frame_display_history, verify_row_hash)
3298 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3299 (row_equal_p, realloc_glyph_pool)
3300 (allocate_matrices_for_frame_redisplay)
3301 (showing_window_margins_p)
3302 (adjust_frame_glyphs_for_frame_redisplay)
3303 (build_frame_matrix_from_leaf_window, make_current)
3304 (mirrored_line_dance, mirror_line_dance, update_frame)
3305 (update_window_tree, update_single_window)
3306 (check_current_matrix_flags, update_window, update_text_area)
3307 (update_window_line, set_window_update_flags, scrolling_window)
3308 (update_frame_1, scrolling, buffer_posn_from_coords)
3309 (do_pending_window_change, change_frame_size)
3310 (change_frame_size_1, sit_for):
3311 Use bool for boolean.
3312 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3313 and remove last int (actually boolean) argument, which was always 0.
3314 All callers changed.
3315 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3316 * dispextern.h (struct composition_it): Use bool for boolean.
3317 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3318 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3319 * dired.c (file_name_completion):
3320 Use bool for boolean. (This was missed in an earlier change.)
3321
3322 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3323
3324 * window.c (Fset_window_configuration): Revert first part of
3325 last change.
3326
3327 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3328
3329 * nsterm.h (NSPanel): New class variable dialog_return.
3330
3331 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3332 Initialize dialog_return.
3333 (windowShouldClose:): Use stop instead of stopModalWithCode.
3334 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3335 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3336 event.
3337 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3338 modal loop returns.
3339
3340 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3341
3342 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3343 * composite.c (find_composition, composition_gstring_p)
3344 (composition_reseat_it, find_automatic_composition):
3345 * data.c (let_shadows_buffer_binding_p)
3346 (let_shadows_global_binding_p, set_internal, make_blv)
3347 (Fmake_variable_buffer_local, Fmake_local_variable)
3348 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3349 (cons_to_signed, arith_driver):
3350 * dbusbind.c (xd_in_read_queued_messages):
3351 * dired.c (directory_files_internal, file_name_completion):
3352 Use bool for booleans.
3353 * dired.c (file_name_completion):
3354 * process.h (fd_callback):
3355 Omit int (actually boolean) argument. It wasn't being used.
3356 All uses changed.
3357 * composite.h, lisp.h: Reflect above API changes.
3358
3359 * cmds.c, coding.c: Use bool for booleans.
3360 * cmds.c (move_point, Fself_insert_command):
3361 * coding.h (struct composition status, struct coding_system):
3362 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3363 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3364 (emacs_mule_char, decode_coding_emacs_mule)
3365 (encode_coding_emacs_mule, detect_coding_iso_2022)
3366 (decode_coding_iso_2022, encode_invocation_designation)
3367 (encode_designation_at_bol, encode_coding_iso_2022)
3368 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3369 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3370 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3371 (encode_coding_raw_text, detect_coding_charset)
3372 (decode_coding_charset, encode_coding_charset, detect_eol)
3373 (detect_coding, get_translation_table, produce_chars)
3374 (consume_chars, reused_workbuf_in_use)
3375 (make_conversion_work_buffer, code_conversion_save)
3376 (decode_coding_object, encode_coding_object)
3377 (detect_coding_system, char_encodable_p)
3378 (Funencodable_char_position, code_convert_region)
3379 (code_convert_string, code_convert_string_norecord)
3380 (Fset_coding_system_priority):
3381 * fileio.c (Finsert_file_contents):
3382 Use bool for booleans.
3383 * coding.h, lisp.h: Reflect above API changes.
3384 * coding.c: Remove unnecessary static function decls.
3385 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3386 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3387 not a boolean 'int', since callers never look at the return value.
3388 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3389 * coding.h (decoding_buffer_size, encoding_buffer_size)
3390 (emacs_mule_string_char): Remove unused extern decls.
3391 (struct iso_2022_spec, struct coding_system):
3392 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3393 (struct emacs_mule_spec): Remove unused field 'full_support'.
3394 All initializations removed.
3395 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3396
3397 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3398
3399 Fix spare memory change (Bug#12286).
3400 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3401 (valid_lisp_object_p): Likewise.
3402
3403 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3404
3405 * window.c (Fset_window_configuration): Record any window's old
3406 buffer if it's replaced (see Bug#8789). If the new current
3407 buffer doesn't appear in the selected window, go to its old
3408 point (Bug#12208).
3409
3410 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3411
3412 Special MEM_TYPE_SPARE to denote reserved memory.
3413 * alloc.c (enum mem_type): New memory type.
3414 (refill_memory_reserve): Use new type for spare memory.
3415 This prevents live_cons_p and live_string_p from incorrect
3416 detection of uninitialized objects from spare memory as live.
3417
3418 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3419
3420 Spelling fixes.
3421 * Makefile.in (.PHONY): versioclean -> versionclean.
3422
3423 Remove unused external symbols.
3424 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3425 * window.c (Qwindow_valid_p, decode_valid_window):
3426 Now static, not extern.
3427 * data.c (Qinterval): Remove; unused.
3428 (syms_of_data): Do not define 'interval'.
3429 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3430 * window.h (decode_valid_window):
3431 Remove decls.
3432
3433 * character.c, charset.c, chartab.c: Use bool for booleans.
3434 * character.c (lisp_string_width, string_count_byte8)
3435 (string_escape_byte8):
3436 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3437 (load_charset_map_from_file, map_charset_chars)
3438 (Fdefine_charset_internal, define_charset_internal)
3439 (Fdeclare_equiv_charset, find_charsets_in_text)
3440 (Ffind_charset_region, char_charset, Fiso_charset):
3441 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3442 (sub_char_table_set, sub_char_table_set_range)
3443 (char_table_set_range, optimize_sub_char_table)
3444 (map_sub_char_table):
3445 Use bool for boolean.
3446 * character.c (str_to_unibyte): Omit last boolean argument; it was
3447 always 0. All callers changed.
3448 * character.h, charset.h: Adjust to match previous changes.
3449 * character.h (char_printable_p): Remove decl of nonexistent function.
3450 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3451 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3452 are all boolean, so make them single-bit bitfields.
3453
3454 * lisp.h (ASET): Remove attempt to detect side effects.
3455 It was meant to be temporary and it often doesn't work,
3456 because when IDX has side effects the behavior of IDX==IDX
3457 is undefined. See Stefan Monnier in
3458 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3459
3460 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3461
3462 * lisp.h (functionp): New function (extracted from Ffunctionp).
3463 (FUNCTIONP): Use it.
3464 * eval.c (Ffunctionp): Use it.
3465
3466 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3469 as that's faster and simpler than static storage. Don't bother
3470 with the g_main_context_query overhead if g_main_context_pending
3471 says no events are pending.
3472 (gfds, gfds_size): Remove these static vars.
3473 (xgselect_initialize): Remove; no longer needed.
3474 All uses and decls removed.
3475
3476 * emacs.c (fatal_error_signal_hook): Remove.
3477 All uses removed. This leftover from old code was always 0.
3478
3479 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3480 * casefiddle.c (casify_object, casify_region):
3481 * casetab.c (set_case_table):
3482 * category.c, category.h (word_boundary_p):
3483 * category.h (CHAR_HAS_CATEGORY):
3484 Use bool for booleans, instead of int.
3485
3486 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3487
3488 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3489
3490 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3491
3492 On assertion failure, print backtrace if available.
3493 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3494 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3495 * Makefile.in (LIB_EXECINFO): New macro.
3496 (LIBES): Use it.
3497
3498 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3499 * bytecode.c (exec_byte_code):
3500 * callint.c (check_mark, Fcall_interactively):
3501 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3502 (getenv_internal, sync_process_alive, call_process_exited):
3503 * lisp.h (USE_SAFE_ALLOCA):
3504 Use bool for booleans, instead of int.
3505 * lisp.h, process.h: Adjust prototypes to match above changes.
3506 * callint.c (Fcall_interactively): Don't assume the mark's
3507 offset fits in 'int'.
3508
3509 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3510
3511 * buffer.c, buffer.h: Use bool for boolean.
3512 * buffer.c (reset_buffer_local_variables)
3513 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3514 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3515 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3516 (overlay_touches_p, overlay_strings, Foverlay_put)
3517 (report_overlay_modification, call_overlay_mod_hooks):
3518 (mmap_enlarge, mmap_set_vars):
3519 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3520 Use bool for booleans, instead of int.
3521 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3522 since the 1-or-0 return value is always ignored anyway.
3523 (mmap_initialized_p):
3524 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3525 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3526
3527 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3528
3529 * bidi.c: Use bool for boolean.
3530 This is a bit more readable, and makes the text segment of bidi.o
3531 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3532 Presumably it's faster too.
3533 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3534 Now bool.
3535 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3536 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3537 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3538 (bidi_explicit_dir_char, bidi_level_of_next_char)
3539 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3540 Use bool for booleans, instead of int.
3541 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3542 (bidi_unshelve_cache): Adjust decls to match code.
3543
3544 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3545
3546 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3547 argument.
3548
3549 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3552 * atimer.h: Include <stdbool.h>.
3553
3554 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3555
3556 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3557 compile time tests instead of run time tests on systems that do
3558 not use them.
3559 (FRAME_MAC_P): Remove leftover from deleted code.
3560 * frame.c (syms_of_frame): Remove leftover from deleted code.
3561
3562 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3563
3564 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3565
3566 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3569 Otherwise, the compiler complains about (A?B:C) where B is void
3570 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3571 (fontset_add): Return void, for FONTSET_ADD.
3572
3573 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3574
3575 * alloc.c: Use bool for booleans.
3576 (gc_in_progress, abort_on_gc)
3577 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3578 (dont_register_blocks) [GC_MALLOC_CHECK]:
3579 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3580 (check_string_bytes, make_specified_string, memory_full)
3581 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3582 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3583 (mark_stack, valid_pointer_p, make_pure_string)
3584 (Fgarbage_collect, survives_gc_p, gc_sweep):
3585 Use bool for booleans, instead of int.
3586 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3587 Remove unused local.
3588 * alloc.c (PURE_POINTER_P):
3589 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3590 * editfns.c (Fformat):
3591 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3592 (Fdo_auto_save):
3593 * fns.c (sweep_weak_table):
3594 * lisp.h (suppress_checking, push_message, survives_gc_p)
3595 (make_pure_string, gc_in_progress, abort_on_gc):
3596 * lread.c (readchar, read1):
3597 * print.c (Fprin1_to_string):
3598 * xdisp.c (push_message):
3599 Use bool for booleans affected directly or indirectly by
3600 alloc.c's changes.
3601
3602 Make recently-introduced setters macros.
3603 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3604 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3605 (set_fontset_default, set_fontset_fallback): Rename from their
3606 upper-case counterparts, and make them functions rather than macros.
3607 This is more consistent with the other recently-introduced setters.
3608 These don't need to be inline, since they're local.
3609
3610 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3611
3612 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3613 the loop (Bug#12247).
3614
3615 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3616
3617 * lisp.h (vcopy): Use memcpy rather than our own loop.
3618 This fixes a performance regression introduced by the recent
3619 addition of vcopy. This means 'vcopy' will need to be modified
3620 for a copying collector, but that's OK. Also, tighten the
3621 checking in the assertion.
3622
3623 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3624
3625 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3626 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3627 non-base glyph for the width of the base character, according to
3628 what x_draw_composite_glyph_string_foreground expects.
3629 Generate WADJUST value according to composition_gstring_width's
3630 expectations, to produce correct width of the composed character.
3631 Reverse the sign of the DU offset produced by ScriptPlace.
3632
3633 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3634
3635 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3636
3637 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3638
3639 Avoid direct writes to contents member of struct Lisp_Vector.
3640 * lisp.h (vcopy): New function to copy data into vector.
3641 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3642 * fns.c (Ffillarray): Use ASET.
3643 * keyboard.c (timer_check_2): Use AREF and ASET.
3644 (append_tool_bar_item, Frecent_keys): Use vcopy.
3645 * lread.c (read_vector): Use ASET.
3646 * msdos.c (Frecent_doskeys): Use vcopy.
3647 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3648 (Finternal_merge_in_global_face): Use ASET and vcopy.
3649 * xfont.c (xfont_list_pattern): Likewise.
3650
3651 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3652
3653 * window.c (Fwindow_point): For the selected window always return
3654 the position of its buffer's point.
3655 (Fset_window_point): For the selected window always go in its
3656 buffer to the specified position.
3657
3658 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3659
3660 Setter macros for fontsets.
3661 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3662 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3663 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3664 Adjust users.
3665
3666 2012-08-20 Glenn Morris <rgm@gnu.org>
3667
3668 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3669 Don't assume that `ln -f' works.
3670
3671 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3672
3673 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3674 and later about non-assignments with no effect. See discussion at
3675 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3676 details.
3677
3678 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3679
3680 Inline setter functions for Lisp_Objects slots of struct specbinding.
3681 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3682 Adjust users.
3683
3684 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3685
3686 * window.c (select_window): Always make selected window's buffer
3687 current.
3688
3689 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3690
3691 Use AREF and ASET for docstrings of category tables.
3692 * category.h (CATEGORY_DOCSTRING): Use AREF.
3693 (SET_CATEGORY_DOCSTRING): Use ASET.
3694 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3695
3696 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3697
3698 Inline setter functions for hash table members.
3699 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3700 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3701 (set_hash_key_and_value, set_hash_index, set_hash_next)
3702 (set_hash_hash): New functions.
3703 * charset.c, fns.c: Adjust users.
3704
3705 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3706
3707 Inline getter and setter functions for per-buffer values.
3708 * buffer.h (per_buffer_default, set_per_buffer_default)
3709 (per_buffer_value, set_per_buffer_value): New functions.
3710 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3711 * buffer.c, data.c: Adjust users.
3712
3713 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3714
3715 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3716
3717 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3718
3719 Rely on <config.h> + <unistd.h> to declare 'environ',
3720 as gnulib does this if the system doesn't.
3721 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3722 Remove declaration. MS-Windows declares it on stdlib.h which is
3723 included by conf_post.h.
3724 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3725 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3726 * vm-limit.c: Include <unistd.h>, for 'environ'.
3727
3728 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3729 (start_of_data): Remove decl; mem-limits.h provides it.
3730
3731 * xdisp.c (handle_invisible_prop): Make it a bit faster
3732 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3733
3734 2012-08-19 Chong Yidong <cyd@gnu.org>
3735
3736 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3737 ends (Bug#3874).
3738
3739 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3740
3741 * .gdbinit: Use call instead of set when calling a function in the
3742 inferior.
3743
3744 * data.c (set_internal): Don't use set_blv_found.
3745 (Fkill_local_variable): Likewise.
3746
3747 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3748
3749 * nsfont.m (ns_ascii_average_width): Ensure the string
3750 ascii_printable is initialized with a null-terminated character
3751 array. Otherwise, it can contain undesired extra characters.
3752
3753 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 port new setting code to Sun C 5.8 2005/10/13
3756 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3757 Return void, not Lisp_Object. Otherwise, the compiler
3758 complains about (A?B:C) where B is void and C is Lisp_Object
3759 when compiling CHAR_TABLE_SET, due to the recent change to
3760 the API of sub_char_table_set_contents.
3761
3762 2012-08-18 Chong Yidong <cyd@gnu.org>
3763
3764 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3765 for the string case (Bug#3874).
3766
3767 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3768
3769 * buffer.h (BSET): Remove (Bug#12215).
3770 Replace all uses with calls to new setter functions.
3771 (bset_bidi_paragraph_direction, bset_case_canon_table)
3772 (bset_case_eqv_table, bset_directory, bset_display_count)
3773 (bset_display_time, bset_downcase_table)
3774 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3775 (bset_last_selected_window, bset_local_var_alist)
3776 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3777 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3778 (bset_width_table):
3779 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3780 (bset_auto_fill_function, bset_auto_save_file_format)
3781 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3782 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3783 (bset_cache_long_line_scans, bset_case_fold_search)
3784 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3785 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3786 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3787 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3788 (bset_header_line_format, bset_indicate_buffer_boundaries)
3789 (bset_indicate_empty_lines, bset_invisibility_spec)
3790 (bset_left_fringe_width, bset_major_mode, bset_mark)
3791 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3792 (bset_name, bset_overwrite_mode, bset_pt_marker)
3793 (bset_right_fringe_width, bset_save_length)
3794 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3795 (bset_scroll_up_aggressively, bset_selective_display)
3796 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3797 (bset_word_wrap, bset_zv_marker):
3798 * category.c (bset_category_table):
3799 * syntax.c (bset_syntax_table):
3800 New setter functions.
3801
3802 * process.h (PSET): Remove (Bug#12215).
3803 Replace all uses with calls to new setter functions.
3804 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3805 (PROCESS_INLINE): New macro.
3806 (pset_childp): New setter function.
3807 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3808 * process.c (PROCESS_INLINE):
3809 Define to EXTERN_INLINE, so that the corresponding functions
3810 are compiled into code.
3811 (pset_buffer, pset_command, pset_decode_coding_system)
3812 (pset_decoding_buf, pset_encode_coding_system)
3813 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3814 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3815 (pset_type, pset_write_queue): New setter functions.
3816
3817 * window.h (WSET): Remove (Bug#12215).
3818 Replace all uses with calls to new setter functions.
3819 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3820 (WINDOW_INLINE): New macro.
3821 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3822 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3823 (wset_total_lines, wset_vertical_scroll_bar)
3824 (wset_window_end_pos, wset_window_end_valid)
3825 (wset_window_end_vpos): New setter functions.
3826 * window.c (WINDOW_INLINE):
3827 Define to EXTERN_INLINE, so that the corresponding functions
3828 are compiled into code.
3829 (wset_combination_limit, wset_dedicated, wset_display_table)
3830 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3831 (wset_new_normal, wset_new_total, wset_next_buffers)
3832 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3833 (wset_prev_buffers, wset_right_fringe_width)
3834 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3835 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3836 (wset_window_parameters):
3837 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3838 (wset_column_number_displayed, wset_region_showing):
3839 New setter functions.
3840
3841 * termhooks.h (TSET): Remove (Bug#12215).
3842 Replace all uses with calls to new setter functions.
3843 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3844 (TERMHOOKS_INLINE): New macro.
3845 (tset_charset_list, tset_selection_alist): New setter functions.
3846 * terminal.c (TERMHOOKS_INLINE):
3847 Define to EXTERN_INLINE, so that the corresponding functions
3848 are compiled into code.
3849 (tset_param_alist): New setter function.
3850
3851 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3852
3853 * keyboard.h (KSET): Remove (Bug#12215).
3854 Replace all uses with calls to new setter functions.
3855 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3856 (KEYBOARD_INLINE): New macro.
3857 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3858 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3859 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3860 New setter functions.
3861 * keyboard.c (KEYBOARD_INLINE):
3862 Define to EXTERN_INLINE, so that the corresponding functions
3863 are compiled into code.
3864 (kset_echo_string, kset_kbd_queue)
3865 (kset_keyboard_translate_table, kset_last_prefix_arg)
3866 (kset_last_repeatable_command, kset_local_function_key_map)
3867 (kset_overriding_terminal_local_map, kset_real_last_command)
3868 (kset_system_key_syms): New setter functions.
3869
3870 * frame.h (FSET): Remove (Bug#12215).
3871 Replace all uses with calls to new setter functions.
3872 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3873 (FRAME_INLINE): New macro.
3874 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3875 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3876 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3877 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3878 (fset_param_alist, fset_root_window, fset_scroll_bars)
3879 (fset_selected_window, fset_title, fset_tool_bar_items)
3880 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3881 * frame.c (FRAME_INLINE):
3882 Define to EXTERN_INLINE, so that the corresponding functions
3883 are compiled into code.
3884 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3885
3886 A few more naming-convention fixes for getters and setters.
3887 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3888 and rename from buffer_overlays_set_before.
3889 (set_buffer_overlays_after): Move here from buffer.h, and rename
3890 from buffer_overlays_set_after.
3891 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3892 All uses changed.
3893 (set_buffer_intervals): Rename from buffer_set_intervals.
3894 * intervals.c (set_interval_object): Move here from intervals.h,
3895 and rename from interval_set_object.
3896 (set_interval_left): Move here from intervals.h, and rename from
3897 interval_set_left.
3898 (set_interval_right): Move here from intervals.h, and rename from
3899 interval_set_right.
3900 (copy_interval_parent): Move here from intervals.h, and rename from
3901 interval_copy_parent.
3902 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3903 (set_interval_plist): Rename from interval_set_plist.
3904 Return void, not Lisp_Object, since no caller uses the result.
3905 * lisp.h (string_intervals): Rename from string_get_intervals.
3906 (set_string_intervals): Rename from string_set_intervals.
3907
3908 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3909 (set_char_table_contents): Rename from char_table_set_contents.
3910 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3911 All uses changed. See the end of
3912 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3913
3914 * lisp.h (CSET): Remove (Bug#12215).
3915 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3916 (set_char_table_purpose): New functions,
3917 replacing CSET. All uses changed. For example, replace
3918 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3919 "set_char_table_parent (char_table, parent);".
3920 The old version was confusing because it used the same name
3921 'parent' for two different things.
3922
3923 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3924
3925 Functions to get and set Lisp_Object fields of buffer-local variables.
3926 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3927 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3928 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3929 * data.c, eval.c, frame.c: Adjust users.
3930
3931 2012-08-17 Chong Yidong <cyd@gnu.org>
3932
3933 * xfaces.c (merge_face_vectors): If the target font specfies a
3934 font spec, make the font's attributes take precedence over
3935 directly-specified attributes.
3936 (merge_face_ref): Recognize :font.
3937
3938 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3939
3940 Do not use memcpy for copying intervals.
3941 * intervals.c (reproduce_interval): New function.
3942 (reproduce_tree, reproduce_tree_obj): Use it.
3943 (reproduce_tree_obj): Remove prototype.
3944
3945 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3946
3947 * lisp.h (duration_to_sec_usec): Remove unused decl.
3948
3949 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3950
3951 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3952 to an allocated instance of NSString, not to the class itself.
3953
3954 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3955
3956 * makefile.w32-in (C_CTYPE_H): New macro.
3957 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3958 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3959 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3960
3961 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3962
3963 Use ASCII tests for character types.
3964 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3965 * xfns.c, xterm.c:
3966 Don't include <ctype.h>; was not needed.
3967 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3968 * sysdep.c, xfaces.c:
3969 Include <c-ctype.h> instead of <ctype.h>.
3970 * nsterm.m: Include <c-ctype.h>.
3971 * charset.c (read_hex):
3972 * doc.c (Fsnarf_documentation):
3973 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3974 (DRIVE_LETTER) [DOS_NT]:
3975 (Ffile_name_directory, Fexpand_file_name)
3976 (Fsubstitute_in_file_name):
3977 * font.c (font_parse_xlfd, font_parse_fcname):
3978 * frame.c (x_set_font_backend):
3979 * gtkutil.c (xg_get_font):
3980 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3981 * nsimage.m (hexchar):
3982 * nsterm.m (ns_xlfd_to_fontname):
3983 * sysdep.c (system_process_attributes):
3984 * xfaces.c (hash_string_case_insensitive):
3985 Use C-locale tests instead of locale-specific tests for character
3986 types, since we want the ASCII interpretation here, not the
3987 interpretation suitable for whatever happens to be the current locale.
3988
3989 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3990
3991 Consistently check windows for validity/liveness
3992 (Bug#11984, Bug#12025, Bug#12026).
3993 * lisp.h (CHECK_VALID_WINDOW): New macro.
3994 * window.c (decode_window): Rename to decode_live_window.
3995 (decode_valid_window, Fwindow_valid_p): New functions.
3996 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3997 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3998 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3999 (Fwindow_prev_sibling, Fwindow_combination_limit)
4000 (Fset_window_combination_limit, Fwindow_use_time)
4001 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4002 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4003 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4004 (Fwindow_hscroll, Fset_window_hscroll)
4005 (Fwindow_redisplay_end_trigger)
4006 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4007 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4008 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4009 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4010 (Fwindow_end, Fset_window_point, Fset_window_start)
4011 (Fpos_visible_in_window_p, Fwindow_line_height)
4012 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4013 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4014 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4015 (Fset_window_parameter, Fwindow_display_table)
4016 (Fset_window_display_table, Fdelete_other_windows_internal)
4017 (Fset_window_buffer, Fset_window_new_total)
4018 (Fset_window_new_normal, Fdelete_window_internal)
4019 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4020 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4021 (Fwindow_scroll_bars): Check whether argument window is a valid or
4022 live window. Update doc-strings.
4023 (syms_of_window): New symbol Qwindow_valid_p.
4024 * keyboard.c (Fposn_at_x_y): Check whether argument
4025 frame_or_window denotes a valid window.
4026
4027 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4028
4029 Fix previous char table change.
4030 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4031 * chartab.c (optimize_sub_char_table): Likewise.
4032
4033 2012-08-16 Chong Yidong <cyd@gnu.org>
4034
4035 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4036
4037 * xfont.c (xfont_open):
4038 * xftfont.c (xftfont_open): Set the font's max_width field.
4039
4040 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4041 min_width to space_width and average_width to the average over
4042 printable ASCII characters.
4043 (ns_char_width): Code cleanup.
4044 (ns_ascii_average_width): New utility function.
4045
4046 * font.h (struct font): Update comments.
4047
4048 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4049
4050 Simple interface to set Lisp_Object fields of character tables.
4051 * lisp.h (CSET): New macro.
4052 (char_table_set_extras, char_table_set_contents)
4053 (sub_char_table_set_contents): New function.
4054 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4055 * syntax.c: Adjust users.
4056
4057 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4058
4059 * eval.c (eval_sub): Bind lexical-binding.
4060 * lread.c (Qlexical_binding): Make non-static.
4061
4062 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4063
4064 * nsmenu.m (popupSession): Remove.
4065 (pop_down_menu): Remove endModalSession.
4066 (timeout_handler:): New method.
4067 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4068 Call runModalForWindow. Check timer_fired when it returns.
4069 If not set, cancel timer and break out of loop.
4070 Otherwise loop again, with a new timeout.
4071
4072 * nsterm.m: Include fcntl.h if present.
4073 (fd_entry, t_readfds, inNsSelect): Remove.
4074 (select_writefds, select_valid, select_timeout, selfds)
4075 (select_mutex, apploopnr): Add.
4076 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4077 Otherwise call kbd_buffer_store_event.
4078 (ns_send_appdefined): Remove release of fd_entry.
4079 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4080 Increment and decrement apploopnr.
4081 (ns_select): If no file descriptors, just do a NSTimer.
4082 Otherwise copy read/write masks and start select thread (fd_handler).
4083 Start main loop and wait for application defined event.
4084 Inform select thread to stop selecting after main loop is exited.
4085 (ns_term_init): Create selfds pipe and set non-blocking.
4086 Initialize select_mutex. Start the select thread (fd_handler).
4087 (fd_handler:): Loop forever, wait for info from the main thread
4088 to either start or stop selecting. When select returns, send
4089 and appdefined event.
4090 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4091 If not call kbd_buffer_store_event.
4092
4093 * nsterm.h (EmacsApp): fd_handler takes id argument.
4094 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4095
4096 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4097
4098 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4099
4100 * region-cache.c (move_cache_gap): Update gap_len using the actual
4101 growth of the boundaries array. Do not change cache_len.
4102 (Bug#12196)
4103
4104 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Generalize and cleanup font subsystem checks.
4107 * font.h (FONT_DEBUG, font_assert): Remove.
4108 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4109 Change font_assert to eassert. Use eassert where appropriate.
4110
4111 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4112
4113 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4114
4115 2012-08-15 Chong Yidong <cyd@gnu.org>
4116
4117 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4118 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4119 extract the font descriptor instead of just the font name.
4120 In that case, return a font spec instead of a string.
4121 (x_last_font_name): Move to this file from xfns.c.
4122
4123 * xfns.c (Fx_select_font): The return value can also be a font
4124 spec. Move x_last_font_name management to gtkutil.c.
4125
4126 * xfaces.c: Make font weight and style symbols non-static.
4127
4128 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4129
4130 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4131 (bug#12117).
4132
4133 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4134
4135 * alloc.c (Fgarbage_collect): Use plural form consistently.
4136
4137 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4138
4139 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4140 iteration through the command loop. Fixes a problem whereby mouse
4141 movements are ignored until the first mouse click.
4142
4143 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4144
4145 Use bool, not int, for Lisp booleans.
4146 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4147 makes Emacs a bit smaller and presumably a bit faster.
4148 * lisp.h: Include <stdbool.h>.
4149 (struct Lisp_Boolfwd, defvar_bool):
4150 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4151 * regex.c [!emacs]: Include <stdbool.h>.
4152 (false, true): Remove; <stdbool.h> does this for us now.
4153
4154 2012-08-14 Chong Yidong <cyd@gnu.org>
4155
4156 * character.c (Fcharacterp): Doc fix (Bug#12076).
4157
4158 * data.c (Findirect_variable): Doc fix (Bug#11040).
4159
4160 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4161
4162 * editfns.c (Fformat): Doc fix (Bug#12059).
4163 (Fsave_current_buffer): Doc fix (Bug#11542).
4164
4165 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4166
4167 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4168 (bug#12022).
4169
4170 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4171
4172 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4173 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4174 * minibuf.c (choose_minibuf_frame, read_minibuf):
4175 * w32fns.c (x_create_tip_frame):
4176 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4177 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4178
4179 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4180
4181 * intervals.c (offset_intervals): Remove obsolete comment.
4182
4183 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4184
4185 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4186
4187 2012-08-14 Gergely Risko <gergely@risko.hu>
4188
4189 * coding.c (decode_coding): Record buffer modification before
4190 disabling undo_list (Bug#11773).
4191
4192 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4193
4194 Revert and cleanup some recent overlay changes.
4195 * buffer.h (enum overlay_type): Remove.
4196 (buffer_get_overlays, buffer_set_overlays): Likewise.
4197 (buffer_set_overlays_before, buffer_set_overlays_after):
4198 New function. Adjust users.
4199 (unchain_both): Add eassert.
4200
4201 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4202
4203 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4204
4205 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4206
4207 * gtkutil.c (xg_mark_data): Don't assume C99.
4208
4209 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4210
4211 * gtkutil.c (xg_frame_tb_info): New struct.
4212 (TB_INFO_KEY): New define.
4213 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4214 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4215 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4216 if not present.
4217 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4218 is up to date. Otherwise store new data.
4219 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4220
4221 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4222
4223 Use KSET for write access to Lisp_Object members of struct kboard.
4224 * keyboard.h (KSET): New macro.
4225 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4226 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4227 * xterm.c: Adjust users.
4228
4229 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 Use BSET for write access to Lisp_Object members of struct buffer.
4232 * buffer.h (BSET): New macro.
4233 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4234 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4235 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4236 * window.c, xdisp.c, xfns.c: Adjust users.
4237
4238 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4239
4240 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4241
4242 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4243
4244 * nsterm.m (not_in_argv): New function.
4245 (application:openFile, application:openTempFile:):
4246 (application:openFileWithoutUI:, application:openFiles:): Open file
4247 if not_in_argv returns non-zero (bug#12171).
4248
4249 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4250 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4251 Define for Gtk+ versions less than 3.2.
4252 (xg_get_font_name): Use those functions/macros here.
4253 Reported by Frans Oilinki <moilinki@gmail.com>.
4254
4255 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4256
4257 * unexmacosx.c (copy_data_segment): Copy initialized data in
4258 statically linked libraries from input file rather than memory.
4259
4260 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4261 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4262 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4263
4264 2012-08-10 Glenn Morris <rgm@gnu.org>
4265
4266 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4267 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4268
4269 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4270
4271 Fix last change to allow compilation with low optimization levels.
4272 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4273 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4274
4275 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4276
4277 Use common inline syntax in intervals.h.
4278 * intervals.h (INTERVALS_INLINE): New macro.
4279 Change all users from LISP_INLINE.
4280
4281 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4282
4283 Define Qnone once for all platforms.
4284 * frame.c (Qnone): Define here.
4285 (syms_of_frame): DEFSYM it.
4286 * lisp.h (Qnone): New declaration.
4287 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4288 * xfns.c: Remove duplication. Adjust users.
4289
4290 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4291
4292 Remove unused macros from intervals.h.
4293 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4294 * intervals.c: Adjust comment.
4295
4296 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4297
4298 * w32fns.c <w32_unicode_gui>: New static variable.
4299 (globals_of_w32fns): Initialize it according to os_subtype.
4300 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4301 testing os_subtype.
4302
4303 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4304 Eli Zaretskii <eliz@gnu.org>
4305
4306 Fix bug #10299 with Unicode characters sent by customized
4307 keyboards created by MSKLC.
4308 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4309 (w32_init_class): Use it to initialize the Emacs class with either
4310 ANSI or Unicode API calls.
4311 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4312 later.
4313 (w32_wnd_proc): If the character code sent by WM_CHAR or
4314 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4315 original message. Call DefWindowProcW on NT and later.
4316
4317 2012-08-10 Glenn Morris <rgm@gnu.org>
4318
4319 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4320
4321 * lisp.h (DIRECTORY_SEP): Let configure set it.
4322
4323 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 Use TSET for write access to Lisp_Object slots of struct terminal.
4326 * termhooks.h (TSET): New macro.
4327 * coding.c, terminal.c, xselect.c: Adjust users.
4328
4329 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4330
4331 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4332 the failing expression, include them in the error message.
4333 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4334 * lisp.h (internal_condition_case_n): Update declaration.
4335
4336 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4337
4338 Inline functions to examine and change buffer overlays.
4339 * buffer.c (unchain_both): New function.
4340 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4341 (buffer_has_overlays): New function.
4342 (enum overlay_type): New enum.
4343 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4344 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4345
4346 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4347
4348 Inline functions to examine and change buffer intervals.
4349 * alloc.c (mark_interval_tree): Remove.
4350 (MARK_INTERVAL_TREE): Simplify.
4351 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4352 * intervals.c (buffer_balance_intervals): New function.
4353 (graft_intervals_into_buffer): Adjust indentation.
4354 (set_intervals_multibyte): Simplify.
4355 * buffer.h (BUF_INTERVALS): Remove.
4356 (buffer_get_intervals, buffer_set_intervals): New function.
4357 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4358 * intervals.c, textprop.c: Adjust users.
4359
4360 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4361
4362 Inline functions to examine and change string intervals.
4363 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4364 (string_get_intervals, string_set_intervals): New function.
4365 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4366 * lread.c, print.c, textprop.c: Adjust users.
4367
4368 2012-08-08 Glenn Morris <rgm@gnu.org>
4369
4370 * lisp.mk (lisp): Remove language/persian.elc.
4371
4372 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4373
4374 Cleanup intervals.
4375 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4376 (NULL_INTERVAL_P): Likewise. Adjust users.
4377 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4378 Adjust comment. Move under #if 0.
4379 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4380 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4381
4382 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4383
4384 Check total length of intervals with eassert.
4385 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4386 * intervals.c: Change all users to eassert.
4387
4388 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4389
4390 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4391 Rename fields to match removal of FGET and WGET and disuse of
4392 INTERNAL_FIELD in Lisp_Cons.
4393
4394 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4395
4396 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4397 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4398 name since all xname users are fixed long time ago. Do not
4399 use INTERNAL_FIELD.
4400 (set_symbol_name, set_symbol_function, set_symbol_plist):
4401 (set_symbol_next, set_overlay_plist): New function.
4402 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4403 (struct Lisp_Overlay): Likewise.
4404 (CVAR, MVAR, SVAR): Remove.
4405 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4406 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4407 * xterm.c: Adjust users.
4408 * .gdbinit: Change to use name field of struct Lisp_Symbol
4409 where appropriate.
4410
4411 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4412
4413 Basic functions to set Lisp_Object and pointer slots of intervals.
4414 * intervals.h (interval_set_parent, interval_set_object):
4415 (interval_set_left, interval_set_right, interval_set_plist):
4416 (interval_copy_parent): New function.
4417 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4418 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4419 Adjust indentation.
4420 (INTERVAL_SIZE): Remove. Adjust users.
4421 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4422
4423 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4424
4425 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4426 * process.h (PGET): Remove.
4427 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4428 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4429
4430 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4431
4432 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4433 * window.h (WGET): Remove.
4434 (struct window): Do not use INTERNAL_FIELD.
4435 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4436 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4437 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4438 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4439 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4440 Adjust users.
4441
4442 2012-08-07 Chong Yidong <cyd@gnu.org>
4443
4444 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4445 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4446 (Fdelete_window_internal): Signal an error if the window is not on
4447 a live frame (Bug#12025).
4448
4449 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4450
4451 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4452 * frame.h (FGET): Remove.
4453 (struct frame): Do not use INTERNAL_FIELD.
4454 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4455 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4456 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4457 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4458
4459 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4460
4461 * w32.c: Silence compiler warnings.
4462 (map_w32_filename): Remove unused variable `is_fat'.
4463 (chase_symlinks): Add parentheses around expression.
4464
4465 2012-08-06 Glenn Morris <rgm@gnu.org>
4466
4467 * sysdep.c: Respect BROKEN_GETWD.
4468
4469 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4470 Let configure handle it.
4471 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4472
4473 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4474
4475 Use GCALIGNMENT where appropriate.
4476 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4477 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4478 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4479
4480 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4481
4482 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4483 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4484
4485 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4486
4487 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4488 that should be sufficient for everyone.
4489
4490 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4491
4492 * keyboard.c (timer_check_2): Add break so timer_check returns next
4493 timeout.
4494
4495 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4496
4497 Fix Windows build errors introduced after converting to WGET and WSET.
4498 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4499 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4500
4501 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4502
4503 * nsterm.m (ns_frame_rehighlight): Use FSET.
4504
4505 * nsmenu.m (ns_update_menubar): Use FSET.
4506
4507 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 Separate read and write access to Lisp_Object slots of Lisp_Process.
4510 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4511 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4512
4513 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4514
4515 Separate read and write access to Lisp_Object slots of struct window.
4516 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4517 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4518 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4519 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4520 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4521 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4522 Adjust users.
4523
4524 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4525
4526 Fix Windows build errors introduced after converting to FGET and FSET.
4527 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4528 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4529 (w32_judge_scroll_bars): Change to use FSET.
4530 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4531
4532 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4533
4534 Fix replacement typo.
4535 * window.c (replace_window): Set root_window instead of
4536 selected_window. This fixes a total window subsystem
4537 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4538
4539 2012-08-06 Glenn Morris <rgm@gnu.org>
4540
4541 * lisp.mk (lisp): Add language/persian.elc.
4542
4543 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4544
4545 Separate read and write access to Lisp_Object slots of struct frame.
4546 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4547 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4548 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4549 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4550 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4551
4552 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4553
4554 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4555
4556 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4557
4558 Generalize common compile-time constants.
4559 * lisp.h (header_size, bool_header_size, word_size): Now here.
4560 (struct Lisp_Vector): Add comment.
4561 (struct Lisp_Bool_Vector): Move up to define handy constants.
4562 (VECSIZE, PSEUDOVECSIZE): Simplify.
4563 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4564 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4565 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4566 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4567 * xfont.c, xmenu.c: Use word_size where appropriate.
4568
4569 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4570
4571 * search.c (Freplace_match): Treat \? in the replacement text
4572 literally (Bug#8161).
4573
4574 2012-08-05 Chong Yidong <cyd@gnu.org>
4575
4576 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4577 * frame.c (Vdelete_frame_functions):
4578 * emacs.c (Vkill_emacs_hook): Doc fix.
4579
4580 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4581
4582 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4583 --with-x-toolkit=no builds.
4584 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4585
4586 2012-08-04 Chong Yidong <cyd@gnu.org>
4587
4588 * syntax.c (Fmodify_syntax_entry): Doc fix.
4589
4590 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4591
4592 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4593 * w32.c (init_environment): Change the default values of many
4594 environment variables in dflt_envvars[] to NULL, to avoid pushing
4595 them into environment when they were not already defined.
4596 Remove the code that deletes site-lisp subdirectories from the default
4597 value of EMACSLOADPATH, as it is no longer needed.
4598 (check_windows_init_file): Now external, not static.
4599 Use Vload_path as is, without adding anything, as this function is now
4600 called when Vload_path is already set up.
4601
4602 * w32.h (check_windows_init_file): Add prototype.
4603
4604 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4605 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4606 compatibility with Posix platforms.
4607 (main): Move the call to check_windows_init_file to here from
4608 w32.c.
4609 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4610 any, in the DEFALT argument into the root of the Emacs build or
4611 installation tree, as appropriate.
4612
4613 * callproc.c (init_callproc_1): Call decode_env_path instead of
4614 doing its equivalent by hand.
4615 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4616 the code that sets Vexec_path run on MS-Windows.
4617
4618 * lread.c (init_lread): Add comments to #ifdef's.
4619
4620 * msdos.c (dos_set_window_size, IT_update_begin)
4621 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4622 instead of direct references.
4623
4624 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4625
4626 Export DEFAULT_REHASH_* to GDB.
4627 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4628 Now constants, not macros.
4629
4630 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 Remove unnecessary casts involving pointers.
4633 These casts are no longer needed now that we assume C89 or later,
4634 since they involve casting to or from void *.
4635 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4636 (make_pure_float, make_pure_vector):
4637 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4638 * macros.c (Fstart_kbd_macro):
4639 * menu.c (find_and_return_menu_selection):
4640 * minibuf.c (read_minibuf_noninteractive):
4641 * sysdep.c (closedir):
4642 * xdisp.c (x_produce_glyphs):
4643 * xfaces.c (compare_fonts_by_sort_order):
4644 * xfns.c (x_real_positions, select_visual):
4645 * xselect.c (x_stop_queuing_selection_requests)
4646 (x_get_window_property, x_get_window_property_as_lisp_data):
4647 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4648 Remove unnecessary pointer casts.
4649 * alloc.c (record_xmalloc): New function.
4650 * lisp.h (record_xmalloc): New decl.
4651 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4652 more like a function. This is because the pointer cast is not
4653 needed. All uses changed.
4654 * print.c (print_string, print_error_message): Avoid length recalc.
4655
4656 Improve fix for macroexp crash with debugging (Bug#12118).
4657 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4658 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4659 not supposed to be invoked from the garbage collector.
4660 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4661 (gc_aset): New function, which is like ASET but can be
4662 used in the garbage collector.
4663 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4664 (set_hash_index): Use it instead of ASET.
4665
4666 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4667
4668 Support symlinks on latest versions of MS-Windows.
4669 * w32.c: Include winioctl.h and aclapi.h.
4670 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4671 (revert_to_self): Forward declarations of static functions.
4672 <static BOOL g_b_init_get_security_info>:
4673 <g_b_init_create_symbolic_link>: New static flags.
4674 (globals_of_w32): Initialize them to zero.
4675 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4676 (map_w32_filename): Improve commentary. Simplify switch.
4677 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4678 headers (most versions of MinGW w32api don't).
4679 (get_security_info, create_symbolic_link)
4680 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4681 New functions.
4682 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4683 in the argument file name.
4684 (sys_access): Call unc_volume_file_attributes only if
4685 GetFileAttributes fails with network-related error codes.
4686 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4687 have the required privileges.
4688 (get_file_security_desc_by_name): Rename from
4689 get_file_security_desc.
4690 (stat_worker): New function, with most of the guts of 'stat', and
4691 with addition of handling of symlinks and support for 'lstat'.
4692 If possible, get file's attributes and security information by
4693 handle, not by name. Produce S_IFLNK bit for symlinks, when
4694 called from 'lstat'.
4695 (stat, lstat): New functions, call 'stat_worker'.
4696 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4697 symlinks when the underlying filesystem supports them.
4698
4699 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4700
4701 Fix macroexp crash on Windows with debugging (Bug#12118).
4702 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4703 checking subscripts; problem introduced with the recent
4704 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4705 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4706 since it's used in non-static inline functions now.
4707
4708 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4709 Don't assume buffer size fits in 'int'. Remove unused local.
4710
4711 Use C99-style 'extern inline' if available.
4712 * buffer.h (BUFFER_INLINE):
4713 * category.h (CATEGORY_INLINE):
4714 * character.h (CHARACTER_INLINE):
4715 * charset.h (CHARSET_INLINE):
4716 * composite.h (COMPOSITE_INLINE):
4717 * dispextern.h (DISPEXTERN_INLINE):
4718 * lisp.h (LISP_INLINE):
4719 * systime.h (SYSTIME_INLINE):
4720 New macro, replacing 'static inline' in this header.
4721 * buffer.h, category.h, character.h, charset.h, composite.h:
4722 * dispextern.h, lisp.h, systime.h:
4723 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4724 * alloc.c (LISP_INLINE):
4725 * buffer.c (BUFFER_INLINE):
4726 * category.c (CATEGORY_INLINE):
4727 * character.c (CHARACTER_INLINE):
4728 * charset.c (CHARSET_INLINE):
4729 * composite.c (COMPOSITE_INLINE):
4730 * dispnew.c (DISPEXTERN_INLINE):
4731 * sysdep.c (SYSTIME_INLINE):
4732 Define to EXTERN_INLINE, so that the corresponding functions
4733 are compiled into code.
4734 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4735 (INLINE_HEADER_END): New macros.
4736 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4737 since it's used in non-static inline functions now.
4738 (VALMASK) [!USE_LSB_TAG]: Likewise.
4739
4740 2012-08-02 Glenn Morris <rgm@gnu.org>
4741
4742 * s/: Remove empty directory.
4743
4744 * s/ms-w32.h: Move to ../nt/inc.
4745 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4746 Update for new ms-w32.h location.
4747
4748 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4749
4750 Port to Solaris 8.
4751 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4752
4753 2012-08-02 Glenn Morris <rgm@gnu.org>
4754
4755 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4756 hard-coding the path separator.
4757
4758 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4759
4760 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4761 This how ASET and AREF are supposed to work, and makes
4762 it easier to think about future improvements. See
4763 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4764 * charset.h (set_charset_attr): New function.
4765 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4766 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4767 (aref_addr): New function. All uses of &AREF(...) changed.
4768 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4769 (set_hash_index): New functions. All lvalue-style uses of
4770 HASH_KEY etc. changed.
4771 * keyboard.c (set_prop): New function. All lvalue-style uses
4772 of PROP changed.
4773
4774 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4775
4776 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4777 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4778 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4779 * nsfns.m (ns_set_name_as_filename): Likewise.
4780 * nsmenu.m (ns_update_menubar): Likewise.
4781 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4782
4783 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4784
4785 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4786 Adapt to latest changes in field names of the corresponding Lisp
4787 objects.
4788
4789 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4790
4791 2012-08-01 Glenn Morris <rgm@gnu.org>
4792
4793 * s/msdos.h: Remove file.
4794 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4795 * Makefile.in (S_FILE): Remove.
4796 (config_h): Remove S_FILE.
4797
4798 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4799
4800 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4801 Remove; moved to nt/config.nt.
4802
4803 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4804
4805 Use INTERNAL_FIELD for conses and overlays.
4806 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4807 Remove obsolete comment.
4808 (MVAR): New macro.
4809 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4810 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4811
4812 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4813
4814 Use INTERNAL_FIELD for symbols.
4815 * lisp.h (SVAR): New macro. Adjust users.
4816 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4817 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4818
4819 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4820
4821 Use INTERNAL_FIELD for processes.
4822 * process.h (PVAR): New macro. Adjust style.
4823 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4824 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4825
4826 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4827
4828 Use INTERNAL_FIELD for windows.
4829 * window.h (WVAR): New macro.
4830 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4831 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4832 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4833 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4834 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4835 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4836
4837 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4840
4841 2012-08-01 Glenn Morris <rgm@gnu.org>
4842
4843 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4844 Move to configure.ac.
4845
4846 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4847
4848 * makefile.w32-in (CONFIG_H): Update dependencies.
4849 (CONF_POST_H): New macro.
4850
4851 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4852
4853 2012-07-31 Glenn Morris <rgm@gnu.org>
4854
4855 * Makefile.in (S_FILE): No longer set by configure.
4856
4857 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4858 is available.
4859 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4860
4861 * process.h (NULL_DEVICE):
4862 * emacs.c (SEPCHAR):
4863 * editfns.c (USER_FULL_NAME): Let configure set them.
4864
4865 * s/README, s/template.h: Remove files.
4866
4867 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4868
4869 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4870 Move to configure.ac.
4871
4872 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4873
4874 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4875 resulting renaming of 'struct frame' members.
4876
4877 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4878
4879 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4880 after introduction of FVAR.
4881
4882 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4883
4884 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4885
4886 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4887 instead of compositeToPoint.
4888 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4889
4890 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4891
4892 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4893
4894 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4895 * lisp.h (INTERNAL_FIELD): New macro.
4896 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4897 (BVAR): Change to use INTERNAL_FIELD.
4898 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4899 (KVAR): Change to use INTERNAL_FIELD.
4900 * frame.h (FVAR): New macro.
4901 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4902 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4903 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4904 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4905 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4906
4907 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4908
4909 Miscellaneous fixes for non-default X toolkits.
4910 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4911 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4912 Move under #ifdef USE_LUCID.
4913 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4914 definition and usage to avoid warnings.
4915
4916 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4917
4918 * nsterm.m (openFiles): Fix previous checkin.
4919
4920 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * indent.c (compute_motion): Remove unused local.
4923
4924 2012-07-31 Glenn Morris <rgm@gnu.org>
4925
4926 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4927
4928 * conf_post.h [USG5_4]:
4929 Move remaining contents of s/usg5-4-common.h here.
4930 * s/usg5-4-common.h: Remove file.
4931
4932 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4933 * s/irix6-5.h: Remove file.
4934
4935 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4936 * s/darwin.h: Remove file.
4937
4938 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4939 * s/hpux10-20.h: Remove file, which is now empty.
4940
4941 2012-07-30 Glenn Morris <rgm@gnu.org>
4942
4943 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4944 * Makefile.in (config_h): Add conf_post.h.
4945 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4946
4947 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4948
4949 * nsterm.m (ns_do_open_file): New variable.
4950 (ns_term_init): Set ns_do_open_file to YES after run returns.
4951 (openFile, openTempFile, openFileWithoutUI, openFiles):
4952 Open files only if ns_do_open_file.
4953
4954 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4955
4956 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4957 This no-op macro hasn't been needed for many years.
4958 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4959
4960 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4961 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4962 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4963 gdb_make_enums_visible.
4964 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4965 (DIRECTORY_SEP): Now a constant, not a macro.
4966
4967 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4968
4969 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4970 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4971
4972 * w32term.c <w32_keyboard_codepage>: Renamed from
4973 keyboard_codepage and now external. All users changed.
4974
4975 * w32term.h: Add declaration of w32_keyboard_codepage.
4976
4977 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4978 the codepage to translate keys to Unicode. If this argument is
4979 -1, use the value returned by GetConsoleCP. All callers changed.
4980
4981 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4982
4983 Update .PHONY listings in makefiles.
4984 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4985 bootstrap-clean, distclean, maintainer-clean, versioclean,
4986 extraclean, frc.
4987
4988 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4989 This is a bit clearer. Fix some commentary typos.
4990
4991 2012-07-30 Glenn Morris <rgm@gnu.org>
4992
4993 * s/netbsd.h: Let configure include signal.h if needed.
4994 Remove file, which is now empty.
4995
4996 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4997 Let configure set them.
4998 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4999 No more need to undefine.
5000
5001 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5002
5003 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5004 non-single-byte char when adding meta modifier. (Bug#12090)
5005
5006 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5007
5008 Convert safe_call to use variable number of arguments.
5009 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5010 (safe_call2): Fix comment.
5011 * lisp.h (safe_call): Adjust prototype.
5012 * coding.c (encode_coding_object): Change to use safe_call2.
5013 * xfaces.c (merge_face_heights): Change to use safe_call1.
5014
5015 2012-07-30 Glenn Morris <rgm@gnu.org>
5016
5017 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
5018 does that unconditionally. Remove file, which is now empty.
5019
5020 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5021 Remove empty files.
5022
5023 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5024
5025 Export to GDB most of lisp.h's remaining object-like macros.
5026 * lisp.h (min, max): Move earlier, because they're used earlier now.
5027 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5028 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5029 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5030 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5031 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5032 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5033 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5034 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5035 Now constants, for GDB. They need not be macros.
5036 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5037 Now constants, for GDB, as well as macros, for static initializers.
5038 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5039 Move to after the definition of struct Lisp_Char_Table,
5040 since the former now needs that type defined.
5041 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5042 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5043 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5044 New enums, for gdb_make_enums_visible.
5045 (GLYPH_MODE_LINE_FACE): Remove; unused.
5046 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
5047 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5048 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5049 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5050 enum maxargs, enum MAX_ALLOCA.
5051 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5052 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5053 no longer needed, now that they are done in lisp.h.
5054
5055 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5056
5057 Cleanup string bytes checking.
5058 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5059 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5060 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5061 (check_sblock, compact_small_strings): Simplify.
5062
5063 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5064
5065 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5066 These macros are confusing and no longer need to be defined, as
5067 the enum values now suffice. All uses replaced with definiens.
5068 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5069
5070 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5071
5072 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5073 ($(BLD)/w32console.$(O)): Update dependencies.
5074
5075 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5076
5077 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5078 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5079 time. Adjust users.
5080 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5081
5082 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5083
5084 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5085 setting sitelisp (Bug#12010).
5086
5087 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5088
5089 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5090
5091 * w32heap.c (cache_system_info):
5092 * w32.c (sys_rename):
5093 * w32proc.c (find_child_console, sys_kill): All users changed.
5094
5095 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5096
5097 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5098
5099 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5100
5101 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5102
5103 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5104
5105 Cleanup statistics calculation in Fgarbage_collect.
5106 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5107 Fix zombies percentage calculation. Simplify elapsed time calculation.
5108
5109 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5110
5111 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5112 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5113 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5114 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5115 (replace_range, replace_range_2, del_range_2): Change to eassert.
5116 * marker.c (byte_char_debug_check): Adjust style.
5117
5118 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5121 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5122 long-ago-commented-out code that talks about "WIN32".
5123 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5124 All uses changed.
5125
5126 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5127
5128 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5129 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5130 Simplify by using alignof.
5131 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5132 * lisp.h: Include <stdalign.h>.
5133 (GCALIGNMENT): New macro and constant.
5134 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5135 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5136 (stdalign): New macro, if not already defined.
5137
5138 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5139
5140 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5141 * w32inevt.c: Include w32inevt.h.
5142 (w32_read_console_input): New inline function, calls either
5143 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5144 w32_console_unicode_input.
5145 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5146 (w32_kbd_patch_key, key_event): Use the codepage returned by
5147 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5148 (key_event): use uChar.UnicodeChar only if
5149 w32_console_unicode_input is non-zero.
5150
5151 * w32console.c: Include w32heap.h.
5152 <w32_console_unicode_input>: New global variable.
5153 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5154 family of Windows, zero otherwise.
5155
5156 * w32inevt.h: Declare w32_console_unicode_input.
5157
5158 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5159 --without-x. (Bug#11742)
5160
5161 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5162
5163 Adjust GDB to reflect pvec_type changes (Bug#12036).
5164 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5165 2012-07-04 changes to pseudovector representation.
5166 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5167
5168 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5169
5170 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5171 bus address.
5172 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5173
5174 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5175
5176 * alloc.c (listn): Fix the order the arguments are consed onto the
5177 list.
5178
5179 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5180 enumeration constants, as PURE and HEAP are too general, and clash
5181 with other headers and sources, such as gmalloc.c and the
5182 MS-Windows system headers. All users changed.
5183
5184 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5185
5186 Revert last save_excursion_save and save_excursion_restore changes.
5187 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5188 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5189
5190 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5191
5192 Fix recently-introduced typos in Windows port.
5193 Reported by Martin Rudalics <rudalics@gmx.at>.
5194 * w32.c (init_environment): Replace comma with semicolon.
5195 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5196
5197 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 Improve GDB symbol export (Bug#12036).
5200 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5201 arms of an 'if', not using conditional expressions; otherwise GDB
5202 complains about the types in the unevaluated arm when the argument
5203 is an integer literal.
5204 (xgetint): Simplify expression.
5205 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5206 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5207 Zaretskii in <http://bugs.gnu.org/12036#13>.
5208 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5209 needed now that we have gdb_make_enums_visible.
5210 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5211 (enum enum_USE_LSB_TAG):
5212 New enum types, packaging up enums that need to be exported to GDB.
5213
5214 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5215
5216 Utility function to make a list from specified amount of objects.
5217 * lisp.h (enum constype): New datatype.
5218 (listn): New prototype.
5219 * alloc.c (listn): New function.
5220 (Fmemory_use_count, syms_of_alloc): Use it.
5221 * buffer.c (syms_of_buffer): Likewise.
5222 * callint.c (syms_of_callint): Likewise.
5223 * charset.c (define_charset_internal): Likewise.
5224 * coding.c (syms_of_coding): Likewise.
5225 * keymap.c (syms_of_keymap): Likewise.
5226 * search.c (syms_of_search): Likewise.
5227 * syntax.c (syms_of_syntax): Likewise.
5228 * w32.c (init_environment): Likewise.
5229 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5230 * xdisp.c (syms_of_xdisp): Likewise.
5231 * xfns.c (syms_of_xfns): Likewise.
5232
5233 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5234
5235 Fast save_excursion_save and save_excursion_restore.
5236 * lisp.h (struct Lisp_Excursion): New data type.
5237 (PVEC_EXCURSION): New pseudovector type.
5238 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5239 to deal with it. Adjust comments.
5240 (init_marker, attach_marker): New prototype.
5241 (unchain_marker): Adjust prototype.
5242 * marker.c (attach_marker): Change to global.
5243 (init_marker): New function.
5244 * alloc.c (Fmake_marker, build_marker): Use it.
5245 (build_marker): More easserts.
5246 (mark_object): Handle struct Lisp_Excursion.
5247 * editfns.c (save_excursion_save, save_excursion_restore):
5248 Reimplement to use struct Lisp_Excursion. Add comments.
5249
5250 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5251
5252 Fix export of symbols to GDB (Bug#12036).
5253 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5254 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5255 emacs.c, as this is a more-suitable home. Had this been done earlier
5256 the fix for 12036 would have avoided some of the problems noted in
5257 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5258 would have been more obvious.
5259 * emacs.c: Do not include <verify.h>; no longer needed.
5260 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5261 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5262 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5263 Remove; now done in lisp.h.
5264 * lisp.h (PUBLISH_TO_GDB): New macro.
5265 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5266 (DATA_SEG_BITS): Use it.
5267 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5268 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5269 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5270 not be usable in #if. This simplifies things.
5271
5272 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5273
5274 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5275
5276 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5277
5278 Simplify export of symbols to GDB (Bug#12036).
5279 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5280 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5281 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5282 Adjust to changes in lisp.h and emacs.c, by using
5283 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5284 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5285 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5286 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5287 instead of gdb_valbits.
5288 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5289 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5290 instead of gdb_array_mark_flag.
5291 (xboolvector): Get size from $->size, not $->header.size.
5292 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5293 (xreload, hook-run, hookpost-run): Remove.
5294 * emacs.c: Include <verify.h>.
5295 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5296 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5297 Remove.
5298 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5299 (gdb_USE_LSB_TAG): New enum constants.
5300 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5301 Also define these as enum constants, so they're visible to GDB.
5302 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5303 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5304 as constants, so they're visible to GDB.
5305 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5306 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5307 Now enum constants, not macros, so they're visible to GDB.
5308 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5309 more convenient now. All uses changed.
5310 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5311 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5312
5313 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5314
5315 Explicitly free restriction data that are not needed anymore.
5316 * editfns.c (save_restriction_restore): Free restriction data.
5317
5318 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5319
5320 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5321 add argument, tune behavior, and adjust all callers.
5322
5323 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5324
5325 Use typedef for EMACS_INT, EMACS_UINT.
5326 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5327 than macros. This simplifies debugging in the usual case, since
5328 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5329 and it allows expressions involving EMACS_INT casts.
5330 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5331
5332 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5333
5334 * nsterm.m (ns_read_socket): Return early if there is a modal
5335 window (Bug#12043).
5336
5337 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5338
5339 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5340 that FOCUS-FRAME can be omitted.
5341
5342 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5343
5344 Adjust buffer text indirection counters at the end of Fkill_buffer.
5345 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5346 buffer is definitely dead. This should really fix an issue reported
5347 by Christoph Scholtes again. (Bug#12007).
5348 (init_buffer_once): Initialize indirection counters of
5349 buffer_defaults and buffer_local_symbols (for sanity and safety).
5350
5351 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5352
5353 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5354 and continuation glyphs on tooltip frames, leave them at zero.
5355 Avoids continued lines in tooltips. (Bug#11832)
5356
5357 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5358
5359 Simplify copy_overlay.
5360 * buffer.c (copy_overlay): Simplify. Use build_marker.
5361 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5362
5363 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5364
5365 * print.c (print_object): Don't crash when a frame's name is nil
5366 or invalid. (Bug#12025)
5367
5368 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5369 it signals an error when a tooltip frame is being created.
5370
5371 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5372
5373 Cleanup miscellaneous objects allocation and initialization.
5374 * alloc.c (allocate_misc): Change to static. Add argument to
5375 specify the subtype. Adjust comment and users.
5376 (build_overlay): New function.
5377 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5378 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5379 (allocate_misc): Remove prototype.
5380 (build_overlay): Add prototype.
5381
5382 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5383
5384 Swap buffer text indirection counters in Fbuffer_swap_text.
5385 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5386 This avoids crash reported by Christoph Scholtes at
5387 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5388
5389 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5390
5391 * nsmenu.m (Popdown_data): New struct.
5392 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5393 free Popdown_data.
5394 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5395 (initWithContentRect): Make imgView and contentView non-static
5396 and autorelease them. Also autorelease img and matrix (Bug#12005).
5397 (dealloc): Remove (Bug#12005).
5398
5399 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5400
5401 Adjust consing_since_gc when objects are explicitly freed.
5402 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5403 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5404 (free_cons, free_misc): Subtract object size from consing_since_gc.
5405
5406 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5407
5408 Simplify and cleanup markers positioning code.
5409 * marker.c (attach_marker): More useful eassert.
5410 (live_buffer, set_marker_internal): New function.
5411 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5412 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5413
5414 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5415
5416 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5417 as it's limited by the amount of memory, not by INT_MAX.
5418
5419 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5420
5421 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5422 in special-event-map. See the discussion at
5423 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5424 for the reasons.
5425
5426 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5427 info.dwItemData. Fixes crashes on 64-bit Windows.
5428 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5429
5430 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5431
5432 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5433 (conversationIdentifier): Return value is NSInteger.
5434 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5435
5436 2012-07-21 Chong Yidong <cyd@gnu.org>
5437
5438 * window.c (decode_any_window): Signal an error if the window is
5439 on a dead frame (Bug#11984).
5440
5441 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5442
5443 Add indirection counting to speed up Fkill_buffer.
5444 * buffer.h (struct buffer): New member.
5445 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5446 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5447 base buffer indirection counter.
5448 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5449 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5450 through buffer list if indirection counter is 0.
5451
5452 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5453
5454 Extend the value returned by Fgarbage_collect with heap statistics.
5455 * alloc.c (Qheap): New symbol.
5456 (syms_of_alloc): DEFSYM it.
5457 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5458 (Fmemory_free): Remove.
5459 (syms_of_alloc): Don't defsubr it.
5460 * buffer.c (Fcompact_buffer): Remove.
5461 (syms_of_buffer): Don't defsubr it.
5462
5463 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5464
5465 Make maybe_gc inline.
5466 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5467 * lisp.h (consing_since_gc, gc_relative_threshold)
5468 (memory_full_cons_threshold): Revert declaration.
5469 (maybe_gc): Remove prototype, define as inline.
5470 * alloc.c: Remove old commented-out code.
5471 (consing_since_gc, gc_relative_threshold)
5472 (memory_full_cons_threshold): Revert to global.
5473 (maybe_gc): Remove.
5474
5475 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5476
5477 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5478 * lisp.h (build_unibyte_string): New function.
5479 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5480 * sysdep.c, w32fns.c, xfns.c: Use it.
5481 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5482 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5483 Adjust users accordingly.
5484 * font.h (font_open_by_name): Adjust prototype.
5485
5486 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5487
5488 Cleanup calls to Fgarbage_collect.
5489 * lisp.h (maybe_gc): New prototype.
5490 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5491 Remove declarations.
5492 * alloc.c (maybe_gc): New function.
5493 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5494 Make them static.
5495 * bytecode.c (MAYBE_GC): Use maybe_gc.
5496 * eval.c (eval_sub, Ffuncall): Likewise.
5497 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5498 to avoid dependency from auto-save feature.
5499
5500 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5501
5502 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5503 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5504 'for_each_per_buffer_object_at'.
5505 All uses changed. It's better to use upper-case for macros that
5506 cannot be implemented as functions, to give the reader a clue
5507 that they're special.
5508
5509 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5510
5511 * alloc.c (Fgarbage_collect): Tweak docstring.
5512
5513 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5514
5515 Tweak the value returned from Fgarbage_collect again.
5516 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5517 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5518 Adjust documentation.
5519 (total_vector_bytes): Rename to total_vector_slots, adjust
5520 accounting.
5521 (total_free_vector_bytes): Rename to total_free_vector_slots,
5522 adjust accounting.
5523 (Qstring_bytes, Qvector_slots): New symbols.
5524 (syms_of_alloc): DEFSYM them.
5525
5526 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5527
5528 Buffer compaction primitive which may be used from Lisp.
5529 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5530 (syms_of_buffer): Register Fcompact_buffer.
5531 * alloc.c (Fgarbage_collect): Use compact_buffer.
5532 * buffer.h (compact_buffer): New prototype.
5533 (struct buffer_text): New member.
5534
5535 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5536
5537 New macro to iterate over all buffers, miscellaneous cleanups.
5538 * lisp.h (all_buffers): Remove declaration.
5539 * buffer.h (all_buffers): Add declaration, with comment.
5540 (for_each_buffer): New macro.
5541 * alloc.c (Fgarbage_collect, mark_object): Use it.
5542 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5543 (init_buffer): Likewise.
5544 * data.c (Fset_default): Likewise.
5545 * coding.c (code_conversion_restore): Remove redundant check
5546 for dead buffer.
5547 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5548
5549 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5550
5551 Fix bug that created negative-length intervals.
5552 * intervals.c (merge_interval_right, merge_interval_left):
5553 Do not zero out this interval if it is absorbed by its children,
5554 as this interval's total length doesn't change in that case. See
5555 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5556
5557 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5558
5559 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5560 when invoking (make-bool-vector N t) and N is a positive
5561 multiple of 8 -- the last 8 bits were mistakenly cleared.
5562
5563 Remove some struct layout assumptions in bool vectors.
5564 * alloc.c (bool_header_size): New constant.
5565 (header_size, word_size): Move earlier, as they're now used earlier.
5566 Use 'word_size' in a few more places, where it's appropriate.
5567 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5568 padding before the data member of a bool vector.
5569 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5570 than doing the check by hand with an abort ().
5571
5572 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5573
5574 * eval.c (Fdefvar): Don't check constants since we only set the var if
5575 it's not yet defined anyway (bug#11904).
5576
5577 * lisp.h (last_undo_boundary): Declare new var.
5578 * keyboard.c (command_loop_1): Set it.
5579 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5580 were auto-added by the command loop (bug#11774).
5581
5582 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5583
5584 * w32font.c (Qsymbol): Remove local definition.
5585 (syms_of_w32font): Don't DEFSYM it.
5586
5587 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5588
5589 Fix sweep_vectors to handle large bool vectors correctly.
5590 * alloc.c (sweep_vectors): Account total_vector_bytes for
5591 bool vectors larger than VBLOCK_BYTES_MAX.
5592
5593 2012-07-18 Chong Yidong <cyd@gnu.org>
5594
5595 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5596 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5597
5598 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5599
5600 Return more descriptive data from Fgarbage_collect.
5601 Suggested by Stefan Monnier in
5602 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5603 * alloc.c (bounded_number): New function.
5604 (total_buffers, total_vectors): New variable.
5605 (total_string_size): Rename to total_string_bytes, adjust users.
5606 (total_vector_size): Rename to total_vector_bytes, adjust users.
5607 (sweep_vectors): Account total_vectors and total_vector_bytes.
5608 (Fgarbage_collect): New return value. Adjust documentation.
5609 (gc_sweep): Account total_buffers.
5610 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5611 (VECTOR_SIZE): Remove.
5612 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5613 (Qinterval, Qmisc): New symbols.
5614 (syms_of_data): Initialize them.
5615 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5616 (Qcons, Qbuffer): New declarations.
5617
5618 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5619
5620 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5621 Round up, not down. Improve doc.
5622
5623 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5624
5625 Restore old code in allocate_string_data to avoid Faset breakage.
5626 Reported by Julien Danjou <julien@danjou.info> in
5627 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5628 * alloc.c (allocate_string_data): Restore old code with minor
5629 adjustments, fix comment to explain this subtle issue.
5630
5631 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5632
5633 Remove FILE_SYSTEM_CASE.
5634 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5635
5636 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5637 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5638 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5639 call-process-region passes it through expand-file-name.
5640
5641 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5642
5643 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5644
5645 Fix crash when creating indirect buffer (Bug#11917)
5646 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5647 Don't handle unbound variables specially if non-zero.
5648 (Fbuffer_local_variables): Pass zero.
5649 (clone_per_buffer_values): Pass non-zero.
5650
5651 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5652
5653 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5654 to make the loop interruptible.
5655
5656 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5657
5658 * gnutls.c (emacs_gnutls_handshake): Only retry if
5659 GNUTLS_E_INTERRUPTED.
5660
5661 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5662
5663 Cleanup and convert miscellaneous checks to eassert.
5664 * alloc.c (mark_interval): Fix comment, partially rephrase
5665 old comment from intervals.h (see below).
5666 * intervals.c (find_interval, adjust_intervals_for_insertion)
5667 (delete_interval, adjust_intervals_for_deletion)
5668 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5669 Convert to eassert.
5670 (adjust_intervals_for_insertion, make_new_interval):
5671 Remove obsolete and unused code.
5672 * intervals.h (struct interval): Remove obsolete comment.
5673 * textprotp.c (erase_properties): Remove unused code.
5674 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5675 (Fremove_list_of_text_properties): Convert to eassert.
5676
5677 2012-07-17 Chong Yidong <cyd@gnu.org>
5678
5679 * editfns.c (Finsert_char): Doc fix.
5680
5681 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5682
5683 Fix previous change to make Fmemory_free always accurate.
5684 * alloc.c (make_interval): Update total_free_intervals.
5685 (make_float): Likewise for total_free_floats.
5686 (free_cons, Fcons): Likewise for total_free_conses.
5687 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5688 Likewise for total_free_vector_bytes.
5689 (Fmake_symbol): Likewise for total_free_symbols.
5690 (bytes_free): Remove.
5691
5692 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5693
5694 Simple free memory accounting feature.
5695 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5696 (sweep_vectors): Accumulate size of free vectors.
5697 (Fgarbage_collect): Setup bytes_free.
5698 (Fmemory_free): New function.
5699 (syms_of_alloc): Register it.
5700
5701 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5702
5703 Cleanup overlays checking.
5704 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5705 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5706 eassert and OVERLAYP.
5707 (sort_overlays): Change to use OVERLAYP.
5708
5709 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5710
5711 * editfns.c (Finsert_char): Make it interactive, and make the
5712 second arg optional. Copy interactive spec and docstring from
5713 ucs-insert.
5714
5715 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5716
5717 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5718 Unlike the other wrapped functions, fabs has an unspecified
5719 effect on errno.
5720
5721 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5722
5723 * nsterm.m (keyDown): Interpret flags without left/right bits
5724 as the left key (Bug#11670).
5725
5726 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 Remove empty and useless init functions.
5729 * lisp.h (init_character_once, init_fns, init_image)
5730 (init_filelock, init_sound): Remove prototype.
5731 * character.c (init_character_once): Remove.
5732 * filelock.c (init_filelock): Likewise.
5733 * fns.c (init_fns): Likewise.
5734 * image.c (init_image): Likewise.
5735 * sound.c (init_sound): Likewise.
5736 * emacs.c (main): Adjust accordingly.
5737
5738 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5739
5740 * gtkutil.h: Tiny cleanups.
5741 (use_old_gtk_file_dialog): Remove useless declaration.
5742 (xg_uses_old_file_dialog): Add suggested const attribute.
5743
5744 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5745
5746 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5747 (bidi_paragraph_init): Use it to limit search forward for a strong
5748 directional character in abnormally large paragraphs full of
5749 neutral or weak characters. (Bug#11943)
5750
5751 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5752
5753 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5754 the toolbar (Bug#9451).
5755 (xg_make_tool_item): Give the widget event box a transparent
5756 background.
5757
5758 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5759
5760 Cleanup basic allocation variables and functions.
5761 * alloc.c (ignore_warnings, init_intervals, init_float)
5762 (init_cons, init_symbol, init_marker): Remove.
5763 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5764 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5765 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5766 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5767 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5768 (staticidx, init_alloc_once, init_strings, free_ablock):
5769 Remove redundant initialization.
5770 * fns.c (init_weak_hash_tables): Remove.
5771 * lisp.h (init_weak_hash_tables): Remove prototype.
5772
5773 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5774
5775 Use zero_vector where appropriate.
5776 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5777 accordingly.
5778 * lisp.h (zero_vector): New declaration.
5779 * font.c (null_vector): Remove.
5780 (syms_of_font): Remove initialization and staticpro.
5781 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5782 * keymap.c (Faccessible_keymaps): Likewise.
5783
5784 2012-07-15 Leo Liu <sdl.web@gmail.com>
5785
5786 * fringe.c: Fix typo in comments.
5787
5788 2012-07-14 Leo Liu <sdl.web@gmail.com>
5789
5790 * fringe.c: Add a new bitmap exclamation-mark.
5791
5792 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5793
5794 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5795
5796 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5797 (HAVE_MENUS): Don't define, defined by editing config.in with
5798 msdos/sed2v2.inp.
5799 (GMALLOC_INHIBIT_VALLOC): Don't define.
5800 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5801
5802 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5803
5804 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5805
5806 2012-07-14 Glenn Morris <rgm@gnu.org>
5807
5808 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5809 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5810 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5811
5812 2012-07-13 Glenn Morris <rgm@gnu.org>
5813
5814 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5815
5816 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5817 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5818
5819 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5820
5821 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5822 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5823 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5824 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5825 where appropriate.
5826 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5827 as boolean expression.
5828 (x_set_window_size): Remove unused variable toolbar.
5829 (ns_get_color_default, ns_mod_to_lisp): Remove.
5830 (ns_mouse_position): Remove unused variables xchar and ychar.
5831 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5832 (ns_set_vertical_scroll_bar): Remove unused variable count.
5833 (ns_delete_terminal): Remove unused variable i.
5834 (ns_term_init): Remove unused variables r, g and b.
5835 (mouseDown): Remove unused variable window.
5836 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5837 (initFrameFromEmacs): Remove unused variable vbextra.
5838 (mouseEntered): Remove unused variables p and dpyinfo.
5839 (mouseExited): Remove unused variables p and r.
5840 (ns_define_frame_cursor, ns_clear_frame_area)
5841 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5842 (menuDown): Assign [sender tag] to variable and cast the variable.
5843
5844 * nsterm.h (menuDown): Add id as type to argument sender.
5845 (ns_display_info_for_name): Add Lisp_Object argument.
5846 (ns_term_init): Add Lisp_Object argument.
5847 (ns_map_event_to_object): Add void argument.
5848 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5849 prototype with arguments and only declare if __OBJC__.
5850 (nxatoms_of_nsselect): Add void argument.
5851 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5852 (ns_alloc_autorelease_pool): Add void argument.
5853 (ns_release_autorelease_pool): Add void* argument.
5854 (ns_get_defaults_value): Add const char* argument.
5855
5856 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5857 (initFromContents): Use SSDATA where appropriate.
5858 (ns_update_menubar): Add braces to ambigous if-else.
5859 (initWithTitle): Put () around assignment in if statement.
5860 (ns_menu_show): Remove unused variables window and keymap.
5861 (update_frame_tool_bar): Remove unused variable selected_p.
5862 (initWithContentRect): Remove unused variable this_cmd_name.
5863
5864 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5865 appropriate.
5866 (setXBMColor): Remove unused variable len.
5867 (setPixmapData): Put () around assignment in loop statement.
5868
5869 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5870 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5871 where appropriate.
5872 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5873 around assignment in loop statement.
5874 (nsfont_open): Remove unused variable i.
5875 (nsfont_open): Remove unused variable len.
5876 (nsfont_draw): Remove unused variable cs.
5877
5878 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5879 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5880 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5881 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5882 (Fns_font_name, Fns_perform_service)
5883 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5884 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5885 (ns_set_name): Remove unused variable view.
5886 (x_set_menu_bar_lines): Remove unused variable olines.
5887 (x_set_tool_bar_lines): Remove unused variable root_window.
5888 (Fns_list_colors): Put () around assignment in while statement.
5889 (Fns_perform_service): Remove unused variable len.
5890 (Fns_display_usable_bounds): Remove unused variable top.
5891 (syms_of_nsfns): Remove unused variable i.
5892
5893 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5894 memcpy (Bug#11907).
5895
5896 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5897
5898 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5899 and free it with DestroyExceptionInfo (Bug#11558).
5900
5901 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5902
5903 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5904 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5905 Set here, not in nt/config.nt.
5906
5907 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5908
5909 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5910 cursor overflow into the last glyph on display line when the right
5911 fringe is off. (Bug#11832)
5912
5913 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * xdisp.c (produce_special_glyphs): Now static.
5916 * dispextern.h (produce_special_glyphs): Remove decl.
5917
5918 2012-07-13 Glenn Morris <rgm@gnu.org>
5919
5920 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5921 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5922
5923 * s/usg5-4-common.h (USG, USG5):
5924 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5925 * s/sol2-6.h (SOLARIS2):
5926 * s/irix6-5.h (IRIX6_5):
5927 * s/hpux10-20.h (USG, USG5, HPUX):
5928 * s/gnu-linux.h (USG, GNU_LINUX):
5929 * s/freebsd.h (BSD_SYSTEM):
5930 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5931 * s/cygwin.h (CYGWIN):
5932 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5933 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5934
5935 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5936
5937 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5938
5939 2012-07-13 Glenn Morris <rgm@gnu.org>
5940
5941 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5942
5943 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5944
5945 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5946 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5947
5948 2012-07-12 Glenn Morris <rgm@gnu.org>
5949
5950 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5951
5952 * process.c (init_process_emacs): Rename from init_process.
5953 The old name is also the name of a Mach system call.
5954 * lisp.h, emacs.c: Update for this name change.
5955 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5956 longer needed.
5957
5958 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5959
5960 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5961 memmove call that removes glyphs covered by the left truncation
5962 glyph. Improve commentary.
5963 (display_line): Fix display of continuation glyphs on GUI frames
5964 when the right fringe is turned off and variable-size fonts are
5965 used in the window. Move the code that appends a stretch glyph to
5966 produce_special_glyphs, so that it could be used for truncation
5967 and continuation glyphs alike.
5968 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5969 glyph of a suitably computed width, to align the special glyphs at
5970 the window margin. Code moved from display_line. (Bug#11832)
5971
5972 2012-07-12 Glenn Morris <rgm@gnu.org>
5973
5974 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5975
5976 * s/gnu-linux.h, s/hpux10-20.h:
5977 Do not unconditionally define HAVE_XRMSETDATABASE.
5978
5979 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5980
5981 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 Fix typos that broke OS X build.
5984 Reported by Randal L. Schwartz in
5985 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5986 * nsterm.m (ns_timeout): Add missing local decl.
5987 (ns_get_color): snprintf -> sprintf, to fix typo.
5988
5989 2012-07-12 Glenn Morris <rgm@gnu.org>
5990
5991 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5992 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5993 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5994 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5995
5996 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5997 Move PTY_OPEN to configure.
5998
5999 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6000 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6001 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6002
6003 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6004
6005 Use empty_unibyte_string where applicable.
6006 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6007 * lread.c (read1): Likewise.
6008 * xsettings.c (syms_of_xsettings): Likewise.
6009
6010 2012-07-12 Glenn Morris <rgm@gnu.org>
6011
6012 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6013 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
6014 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6015 * s/hpux10-20.h (RUN_TIME_REMAP):
6016 * s/bsd-common.h (TABDLY): Move to configure.
6017
6018 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6019
6020 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6021
6022 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6023 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
6024
6025 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
6026
6027 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6028 * s/template.h: Move NARROWPROTO to configure.
6029
6030 2012-07-11 Glenn Morris <rgm@gnu.org>
6031
6032 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6033 unused since 2011-01-17 change to systty.h.
6034
6035 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6036 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6037 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6038
6039 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6042
6043 2012-07-11 Glenn Morris <rgm@gnu.org>
6044
6045 * s/darwin.h, s/gnu-linux.h, s/template.h:
6046 Move INTERRUPT_INPUT to configure.
6047
6048 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 Minor adjustments to interning code.
6051 * lisp.h (intern, intern_c_string): Redefine as static inline
6052 wrappers for intern_1 and intern_c_string_1, respectively.
6053 (intern_1, intern_c_string_1): Rename prototypes.
6054 * lread.c (intern_1, intern_c_string_1, oblookup):
6055 Simplify Vobarray checking.
6056 * font.c (font_intern_prop): Likewise. Adjust comment.
6057 * w32font.c (intern_font_name): Likewise.
6058
6059 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6060
6061 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6062
6063 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6064 of Fcar/Fcdr if possible.
6065 * font.c (check_otf_features): Likewise.
6066 * fontset.c (Fnew_fontset): Likewise.
6067 * gnutls.c (Fgnutls_boot): Likewise.
6068 * minibuf.c (read_minibuf): Likewise.
6069 * msdos.c (IT_set_frame_parameters): Likewise.
6070 * xmenu.c (Fx_popup_dialog): Likewise.
6071 * w32menu.c (Fx_popup_dialog): Likewise.
6072
6073 2012-07-11 Glenn Morris <rgm@gnu.org>
6074
6075 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6076 since nothing has defined it on these platforms.
6077
6078 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6079 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6080
6081 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6082 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6083 Move CLASH_DETECTION to configure.
6084
6085 * s/gnu.h: Remove file, which is now empty.
6086
6087 * s/gnu.h, s/gnu-linux.h:
6088 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6089
6090 2012-07-11 John Wiegley <johnw@newartisans.com>
6091
6092 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6093 function attribute, so we only use it if it exists in the
6094 compiler.
6095
6096 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6097
6098 Avoid call to strlen in fast_c_string_match_ignore_case.
6099 * search.c (fast_c_string_match_ignore_case): Change to use
6100 length argument. Adjust users accordingly.
6101 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6102
6103 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6104
6105 Assume mkdir, rmdir.
6106 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6107 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6108
6109 Assume rename.
6110 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6111
6112 Assume perror.
6113 * s/hpux10-20.h (HAVE_PERROR): Remove.
6114 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6115 Remove dummy definition, as this problem was obsolete long ago.
6116
6117 Assume strerror.
6118 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6119
6120 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6121
6122 Avoid calls to strlen in font processing functions.
6123 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6124 (font_open_by_name): Change to use length argument.
6125 Adjust users accordingly.
6126 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6127 Adjust prototypes.
6128 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6129 Change to return ptrdiff_t.
6130 (xfont_list_pattern, xfont_match): Use length returned by
6131 xfont_decode_coding_xlfd.
6132 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6133
6134 2012-07-11 Glenn Morris <rgm@gnu.org>
6135
6136 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6137 Move DONT_REOPEN_PTY to configure.
6138
6139 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6140 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6141
6142 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6143
6144 Remove "#define unix" that is no longer needed (Bug#11905).
6145 * s/aix4-2.h (unix): Remove; no longer needed.
6146
6147 EMACS_TIME simplification (Bug#11875).
6148 This replaces macros (which typically do not work in GDB)
6149 with functions, typedefs and enums, making the code easier to debug.
6150 The functional style also makes code easier to read and maintain.
6151 * systime.h: Include <sys/time.h> on all hosts, not just if
6152 WINDOWSNT, since 'struct timeval' is needed in general.
6153 (EMACS_TIME): Now a typedef, not a macro.
6154 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6155 not macros.
6156 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6157 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6158 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6159 (EMACS_TIME_LE): Now functions, not macros.
6160 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6161 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6162 which are not functions. All uses rewritten to use:
6163 (make_emacs_time): New function.
6164 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6165 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6166 not functions. All uses rewritten to use the following, respectively:
6167 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6168 (add_emacs_time, sub_emacs_time): New functions.
6169 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6170 * fileio.c (Fcopy_file):
6171 * xterm.c (XTflash): Get the current time closer to when it's used.
6172 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6173
6174 * bytecode.c (targets): Suppress -Woverride-init warnings.
6175
6176 Simplify by avoiding confusing use of strncpy etc.
6177 * doc.c (Fsnarf_documentation):
6178 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6179 * frame.c (Fmake_terminal_frame):
6180 * gtkutil.c (get_utf8_string):
6181 * lread.c (openp):
6182 * nsmenu.m (ns_update_menubar):
6183 * regex.c (regerror):
6184 Prefer memcpy to strncpy and strncat when either will do.
6185 * fileio.c (Fsubstitute_in_file_name):
6186 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6187 (menu_separator_name_p):
6188 * nsmenu.m (ns_update_menubar):
6189 Prefer memcmp to strncmp when either will do.
6190 * nsterm.m: Include <ftoastr.h>.
6191 (ns_get_color):
6192 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6193 Prefer snprintf to strncpy.
6194 * nsterm.m (ns_term_init):
6195 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6196 * nsterm.m (ns_term_init):
6197 Avoid the need for strncpy, by using build_string or
6198 make_unibyte_string directly. Use dtoastr, not snprintf.
6199 * process.c (Fmake_network_process): Diagnose service names that
6200 are too long, rather than silently truncating them or creating
6201 non-null-terminated names.
6202 (Fnetwork_interface_info): Likewise, for interface names.
6203 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6204 Prefer sprintf to strncat.
6205 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6206 Prefer vsnprintf to vsprintf + strncpy.
6207
6208 2012-07-10 Glenn Morris <rgm@gnu.org>
6209
6210 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6211 Clarify fallback case.
6212
6213 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6214
6215 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6216 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6217 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6218 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6219 where argument type is known to be a Lisp_Cons.
6220
6221 2012-07-10 Tom Tromey <tromey@redhat.com>
6222
6223 * bytecode.c (BYTE_CODE_THREADED): New macro.
6224 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6225 (enum byte_code_op): New type.
6226 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6227 (exec_byte_code): Use them. Use token threading when applicable.
6228
6229 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6230
6231 Optimize pure C strings initialization.
6232 * lisp.h (make_pure_string): Fix prototype.
6233 (build_pure_c_string): New function, defined as static inline. This
6234 provides a better opportunity to optimize away calls to strlen when
6235 the function is called with compile-time constant argument.
6236 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6237 argument, adjust users accordingly. Use build_pure_c_string where
6238 appropriate.
6239 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6240 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6241 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6242
6243 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6244
6245 Avoid calls to strlen in miscellaneous functions.
6246 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6247 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6248 * lread.c (openp): Likewise.
6249
6250 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6251
6252 Avoid calls to strlen in path processing functions.
6253 * fileio.c (file_name_as_directory): Add comment. Change to add
6254 srclen argument and return the length of result. Adjust users
6255 accordingly.
6256 (directory_file_name): Fix comment. Change to add srclen argument,
6257 swap 1st and 2nd arguments to obey the common convention.
6258 Adjust users accordingly.
6259 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6260
6261 2012-07-10 Glenn Morris <rgm@gnu.org>
6262
6263 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6264 Move PENDING_OUTPUT_COUNT definition to configure.
6265
6266 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6267 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6268 * s/gnu.h (DATA_START): Move definitions to configure.
6269
6270 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6271 We include usg5-4-common.h, which defines them both.
6272
6273 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6274 O_RDONLY already includes it).
6275
6276 Stop ns builds setting the EMACSLOADPATH environment variable.
6277 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6278 Now it does not set EMACSLOADPATH, just returns the load-path string.
6279 * nsterm.h: Update accordingly.
6280 * lread.c [HAVE_NS]: Include nsterm.h.
6281 (init_lread) [HAVE_NS]: Use ns_load_path.
6282 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6283
6284 2012-07-09 Glenn Morris <rgm@gnu.org>
6285
6286 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6287 since the included bsd-common.h does so.
6288
6289 Stop ns builds setting the EMACSPATH environment variable.
6290 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6291 (ns_init_paths): Do not set EMACSPATH.
6292 * nsterm.h (ns_exec_path): Add it.
6293 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6294 Use ns_exec_path.
6295
6296 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6297
6298 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6299
6300 * process.c (wait_reading_process_output): 'waitchannels' was unset
6301 when read_kbd || !NILP (wait_for_cell); fix this.
6302
6303 Add GCC-style 'const' attribute to functions that can use it.
6304 * character.h (char_resolve_modifier_mask):
6305 * keyboard.h (make_ctrl_char):
6306 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6307 (init_character_once, next_almost_prime, init_fns, init_image)
6308 (flush_pending_output, init_sound):
6309 * mem-limits.h (start_of_data):
6310 * menu.h (finish_menu_items):
6311 Add ATTRIBUTE_CONST.
6312 * emacs.c (DEFINE_DUMMY_FUNCTION):
6313 Declare the dummy function with ATTRIBUTE_CONST.
6314 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6315 Add decls with ATTRIBUTE_CONST.
6316
6317 Minor improvements to make_formatted_string.
6318 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6319 where int is good enough, as vsprintf returns an int.
6320 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6321
6322 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6323
6324 Use make_formatted_string to avoid double length calculation.
6325 * lisp.h (make_formatted_string): New prototype.
6326 * alloc.c (make_formatted_string): New function.
6327 * buffer.c (Fgenerate_new_buffer_name): Use it.
6328 * dbusbind.c (syms_of_dbusbind): Likewise.
6329 * editfns.c (Fcurrent_time_zone): Likewise.
6330 * filelock.c (get_boot_time): Likewise.
6331 * frame.c (make_terminal_frame, set_term_frame_name)
6332 (x_report_frame_params): Likewise.
6333 * image.c (gs_load): Likewise.
6334 * minibuf.c (get_minibuffer): Likewise.
6335 * msdos.c (dos_set_window_size): Likewise.
6336 * process.c (make_process): Likewise.
6337 * xdisp.c (ensure_echo_area_buffers): Likewise.
6338 * xsettings.c (apply_xft_settings): Likewise.
6339
6340 2012-07-09 Glenn Morris <rgm@gnu.org>
6341
6342 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6343 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6344 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6345 * nsterm.h (ns_etc_directory): Add it.
6346 * callproc.c [HAVE_NS]: Include nsterm.h.
6347 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6348
6349 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6350
6351 Move marker debugging code under MARKER_DEBUG.
6352 * marker.c (MARKER_DEBUG): Move marker debugging code under
6353 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6354 for bootstrap with --enable-checking (~3x slowdown reported
6355 by Juanma Barranquero <lekktu@gmail.com>).
6356 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6357
6358 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6359
6360 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6361 See <http://bugs.gnu.org/11825#29>.
6362
6363 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6364
6365 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6366 has no font, use the frame's font. (Bug#11813)
6367 (display_line): Add commentary about displaying truncation glyphs
6368 on GUI frames.
6369 (produce_special_glyphs): Move here from term.c.
6370
6371 * term.c (produce_special_glyphs): Move to xdisp.c.
6372
6373 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6374 section.
6375
6376 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6377
6378 * xdisp.c (display_line): Avoid warning about implicit declaration
6379 of FRAME_FONT.
6380
6381 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6382
6383 * lisp.h: Remove empty conditional.
6384
6385 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6386
6387 * lread.c (load_path_check): Now static.
6388
6389 Fix some minor --with-ns problems found by static checking.
6390 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6391 (x_set_font) [!HAVE_X_WINDOWS]:
6392 * image.c (xpm_load_image) [HAVE_NS]:
6393 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6394 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6395 Remove unused local.
6396 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6397 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6398 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6399 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6400 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6401 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6402 Fix pointer signedness problem.
6403 * xfaces.c (FRAME_X_FONT_TABLE):
6404 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6405
6406 2012-07-07 Glenn Morris <rgm@gnu.org>
6407
6408 * lread.c (load_path_check): New function, split from init_lread.
6409 (init_lread): Reorganize. Motivation:
6410 If EMACSLOADPATH is set, check/warn about that rather than the
6411 defaults, which we are not going to use. Hence we can remove
6412 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6413 Don't warn if site-lisp directories are missing.
6414 If not installed, start from a blank load-path, since
6415 PATH_LOADSEARCH refers to the eventual installation directories.
6416
6417 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6418
6419 Support truncation and continuation glyphs on GUI frames, when
6420 fringes are disabled. (Bug#11832)
6421 * xdisp.c (init_iterator): Get dimensions of truncation and
6422 continuation glyphs even if on GUI frames.
6423 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6424 or both, are absent.
6425 (start_display, move_it_in_display_line_to): Handle the case of a
6426 GUI frame without a fringe to display continuation or truncation
6427 glyphs.
6428 (insert_left_trunc_glyphs): Support GUI frames: make sure
6429 truncation glyphs overwrite enough glyphs from the current line to
6430 have sufficient space in pixels.
6431 (display_line): Support truncation and continuation glyphs on GUI
6432 frames. If some spare pixels are left on the line after inserting
6433 the truncation glyphs, fill that space with a stretch glyph of a
6434 suitably computed width.
6435
6436 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6437 produce_glyphs, to support GUI sessions.
6438
6439 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6440
6441 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6442
6443 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6444
6445 Do not require float-time's arg to fit in time_t (Bug#11825).
6446 This works better on hosts where time_t is unsigned, and where
6447 float-time is applied to the (negative) difference between two times.
6448 * editfns.c (decode_time_components): Last arg is now double *,
6449 not int *, and means to store all the result as a double, without
6450 worrying about whether the seconds part fits in time_t.
6451 All callers changed.
6452 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6453 All callers changed.
6454 (Ffloat_time): Do not fail merely because the specified time falls
6455 outside of time_t range.
6456
6457 2012-07-07 Glenn Morris <rgm@gnu.org>
6458
6459 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6460 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6461 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6462
6463 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6464
6465 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6466 Update dependencies.
6467
6468 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6469
6470 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6471
6472 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6473 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6474 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6475 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6476 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6477 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6478
6479 * xfont.c (compare_font_names): Redo to omit the need for casts.
6480
6481 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6482
6483 * xfns.c (Fx_change_window_property): Doc fix.
6484 * w32fns.c (Fx_change_window_property): Doc fix.
6485
6486 * w32fns.c (Fx_window_property): Accept the same arguments as the
6487 X Windows version. Doc fix.
6488 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6489
6490 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6491 Eli Zaretskii <eliz@gnu.org>
6492
6493 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6494 Windows-specific code from nt/config.nt moved here.
6495 Obsolete settings removed.
6496
6497 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6498
6499 * process.c: Avoid unnecessary calls to gettime.
6500 (wait_reading_process_output): Don't get the time of day
6501 when gobbling data immediately and not waiting, as there's no need
6502 for it in that case. This removes a FIXME.
6503
6504 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6505
6506 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6507 is defined (Bug#11768).
6508
6509 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6510
6511 Fix marker debugging code.
6512 * marker.c (byte_char_debug_check): Do not perform the check
6513 if buffer is not multibyte.
6514 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6515 Call byte_char_debug_check with correct arguments.
6516
6517 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6518
6519 Compile marker debugging code only if ENABLE_CHECKING is defined.
6520 * marker.c (byte_char_debug_check, count_markers):
6521 Use only if ENABLE_CHECKING is defined.
6522 (byte_debug_flag): Remove.
6523 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6524 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6525
6526 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6527
6528 Avoid code repetition in marker-related functions.
6529 * marker.c (attach_marker): New function.
6530 (Fset_marker, set_marker_restricted, set_marker_both)
6531 (set_marker_restricted_both): Use it.
6532 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6533 Consistently rename charno to charpos.
6534 (marker_position): Add eassert.
6535 (marker_byte_position): Convert to eassert.
6536
6537 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6538
6539 Simplify list operations in unchain_overlay and unchain_marker.
6540 * buffer.c (unchain_overlay): Simplify. Add comment.
6541 * marker.c (unchain_marker): Simplify. Fix comments.
6542
6543 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6544
6545 Introduce fast path for the widely used marker operation.
6546 * alloc.c (build_marker): New function.
6547 * lisp.h (build_marker): New prototype.
6548 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6549 * composite.c (autocmp_chars): Likewise.
6550 * editfns.c (buildmark): Remove.
6551 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6552 (save_restriction_save): Use build_marker.
6553 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6554 * window.c (save_window_save): Likewise.
6555
6556 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6557
6558 Do not use Fdelete_overlay in delete_all_overlays
6559 to avoid redundant calls to unchain_overlay.
6560 * buffer.c (drop_overlay): New function.
6561 (delete_all_overlays, Fdelete_overlay): Use it.
6562 * minibuf.c (get_minibuffer): Fix comment.
6563
6564 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 Port to OpenBSD 5.1 amd64.
6567 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6568 This is needed for OpenBSD, and should be harmless on all BSD systems.
6569 Also, include <sys/sysctl.h>, as it should be available on all
6570 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6571 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6572 use p_pid member, not kp_proc.pid.
6573
6574 2012-07-06 Glenn Morris <rgm@gnu.org>
6575
6576 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6577
6578 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 More xmalloc and related cleanup.
6581 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6582 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6583 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6584 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6585 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6586 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6587 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6588 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6589 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6590 * xterm.c:
6591 Omit needless casts involving void * pointers and allocation.
6592 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6593 as the former is more robust if P's type is changed.
6594 Prefer xzalloc to xmalloc + memset 0.
6595 Simplify malloc-or-realloc to realloc.
6596 Don't worry about xmalloc returning a null pointer.
6597 Prefer xstrdup to xmalloc + strcpy.
6598 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6599 growing it.
6600 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6601 alloca of a constant.
6602
6603 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6604
6605 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6606 hscroll is larger than the line width. Fixes long and futile
6607 looping inside extend_face_to_end_of_line (on a TTY) producing
6608 glyphs that are not needed and thrown away.
6609
6610 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6611
6612 * marker.c (set_marker_restricted_both): Simplify by using
6613 clip_to_bounds.
6614
6615 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6616
6617 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6618
6619 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6620
6621 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6622 not defined (Bug#11768).
6623 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6624 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6625 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6626 followed by gtk_box_set_homogeneous (Bug#11768).
6627 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6628 (update_theme_scrollbar_width, xg_create_scroll_bar):
6629 Use gtk_scrollbar_new (Bug#11768).
6630 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6631 (is_box_type): New function (Bug#11768).
6632 (xg_tool_item_stale_p): Call is_box_type.
6633 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6634 with default display (Bug#11768).
6635
6636 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6637
6638 * xdisp.c (window_hscroll_limited): New function.
6639 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6640 coordinates when window's hscroll is set to insanely large
6641 values. (Bug#11857)
6642
6643 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6644
6645 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6646 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6647
6648 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6649
6650 Cleanup xmalloc.
6651 * lisp.h (xzalloc): New prototype. Omit needless casts.
6652 * alloc.c (xzalloc): New function. Omit needless casts.
6653 * charset.c: Omit needless casts. Convert all calls to
6654 xmalloc with following memset to xzalloc.
6655 * dispnew.c: Likewise.
6656 * fringe.c: Likewise.
6657 * image.c: Likewise.
6658 * sound.c: Likewise.
6659 * term.c: Likewise.
6660 * w32fns.c: Likewise.
6661 * w32font.c: Likewise.
6662 * w32term.c: Likewise.
6663 * xfaces.c: Likewise.
6664 * xfns.c: Likewise.
6665 * xterm.c: Likewise.
6666 * atimer.c: Omit needless casts.
6667 * buffer.c: Likewise.
6668 * callproc.c: Likewise.
6669 * ccl.c: Likewise.
6670 * coding.c: Likewise.
6671 * composite.c: Likewise.
6672 * doc.c: Likewise.
6673 * doprnt.c: Likewise.
6674 * editfns.c: Likewise.
6675 * emacs.c: Likewise.
6676 * eval.c: Likewise.
6677 * filelock.c: Likewise.
6678 * fns.c: Likewise.
6679 * gtkutil.c: Likewise.
6680 * keyboard.c: Likewise.
6681 * lisp.h: Likewise.
6682 * lread.c: Likewise.
6683 * minibuf.c: Likewise.
6684 * msdos.c: Likewise.
6685 * print.c: Likewise.
6686 * process.c: Likewise.
6687 * region-cache.c: Likewise.
6688 * search.c: Likewise.
6689 * sysdep.c: Likewise.
6690 * termcap.c: Likewise.
6691 * terminal.c: Likewise.
6692 * tparam.c: Likewise.
6693 * w16select.c: Likewise.
6694 * w32.c: Likewise.
6695 * w32reg.c: Likewise.
6696 * w32select.c: Likewise.
6697 * w32uniscribe.c: Likewise.
6698 * widget.c: Likewise.
6699 * xdisp.c: Likewise.
6700 * xmenu.c: Likewise.
6701 * xrdb.c: Likewise.
6702 * xselect.c: Likewise.
6703
6704 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * fileio.c (time_error_value): Check the right error number.
6707 Problem reported by Troels Nielsen in
6708 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6709
6710 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6713 This should be fixed in a better way; see Eli Zaretskii in
6714 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6715 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6716
6717 * fileio.c (time_error_value): Rename from special_mtime.
6718 The old name's problems were noted by Eli Zaretskii in
6719 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6720
6721 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6722 This variable's comment says Emacs needs at least one GDB-visible
6723 symbol of type enum pvec_type, to work around GDB problems.
6724 The symbol's value doesn't matter.
6725
6726 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6727 that causes compilation to fail on pre-C99 compilers.
6728
6729 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6730
6731 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6732 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6733
6734 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6735
6736 * buffer.c (init_buffer_once): Fix initialization of
6737 headers for buffer_defaults and buffer_local_symbols.
6738 Reported by Juanma Barranquero <lekktu@gmail.com>.
6739
6740 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6741
6742 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6743 * lisp.h (enum pvec_type): Use fewer bits.
6744 (PSEUDOVECTOR_SIZE_BITS): New constant.
6745 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6746 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6747 change in pvec_type.
6748 (PSEUDOVECTOR_TYPEP): New macro.
6749 (TYPED_PSEUDOVECTORP): Use it.
6750 * fns.c (internal_equal): Adapt code to extract pvectype.
6751 * emacs.c (gdb_pvec_type): Update type.
6752 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6753 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6754 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6755 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6756 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6757 abusing vector->header.next.nbytes.
6758 (live_vector_p): Use PVEC_TYPE.
6759 (mark_object): Adapt code to extract pvectype. Use switch.
6760
6761 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6762
6763 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6764 Tighten new eassert a bit.
6765
6766 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6767
6768 Fix compilation with --enable-gcc-warnings and -O1
6769 optimization level.
6770 * doprnt.c (doprnt): Change type of tem to int, initialize
6771 to avoid compiler warning. Add eassert.
6772 * search.c (simple_search): Initialize match_byte to avoid
6773 compiler warning. Add eassert.
6774
6775 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6776
6777 Avoid weird behavior with large horizontal scrolls.
6778 Without this change, for example, large hscroll values would
6779 mess up Emacs's display on Fedora 15 x86, presumably due to
6780 overflows in int calculations in the display code.
6781 Also, if buffers had long lines, Emacs would freeze.
6782 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6783 (set_window_hscroll): New function, containing the old guts of
6784 Fset_window_hscroll. Return the clipped value.
6785 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6786 This avoids the need to check against PTRDIFF_MAX.
6787
6788 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6789
6790 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6791
6792 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6793
6794 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6797 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6798 since GCC 4.4.6 issues a bogus warning for them.
6799
6800 Fix bugs in file timestamp newness comparisons.
6801 * fileio.c (Ffile_newer_than_file_p):
6802 * lread.c (Fload): Use full timestamp resolution of files,
6803 not just the 1-second resolution, so that files that are only
6804 slightly newer still count as newer.
6805 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6806 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6807
6808 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6809
6810 * fileio.c: Improve handling of file time marker. (Bug#11852)
6811 (special_mtime): New function.
6812 (Finsert_file_contents, Fverify_visited_file_modtime):
6813 Use it to set special mtime values consistently.
6814
6815 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6816
6817 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6818 marker for non-existing file. (Bug#11852)
6819
6820 2012-07-03 Glenn Morris <rgm@gnu.org>
6821
6822 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6823 and did not make it into globals.h).
6824
6825 2012-07-03 Tom Tromey <tromey@redhat.com>
6826
6827 * window.c (Fset_window_margins, Fset_window_fringes)
6828 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6829 * textprop.c (Fprevious_property_change): No longer static.
6830 * syntax.c (Fsyntax_table_p): No longer static.
6831 * process.c (Fget_process, Fprocess_datagram_address): No longer
6832 static.
6833 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6834 * keyboard.c (Fcommand_execute): No longer static.
6835 Remove EXFUN.
6836 * insdel.c (Fcombine_after_change_execute): No longer static.
6837 * image.c (Finit_image_library): No longer static.
6838 * fileio.c (Fmake_symbolic_link): No longer static.
6839 * eval.c (Ffetch_bytecode): No longer static.
6840 * editfns.c (Fuser_full_name): No longer static.
6841 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6842 No longer static.
6843 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6844 static.
6845 * dired.c (Ffile_attributes): No longer static.
6846 * composite.c (Fcomposition_get_gstring): No longer static.
6847 * callproc.c (Fgetenv_internal): No longer static.
6848
6849 * ccl.h: Remove EXFUNs.
6850 * buffer.h: Remove EXFUNs.
6851 * dispextern.h: Remove EXFUNs.
6852 * intervals.h: Remove EXFUNs.
6853 * fontset.h: Remove EXFUN.
6854 * font.h: Remove EXFUNs.
6855 * dosfns.c (system_process_attributes): Remove EXFUN.
6856 * keymap.h: Remove EXFUNs.
6857 * lisp.h: Remove EXFUNs.
6858 * w32term.h: Remove EXFUNs.
6859 * window.h: Remove EXFUNs.
6860 * xsettings.h: Remove EXFUN.
6861 * xterm.h: Remove EXFUN.
6862
6863 2012-07-03 Glenn Morris <rgm@gnu.org>
6864
6865 * lisp.h (Frandom): Make it visible to C.
6866 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6867 buffer for invisible buffers. (Bug#1229)
6868
6869 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6870
6871 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6872 values which aren't power of 2.
6873 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6874 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6875 accordingly.
6876
6877 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6878
6879 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6880
6881 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6882
6883 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6884
6885 * alloc.c (allocate_vector_block): Remove redundant
6886 calls to mallopt if DOUG_LEA_MALLOC is defined.
6887 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6888 avoid calls to mallopt if zero_vector is returned.
6889
6890 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6891
6892 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6893 is enabled, avoid dereferencing NULL current_sblock if
6894 running undumped.
6895
6896 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6897
6898 Cleanup basic buffer management.
6899 * buffer.h (struct buffer): Change layout to use generic vector
6900 marking code. Fix some comments. Change type of 'clip_changed'
6901 to bitfield. Remove unused #ifndef old.
6902 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6903 (GET_OVERLAYS_AT): Fix indentation.
6904 (for_each_per_buffer_object_at): New macro.
6905 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6906 (Fbuffer_local_variables): Use it.
6907 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6908 * alloc.c (allocate_buffer): Adjust to match new layout of
6909 struct buffer. Fix comment.
6910 (mark_overlay): New function.
6911 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6912 Lisp area of struct buffer.
6913 (mark_object): Use it. Adjust marking of misc objects
6914 and related comments.
6915
6916 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6917
6918 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6919 wrapper that is not needed because the wrapped code is a no-op (zero
6920 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6921 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6922
6923 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6924
6925 * alloc.c (mark_buffer): Simplify. Remove prototype.
6926 (mark_object): Add comment. Reorganize marking of vector-like
6927 objects. Use CHECK_LIVE for all vector-like objects except buffers
6928 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6929 Avoid redundant calls to mark_vectorlike for bool vectors.
6930
6931 2012-06-30 Glenn Morris <rgm@gnu.org>
6932
6933 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6934
6935 * epaths.in (PATH_SITELOADSEARCH): New.
6936 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6937 This is rather than relying on --enable-locallisppath elements
6938 having "site-lisp" in their names. (Bug#10208#25, 11658)
6939
6940 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6941
6942 * w32proc.c (sys_select): Accept and ignore one more argument.
6943
6944 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6945
6946 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6947 (pselect) [!MS_DOS]: Redirect to sys_select.
6948
6949 * sysdep.c: Don't include dos.h and dosfns.h.
6950
6951 * process.c (sys_select):
6952 * msdos.c (sys_select): Accept one more argument and ignore it.
6953
6954 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6955 adapt data types and code to that.
6956
6957 * dosfns.c:
6958 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6959 which clashes with the gnulib function of the same name.
6960
6961 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6962
6963 * font.c (font_style_to_value, font_style_symbolic)
6964 (font_prop_validate_style): Add type checks for values in
6965 font_style_table.
6966
6967 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6968 argument.
6969 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6970 uses.
6971
6972 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6973
6974 * xdisp.c (try_window_id): Undo last change.
6975
6976 * w32.c (getwd): Adjust commentary about startup_dir.
6977 (init_environment): Always call sys_access, even in non-MSVC
6978 builds. Don't chdir to the directory of the Emacs executable.
6979 This undoes code from 1997 which was justified by the need to
6980 "avoid conflicts when removing and renaming directories". But its
6981 downside was that every relative file name was being interpreted
6982 relative to the directory of the Emacs executable, which can never
6983 be TRT. In particular, it broke sys_access when called with
6984 relative file names.
6985 (sys_access): Map GetLastError to errno.
6986
6987 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6988
6989 * window.h (struct window): Change type of 'fringes_outside_margins'
6990 to bitfield. Fix comment. Adjust users accordingly.
6991 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6992 Adjust comment.
6993 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6994 to ptrdiff_t.
6995
6996 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6997
6998 * gnutls.c (emacs_gnutls_handshake):
6999 Add QUIT to make the loop interruptible.
7000
7001 2012-06-29 Glenn Morris <rgm@gnu.org>
7002
7003 * charset.c (init_charset): Make lack of etc/charsets fatal.
7004
7005 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7006
7007 * editfns.c (region_limit): Fix type mismatch.
7008
7009 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7010
7011 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7012 undefined. Convert from xassert to eassert.
7013 * nsmenu.m: Convert from xassert to eassert.
7014 * nsterm.m: Likewise.
7015
7016 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7017
7018 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7019
7020 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7021
7022 Avoid integer overflow on scroll-left and scroll-right.
7023 * window.c (HSCROLL_MAX): New macro.
7024 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7025 overflow when requested scroll falls outside ptrdiff_t range.
7026
7027 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7028
7029 * window.h (struct window): Change type of 'hscroll',
7030 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7031 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7032 Adjust users accordingly.
7033 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7034 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7035 from EMACS_INT to ptrdiff_t.
7036 (make_window): Omit redundant initialization.
7037
7038 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
7039
7040 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7041
7042 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7043
7044 * window.h (struct window): Change type of 'use_time' and
7045 'sequence_number' from Lisp_Object to int.
7046 * frame.c (make_frame): Adjust users accordingly.
7047 * print.c (print_object): Likewise.
7048 * window.c (select_window, Fwindow_use_time, make_parent_window)
7049 (make_window): Likewise.
7050
7051 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7052
7053 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7054 enabled with --enable-checking=[all,glyphs] configure option.
7055 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7056 adjust comments accordingly.
7057 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7058 undefined, adjust comments accordingly.
7059 * image.c: Likewise.
7060 * scroll.c: Likewise.
7061 * w32fns.c: Likewise.
7062 * w32term.c: Likewise.
7063 * xdisp.c: Likewise.
7064 * xfaces.c: Likewise.
7065 * xfns.c: Likewise.
7066 * xterm.c: Likewise.
7067
7068 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7069
7070 Generalize run-time debugging checks.
7071 * dispextern.h (XASSERTS): Remove.
7072 * fontset.c (xassert): Remove.
7073 Convert from xassert to eassert.
7074 * alloc.c: Convert from xassert to eassert.
7075 * bidi.c: Likewise.
7076 * dispnew.c: Likewise.
7077 * fns.c: Likewise.
7078 * fringe.c: Likewise.
7079 * ftfont.c: Likewise.
7080 * gtkutil.c: Likewise.
7081 * image.c: Likewise.
7082 * keyboard.c: Likewise.
7083 * menu.c: Likewise.
7084 * process.c: Likewise.
7085 * scroll.c: Likewise.
7086 * sound.c: Likewise.
7087 * term.c: Likewise.
7088 * w32console.c: Likewise.
7089 * w32fns.c: Likewise.
7090 * w32term.c: Likewise.
7091 * window.c: Likewise.
7092 * xdisp.c: Likewise.
7093 * xfaces.c: Likewise.
7094 * xfns.c: Likewise.
7095 * xselect.c: Likewise.
7096 * xterm.c: Likewise.
7097
7098 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7099
7100 * fns.c (maybe_resize_hash_table): Output message when growing the
7101 purify-hashtable.
7102
7103 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7104
7105 * alloc.c (allocate_string_data): Remove dead code.
7106 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7107 avoid GCC warning about unused macro.
7108
7109 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7110
7111 * alloc.c (allocate_string): Omit intervals initialization.
7112 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7113 as in make_pure_string and make_pure_c_string.
7114
7115 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7116
7117 * alloc.c (allocate_string): Fix last change.
7118
7119 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7120
7121 * alloc.c (allocate_string): Remove two redundant calls
7122 to memset, add explicit initialization where appropriate.
7123
7124 2012-06-27 Glenn Morris <rgm@gnu.org>
7125
7126 * lisp.mk (lisp): Remove paths.elc.
7127
7128 2012-06-27 Chong Yidong <cyd@gnu.org>
7129
7130 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7131
7132 2012-06-26 John Wiegley <johnw@newartisans.com>
7133
7134 * unexmacosx.c (copy_data_segment): Add two section names used
7135 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7136
7137 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7138 when building with Clang.
7139
7140 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7141
7142 * eval.c (Fapply): Allow calling it with a single argument.
7143
7144 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7145
7146 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7147 _stricmp and _strnicmp.
7148 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7149
7150 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7151
7152 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7153 allocated window.
7154 (allocate_process): Likewise for new process.
7155 (allocate_terminal): Change to use offsetof.
7156 (allocate_frame): Likewise.
7157 * frame.c (make_frame): Omit redundant initialization.
7158 * window.c (make_parent_window): Use memset.
7159 (make_window): Omit redundant initialization.
7160 * process.c (make_process): Omit redundant initialization.
7161 * terminal.c (create_terminal): Likewise.
7162
7163 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7164
7165 * term.c (delete_tty): Remove redundant call to memset.
7166
7167 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7168
7169 * alloc.c: Remove build_string.
7170 * lisp.h: Define build_string as static inline. This provides
7171 a better opportunity to optimize away calls to strlen when the
7172 function is called with compile-time constant argument.
7173 * image.c (imagemagick_error): Convert to build_string.
7174 * w32proc.c (sys_spawnve): Likewise.
7175 * xterm.c (x_term_init): Likewise.
7176
7177 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7178
7179 Use sprintf return value instead of invoking strlen on result.
7180 In the old days this wasn't portable, since some sprintf
7181 implementations returned char *. But they died out years ago and
7182 Emacs already assumes sprintf returns int.
7183 Similarly for float_to_string.
7184 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7185 * ccl.c (ccl_driver):
7186 * character.c (string_escape_byte8):
7187 * data.c (Fnumber_to_string):
7188 * doprnt.c (doprnt):
7189 * print.c (print_object):
7190 * xdisp.c (message_dolog):
7191 * xfns.c (syms_of_xfns):
7192 Use sprintf or float_to_string result to avoid need to call strlen.
7193 * data.c (Fnumber_to_string):
7194 Use make_unibyte_string, since the string must be ASCII.
7195 * lisp.h, print.c (float_to_string): Now returns int length.
7196 * term.c (produce_glyphless_glyph):
7197 Use sprintf result rather than recomputing it.
7198
7199 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7200 * Makefile.in (ALL_CFLAGS):
7201 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7202 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7203
7204 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7205
7206 * dispextern.h (xstrcasecmp): Define to library function
7207 strcasecmp if available.
7208 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7209
7210 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7211
7212 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7213 Avoid comma operator.
7214 * menu.c (push_submenu_start, push_submenu_end)
7215 (push_left_right_boundary, push_menu_pane): Likewise.
7216 * msdos.c (dos_rawgetc): Likewise.
7217
7218 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7219
7220 * xfns.c (xic_create_fontsetname): Remove redundant calls
7221 to memset.
7222
7223 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7224
7225 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7226 sprintf already null-terminates its output.
7227
7228 * xfns.c (x_window): Remove redundant cast.
7229
7230 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7231
7232 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7233 `const char *' to `char *' to avoid compiler warning.
7234
7235 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7236
7237 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7238 instead of truncating it to 63 (admittedly a generous limit).
7239
7240 * process.c: Fix spelling and caps in comments.
7241
7242 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7243
7244 * emacs.c (setpgrp): Remove definition, unused.
7245 * sysdep.c (setpgrp): Remove definition, not used in this file.
7246
7247 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7248
7249 * makefile.w32-in: Update dependencies.
7250
7251 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7252
7253 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7254 (SYSTIME_H): Add nt/inc/sys/time.h.
7255
7256 * systime.h [WINDOWSNT]: Include sys/time.h.
7257
7258 * s/ms-w32.h (struct timespec): Definition moved from
7259 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7260
7261 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7262
7263 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7264 * buffer.h (buffer_slot_type_mismatch):
7265 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7266 * eval.c (unwind_to_catch):
7267 * image.c (my_png_error, my_error_exit):
7268 * keyboard.c (quit_throw_to_read_char, user_error)
7269 (Fexit_recursive_edit, Fabort_recursive_edit):
7270 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7271 (wrong_type_argument, buffer_overflow, __executable_start)
7272 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7273 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7274 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7275 (fatal):
7276 (child_setup) [!DOS_NT]:
7277 * lread.c (end_of_file_error, invalid_syntax):
7278 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7279 * puresize.h (pure_write_error):
7280 * search.c (matcher_overflow):
7281 * sound.c (sound_perror, alsa_sound_perror):
7282 * sysdep.c, syssignal.h (croak):
7283 * term.c (maybe_fatal, vfatal):
7284 * textprop.c (text_read_only):
7285 * undo.c (user_error):
7286 * unexmacosx.c (unexec_error):
7287 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7288 Use _Noreturn rather than NO_RETURN.
7289 No need for separate decl merely because of _Noreturn.
7290 * sound.c (sound_warning, parse_sound):
7291 Remove unnecessary forward decls.
7292
7293 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7296 * lisp.h (WAIT_READING_MAX): New macro.
7297 * dispnew.c (Fsleep_for, sit_for):
7298 * keyboard.c (kbd_buffer_get_event):
7299 * process.c (Faccept_process_output):
7300 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7301 This improves on the previous patch, which introduced a bug
7302 when time_t is unsigned and as wide as intmax_t.
7303 See <http://bugs.gnu.org/9000#51>.
7304
7305 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7306
7307 * dispnew.c (sit_for, Fsleep_for):
7308 * keyboard.c (kbd_buffer_get_event):
7309 * process.c (Faccept_process_output): Avoid compiler warnings when
7310 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7311
7312 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7313
7314 * makefile.w32-in: Update dependencies.
7315
7316 * w32.c (ltime): Add return type and declare static.
7317 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7318
7319 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7320
7321 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7322 Privately reported by Herbert J. Skuhra.
7323 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7324 All uses changed.
7325 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7326 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7327
7328 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7329
7330 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7331 last argument of make_unibyte_string.
7332
7333 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7334 language ID in the event parameters.
7335
7336 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7337 event.code, not the obscure "character set ID".
7338
7339 2012-06-23 Chong Yidong <cyd@gnu.org>
7340
7341 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7342
7343 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7344
7345 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7346 * w32.c (fdutimens): New function.
7347
7348 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7349
7350 * s/ms-w32.h (pselect): Redirect to sys_select.
7351
7352 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7353
7354 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7355 in the logic of incrementing and decrementing the value of
7356 use_relocatable_buffers.
7357
7358 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7359
7360 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7361 Privately reported by Herbert J. Skuhra.
7362 [__FreeBSD__]: Remove "*/" typo after "#include".
7363 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7364 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7365 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7366 Don't assume EMACS_TIME and struct timeval are the same type.
7367
7368 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 Support higher-resolution time stamps (Bug#9000).
7371 The time stamps are only nanosecond-resolution at the C level,
7372 since that's the best that any real-world system supports now.
7373 But they are picosecond-resolution at the Lisp level, as that's
7374 easy, and leaves room for future OS improvements.
7375
7376 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7377 (LIBES): Use it.
7378
7379 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7380 Don't get current time unless it's needed.
7381
7382 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7383 now provides it if it's absent.
7384 (start_atimer): Port to higher-res time stamps.
7385 Check for time stamp overflow. Don't get current time more
7386 often than is needed.
7387
7388 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7389 Include systime.h, not time.h.
7390 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7391
7392 * dired.c: Include stat-time.h.
7393 (Ffile-attributes): File times now have higher resolution.
7394
7395 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7396 (struct image): Timestamp now has higher resolution.
7397
7398 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7399 has at least microseconds now. All uses removed.
7400 (update_frame, update_single_window, update_window, update_frame_1)
7401 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7402 (duration_to_sec_usec): Remove; no longer needed.
7403
7404 * editfns.c (time_overflow): Now extern.
7405 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7406 (float-time, Fformat_time_string, Fcurrent_time_string)
7407 (Fcurrent_time_zone): Accept and generate higher-resolution
7408 time stamps.
7409 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7410 (decode_time_components, lisp_seconds_argument): New functions.
7411 (make_time): Now static.
7412 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7413 Report an error if the time is invalid, rather than having the caller
7414 do that.
7415
7416 * fileio.c: Include <stat-time.h>
7417 (Fcopy_file): Copy higher-resolution time stamps.
7418 Prefer to set the time stamp via a file descriptor if that works.
7419 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7420 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7421 (Fvisited_file_modtime, Fset_visited_file_modtime):
7422 Support higher-resolution time stamps.
7423
7424 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7425
7426 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7427
7428 * image.c (prepare_image_for_display, clear_image_cache)
7429 (lookup_image): Port to higer-resolution time stamps.
7430
7431 * keyboard.c (start_polling, bind_polling_period):
7432 Check for time stamp overflow.
7433 (read_char, kbd_buffer_get_event, timer_start_idle)
7434 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7435 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7436 Port to higher-resolution time stamps. Do not assume time_t is signed.
7437 (decode_timer): New function. Timers are now vectors of length 9,
7438 not 8, to accommodate the picosecond component.
7439 (timer_check_2): Use it.
7440
7441 * nsterm.m (select_timeout, timeval_subtract): Remove.
7442 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7443 as they're a bit more accurate and handle overflow better.
7444 (ns_select): Change prototype to be compatible with pselect.
7445 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7446 * nsterm.h (ns_select): Adjust prototype.
7447
7448 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7449 us-resolution time stamps.
7450 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7451
7452 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7453
7454 * lisp.h (time_overflow): New decl.
7455 (wait_reading_process_output): First arg is now intmax_t, not int,
7456 to accommodate larger waits.
7457
7458 * process.h (struct Lisp_Process.read_output_delay):
7459 Now counts nanoseconds, not microseconds.
7460 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7461 EMACS_HAS_USECS.
7462 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7463 (wait_reading_process_output):
7464 Port to ns-resolution time stamps.
7465 (Faccept_process_output, wait_reading_process_output):
7466 Check for time stamp overflow. Do not assume time_t is signed.
7467 (select_wrapper): Remove; we now use pselect.
7468 (Fprocess_attributes): Now generates ns-resolution time stamps.
7469
7470 * sysdep.c: Include utimens.h. Don't include utime.h
7471 or worry about struct utimbuf; gnulib does that for us now.
7472 (gettimeofday): Remove; gnulib provides a substitute.
7473 (make_timeval): New function.
7474 (set_file_times): Now sets ns-resolution time stamps.
7475 New arg FD; all uses changed.
7476 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7477 (system_process_attributes):
7478 Now returns ns-resolution time stamp. All uses changed.
7479 Check for time stamp overflow.
7480
7481 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7482 provides a substitute now.
7483
7484 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7485 since it guarantees struct timespec.
7486 (EMACS_TIME): Now struct timespec, so that we can support
7487 ns-resolution time stamps.
7488 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7489 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7490 (EMACS_USECS): Remove.
7491 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7492 so multiply the arg by 1000 before storing it.
7493 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7494 New macros.
7495 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7496 Port to ns-resolution time stamps.
7497 (EMACS_TIME_NEG_P): Remove; replaced by....
7498 (EMACS_TIME_SIGN): New macro.
7499 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7500 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7501 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7502 (make_timeval, make_lisp_time, decode_time_components): New decls.
7503 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7504 that it mishandled time_t overflow. You can't compare by subtracting!
7505 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7506 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7507
7508 * term.c: Include <sys/time.h>.
7509 (timeval_to_Time): New function, for proper overflow wraparound.
7510 (term_mouse_position, term_mouse_click): Use it.
7511
7512 * undo.c (record_first_change): Support higher-resolution time stamps
7513 in the undo buffer.
7514 (Fprimitive_undo): Use them when restoring time stamps.
7515
7516 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7517 (w32_get_internal_run_time):
7518 Port to higher-resolution Emacs time stamps.
7519 (ltime): Now accepts single 64-bit integer, as that's more convenient
7520 for callers.
7521
7522 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7523
7524 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7525 for compatibility with pselect. Support ns-resolution time stamps.
7526
7527 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7528
7529 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7530 Check for time stamp overflow, and support ns-resolution time stamps.
7531
7532 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7533 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7534 (timeval_subtract): Remove; no longer needed.
7535 (XTflash, XTring_bell, x_wait_for_event):
7536 Port to ns-resolution time stamps. Don't assume time_t is signed.
7537
7538 2012-06-22 Chong Yidong <cyd@gnu.org>
7539
7540 * xdisp.c (x_consider_frame_title): Revert last change.
7541
7542 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7543
7544 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7545 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7546 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7547 staticidx goes up to 1597 out of 1600 = 0x640.)
7548
7549 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7550
7551 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7552 Otherwise, the umask might be mistakenly 0 while handling input signals.
7553
7554 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7555
7556 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7557
7558 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7559
7560 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7561 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7562 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7563 access to `contents' member of Lisp_Vector objects with AREF and ASET
7564 where appropriate.
7565
7566 2012-06-19 Chong Yidong <cyd@gnu.org>
7567
7568 * frame.c (delete_frame): When selecting a frame on a different
7569 text terminal, do not alter the terminal's top-frame.
7570
7571 * xdisp.c (format_mode_line_unwind_data): Record the target
7572 frame's selected window and its terminal's top-frame.
7573 (unwind_format_mode_line): Restore them.
7574 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7575 Callers changed.
7576 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7577 since tty frames can be explicitly named.
7578 (prepare_menu_bars): Likewise.
7579
7580 * term.c (Ftty_top_frame): New function.
7581
7582 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7583
7584 Port byte-code-meter to modern targets.
7585 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7586 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7587 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7588 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7589 (METER_1, METER_2): Simplify.
7590
7591 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7592
7593 * data.c (Fdefalias): Return `symbol' (bug#11686).
7594
7595 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7596
7597 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7598 gets killed during executing of this function (Bug#11665).
7599 Try to always return Qt when the buffer has been actually killed.
7600 (Vkill_buffer_query_functions): In doc-string say that functions
7601 run by this hook should not change the current buffer.
7602
7603 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7604
7605 Fix recently-introduced process.c problems found by static checking.
7606 * process.c (write_queue_push, write_queue_pop, send_process):
7607 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7608 (write_queue_pop): Fix pointer signedness problem.
7609 (send_process): Remove unused local.
7610
7611 2012-06-17 Chong Yidong <cyd@gnu.org>
7612
7613 * xdisp.c (redisplay_internal): No need to redisplay terminal
7614 frames that are not on top.
7615
7616 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7617
7618 * process.c (make_process): Initialize write_queue.
7619 (write_queue_push, write_queue_pop): New functions.
7620 (send_process): Use them to maintain correct ordering of process
7621 writes (Bug#10815).
7622
7623 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7624
7625 * lisp.h (eassert): Assume C89 or later.
7626 This removes the need for CHECK.
7627 (CHECK): Remove. Its comments about always evaluating its
7628 argument were confusing, as 'eassert' typically does not evaluate
7629 its argument.
7630
7631 * coding.c (produce_chars): Use ptrdiff_t, not int.
7632
7633 * xterm.c (x_draw_underwave): Check for integer overflow.
7634 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7635
7636 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7637
7638 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7639 referenced (Bug#11583).
7640
7641 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7642
7643 Implement wave-style variant of underlining.
7644 * dispextern.h (face_underline_type): New enum.
7645 (face): Add field for underline type.
7646 * nsterm.m (ns_draw_underwave): New function.
7647 (ns_draw_text_decoration): Use it.
7648 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7649 New functions.
7650 (x_draw_glyph_string): Use them.
7651 * xfaces.c (Qline, Qwave): New Lisp objects.
7652 (check_lface_attrs, merge_face_ref)
7653 (Finternal_set_lisp_face_attribute, realize_x_face):
7654 Handle wave-style underline face attributes.
7655 * xterm.c (x_draw_underwave): New function.
7656 (x_draw_glyph_string): Use it.
7657
7658 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7659
7660 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7661 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7662 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7663 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7664 ($(BLD)/w32select.$(O)): Update dependencies.
7665
7666 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7667
7668 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7669 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7670 * character.c (_fetch_multibyte_char_p): Remove.
7671 * alloc.c: Include "character.h" before "buffer.h".
7672 * bidi.c: Likewise.
7673 * buffer.c: Likewise.
7674 * bytecode.c: Likewise.
7675 * callint.c: Likewise.
7676 * callproc.c: Likewise.
7677 * casefiddle.c: Likewise.
7678 * casetab.c: Likewise.
7679 * category.c: Likewise.
7680 * cmds.c: Likewise.
7681 * coding.c: Likewise.
7682 * composite.c: Likewise.
7683 * dired.c: Likewise.
7684 * dispnew.c: Likewise.
7685 * doc.c: Likewise.
7686 * dosfns.c: Likewise.
7687 * editfns.c: Likewise.
7688 * emacs.c: Likewise.
7689 * fileio.c: Likewise.
7690 * filelock.c: Likewise.
7691 * font.c: Likewise.
7692 * fontset.c: Likewise.
7693 * fringe.c: Likewise.
7694 * indent.c: Likewise.
7695 * insdel.c: Likewise.
7696 * intervals.c: Likewise.
7697 * keyboard.c: Likewise.
7698 * keymap.c: Likewise.
7699 * lread.c: Likewise.
7700 * macros.c: Likewise.
7701 * marker.c: Likewise.
7702 * minibuf.c: Likewise.
7703 * nsfns.m: Likewise.
7704 * nsmenu.m: Likewise.
7705 * print.c: Likewise.
7706 * process.c: Likewise.
7707 * regex.c: Likewise.
7708 * region-cache.c: Likewise.
7709 * search.c: Likewise.
7710 * syntax.c: Likewise.
7711 * term.c: Likewise.
7712 * textprop.c: Likewise.
7713 * undo.c: Likewise.
7714 * unexsol.c: Likewise.
7715 * w16select.c: Likewise.
7716 * w32fns.c: Likewise.
7717 * w32menu.c: Likewise.
7718 * window.c: Likewise.
7719 * xdisp.c: Likewise.
7720 * xfns.c: Likewise.
7721 * xmenu.c: Likewise.
7722 * xml.c: Likewise.
7723 * xselect.c: Likewise.
7724
7725 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7726
7727 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7728 If all the glyphs of the glyph row came from strings, and we have no
7729 cursor positioning clues, put the cursor on the first glyph of the
7730 row.
7731 (handle_face_prop): Use chunk-relative overlay string index when
7732 indexing into it->string_overlays array. (Bug#11653)
7733 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7734 the rightmost. (Bug#11720)
7735
7736 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7737
7738 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7739 (CATEGORY_MEMBER): Enforce 1/0 value.
7740 * category.c (_temp_category_set): Remove.
7741
7742 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7743
7744 * window.c (Fdelete_other_windows_internal)
7745 (Fdelete_window_internal): Don't access frame's mouse highlight
7746 info of the initial frame. (Bug#11677)
7747
7748 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7749
7750 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7751 Assume USE_2_TAGS_FOR_INTS.
7752 (xreload): Adjust $tagmask width to match recent lisp.h change.
7753
7754 Simplify lisp.h in minor ways that should not affect code.
7755 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7756 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7757 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7758 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7759 (INTTYPEBITS): New macro, for clarity.
7760 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7761 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7762 Simplify now that USE_LSB_TAG is always defined.
7763 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7764 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7765
7766 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7767
7768 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7769
7770 2012-06-13 Glenn Morris <rgm@gnu.org>
7771
7772 * s/bsd-common.h (BSD4_3):
7773 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7774
7775 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7776
7777 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7778 instead of union.
7779 (XLI, XIL): Define.
7780 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7781 Use them.
7782 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7783 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7784 * alloc.c (widen_to_Lisp_Object): Remove.
7785 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7786 * frame.c (delete_frame): Remove outdated comment.
7787 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7788 USE_LISP_UNION_TYPE.
7789 (Fw32_unregister_hot_key): Likewise.
7790 (Fw32_toggle_lock_key): Likewise.
7791 * w32menu.c (add_menu_item): Likewise.
7792 (w32_menu_display_help): Use XIL instead of checking
7793 USE_LISP_UNION_TYPE.
7794 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7795 (init_heap): Likewise.
7796 * w32term.c (w32_read_socket): Update comment.
7797
7798 2012-06-13 Glenn Morris <rgm@gnu.org>
7799
7800 * s/usg5-4-common.h, src/s/unixware.h:
7801 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7802
7803 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7804
7805 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7806
7807 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7808 * alloc.c (make_number) [!defined make_number]:
7809 Remove, as lisp.h always defines this now.
7810 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7811 (roundup_size): Verify that it is a power of 2.
7812 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7813 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7814 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7815 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7816 USE_LSB_TAG now is always defined to be either 0 or 1.
7817 All uses changed.
7818 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7819 code works fine either way, and efficiency is not a concern here,
7820 as the union type is for debugging, not for production.
7821 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7822 Use an inline function on all platforms when using the union type,
7823 since this is simpler and 'static inline' can be used portably
7824 within Emacs now.
7825 (LISP_INITIALLY_ZERO): New macro.
7826 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7827 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7828
7829 2012-06-12 Glenn Morris <rgm@gnu.org>
7830
7831 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7832
7833 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7834
7835 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7836 Move BROKEN_SIGIO to configure.
7837
7838 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7839 Move NO_TERMIO to configure.
7840
7841 2012-06-12 Chong Yidong <cyd@gnu.org>
7842
7843 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7844 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7845 MagickExportImagePixels is undefined.
7846
7847 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7848
7849 * image.c (imagemagick_load_image): Remove unused label.
7850
7851 2012-06-11 Glenn Morris <rgm@gnu.org>
7852
7853 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7854 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7855 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7856 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7857
7858 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7859
7860 * alloc.c (make_byte_code): New function.
7861 (Fmake_byte_code): Use it. Don't purify here.
7862 * lread.c (read1): Use it as well to avoid extra allocation.
7863
7864 2012-06-11 Chong Yidong <cyd@gnu.org>
7865
7866 * image.c (imagemagick_load_image): Implement transparency.
7867
7868 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7869
7870 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7871 account for preceding backslashes. (Bug#11663)
7872
7873 2012-06-09 Chong Yidong <cyd@gnu.org>
7874
7875 * term.c: Support italics in capable terminals (Bug#9652).
7876 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7877 (turn_on_face): Output using TS_enter_italic_mode if available.
7878 Don't handle unused blinking and alt-charset cases.
7879 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7880 and tty_alt_charset_p cases.
7881 (tty_capable_p, init_tty): Support italics.
7882
7883 * termchar.h (struct tty_display_info): Add field for italics.
7884 Remove unused blink field.
7885
7886 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7887 Handle slant.
7888
7889 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7890 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7891 tty_alt_charset_p. Add tty_italic_p.
7892
7893 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7894
7895 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7896 dbus_type_is_basic if available.
7897 (xd_extract_signed, xd_extract_unsigned): Rename from
7898 extract_signed and extract_unsigned, respectively. Adapt callers.
7899
7900 2012-06-09 Chong Yidong <cyd@gnu.org>
7901
7902 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7903
7904 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7905 case (Bug#9752).
7906
7907 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7908
7909 * xdisp.c (vmessage): Treat frame message as multibyte.
7910 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7911 would generate the diagnostic "Making \302\247 buffer-local while
7912 let-bound!".
7913
7914 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7915
7916 * dispnew.c (showing_window_margins_p): Undo last change, which
7917 was done due to an inadvertent commit.
7918 (adjust_frame_glyphs_for_frame_redisplay): Do call
7919 showing_window_margins_p.
7920
7921 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7922
7923 * eval.c (Fmake_var_non_special): New primitive.
7924 (syms_of_eval): Defsubr it.
7925 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7926
7927 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7928
7929 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7930 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7931
7932 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7933
7934 * alloc.c (allocate_vectorlike): Fix last change.
7935
7936 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7937
7938 Block-based vector allocation of small vectors.
7939 * lisp.h (struct vectorlike_header): New field `nbytes',
7940 adjust comment accordingly.
7941 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7942 to denote vector blocks. Adjust users (live_vector_p,
7943 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7944 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7945 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7946 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7947 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7948 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7949 (roundup_size): New constant.
7950 (struct vector_block): New data type.
7951 (vector_blocks, vector_free_lists, zero_vector): New variables.
7952 (all_vectors): Rename to `large_vectors'.
7953 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7954 (sweep_vectors): New functions.
7955 (allocate_vectorlike): Return `zero_vector' as the only vector of
7956 0 items. Allocate new vector from block if vector size is less than
7957 or equal to VBLOCK_BYTES_MAX.
7958 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7959 (init_alloc_once): Add call to init_vectors.
7960
7961 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7962
7963 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7964
7965 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7966
7967 * doprnt.c (doprnt): Truncate multibyte char correctly.
7968 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7969 would mishandle a string argument "Xc" if X was a multibyte
7970 character of length 2: it would truncate after X's first byte
7971 rather than including all of X.
7972
7973 2012-06-06 Chong Yidong <cyd@gnu.org>
7974
7975 * buffer.c (word_wrap): Doc fix.
7976
7977 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7980
7981 2012-06-03 Glenn Morris <rgm@gnu.org>
7982
7983 * xdisp.c (tool-bar-style): Doc fix.
7984
7985 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7986
7987 * Makefile.in (PAXCTL): Define.
7988 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7989 binary via PaX flags if the paxctl utility is available.
7990 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7991 Restore PaX flags to their default. (Bug#11398)
7992
7993 2012-06-03 Chong Yidong <cyd@gnu.org>
7994
7995 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7996 buffer (Bug#11226).
7997
7998 2012-06-03 Chong Yidong <cyd@gnu.org>
7999
8000 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8001 (note_mode_line_or_margin_highlight): If there is no help echo,
8002 use mode-line-default-help-echo. Handle the case where the mouse
8003 position is past the end of the mode line string.
8004
8005 * buffer.c (buffer_local_value_1): New function, split from
8006 Fbuffer_local_value; can return Qunbound.
8007 (Fbuffer_local_value): Use it.
8008 (Vmode_line_format): Docstring tweaks.
8009
8010 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8011
8012 * sysdep.c (system_process_attributes): Improve comment.
8013
8014 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8015
8016 * keyboard.c: Export real-this-command to Elisp.
8017 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8018 and DEFVAR it. Update all users.
8019
8020 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8023
8024 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8025 Convert pctcpu and pctmem to Lisp float properly.
8026 Let the compiler fold better, as 100.0/0x8000 is exact.
8027
8028 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8029
8030 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8031 cons_block.
8032
8033 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8034
8035 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8036
8037 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8038
8039 For a 'struct window', replace some Lisp_Object fields to
8040 bitfields where appropriate, remove unused fields.
8041 * window.h (struct window): Remove unused 'last_mark_x' and
8042 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
8043 change its type from Lisp_Object to bitfield.
8044 Change type of 'force_start', 'optional_new_start',
8045 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
8046 fields from Lisp_Object to bitfield. Adjust users accordingly.
8047
8048 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8049
8050 Pacify gcc -Wdouble-precision when using Xaw.
8051 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8052 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8053 Use 'float' consistently, rather than 'float' in most places
8054 and 'double' in a couple of places.
8055
8056 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8057
8058 * xdisp.c (handle_stop): Detect whether we have overlay strings
8059 loaded by testing it->current.overlay_string_index to be
8060 non-negative, instead of checking whether n_overlay_strings is
8061 positive. (Bug#11587)
8062
8063 2012-05-31 Chong Yidong <cyd@gnu.org>
8064
8065 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8066
8067 * doc.c (Fsubstitute_command_keys): Doc fix.
8068
8069 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8070
8071 * search.c (search_buffer): Remove calls to
8072 r_alloc_inhibit_buffer_relocation, as it is now called by
8073 maybe_unify_char, which was the cause of relocation of buffer text
8074 in bug#11519.
8075
8076 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8077
8078 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8079 for the duration of call to load_charset, to avoid problems with
8080 callers of maybe_unify_char that access buffer text through C
8081 pointers.
8082
8083 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8084 decrement the inhibition flag, instead of just setting or
8085 resetting it.
8086
8087 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8088
8089 Remove obsolete '#define static' cruft.
8090 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8091 This #undef was "temporary" in 2000; it is no longer needed
8092 now that '#define static' has gone away.
8093 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8094 (gray_bitmap_bits): Remove; no longer needed.
8095 All uses replaced with definiens.
8096 * xterm.c: Include "bitmaps/gray.xbm".
8097
8098 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8099
8100 Clean up __executable_start, monstartup when --enable-profiling.
8101 The following changes affect the code only when profiling.
8102 * dispnew.c (__executable_start): Rename from safe_bcopy.
8103 Define only on platforms that need it.
8104 * emacs.c: Include <sys/gmon.h> when profiling.
8105 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8106 (__executable_start): Remove decl, since lisp.h does it now.
8107 (safe_bcopy): Remove decl; no longer has that name.
8108 (main): Coalesce #if into single bit of code, for simplicity.
8109 Cast pointers to uintptr_t, since standard libraries want integers
8110 and not pointers.
8111 * lisp.h (__executable_start): New decl.
8112
8113 2012-05-31 Glenn Morris <rgm@gnu.org>
8114
8115 * image.c (Fimagemagick_types): Doc fix.
8116
8117 2012-05-30 Jim Meyering <meyering@redhat.com>
8118
8119 * callproc.c (Fcall_process_region): Include directory component
8120 in mkstemp error message (Bug#11586).
8121
8122 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8123
8124 * alloc.c, lisp.h (make_pure_vector): Now static.
8125
8126 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8127
8128 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8129 Move to byte-run.el.
8130 (Fautoload): Do the hash-doc more carefully.
8131 * data.c (Fdefalias): Purify definition, except for keymaps.
8132 (Qdefun): Move from eval.c.
8133 * lisp.h (Qdefun): Remove.
8134 * lread.c (read1): Tiny simplification.
8135
8136 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8137
8138 Do not create empty overlays with the evaporate property (Bug#9642).
8139 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8140 Bug#9642, but explicitly check that the buffer the overlay would
8141 be moved to is live and rearrange lines to make sure that errors
8142 will not put the overlay in an inconsistent state.
8143 (Fdelete_overlay): Cosmetics.
8144
8145 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8146
8147 * w32term.c (my_bring_window_to_top): New function.
8148 (x_raise_frame): Use handle returned by DeferWindowPos, which
8149 could be different from the original one.
8150 Call my_bring_window_to_top instead of my_set_foreground_window.
8151 (Bug#11513)
8152
8153 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8154 by calling BringWindowToTop.
8155
8156 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8157 (WM_EMACS_END): Increase by one.
8158
8159 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8160
8161 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8162 This avoids undefined behavior that might cause the eassert
8163 to not catch an out-of-range value.
8164
8165 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8166
8167 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8168 Update dependencies.
8169
8170 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8171
8172 * bidi.c (bidi_mirror_char): Fix last change.
8173
8174 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8175
8176 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8177 when referring to sectname field in printf format.
8178
8179 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8180
8181 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8182 Only r_alloc_inhibit_buffer_relocation needed to be added;
8183 the others were already declared.
8184
8185 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8186 before checking whether it's out of range. Put the check inside
8187 eassert. See
8188 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8189
8190 2012-05-27 Ken Brown <kbrown@cornell.edu>
8191
8192 * callproc.c (Fcall_process): Restore a line that was accidentally
8193 commented out in the 2011-02-13 change (bug#11547).
8194
8195 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8196
8197 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8198 defined on ralloc.c.
8199
8200 * buffer.c [REL_ALLOC]: Remove prototypes of
8201 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8202 they are now on lisp.h.
8203
8204 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8205
8206 * search.c (search_buffer): Use it to inhibit relocation of buffer
8207 text while re_search_2 is doing its job, because re_search_2 is
8208 passed C pointers to buffer text. (Bug#11519)
8209
8210 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8211 Update value to 24.
8212
8213 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8214 state after an additional call to move_it_in_display_line_to, keep
8215 the values of it->max_ascent and it->max_descent found for the
8216 entire line.
8217 (pos_visible_p): Revert the comparison against bottom_y to what it
8218 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8219 (Bug#11464)
8220
8221 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 Fix coding-related core dumps with gcc -ftrapv.
8224 The code was computing A - B, where A and B are pointers, and B is
8225 random garbage. This can lead to core dumps on platforms that
8226 have special pointer registers, and it also leads to core dumps on
8227 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8228 A - B only when B is initialized properly.
8229 * coding.c (coding_set_source, coding_set_destination): Return void.
8230 (coding_change_source, coding_change_destinations): New functions,
8231 with the old behaviors of coding_set_source and coding_set_destination.
8232 All callers that need an offset changed to use these new functions.
8233
8234 2012-05-26 Glenn Morris <rgm@gnu.org>
8235
8236 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8237
8238 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8239
8240 Extend mouse support on W32 text-mode console.
8241 * xdisp.c (draw_row_with_mouse_face):
8242 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8243
8244 * w32console.c: Include window.h.
8245 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8246 New functions.
8247 (initialize_w32_display): Initialize mouse-highlight data.
8248
8249 * w32inevt.c: Include termchar.h and window.h.
8250 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8251 moves, call note_mouse_highlight. If help_echo changed, call
8252 gen_help_event to produce help-echo message in the echo area.
8253 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8254 highlight info.
8255
8256 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 * lread.c (read1): Simplify slightly to avoid an overflow warning
8259 with GCC 4.7.0 on x86-64.
8260
8261 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8262
8263 * bidi.c (bidi_mirror_char): Revert last change: an int is
8264 definitely wide enough here.
8265
8266 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 Fix integer width and related bugs (Bug#9874).
8269 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8270 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8271 (string_bytes, check_sblock, allocate_string_data):
8272 (compact_small_strings, Fmake_bool_vector, make_string)
8273 (make_unibyte_string, make_multibyte_string)
8274 (make_string_from_bytes, make_specified_string)
8275 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8276 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8277 (mark_vectorlike):
8278 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8279 (allocate_pseudovector):
8280 Use int, not EMACS_INT, where int is wide enough.
8281 (inhibit_garbage_collection, Fgarbage_collect):
8282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8283 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8284 int might not be wide enough.
8285 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8286 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8287 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8288 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8289 (bidi_level_of_next_char, bidi_move_to_visually_next):
8290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8291 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8292 (Fkill_buffer, Fset_buffer_major_mode)
8293 (advance_to_char_boundary, Fbuffer_swap_text)
8294 (Fset_buffer_multibyte, overlays_at, overlays_in)
8295 (overlay_touches_p, struct sortvec, record_overlay_string)
8296 (overlay_strings, recenter_overlay_lists)
8297 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8298 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8299 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8300 (Foverlay_recenter, last_overlay_modification_hooks_used)
8301 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8303 (validate_region): Omit unnecessary test for b <= e,
8304 since that's guaranteed by the previous test.
8305 (adjust_overlays_for_delete): Avoid pos + length overflow.
8306 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8307 (report_overlay_modification):
8308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8309 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8310 Omit pointer cast, which isn't needed anyway, and doesn't work
8311 after the EMACS_INT -> ptrdiff_t change.
8312 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8313 * buffer.h: Adjust decls to match defn changes elsewhere.
8314 (struct buffer_text, struct buffer):
8315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8316 Use EMACS_INT, not int, where int might not be wide enough.
8317 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8318 not int, to avoid needless 32-bit limit on 64-bit hosts.
8319 (exec_byte_code): Use tighter memory-full test, one that checks
8320 for alloca overflow. Don't compute the address of the object just
8321 before an array, as that's not portable. Use EMACS_INT, not
8322 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8323 * callint.c (Fcall_interactively):
8324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8325 * callproc.c (call_process_kill, Fcall_process):
8326 Don't assume pid_t fits into an Emacs fixnum.
8327 (call_process_cleanup, Fcall_process, child_setup):
8328 Don't assume pid_t fits into int.
8329 (call_process_cleanup, Fcall_process, delete_temp_file)
8330 (Fcall_process_region):
8331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8332 (Fcall_process): Simplify handling of volatile integers.
8333 Use int, not EMACS_INT, where int will do.
8334 * casefiddle.c (casify_object, casify_region, operate_on_word)
8335 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8337 (casify_object): Avoid integer overflow when overallocating buffer.
8338 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8339 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8340 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8341 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8342 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8343 integers are now checked earlier. All uses replaced with XINT.
8344 (ccl_driver):
8345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8346 For CCL_MapSingle, check that content and value are in int range.
8347 (ccl_driver, Fregister_code_conversion_map):
8348 Check that Vcode_version_map_vector is a vector.
8349 (resolve_symbol_ccl_program): Check that vector header is in range.
8350 Always copy the vector, so that we can check its contents reliably
8351 now rather than having to recheck each instruction as it's being
8352 executed. Check that vector words fit in 'int'.
8353 (ccl_get_compiled_code, Fregister_ccl_program)
8354 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8355 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8356 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8357 contents are in range.
8358 (Fccl_execute_on_string): Check that status is in range.
8359 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8360 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8361 Accept and return EMACS_INT, not int, because callers can pass values
8362 out of 'int' range.
8363 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8364 (multibyte_chars_in_text, parse_str_as_multibyte)
8365 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8366 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8367 (string_escape_byte8, Fget_byte):
8368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8369 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8370 avoid mishandling large integers.
8371 * character.h: Adjust decls to match defn changes elsewhere.
8372 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8373 (Ffind_charset_region):
8374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8375 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8376 (load_charset_map_from_vector, Fdefine_charset_internal):
8377 Don't assume fixnum fits in int.
8378 (load_charset_map_from_vector, Fmap_charset_chars):
8379 Remove now-unnecessary CHECK_NATNUMs.
8380 (Fdefine_charset_internal): Check ranges here, more carefully.
8381 Don't rely on undefined behavior with signed left shift overflow.
8382 Don't assume unsigned int fits into fixnum, or that fixnum fits
8383 into unsigned int. Don't require max_code to be a valid fixnum;
8384 that's not true for gb10830 4-byte on a 32-bit host. Allow
8385 invalid_code to be a cons, for the same reason. Require code_offset
8386 to be a character. Avoid int overflow if max_char is close
8387 to INT_MAX.
8388 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8389 this is intended anyway and avoids some undefined behavior.
8390 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8391 INDEX_TO_CODE_POINT, as that's what it expects.
8392 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8393 * charset.h (DECODE_CHAR): Return int, not unsigned;
8394 this is what was intended anyway, and it avoids undefined behavior.
8395 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8396 integer-overflow issues.
8397 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8398 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8399 where the argument is EMACS_INT, and this behavior is not intended.
8400 * chartab.c (Fmake_char_table, Fset_char_table_range)
8401 (uniprop_get_decoder, uniprop_get_encoder):
8402 Don't assume fixnum fits in int.
8403 * cmds.c (move_point): New function, that does the gist of
8404 Fforward_char and Fbackward_char, but does so while checking
8405 for integer overflow more accurately.
8406 (Fforward_char, Fbackward_char): Use it.
8407 (Fforward_line, Fend_of_line, internal_self_insert)
8408 (internal_self_insert):
8409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8410 Fix a FIXME, by checking for integer overflow when calculating
8411 target_clm and actual_clm.
8412 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8413 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8414 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8415 (coding_alloc_by_making_gap, alloc_destination)
8416 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8417 (encode_coding_utf_16, detect_coding_emacs_mule)
8418 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8419 (detect_coding_iso_2022, decode_coding_iso_2022)
8420 (encode_invocation_designation, encode_designation_at_bol)
8421 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8422 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8423 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8424 (encode_coding_ccl, encode_coding_raw_text)
8425 (detect_coding_charset, decode_coding_charset)
8426 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8427 (produce_composition, produce_charset, produce_annotation)
8428 (decode_coding, handle_composition_annotation)
8429 (handle_charset_annotation, consume_chars, decode_coding_gap)
8430 (decode_coding_object, encode_coding_object, detect_coding_system)
8431 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8432 (code_convert_region, code_convert_string)
8433 (Fdefine_coding_system_internal)
8434 (coding_set_source, coding_set_destination):
8435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8436 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8437 (Fdefine_coding_system_internal):
8438 Don't assume fixnums fit in int.
8439 (decode_coding_gap, decode_coding_object, encode_coding_object)
8440 (Fread_coding_system, Fdetect_coding_region)
8441 (Funencodable_char_position, Fcheck_coding_systems_region)
8442 (get_translation, handle_composition_annotation, consume_chars):
8443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8444 (consume_chars): Rewrite to not calculate an address outside buffer.
8445 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8446 Don't access memory outside of the args array.
8447 (Fdefine_coding_system_internal): Check for charset-id overflow.
8448 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8449 result of ENCODE_CHAR.
8450 * coding.h: Adjust decls to match defn changes elsewhere.
8451 (struct coding_system):
8452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8453 * composite.c (get_composition_id, find_composition)
8454 (run_composition_function, update_compositions)
8455 (compose_text, composition_gstring_put_cache)
8456 (composition_gstring_p, composition_gstring_width)
8457 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8458 (composition_compute_stop_pos, composition_reseat_it)
8459 (composition_update_it, struct position_record)
8460 (find_automatic_composition, composition_adjust_point)
8461 (Fcomposition_get_gstring, Ffind_composition_internal):
8462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8463 (update_compositions):
8464 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8465 * composite.h: Adjust decls to match defn changes elsewhere.
8466 (struct composition):
8467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8468 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8469 Do not attempt to compute the address of the object just before a
8470 buffer; this is not portable.
8471 (Faref, Faset):
8472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8473 (Faset): Use int, not EMACS_INT, where int is wide enough.
8474 (Fstring_to_number): Don't assume fixnums fit in int.
8475 (Frem): Don't assume arg is nonnegative.
8476 * dbusbind.c (xd_append_arg): Check for integers out of range.
8477 (Fdbus_call_method): Don't overflow the timeout int.
8478 (extract_signed, extract_unsigned): New functions.
8479 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8480 (xd_get_connection_references): Return ptrdiff_t, not int.
8481 All uses changed.
8482 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8483 (xd_read_message_1):
8484 Use int, not unsigned, where the dbus API uses int.
8485 (Fdbus_message_internal): Don't overflow mtype.
8486 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8487 * dired.c (directory_files_internal, file_name_completion, scmp)
8488 (file_name_completion_stat):
8489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8490 (file_name_completion): Don't overflow matchcount.
8491 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8492 * dispextern.h: Adjust decls to match defn changes elsewhere.
8493 (struct text_pos, struct glyph, struct bidi_saved_info)
8494 (struct bidi_string_data, struct bidi_it, struct composition_it)
8495 (struct it):
8496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8497 (struct display_pos, struct composition_it, struct it):
8498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8499 * dispnew.c (increment_matrix_positions)
8500 (increment_row_positions, mode_line_string)
8501 (marginal_area_string):
8502 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8503 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8504 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8505 (duration_to_sec_usec): New function, to check for overflow better.
8506 (Fsleep_for, sit_for): Use it.
8507 * doc.c (get_doc_string, store_function_docstring):
8508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8509 (get_doc_string, Fsnarf_documentation):
8510 Use int, not EMACS_INT, where int is wide enough.
8511 (get_doc_string):
8512 Use SAFE_ALLOCA, not alloca.
8513 Check for overflow when converting EMACS_INT to off_t.
8514 * doprnt.c (doprnt):
8515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8516 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8517 Don't assume uid_t fits into fixnum.
8518 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8519 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8520 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8521 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8522 (general_insert_function)
8523 (Finsert_char, make_buffer_string, make_buffer_string_both)
8524 (update_buffer_properties, Fbuffer_substring)
8525 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8526 (Fsubst_char_in_region, check_translation)
8527 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8528 (transpose_markers, Ftranspose_regions):
8529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8530 (clip_to_bounds): Move to lisp.h as an inline function).
8531 (Fconstrain_to_field): Don't assume integers are nonnegative.
8532 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8533 (Fsubst_char_in_region, Fsave_restriction):
8534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8535 (Femacs_pid): Don't assume pid_t fits into fixnum.
8536 (lo_time): Use int, not EMACS_INT, when int suffices.
8537 (lisp_time_argument): Check for usec out of range.
8538 (Fencode_time): Don't assume fixnum fits in int.
8539 (Fuser_login_name, Fuser_full_name): Signal an error
8540 if a uid argument is out of range, rather than relying on
8541 undefined behavior.
8542 (Fformat_time_string): Remove now-unnecessary check.
8543 lisp_time_argument checks for out-of-range usec now.
8544 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8545 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8546 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8547 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8548 (init_cmdargs, Fdump_emacs):
8549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8550 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8551 the bottom (typically) 32 bits of the fixnum.
8552 * eval.c (specpdl_size, call_debugger):
8553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8554 (when_entered_debugger, Fbacktrace_debug):
8555 Don't assume fixnum can fit in int.
8556 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8557 the object just before a buffer; this is not portable.
8558 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8559 (grow_specpdl, unbind_to):
8560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8561 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8562 (grow_specpdl): Simplify allocation by using xpalloc.
8563 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8564 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8565 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8567 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8568 (a_write, e_write):
8569 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8570 (Fcopy_file, non_regular_nbytes, read_non_regular)
8571 (Finsert_file_contents):
8572 Use int, not EMACS_INT, where int is wide enough.
8573 (READ_BUF_SIZE): Verify that it fits in int.
8574 (Finsert_file_contents): Check that counts are in proper range,
8575 rather than assuming fixnums fit into ptrdiff_t etc.
8576 Don't assume fixnums fit into int.
8577 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8578 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8579 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8580 (string_char_to_byte, string_byte_to_char)
8581 (string_make_multibyte, string_to_multibyte)
8582 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8583 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8584 (substring_both, Fdelete, internal_equal, Ffillarray)
8585 (Fclear_string, mapcar1)
8586 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8587 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8588 (larger_vector, make_hash_table, maybe_resize_hash_table)
8589 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8590 (Fmaphash, secure_hash):
8591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8592 (concat): Check for string index and length overflow.
8593 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8594 (Frequire):
8595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8596 (larger_vector): New API (vec, incr_min, size_max) replaces old
8597 one (vec, new_size, init). This catches size overflow.
8598 INIT was removed because it was always Qnil.
8599 All callers changed.
8600 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8601 the upper bound on a hash table index size.
8602 (make_hash_table, maybe_resize_hash_table): Use it.
8603 (secure_hash): Computer start_byte and end_byte only after
8604 they're known to be in ptrdiff_t range.
8605 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8606 (Ffont_get_glyphs, Ffont_at):
8607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8608 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8609 (Flist_fonts, Fopen_font):
8610 Don't assume fixnum can fit in int.
8611 (check_gstring): Don't assume index can fit in int.
8612 (font_match_p): Check that fixnum is a character, not a nonnegative
8613 fixnum, since the later code needs to stuff it into an int.
8614 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8615 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8616 conversion overflow issues.
8617 (Fopen_font): Check for integer out of range.
8618 (Ffont_get_glyphs): Don't assume index can fit in int.
8619 * font.h: Adjust decls to match defn changes elsewhere.
8620 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8621 integer overflow.
8622 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8623 printmax_t, where ptrdiff_t is wide enough.
8624 (Finternal_char_font):
8625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8626 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8627 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8628 (Fset_frame_position, x_set_frame_parameters)
8629 (x_set_line_spacing, x_set_border_width)
8630 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8631 Check that fixnums are in proper range for system types.
8632 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8633 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8634 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8635 Use SAFE_ALLOCA_LISP, not alloca.
8636 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8637 intptr_t is wide enough.
8638 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8639 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8640 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8641 Check for fixnum out of range.
8642 * ftfont.c (ftfont_list): Don't assume index fits in int.
8643 Check that fixnums are in proper range for system types.
8644 (ftfont_shape_by_flt):
8645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8646 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8647 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8648 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8649 Check that fixnums are in proper range for system types.
8650 * gnutls.h: Adjust decls to match defn changes elsewhere.
8651 * gtkutil.c (xg_dialog_run):
8652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8653 (update_frame_tool_bar):
8654 Check that fixnums are in proper range for system types.
8655 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8656 (lookup_image): Check that fixnums are in range for system types.
8657 * indent.c (last_known_column, last_known_column_point):
8658 (current_column_bol_cache):
8659 (skip_invisible, current_column, check_display_width):
8660 (check_display_width, scan_for_column, current_column_1)
8661 (Findent_to, Fcurrent_indentation, position_indentation)
8662 (indented_beyond_p, Fmove_to_column, compute_motion):
8663 (Fcompute_motion, Fvertical_motion):
8664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8665 (last_known_column_modified): Use EMACS_INT, not int.
8666 (check_display_width):
8667 (Fcompute_motion):
8668 Check that fixnums and floats are in proper range for system types.
8669 (compute_motion): Don't assume index or fixnum fits in int.
8670 (compute_motion, Fcompute_motion):
8671 Use int, not EMACS_INT, when it is wide enough.
8672 (vmotion): Omit local var start_hpos that is always 0; that way
8673 we don't need to worry about overflow in expressions involving it.
8674 * indent.h: Adjust decls to match defn changes elsewhere.
8675 (struct position):
8676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8677 Use int, not EMACS_INT, where int is wide enough.
8678 Remove unused members ovstring_chars_done and tab_offset;
8679 all uses removed.
8680 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8681 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8682 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8683 (make_gap, copy_text, insert, insert_and_inherit)
8684 (insert_before_markers, insert_before_markers_and_inherit)
8685 (insert_1, count_combining_before, count_combining_after)
8686 (insert_1_both, insert_from_string)
8687 (insert_from_string_before_markers, insert_from_string_1)
8688 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8689 (adjust_after_replace, adjust_after_insert, replace_range)
8690 (replace_range_2, del_range, del_range_1, del_range_byte)
8691 (del_range_both, del_range_2, modify_region)
8692 (prepare_to_modify_buffer, signal_before_change)
8693 (signal_after_change, Fcombine_after_change_execute):
8694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8695 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8696 (balance_an_interval, split_interval_right, split_interval_left)
8697 (find_interval, next_interval, update_interval)
8698 (adjust_intervals_for_insertion, delete_node, delete_interval)
8699 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8700 (static_offset_intervals, offset_intervals)
8701 (merge_interval_right, merge_interval_left, make_new_interval)
8702 (graft_intervals_into_buffer, temp_set_point_both)
8703 (temp_set_point, set_point, adjust_for_invis_intang)
8704 (set_point_both, move_if_not_intangible, get_property_and_range)
8705 (get_local_map, copy_intervals, copy_intervals_to_string)
8706 (compare_string_intervals, set_intervals_multibyte_1):
8707 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8708 * intervals.h: Adjust decls to match defn changes elsewhere.
8709 (struct interval):
8710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8711 * keyboard.c (this_command_key_count, this_single_command_key_start)
8712 (before_command_key_count, before_command_echo_length, echo_now)
8713 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8714 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8715 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8716 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8718 (last_non_minibuf_size, last_point_position, echo_truncate)
8719 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8720 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8721 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8722 (stuff_buffered_input):
8723 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8724 (last_auto_save, command_loop_1, read_char):
8725 Use EMACS_INT, not int, to avoid integer overflow.
8726 (record_char): Avoid overflow in total_keys computation.
8727 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8728 * keyboard.h: Adjust decls to match defn changes elsewhere.
8729 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8730 (Fkey_description, Fdescribe_vector, Flookup_key):
8731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8732 (click_position): New function, to check that positions are in range.
8733 (Fcurrent_active_maps):
8734 (describe_command):
8735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8736 (Faccessible_keymaps, Fkey_description):
8737 (preferred_sequence_p):
8738 Don't assume fixnum can fit into int.
8739 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8740 Check for integer overflow in size calculations.
8741 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8742 avoid mishandling large integers.
8743 * lisp.h: Adjust decls to match defn changes elsewhere.
8744 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8745 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8746 (struct Lisp_Marker):
8747 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8748 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8749 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8750 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8751 All callers changed.
8752 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8753 Assume the arg has valid form, since it always does.
8754 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8755 unsigned integer system type.
8756 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8757 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8759 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8760 (duration_to_sec_usec): New decl.
8761 * lread.c (read_from_string_index, read_from_string_index_byte)
8762 (read_from_string_limit, readchar, unreadchar, openp)
8763 (read_internal_start, read1, oblookup):
8764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8765 (Fload, readevalloop, Feval_buffer, Feval_region):
8766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8767 (openp): Check for out-of-range argument to 'access'.
8768 (read1): Use int, not EMACS_INT, where int is wide enough.
8769 Don't assume fixnum fits into int.
8770 Fix off-by-one error that can read outside a buffer.
8771 (read_filtered_event): Use duration_to_sec_usec
8772 to do proper overflow checking on durations.
8773 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8774 in size calculation.
8775 (Fexecute_kbd_macro):
8776 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8777 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8778 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8779 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8780 (set_marker_both, set_marker_restricted_both, marker_position)
8781 (marker_byte_position, Fbuffer_has_markers_at):
8782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8783 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8784 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8785 It now merely ensures that the menu is large enough, without
8786 necessarily growing it, as this avoids some integer overflow issues.
8787 All callers changed.
8788 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8790 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8791 Use SAFE_ALLOCA_LISP, not alloca.
8792 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8793 to EMACS_INT. Check that fixnums are in proper range for system types.
8794 * minibuf.c (minibuf_prompt_width, string_to_object)
8795 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8796 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8798 (get_minibuffer, read_minibuf_unwind):
8799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8800 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8801 this simplifies overflow checking. All callers changed.
8802 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8803 (Ftest_completion):
8804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8805 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8806 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8807 Check that fixnums are in proper range for system types.
8808 (Fx_create_frame, Fx_show_tip):
8809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8810 * nsfont.m (ns_findfonts, nsfont_list_family):
8811 Don't assume fixnum fits in long.
8812 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8814 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8815 wide enough.
8816 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8818 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8819 (PRINTDECLARE, PRINTPREPARE):
8820 (strout, print_string):
8821 (print, print_preprocess, print_check_string_charset_prop)
8822 (print_object):
8823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8824 (PRINTDECLARE):
8825 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8827 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8828 (printchar, strout): Use xpalloc to catch size calculation overflow.
8829 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8830 (print_error_message): Use SAFE_ALLOCA, not alloca.
8831 (print_object): Use int, not EMACS_INT, where int is wide enough.
8832 (print_depth, new_backquote_output, print_number_index):
8833 Use ptrdiff_t, not int, where int might not be wide enough.
8834 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8835 (Fset_process_window_size, Fformat_network_address)
8836 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8837 (sigchld_handler):
8838 Check that fixnums are in proper range for system types.
8839 (Fsignal_process): Simplify by avoiding a goto.
8840 Check for process-ids out of pid_t range rather than relying on
8841 undefined behavior.
8842 (process_tick, update_tick): Use EMACS_INT, not int.
8843 (Fformat_network_address, read_process_output, send_process)
8844 (Fprocess_send_region, status_notify):
8845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8846 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8847 (wait_reading_process_output, read_process_output, exec_sentinel):
8848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8849 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8850 (Faccept_process_output): Use duration_to_sec_usec to do proper
8851 overflow checking on durations.
8852 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8853 Don't assume pid_t fits in int.
8854 * process.h (struct Lisp_Process): Members tick and update_tick
8855 are now of type EMACS_INT, not int.
8856 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8857 configured --with-wide-int.
8858 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8859 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8860 * search.c (looking_at_1, string_match_1):
8861 (fast_string_match, fast_c_string_match_ignore_case)
8862 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8863 (scan_newline, find_before_next_newline, search_command)
8864 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8865 (set_search_regs, wordify):
8866 (Freplace_match):
8867 (Fmatch_data):
8868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8869 (string_match_1, search_buffer, set_search_regs):
8870 (Fmatch_data):
8871 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8872 (wordify): Check for overflow in size calculation.
8873 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8874 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8875 Check that fixnums are in proper range for system types.
8876 * sound.c (struct sound_device)
8877 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8878 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8879 (Fplay_sound_internal):
8880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8881 * syntax.c (struct lisp_parse_state, find_start_modiff)
8882 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8883 (Fparse_partial_sexp):
8884 Don't assume fixnums can fit in int.
8885 (struct lisp_parse_state, find_start_pos, find_start_value)
8886 (find_start_value_byte, find_start_begv)
8887 (update_syntax_table, char_quoted, dec_bytepos)
8888 (find_defun_start, prev_char_comend_first, back_comment):
8889 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8890 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8891 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8892 (Finternal_describe_syntax_value): Check that match_lisp is a
8893 character, not an integer, since the code stuffs it into int.
8894 (scan_words, scan_sexps_forward):
8895 Check that fixnums are in proper range for system types.
8896 (Fforward_word):
8897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8898 (scan_sexps_forward):
8899 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8900 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8901 * syntax.h: Adjust decls to match defn changes elsewhere.
8902 (struct gl_state_s):
8903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8904 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8905 MOST_POSITIVE_FIXNUM.
8906 * sysdep.c (wait_for_termination_1, wait_for_termination)
8907 (interruptible_wait_for_termination, mkdir):
8908 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8909 (emacs_read, emacs_write):
8910 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8911 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8912 and double all fit in int.
8913 * term.c (set_tty_color_mode):
8914 Check that fixnums are in proper range for system types.
8915 * termhooks.h (struct input_event):
8916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8917 * textprop.c (validate_interval_range, interval_of)
8918 (Fadd_text_properties, set_text_properties_1)
8919 (Fremove_text_properties, Fremove_list_of_text_properties)
8920 (Ftext_property_any, Ftext_property_not_all)
8921 (copy_text_properties, text_property_list, extend_property_ranges)
8922 (verify_interval_modification):
8923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8924 (Fnext_single_char_property_change)
8925 (Fprevious_single_char_property_change):
8926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8927 (copy_text_properties):
8928 Check for integer overflow in index calculation.
8929 * undo.c (last_boundary_position, record_point, record_insert)
8930 (record_delete, record_marker_adjustment, record_change)
8931 (record_property_change):
8932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8933 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8934 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8935 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8936 (Fx_hide_tip, Fx_file_dialog):
8937 * w32menu.c (set_frame_menubar):
8938 Use ptrdiff_t, not int, for consistency with rest of code.
8939 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8940 (select_window, Fdelete_other_windows_internal)
8941 (window_scroll_pixel_based, window_scroll_line_based)
8942 (Frecenter, Fset_window_configuration):
8943 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8944 (Fset_window_hscroll, run_window_configuration_change_hook)
8945 (set_window_buffer, temp_output_buffer_show, scroll_command)
8946 (Fscroll_other_window, Frecenter):
8947 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8948 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8949 Don't assume fixnum fits in int.
8950 (Fset_window_scroll_bars):
8951 Check that fixnums are in proper range for system types.
8952 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8953 (string_pos, c_string_pos, number_of_chars, init_iterator)
8954 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8955 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8956 (compute_display_string_end, handle_face_prop)
8957 (face_before_or_after_it_pos, handle_invisible_prop)
8958 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8959 (display_prop_intangible_p, string_buffer_position_lim)
8960 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8961 (get_overlay_strings_1, get_overlay_strings)
8962 (iterate_out_of_display_property, forward_to_next_line_start)
8963 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8964 (get_next_display_element, set_iterator_to_next)
8965 (get_visually_first_element, compute_stop_pos_backwards)
8966 (handle_stop_backwards, next_element_from_buffer)
8967 (move_it_in_display_line_to, move_it_in_display_line)
8968 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8969 (add_to_log, message_dolog, message_log_check_duplicate)
8970 (message2, message2_nolog, message3, message3_nolog
8971 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8972 (current_message_1, truncate_echo_area, truncate_message_1)
8973 (set_message, set_message_1, store_mode_line_noprop)
8974 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8975 (text_outside_line_unchanged_p, check_point_in_composition)
8976 (reconsider_clip_changes)
8977 (redisplay_internal, set_cursor_from_row, try_scrolling)
8978 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8979 (redisplay_window, find_last_unchanged_at_beg_row)
8980 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8981 (trailing_whitespace_p, find_row_edges, display_line)
8982 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8983 (display_mode_element, store_mode_line_string)
8984 (pint2str, pint2hrstr, decode_mode_spec)
8985 (display_count_lines, display_string, draw_glyphs)
8986 (x_produce_glyphs, x_insert_glyphs)
8987 (rows_from_pos_range, mouse_face_from_buffer_pos)
8988 (fast_find_string_pos, mouse_face_from_string_pos)
8989 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8990 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8991 (safe_call, init_from_display_pos, handle_fontified_prop)
8992 (handle_single_display_spec, load_overlay_strings)
8993 (with_echo_area_buffer, setup_echo_area_for_printing)
8994 (display_echo_area, echo_area_display)
8995 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8996 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8997 (redisplay_window, dump_glyph_row, display_mode_line)
8998 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8999 (handle_display_spec, display_prop_string_p):
9000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9001 (handle_single_display_spec, build_desired_tool_bar_string)
9002 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9003 (get_specified_cursor_type):
9004 Check that fixnums are in proper range for system types.
9005 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9006 (Flookup_image_map):
9007 Don't assume fixnums fit in int.
9008 (compare_overlay_entries):
9009 Avoid mishandling comparisons due to subtraction overflow.
9010 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9011 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9012 (handle_tool_bar_click):
9013 Use int, not unsigned, since we prefer signed and the signedness
9014 doesn't matter here.
9015 (get_next_display_element, next_element_from_display_vector):
9016 Use int, not EMACS_INT, when int is wide enough.
9017 (start_hourglass): Use duration_to_sec_usec to do proper
9018 overflow checking on durations.
9019 * xfaces.c (Fbitmap_spec_p):
9020 Check that fixnums are in proper range for system types.
9021 (compare_fonts_by_sort_order):
9022 Avoid mishandling comparisons due to subtraction overflow.
9023 (Fx_family_fonts, realize_basic_faces):
9024 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9025 (Fx_family_fonts):
9026 Don't assume fixnum fits in int.
9027 Use SAFE_ALLOCA_LISP, not alloca.
9028 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9029 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9030 (face_at_buffer_position, face_for_overlay_string)
9031 (face_at_string_position):
9032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9033 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9034 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9035 (Fx_show_tip):
9036 Check that fixnums are in proper range for system types.
9037 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9038 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9040 (Fx_change_window_property): Don't assume fixnums fit in int.
9041 * xfont.c (xfont_chars_supported):
9042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9043 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9044 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9046 * xml.c (parse_region):
9047 * xrdb.c (magic_file_p):
9048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9049 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9050 (x_get_local_selection, x_reply_selection_request)
9051 (x_handle_selection_request, wait_for_property_change):
9052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9053 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9054 short is wide enough.
9055 (x_send_client_event): Don't assume fixnum fits in int.
9056 * xterm.c (x_x_to_emacs_modifiers):
9057 Don't assume EMACS_INT overflows nicely into int.
9058 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9059 may come from Lisp.
9060 (handle_one_xevent): NATNUMP can eval its arg twice.
9061 (x_connection_closed):
9062 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9063 * xterm.h: Adjust decls to match defn changes elsewhere.
9064 (struct scroll_bar): Use struct vectorlike_header
9065 rather than rolling our own approximation.
9066 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9067
9068 2012-05-25 Glenn Morris <rgm@gnu.org>
9069
9070 * lisp.mk (lisp): Update for more files being compiled now.
9071
9072 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9073
9074 * lread.c: Remove `read_pure' which makes no difference.
9075 (read_pure): Remove var.
9076 (unreadpure): Remove function.
9077 (readevalloop): Don't call read_list with -1 flag.
9078 (read1, read_vector): Don't test read_pure any more.
9079 (read_list): Simplify.
9080
9081 * fileio.c, character.h: Minor style tweaks.
9082
9083 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9084
9085 * window.h (clip_changed): Remove useless declaration.
9086
9087 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9088
9089 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9090 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9091
9092 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9093
9094 Remove src/m/*.
9095 This directory predates autoconf and is no longer needed nowadays.
9096 Move its few remaining bits of functionality to where they're needed.
9097 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9098 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9099 * m/template.h: Remove.
9100 * Makefile.in (M_FILE): Remove. All uses removed.
9101 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9102 * lisp.h (USE_LSB_TAG):
9103 * mem-limits.h (EXCEEDS_LISP_PTR):
9104 Use VAL_MAX, not VALBITS, in #if.
9105 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9106 (EMACS_UINT): Define unconditionally now.
9107 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9108 (BITS_PER_EMACS_INT): New constants, replacing
9109 what used to be in config.h, but not useful in #if.
9110 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9111 define them any more.
9112 (VAL_MAX): New macro.
9113 (VALMASK): Use it.
9114 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9115 BITS_PER_EMACS_INT, in #if.
9116 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9117 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9118 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9119 * s/ms-w32.h (DATA_START):
9120 Move here from removed file m/intel386.h.
9121 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9122 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9123
9124 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9125
9126 Assume C89 or later.
9127 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9128 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9129 (xrealloc):
9130 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9131 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9132 * textprop.c, tparam.c (NULL): Remove.
9133 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9134 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9135 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9136 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9137 * xterm.c (input_signal_count): Assume volatile works.
9138
9139 2012-05-21 Ken Brown <kbrown@cornell.edu>
9140
9141 * xgselect.c (xg_select): Fix first argument in call to 'select'
9142 (bug#11508).
9143
9144 2012-05-20 Ken Brown <kbrown@cornell.edu>
9145
9146 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9147 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9148
9149 2012-05-19 Ken Brown <kbrown@cornell.edu>
9150
9151 * xfns.c (x_in_use): Remove `static' qualifier.
9152 * xterm.h (x_in_use): Declare.
9153 * xgselect.c: Include xterm.h.
9154 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9155 and `display_arg' (bug#9754).
9156
9157 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9160
9161 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9162 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9163
9164 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9165
9166 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9167
9168 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9169 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9170
9171 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9172 reference to image_cache->refcount.
9173 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9174
9175 2012-05-17 Juri Linkov <juri@jurta.org>
9176
9177 * search.c (Fword_search_regexp, Fword_search_backward)
9178 (Fword_search_forward, Fword_search_backward_lax)
9179 (Fword_search_forward_lax): Move functions to isearch.el
9180 (bug#10145, bug#11381).
9181
9182 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9183
9184 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9185
9186 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9187
9188 * lread.c (init_obarray): Declare Qt and Qnil as special.
9189
9190 2012-05-14 Glenn Morris <rgm@gnu.org>
9191
9192 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9193 Put "libexec" before "bin", for the sake of init_callproc_1.
9194
9195 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9196
9197 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9198
9199 * unexaix.c: Port to more-recent AIX compilers.
9200 (report_error, report_error_1, make_hdr, copy_sym)
9201 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9202 Make arguments const char *, not char *, to avoid violations of C
9203 standard and to fix some AIX warnings reported by Gilles Pion.
9204
9205 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9206
9207 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9208 already have overlays loaded.
9209 (handle_single_display_spec): Before returning without displaying
9210 fringe bitmap, synchronize the bidi iterator with the main display
9211 iterator, by calling iterate_out_of_display_property.
9212 (iterate_out_of_display_property): Detect buffer iteration by
9213 testing that it->string is a Lisp string.
9214 (get_next_display_element): When the current object is exhausted,
9215 and there's something on it->stack, call set_iterator_to_next to
9216 proceed with what's on the stack, instead of returning zero.
9217 (set_iterator_to_next): If called at the end of a Lisp string,
9218 proceed to consider_string_end without incrementing string
9219 position. Don't increment display vector index past the end of
9220 the display vector. (Bug#11417)
9221 (pos_visible_p): Don't report a position visible when move_it_to
9222 stopped at the last line of window, which happens to be scanned
9223 backwards by the bidi iteration. (Bug#11464)
9224
9225 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9226
9227 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9228 and right-margin display specs even if the spec is invalid or we
9229 are on a TTY, and thus unable to display on the fringes.
9230 That's because the text with the property will not be displayed anyway,
9231 so we need to signal to the caller that this is a "replacing"
9232 display spec. This fixes display when the spec is invalid or we
9233 are on a TTY.
9234
9235 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9236
9237 * unexaix.c (make_hdr): Fix typo in prototype.
9238 This bug broke the build on AIX. Problem reported by Gilles Pion.
9239
9240 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9241
9242 * keyboard.c (kbd_buffer_get_event): Read special events also in
9243 batch mode. (Bug#11415)
9244
9245 2012-05-12 Glenn Morris <rgm@gnu.org>
9246
9247 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9248
9249 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9250
9251 * lisp.mk (lisp): Add newcomment.elc.
9252
9253 2012-05-12 Glenn Morris <rgm@gnu.org>
9254
9255 * Makefile.in (MKDIR_P): New, set by configure.
9256 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9257
9258 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9259
9260 Remove unused function hourglass_started.
9261 * dispextern.h (hourglass_started):
9262 * w32fns.c (hourglass_started):
9263 * xdisp.c (hourglass_started): Remove.
9264
9265 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9266
9267 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9268 Update dependencies.
9269
9270 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9271
9272 * xgselect.c (xg_select): Put maxfds+1 into a var.
9273 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9274
9275 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9276
9277 2012-05-10 Dave Abrahams <dave@boostpro.com>
9278
9279 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9280 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9281
9282 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9283
9284 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9285 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9286 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9287 Initialize xd_registered_buses.
9288
9289 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9290
9291 Untag more efficiently if USE_LSB_TAG.
9292 This is based on a proposal by YAMAMOTO Mitsuharu in
9293 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9294 For an admittedly artificial (nth 8000 longlist) benchmark on
9295 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9296 Emacs's overall text size by 1%.
9297 * lisp.h (XUNTAG): New macro.
9298 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9299 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9300 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9301 * eval.c (Fautoload):
9302 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9303 * frame.h (XFRAME): Use XUNTAG.
9304
9305 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9306 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9307 Remove unportable assumptions about print widths of types like
9308 dbus_uint32_t.
9309 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9310 intptr_t when converting between pointer and integer, to avoid GCC
9311 warnings about wrong width.
9312
9313 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9314
9315 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9316 stack for each reader_thread, instead of defaulting to 8MB
9317 determined by the linker. This avoids failures in creating
9318 subprocesses on Windows 7, see the discussion in this thread:
9319 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9320
9321 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9322
9323 Fix up display of the *Minibuf-0* buffer in the mini window.
9324 * keyboard.c (read_char): Don't clear the echo area if there's no
9325 message to clear.
9326 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9327 contents of *Minibuf-0*) if there's no message displayed in its stead.
9328
9329 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9330
9331 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9332 batch mode.
9333
9334 2012-05-06 Chong Yidong <cyd@gnu.org>
9335
9336 * lisp.mk (lisp): Update.
9337
9338 2012-05-05 Jim Meyering <meyering@redhat.com>
9339
9340 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9341
9342 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9343
9344 * data.c (PUT_ERROR): New macro.
9345 (syms_of_data): Use it. Add new error type `user-error'.
9346 * undo.c (user_error): New function.
9347 (Fprimitive_undo): Use it.
9348 * print.c (print_error_message): Adjust print style for `user-error'.
9349 * keyboard.c (user_error): New function.
9350 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9351
9352 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9353
9354 Do not limit current-time-string to years 1000..9999.
9355 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9356 (Fcurrent_time_string): Support any year that is supported by the
9357 underlying localtime representation. Don't use asctime, as it
9358 has undefined behavior for years outside the range -999..9999.
9359
9360 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9361
9362 Fix race conditions involving setenv, gmtime, localtime, asctime.
9363 Without this fix, interrupts could mess up code that uses these
9364 nonreentrant functions, since setting TZ invalidates existing
9365 tm_zone or tzname values, and since most of these functions return
9366 pointers to static storage.
9367 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9368 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9369 Grow the critical sections to include not just invoking
9370 localtime/gmtime, but also accessing these functions' results
9371 including their tm_zone values if any, and any related TZ setting.
9372 (format_time_string): Last arg is now struct tm *, not struct tm **,
9373 so that the struct tm is saved in the critical section.
9374 All callers changed. Simplify allocation of initial buffer, partly
9375 motivated by the fact that memory allocation needs to be outside
9376 the critical section.
9377
9378 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9379
9380 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9381 with RESET_INTERVAL.
9382
9383 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9384 Remove duplicated buffer name initialization.
9385
9386 2012-05-02 Jim Meyering <jim@meyering.net>
9387
9388 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9389
9390 * xfns.c (x_window): Use xstrdup (Bug#11375).
9391
9392 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9393
9394 * xdisp.c (pos_visible_p): If already at a newline from the
9395 display string before the 'while' loop, don't walk back the glyphs
9396 from it3.glyph_row. Solves assertion violation when the display
9397 string begins with a newline (egg.el). (Bug#11367)
9398
9399 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9400
9401 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9402 Move to simple.el.
9403
9404 2012-05-01 Glenn Morris <rgm@gnu.org>
9405
9406 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9407 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9408 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9409 All were removed before 23.1.
9410
9411 * dispnew.c: Remove HAVE_LIBNCURSES test;
9412 it is always true on relevant platforms.
9413
9414 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9415 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9416
9417 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9418
9419 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9420
9421 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9422 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9423 Remove.
9424
9425 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9426
9427 Do not avoid creating empty evaporating overlays (Bug#9642).
9428 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9429 That is, do not delete an evaporating overlay if it becomes
9430 empty after its bounds are adjusted to fit within its buffer.
9431 This fix caused other problems, and I'm reverting it until we get
9432 to the bottom of them.
9433
9434 2012-04-27 Chong Yidong <cyd@gnu.org>
9435
9436 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9437
9438 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9439
9440 * xdisp.c (pos_visible_p): If the window start position is beyond
9441 ZV, start the display from buffer beginning. Prevents assertion
9442 violation in init_iterator when the minibuffer window is scrolled
9443 via the scroll bar.
9444
9445 * window.c (window_scroll_pixel_based): Likewise.
9446
9447 2012-04-27 Chong Yidong <cyd@gnu.org>
9448
9449 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9450
9451 2012-04-27 Glenn Morris <rgm@gnu.org>
9452
9453 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9454 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9455
9456 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9457
9458 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9459 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9460
9461 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9462
9463 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9464 display element, check also the underlying string or buffer
9465 character. (Bug#11341)
9466
9467 * w32menu.c: Include w32heap.h.
9468 (add_menu_item): If the call to AppendMenuW (via
9469 unicode_append_menu) fails, disable Unicode menus only if we are
9470 running on Windows 9X/Me.
9471
9472 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9473
9474 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9475 (xgetint): Add missing shift for LSB tags.
9476
9477 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9478
9479 * keyboard.c (read_char): Don't wipe echo area for select window
9480 events: These might get delayed via `mouse-autoselect-window'
9481 (Bug#11304).
9482
9483 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9484
9485 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9486 manipulation of :loaded-from data.
9487
9488 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9489
9490 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9491 now a cons (bug#11311).
9492
9493 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9494
9495 Do not create empty overlays with the evaporate property (Bug#9642).
9496 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9497 if it becomes empty after its bounds are adjusted to fit within
9498 its buffer. Without this fix, in a nonempty buffer (let ((o
9499 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9500 yields an empty overlay that has the evaporate property, which is
9501 not supposed to happen.
9502
9503 Fix minor GTK3 problems found by static checking.
9504 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9505 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9506 (struct _EmacsFixedClass, emacs_fixed_get_type):
9507 Move decls here from emacsgtkfixed.h, since they needn't be public.
9508 (emacs_fixed_get_type): Now static.
9509 (emacs_fixed_class_init): Omit unused local.
9510 (emacs_fixed_child_type): Remove; unused.
9511 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9512 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9513 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9514 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9515 (EMACS_FIXED_GET_CLASS): Remove; unused.
9516 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9517
9518 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9519 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9520
9521 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9522
9523 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9524 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9525 (__malloc_size_t, __malloc_ptrdiff_t):
9526 Remove. All uses removed, replaced by the definiens if needed,
9527 since we can assume C89 or better now.
9528 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9529 (protect_malloc_state, align, get_contiguous_space)
9530 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9531 (malloc_atfork_handler_child, malloc_enable_thread)
9532 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9533 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9534 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9535 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9536 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9537 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9538 Define using prototypes, not old style.
9539 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9540 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9541 (align): Don't assume that signed integer overflow wraps around.
9542 Omit unused local var.
9543 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9544 (_free_internal_nolock, memalign, mallochook, reallochook):
9545 Omit no-longer-needed casts.
9546 (valloc): Use getpagesize, not __getpagesize.
9547 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9548 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9549
9550 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9551
9552 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9553
9554 Move functions from C to Lisp. Make non-blocking method calls
9555 the default. Implement further D-Bus standard interfaces.
9556
9557 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9558 (QCdbus_request_name_allow_replacement)
9559 (QCdbus_request_name_replace_existing)
9560 (QCdbus_request_name_do_not_queue)
9561 (QCdbus_request_name_reply_primary_owner)
9562 (QCdbus_request_name_reply_in_queue)
9563 (QCdbus_request_name_reply_exists)
9564 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9565 (QCdbus_registered_serial, QCdbus_registered_method)
9566 (QCdbus_registered_signal): New Lisp objects.
9567 (XD_DEBUG_MESSAGE): Use sizeof.
9568 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9569 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9570 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9571 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9572 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9573 (xd_signature, xd_append_arg): Allow float for integer types.
9574 (xd_get_connection_references): New function.
9575 (xd_get_connection_address): Rename from xd_initialize.
9576 Return cached address.
9577 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9578 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9579 level.
9580 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9581 Return number of refcounts.
9582 (Fdbus_get_unique_name): Make stronger parameter check.
9583 (Fdbus_message_internal): New defun.
9584 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9585 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9586 (Fdbus_send_signal, Fdbus_register_service)
9587 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9588 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9589 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9590 (Vdbus_compiled_version, Vdbus_runtime_version)
9591 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9592 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9593 (Vdbus_message_type_signal): New defvars.
9594 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9595 Adapt docstring.
9596
9597 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9600 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9601 Do not assume ptrdiff_t is the same width as 'int'.
9602
9603 * alloc.c: Handle unusual debugging option combinations.
9604 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9605 since the two debugging options are incompatible.
9606 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9607 is defined.
9608 (mem_init, mem_insert, mem_insert_fixup):
9609 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9610 (NEED_MEM_INSERT): Remove; no longer needed.
9611
9612 2012-04-22 Leo Liu <sdl.web@gmail.com>
9613
9614 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9615
9616 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9617
9618 * sysdep.c [__FreeBSD__]: Minor cleanups.
9619 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9620 Use Emacs indenting style more consistently. Avoid some casts.
9621 Use 'double' consistently rather than mixing 'float' and 'double'.
9622
9623 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9624
9625 * sysdep.c (list_system_processes, system_process_attributes):
9626 Add implementation for FreeBSD (Bug#5243).
9627
9628 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9629
9630 * lisp.mk (lisp): Update.
9631
9632 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9633
9634 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9635 It is never used otherwise.
9636
9637 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9638
9639 * print.c (print_preprocess): Only check print_depth if print-circle
9640 is nil.
9641 (print_object): Check for cycles even when print-circle is nil and
9642 print-gensym is t, but only check print_depth if print-circle is nil.
9643
9644 2012-04-20 Chong Yidong <cyd@gnu.org>
9645
9646 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9647 set the status to "failed" and ensure that sentinel is run.
9648
9649 2012-04-20 Glenn Morris <rgm@gnu.org>
9650
9651 * process.c (Fset_process_inherit_coding_system_flag)
9652 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9653 (Fmake_network_process, Fmake_serial_process): Doc fix.
9654
9655 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9656
9657 * xdisp.c (string_buffer_position_lim): Limit starting position to
9658 BEGV.
9659 (set_cursor_from_row): If called for a mode-line or header-line
9660 row, return zero immediately.
9661 (try_cursor_movement): If inside continuation line, don't back up
9662 farther than the first row after the header line, if any.
9663 Don't consider the header-line row as "partially visible", even if
9664 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9665
9666 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9667
9668 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9669 (bug#11238).
9670
9671 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9672 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9673
9674 configure: new option --enable-gcc-warnings (Bug#11207)
9675 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9676 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9677 (ALL_CFLAGS): Use new macros rather than old.
9678 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9679 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9680 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9681 -Wunused-result, -Wunused-variable. This should go away once
9682 the Emacs and Gnulib regex code is merged.
9683 (xmalloc, xrealloc): Now static.
9684
9685 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9686
9687 * dired.c (Fsystem_groups): Remove unused local.
9688
9689 2012-04-17 Glenn Morris <rgm@gnu.org>
9690
9691 * dired.c (Fsystem_users): Doc fix.
9692
9693 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9694
9695 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9696 (syms_of_dired): Add them.
9697
9698 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9699
9700 Fix minor alloc.c problems found by static checking.
9701 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9702 New extern decls, to avoid calling undeclared functions.
9703 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9704 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9705 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9706 (NEED_MEM_INSERT): New macro.
9707 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9708 Remove one incorrect comment and fix another.
9709
9710 Fix minor ralloc.c problems found by static checking.
9711 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9712 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9713 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9714 (r_alloc_sbrk): Now static.
9715
9716 Improve ralloc.c interface checking.
9717 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9718 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9719 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9720 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9721 [REL_ALLOC]: ... to here, to check interface.
9722 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9723 Remove decls. This fixes an "It stinks!".
9724
9725 * alloc.c (which_symbols): Fix alignment issue / type clash.
9726
9727 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9728
9729 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9730 (struct Lisp_Misc_Any): Likewise.
9731 (struct Lisp_Free): Likewise.
9732 * alloc.c (union aligned_Lisp_Symbol): Define.
9733 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9734 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9735 (union aligned_Lisp_Misc): Define.
9736 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9737 aligned_Lisp_Misc instead of union Lisp_Misc.
9738 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9739
9740 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9741
9742 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9743 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9744 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9745 * s/netbsd.h, s/sol2-6.h:
9746 Remove definition of GC_MARK_STACK, since the default now works.
9747 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9748 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9749 no longer the default.
9750 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9751
9752 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9753
9754 * lread.c (lisp_file_lexically_bound_p):
9755 Fix hang at ";-*-\n" (bug#11238).
9756
9757 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9758
9759 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9760 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9761
9762 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9763
9764 * nsterm.m (constrainFrameRect): Always constrain when there is only
9765 one screen (Bug#10962).
9766
9767 2012-04-13 Ken Brown <kbrown@cornell.edu>
9768
9769 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9770
9771 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9772
9773 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9774
9775 2012-04-11 Daniel Colascione <dancol@dancol.org>
9776
9777 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9778 against is gone. It's better to use vfork now so that when Cygwin
9779 gains a new, working vfork, we use it automatically (bug#10398).
9780
9781 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9782
9783 * window.c (save_window_save): Obey window-point-insertion-type.
9784
9785 2012-04-11 Glenn Morris <rgm@gnu.org>
9786
9787 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9788
9789 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9790
9791 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9792
9793 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9794
9795 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9796 (force_quit_count): New var.
9797 (handle_interrupt): Use it.
9798
9799 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9800
9801 * w32.c (w32_delayed_load): Record the full path of the library
9802 being loaded (bug#10424).
9803
9804 2012-04-09 Glenn Morris <rgm@gnu.org>
9805
9806 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9807 not just in the obarray, before snarfing them. (Bug#11036)
9808
9809 * Makefile.in ($(leimdir)/leim-list.el):
9810 Pass EMACS rather than BUILT_EMACS.
9811
9812 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9813
9814 * process.c (make_process):
9815 * process.h: Add integer `gnutls_handshakes_tried' member to
9816 process struct.
9817
9818 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9819 Add convenience `GNUTLS_LOG2i' macro.
9820
9821 * gnutls.c (gnutls_log_function2i): Convenience log function.
9822 (emacs_gnutls_read): Use new log functions,
9823 `gnutls_handshakes_tried' process member, and
9824 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9825 attempts per process (connection).
9826
9827 2012-04-09 Chong Yidong <cyd@gnu.org>
9828
9829 * eval.c (Fuser_variable_p, user_variable_p_eh)
9830 (lisp_indirect_variable): Functions deleted.
9831 (Fdefvar): Caller changed.
9832
9833 * callint.c (Finteractive, Fcall_interactively):
9834 * minibuf.c (Fread_variable): Callers changed.
9835
9836 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9837
9838 * xdisp.c (set_cursor_from_row): If the display string appears in
9839 the buffer at position that is closer to point than the position
9840 after the display string, display the cursor on the first glyph of
9841 the display string. Fixes cursor display when a 'display' text
9842 property immediately follows invisible text. (Bug#11094)
9843
9844 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9845
9846 composite.c: use 'double' consistently
9847 * composite.c (get_composition_id): Use 'double' consistently
9848 instead of converting 'float' to 'double' and vice versa; this is
9849 easier to understand and avoids a GCC warning.
9850
9851 2012-04-09 Glenn Morris <rgm@gnu.org>
9852
9853 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9854 preparation for dumping it with emacs. (Bug#4789)
9855 (leimdir): New variable.
9856 ($(leimdir)/leim-list.el): New rule.
9857 (emacs$(EXEEXT)): Depend on leim-list.el.
9858
9859 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9860 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9861 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9862
9863 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9864
9865 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9866 proper alignment.
9867
9868 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9869
9870 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9871 Remove unused local variable.
9872
9873 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9876 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9877 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9878 objects, as mark_maybe_pointer will catch them otherwise.
9879 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9880 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9881
9882 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9883
9884 Fix typo that broke non-Windows builds.
9885 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9886
9887 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9888
9889 Support building on MS-Windows with libxml2.
9890
9891 * makefile.w32-in (OBJ2): Add xml.$(O).
9892 (GLOBAL_SOURCES): Add xml.c.
9893 ($(BLD)/xml.$(O)): New dependency list.
9894
9895 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9896 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9897 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9898 [!WINDOWSNT]: New macros.
9899 (init_libxml2_functions, libxml2_loaded_p): New functions.
9900 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9901 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9902 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9903 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9904 linked in).
9905 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9906 Call init_libxml2_functions before calling libxml2 functions.
9907 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9908
9909 * emacs.c: Don't include libxml/parser.h.
9910 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9911 xmlCleanupParser directly.
9912
9913 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9914
9915 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9916
9917 * indent.c (Fvertical_motion): If there is a display string at
9918 point, use it.vpos to compute how many lines to backtrack after
9919 move_it_to point. (Bug#11133)
9920
9921 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9922
9923 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9924 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9925 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9926 macros related to unification of CJK characters. For the details,
9927 see the discussion following the message here:
9928 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9929
9930 2012-04-04 Chong Yidong <cyd@gnu.org>
9931
9932 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9933
9934 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9935
9936 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9937 instead of alloca. (Bug#11138)
9938
9939 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9940
9941 * w32menu.c (is_simple_dialog): Properly check lisp types.
9942 (Bug#11141)
9943
9944 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9945
9946 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9947 position we get to after a call to move_it_to fails the
9948 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9949 only if we wind up in a string from display property. (Bug#11063)
9950
9951 * window.c (Fdelete_other_windows_internal): Invalidate the row
9952 and column information about mouse highlight, so that redisplay
9953 restores it after reallocating the glyph matrices. (Bug#7464)
9954
9955 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9956 string comes from a `display' text property, use the buffer
9957 position of that property as if we actually saw that position in
9958 the row's glyphs.
9959 (move_it_by_lines): Remove the assertion that
9960 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9961 violated when there's a before-string at the beginning of a line.
9962 (Bug#11063)
9963
9964 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9965
9966 * xdisp.c (append_space_for_newline): If the default face was
9967 remapped, use the remapped face for the appended newline.
9968 (extend_face_to_end_of_line): Use the remapped default face for
9969 extending the face to the end of the line.
9970 (display_line): Call extend_face_to_end_of_line when the default
9971 face was remapped. (Bug#11068)
9972
9973 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9974
9975 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9976
9977 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9978
9979 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9980
9981 2012-03-27 Glenn Morris <rgm@gnu.org>
9982
9983 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9984 Doc fixes.
9985
9986 2012-03-26 Kenichi Handa <handa@m17n.org>
9987
9988 * dispextern.h (struct glyph): Fix previous change. Change the
9989 bit length of glyphless.ch to 25 (Bug#11082).
9990
9991 2012-03-26 Chong Yidong <cyd@gnu.org>
9992
9993 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9994 (command_loop_1): Use it; inhibit selection update for
9995 handle-select-window too (Bug#8996).
9996
9997 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9998
9999 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
10000
10001 2012-03-25 Kenichi Handa <handa@m17n.org>
10002
10003 * dispextern.h (struct glyph): Change the bit length of
10004 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10005
10006 2012-03-24 Eli Zaretskii <eliz@gnu.org>
10007
10008 * s/ms-w32.h (tzname): Include time.h before redirecting to
10009 _tzname. Fixes the MSVC build. (Bug#9960)
10010
10011 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10012
10013 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10014 characters.
10015
10016 * xterm.c (XTread_socket): Only modify handling_signal if
10017 !SYNC_INPUT. (Bug#11080)
10018
10019 2012-03-23 Eli Zaretskii <eliz@gnu.org>
10020
10021 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10022 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10023 when fetching a multibyte character consumes more bytes than
10024 CHAR_BYTES returns, due to unification of CJK characters in
10025 string_char. (Bug#11073)
10026
10027 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10028
10029 * process.c (wait_reading_process_output): Handle pty disconnect
10030 by refraining from sending oneself a SIGCHLD (bug#10933).
10031
10032 2012-03-22 Chong Yidong <cyd@gnu.org>
10033
10034 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10035
10036 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
10037 Mark string as coming from a prefix property.
10038 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10039 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10040
10041 2012-03-21 Chong Yidong <cyd@gnu.org>
10042
10043 * xfaces.c (Vface_remapping_alist): Doc fix.
10044
10045 2012-03-20 Eli Zaretskii <eliz@gnu.org>
10046
10047 * w32proc.c (Fw32_set_console_codepage)
10048 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10049 Doc fixes.
10050
10051 2012-03-20 Chong Yidong <cyd@gnu.org>
10052
10053 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10054 to reflect default non-nil value of redisplay-dont-pause.
10055
10056 2012-03-19 Kenichi Handa <handa@m17n.org>
10057
10058 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10059 it fit in a valid range (Bug#11003).
10060
10061 2012-03-18 Eli Zaretskii <eliz@gnu.org>
10062
10063 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10064 that is not from display property, accept the row as a "cursor
10065 row" if one of the string's character has a non-nil `cursor'
10066 property. Fixes cursor positioning when there are newlines in
10067 overlay strings, e.g. in icomplete.el. (Bug#11035)
10068
10069 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10070
10071 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10072
10073 2012-03-12 Chong Yidong <cyd@gnu.org>
10074
10075 * eval.c (inhibit_lisp_code): Rename from
10076 inhibit_window_configuration_change_hook; move from window.c.
10077
10078 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10079 * window.c (run_window_configuration_change_hook)
10080 (syms_of_window): Callers changed.
10081
10082 2012-03-11 Chong Yidong <cyd@gnu.org>
10083
10084 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10085
10086 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10087
10088 2012-03-10 Chong Yidong <cyd@gnu.org>
10089
10090 * frame.c (other_visible_frames): Don't assume the selected frame
10091 is visible (Bug#10955).
10092
10093 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10094
10095 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10096
10097 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10098
10099 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10100 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10101 zero (Bug#10954).
10102
10103 2012-03-03 Glenn Morris <rgm@gnu.org>
10104
10105 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10106
10107 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10108
10109 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10110 position past the first glyph_row that ends at ZV. (Bug#10902)
10111 (redisplay_window, next_element_from_string): Fix typos in
10112 comments.
10113 (redisplay_window): Pass to move_it_vertically the margin in
10114 pixels, not in screen lines.
10115
10116 2012-03-02 Glenn Morris <rgm@gnu.org>
10117
10118 * buffer.c (buffer-list-update-hook): Doc fix.
10119
10120 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10121
10122 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10123 push_it before setting up the iterator for the first overlay
10124 string, even if we have an empty string loaded.
10125 (next_overlay_string): If there's an empty string on the iterator
10126 stack, pop the stack. (Bug#10903)
10127
10128 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10129
10130 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10131 Suggested by Stefan Monnier in
10132 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10133 * alloc.c (widen_to_Lisp_Object): New static function.
10134 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10135 and widening them to Lisp_Objects. This would work even if
10136 USE_LSB_TAG is defined and wide integers are used, which might
10137 happen in a future version of Emacs.
10138
10139 2012-02-25 Chong Yidong <cyd@gnu.org>
10140
10141 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10142 Doc fix.
10143
10144 * xselect.c (Fx_selection_exists_p): Doc fix.
10145 (x_clipboard_manager_save_all): Print an informative message
10146 before saving to clipboard manager.
10147
10148 2012-02-24 Chong Yidong <cyd@gnu.org>
10149
10150 * keyboard.c (process_special_events): Handle all X selection
10151 requests in kbd_buffer, not just the next one (Bug#8869).
10152
10153 2012-02-23 Chong Yidong <cyd@gnu.org>
10154
10155 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10156 call when setting menu-bar-lines and tool-bar-lines parameters.
10157 (unwind_create_frame_1): New helper function.
10158
10159 * window.c (inhibit_window_configuration_change_hook): New var.
10160 (run_window_configuration_change_hook): Obey it.
10161 (syms_of_window): Initialize it.
10162
10163 2012-02-22 Chong Yidong <cyd@gnu.org>
10164
10165 * xterm.c (x_draw_image_relief): Add missing type check for
10166 Vtool_bar_button_margin (Bug#10743).
10167
10168 2012-02-21 Chong Yidong <cyd@gnu.org>
10169
10170 * fileio.c (Vfile_name_handler_alist): Doc fix.
10171
10172 * buffer.c (Fget_file_buffer): Protect against invalid file
10173 handler return value.
10174
10175 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10176
10177 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10178 when computing $valmask.
10179
10180 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10181 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10182 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10183 It's useless in that case, and it can cause problems on hosts
10184 that allocate halves of EMACS_INT values separately.
10185 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10186 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10187 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10188 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10189 it avoids undefined behavior on hosts where shifting right by more
10190 than the word width has undefined behavior.
10191
10192 2012-02-19 Chong Yidong <cyd@gnu.org>
10193
10194 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10195 (Funhandled_file_name_directory, Ffile_name_as_directory)
10196 (Fdirectory_file_name, Fexpand_file_name)
10197 (Fsubstitute_in_file_name): Protect against invalid file handler
10198 return values (Bug#10845).
10199
10200 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10201
10202 * .gdbinit (pitx): Fix incorrect references to fields of the
10203 iterator stack.
10204
10205 2012-02-17 Chong Yidong <cyd@gnu.org>
10206
10207 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10208
10209 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10210
10211 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10212 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10213
10214 2012-02-15 Chong Yidong <cyd@gnu.org>
10215
10216 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10217 marked as special. Also, starting docstrings with * is obsolete.
10218
10219 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10220
10221 * gnutls.c (emacs_gnutls_write): Fix last change.
10222
10223 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10224
10225 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10226 send_process.
10227
10228 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10229
10230 * keymap.c (Fsingle_key_description): Handle char ranges.
10231
10232 2012-02-12 Chong Yidong <cyd@gnu.org>
10233
10234 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10235 as that creates a dangerous corner case.
10236
10237 * window.c (Fdelete_window_internal): Invalidate the mouse
10238 highlight (Bug#9904).
10239
10240 2012-02-12 Glenn Morris <rgm@gnu.org>
10241
10242 * xselect.c (Fx_own_selection_internal)
10243 (Fx_get_selection_internal, Fx_disown_selection_internal)
10244 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10245 * nsselect.m (Fx_own_selection_internal)
10246 (Fx_disown_selection_internal, Fx_selection_exists_p)
10247 (Fx_selection_owner_p, Fx_get_selection_internal):
10248 Sync docs and argument specs with the xselect.c versions.
10249
10250 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10251
10252 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10253
10254 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10255
10256 * w32select.c (Fx_selection_exists_p): Sync doc string and
10257 argument list with xselect.c. (Bug#10783)
10258
10259 * w16select.c (Fx_selection_exists_p): Sync doc string and
10260 argument list with xselect.c. (Bug#10783)
10261
10262 2012-02-10 Glenn Morris <rgm@gnu.org>
10263
10264 * fns.c (Fsecure_hash): Doc fix.
10265
10266 2012-02-09 Kenichi Handa <handa@m17n.org>
10267
10268 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10269
10270 2012-02-07 Chong Yidong <cyd@gnu.org>
10271
10272 * buffer.c (Fbuffer_local_variables)
10273 (buffer_lisp_local_variables): Handle unbound vars correctly;
10274 don't let Qunbound leak into Lisp.
10275
10276 2012-02-07 Glenn Morris <rgm@gnu.org>
10277
10278 * image.c (Fimagemagick_types): Doc fix.
10279
10280 * image.c (imagemagick-render-type): Change it from a lisp object
10281 to an integer. Move the doc here from the lisp manual.
10282 Treat all values not equal to 0 the same.
10283
10284 2012-02-06 Chong Yidong <cyd@gnu.org>
10285
10286 * doc.c (store_function_docstring): Avoid applying docstring of
10287 alias to base function (Bug#2603).
10288
10289 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10290
10291 * .gdbinit (pp1, pv1): Remove redundant defines.
10292 (pr): Use pp.
10293
10294 2012-02-04 Chong Yidong <cyd@gnu.org>
10295
10296 * nsterm.m: Declare a global (Bug#10694).
10297
10298 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10299
10300 * w32.c (get_emacs_configuration_options):
10301 Include --enable-checking, if specified, in the return value.
10302
10303 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10304
10305 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10306 after rounding frame sizes. (Bug#9723)
10307
10308 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10309
10310 * keyboard.c (adjust_point_for_property): Don't position point
10311 before BEGV. (Bug#10696)
10312
10313 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10314
10315 Handle overflow when computing char display width (Bug#9496).
10316 * character.c (char_width): Return EMACS_INT, not int.
10317 (char_width, c_string_width): Check for overflow when
10318 computing the width; this is possible now that individual
10319 characters can have unbounded width. Problem introduced
10320 by merge from Emacs 23 on 2012-01-19.
10321
10322 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10323
10324 * dbusbind.c (Fdbus_register_method): Mention the return value
10325 :ignore in the docstring.
10326
10327 2012-02-02 Glenn Morris <rgm@gnu.org>
10328
10329 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10330
10331 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10332 Unconditionally set to t. (Bug#10673)
10333 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10334 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10335 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10336
10337 2012-02-02 Kenichi Handa <handa@m17n.org>
10338
10339 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10340 0, do not call append_composite_glyph.
10341
10342 2012-02-02 Kenichi Handa <handa@m17n.org>
10343
10344 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10345 NULL (Bug#6988).
10346 (x_produce_glyphs): If the component of a composition is a null
10347 string, set it->pixel_width to 1 to avoid zero-width glyph.
10348
10349 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10350
10351 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10352 first 2 arguments are identical. This makes inserting large
10353 output from a subprocess an order of magnitude faster on
10354 MS-Windows, where all sbrk'ed memory is always contiguous.
10355
10356 2012-01-31 Glenn Morris <rgm@gnu.org>
10357
10358 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10359 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10360 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10361
10362 2012-01-29 Glenn Morris <rgm@gnu.org>
10363
10364 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10365
10366 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10367
10368 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10369
10370 2012-01-28 Chong Yidong <cyd@gnu.org>
10371
10372 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10373
10374 2012-01-26 Chong Yidong <cyd@gnu.org>
10375
10376 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10377
10378 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10379 repeat counts (Bug#10507).
10380
10381 2012-01-26 Glenn Morris <rgm@gnu.org>
10382
10383 * lread.c (syms_of_lread): Doc fix.
10384
10385 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10386
10387 * coding.c (encode_designation_at_bol): Change return value to
10388 EMACS_INT.
10389
10390 2012-01-25 Chong Yidong <cyd@gnu.org>
10391
10392 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10393
10394 2012-01-21 Chong Yidong <cyd@gnu.org>
10395
10396 * floatfns.c (Fcopysign): Make the second argument non-optional,
10397 since nil is not allowed anyway.
10398
10399 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10400
10401 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10402 (send_process): Likewise.
10403
10404 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10405
10406 * window.c (save_window_save, Fcurrent_window_configuration)
10407 (Vwindow_persistent_parameters): Do not use Qstate.
10408 Rewrite doc-strings.
10409
10410 2012-01-19 Kenichi Handa <handa@m17n.org>
10411
10412 * character.c (char_width): New function.
10413 (Fchar_width, c_string_width, lisp_string_width):
10414 Use char_width (Bug#9496).
10415
10416 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10417
10418 * window.c (Vwindow_persistent_parameters): New variable.
10419 (Fset_window_configuration, save_window_save): Handle persistent
10420 window parameters.
10421
10422 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10423
10424 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10425 thrashing the stack of the thread. (Bug#9087)
10426
10427 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10428
10429 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10430
10431 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10432
10433 * xdisp.c (rows_from_pos_range): Handle the case where the
10434 highlight ends on a newline. (Bug#10464)
10435 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10436 he end column for display of highlight that ends on a newline
10437 before a R2L line.
10438
10439 2012-01-11 Glenn Morris <rgm@gnu.org>
10440
10441 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10442 from load-path also when installation-directory is nil. (Bug#10208)
10443
10444 2012-01-10 Glenn Morris <rgm@gnu.org>
10445
10446 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10447
10448 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10449 Update template values to be closer to their typical values these days.
10450
10451 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10452
10453 * xdisp.c (rows_from_pos_range): Accept additional argument
10454 DISP_STRING, and accept any glyph in a row whose object is that
10455 string as eligible for mouse highlight. Fixes mouse highlight of
10456 display strings from overlays. (Bug#10464)
10457
10458 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10459
10460 emacs: fix an auto-save permissions race condition (Bug#10400)
10461 * fileio.c (auto_saving_dir_umask): New static var.
10462 (Fmake_directory_internal): Use it.
10463 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10464 creating the directory. The old code temporarily assigns
10465 too-generous permissions to the directory.
10466 (do_auto_save_eh): Clear it.
10467 (Fdo_auto_save): Catch all errors, not just file errors, so
10468 that the var is always cleared.
10469
10470 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10471
10472 * search.c (scan_buffer): Pass character positions to
10473 know_region_cache, not byte positions. (Bug#6540)
10474
10475 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10476
10477 * w32.c (sys_rename): Report EXDEV when rename of a directory
10478 fails because the target is on another logical disk. (Bug#10284)
10479
10480 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10481
10482 * xterm.c (x_embed_request_focus): New function.
10483
10484 * xterm.h: Add prototype.
10485
10486 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10487
10488 2012-01-05 Glenn Morris <rgm@gnu.org>
10489
10490 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10491
10492 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10493
10494 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10495 Load gnutls_transport_set_lowat only if GnuTLS version is below
10496 2.11.1.
10497 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10498 GnuTLS versions below 2.11.1.
10499
10500 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10501
10502 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10503 to the doc string advising against its use for altering the way
10504 windows are scrolled.
10505
10506 2011-12-28 Kenichi Handa <handa@m17n.org>
10507
10508 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10509 coding-system ASCII compatible only when it does not produce BOM
10510 on encoding (Bug#10383).
10511
10512 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10513
10514 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10515 can scroll.
10516 (create_and_show_popup_menu): Always use menu_position_func for
10517 Gtk3 (Bug#10361).
10518
10519 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10520
10521 * callint.c (Fcall_interactively): Don't truncate prompt string.
10522
10523 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10524
10525 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10526 property that ends at ZV, so that the bidi iteration could be
10527 resumed from there (after widening). (Bug#10360)
10528
10529 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10530
10531 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10532
10533 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10534
10535 * nsterm.m (x_free_frame_resources):
10536 Release f->output_data.ns->miniimage.
10537 (ns_index_color): Fix indentation. Do not retain
10538 color_table->colors[i].
10539
10540 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10541 before returning.
10542
10543 * nsfns.m (x_set_background_color): Assign return value from
10544 ns_index_color to face-background instead of NSColor*.
10545 (ns_implicitly_set_icon_type): Fix indentation.
10546 Change assignment in for loop to comparison.
10547
10548 * emacs.c (ns_pool): New variable.
10549 (main): Assign ns_pool.
10550 (Fkill_emacs): Call ns_release_autorelease_pool.
10551
10552 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10553 autorelease fdesc, release fdAttrs and tdict.
10554 (ns_get_covering_families): Release charset.
10555 (ns_findfonts): Release NSFontDescriptor created with new.
10556 (ns_uni_to_glyphs): Fix indentation.
10557 (setString): Release attrStr before assigning new value.
10558
10559 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10560
10561 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10562 and NS_IMPL_COCOA.
10563 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10564 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10565
10566 2011-12-18 David Reitter <reitter@cmu.edu>
10567
10568 * nsterm.m (ns_term_init): Subscribe for notifications
10569 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10570 to method trackingNotification in EmacsMenu.
10571
10572 * nsmenu.m (trackingMenu): New variable.
10573 (trackingNotification): New method (from Aquamacs).
10574 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10575 from Aquamacs (Bug#7030).
10576
10577 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10578
10579 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10580 (symbol_to_nsstring): Fix indentation.
10581 (ns_symbol_to_pb): New function.
10582 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10583 (Fns_rotate_cut_buffers_internal): Remove.
10584 (Fns_store_selection_internal): Rename from
10585 Fns_store_cut_buffer_internal.
10586 (ns_get_foreign_selection, Fx_own_selection_internal)
10587 (Fx_disown_selection_internal, Fx_selection_exists_p)
10588 (Fns_get_selection_internal, Fns_store_selection_internal):
10589 Use ns_symbol_to_pb and check if return value is nil.
10590 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10591 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10592 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10593 renamed to Sns_store_selection_internal.
10594 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10595 and remove this function.
10596 (ns_handle_selection_clear): Remove, never used.
10597 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10598 here.
10599
10600 2011-12-17 Ken Brown <kbrown@cornell.edu>
10601
10602 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10603 GID is unknown (Bug#10257).
10604
10605 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10606
10607 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10608 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10609 which caused a build failure on GNU/Linux IA-64. This problem was
10610 introduced by my 2011-10-07 patch.
10611
10612 2011-12-15 Juri Linkov <juri@jurta.org>
10613
10614 * image.c (imagemagick_error): New function. (Bug#10112)
10615 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10616 Use `imagemagick_error' where ImageMagick functions return
10617 `MagickFalse'.
10618 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10619 proper order.
10620
10621 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10622
10623 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10624 fill background (Bug#8992).
10625
10626 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10627
10628 * window.c (Vwindow_combination_resize)
10629 (Vwindow_combination_limit): Use t instead of non-nil in
10630 doc-strings.
10631 (Vrecenter_redisplay): Add first sentence of doc-string on
10632 separate line.
10633 (Frecenter): Fix doc-string typo.
10634
10635 2011-12-11 Kenichi Handa <handa@m17n.org>
10636
10637 * coding.c (Funencodable_char_position): Pay attention to the
10638 buffer text relocation (Bug#9389).
10639
10640 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10641
10642 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10643 gtk_init (Bug#10100).
10644
10645 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10646
10647 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10648 IT->string is nil. (Bug#10263)
10649
10650 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10651
10652 * nsterm.h (x_free_frame_resources): Declare.
10653
10654 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10655 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10656
10657 * nsterm.h (ns_get_defaults_value): Declare.
10658
10659 * nsterm.m (ns_default): Call ns_get_defaults_value.
10660
10661 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10662
10663 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10664 (Bug#10170)
10665
10666 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10667
10668 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10669 that where the value of an _OBJC_* symbol points to is in the .bss
10670 section (Bug#10240).
10671
10672 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10673
10674 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10675 after the loop to call ccl_driver at least once (Bug#8619).
10676
10677 2011-12-08 Kenichi Handa <handa@m17n.org>
10678
10679 * ftfont.c (get_adstyle_property): Fix previous change
10680 (Bug#10233).
10681
10682 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10683
10684 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10685 dirs from the default value of EMACSLOADPATH (bug#10208).
10686
10687 2011-12-07 Glenn Morris <rgm@gnu.org>
10688
10689 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10690 installation and source directories as well. (Bug#10208)
10691
10692 2011-12-06 Chong Yidong <cyd@gnu.org>
10693
10694 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10695
10696 2011-12-06 Glenn Morris <rgm@gnu.org>
10697
10698 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10699 as an error, not just -1. (Bug#10217)
10700
10701 2011-12-05 Chong Yidong <cyd@gnu.org>
10702
10703 * keyboard.c (process_special_events): New function.
10704 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10705
10706 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10707
10708 * coding.c (encode_designation_at_bol): Don't use uninitialized
10709 local variable (Bug#9318).
10710
10711 2011-12-05 Kenichi Handa <handa@m17n.org>
10712
10713 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10714 return Qnil (Bug#8046, Bug#10193).
10715
10716 2011-12-05 Kenichi Handa <handa@m17n.org>
10717
10718 * coding.c (encode_designation_at_bol): New args charbuf_end and
10719 dst. Return the number of produced bytes. Callers changed.
10720 (coding_set_source): Return how many bytes coding->source was
10721 relocated.
10722 (coding_set_destination): Return how many bytes
10723 coding->destination was relocated.
10724 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10725 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10726
10727 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10728
10729 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10730 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10731 macro (Bug#9318).
10732
10733 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10734
10735 The following changes are to fix Bug#9318.
10736
10737 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10738 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10739 (encode_coding_iso_2022, encode_coding_sjis)
10740 (encode_coding_big5, encode_coding_charset): Use the above macros.
10741
10742 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10743
10744 * lisp.h (process_quit_flag): Fix external declaration.
10745
10746 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10747
10748 Don't macro-inline non-performance-critical code.
10749 * eval.c (process_quit_flag): New function.
10750 * lisp.h (QUIT): Use it.
10751
10752 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10753
10754 * nsfns.m (get_geometry_from_preferences): New function.
10755 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10756
10757 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10758
10759 * emacs.c (Qkill_emacs): Define.
10760 (syms_of_emacs): Initialize it.
10761 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10762 Qquit_flag to `kill-emacs' instead.
10763 (quit_throw_to_read_char): Add parameter `from_signal'.
10764 All callers changed. Call Fkill_emacs if requested and safe.
10765 * lisp.h (QUIT): Call Fkill_emacs if requested.
10766
10767 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10768
10769 * widget.c (update_wm_hints): Return if wmshell is null.
10770 (widget_update_wm_size_hints): New function.
10771
10772 * widget.h (widget_update_wm_size_hints): Declare.
10773
10774 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10775 widget_update_wm_size_hints (Bug#10104).
10776
10777 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10778
10779 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10780 before a newline, prepare the bidi iterator for consuming the
10781 newline, and keep the current paragraph direction. (Bug#10183)
10782 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10783
10784 2011-12-02 Juri Linkov <juri@jurta.org>
10785
10786 * search.c (Fword_search_regexp): New Lisp function created from
10787 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10788 (Fword_search_backward, Fword_search_forward)
10789 (Fword_search_backward_lax, Fword_search_forward_lax):
10790 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10791 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10792
10793 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10794
10795 * fileio.c (Finsert_file_contents): Move after-change-function call
10796 to before the "handled:" label, since all "goto handled" appear in
10797 cases where the *-change-functions have already been properly called
10798 (bug#10117).
10799
10800 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10801
10802 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10803 waiting for input. (Bug#10169)
10804
10805 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10806
10807 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10808 verifies glyph row's hash code--we have just reallocated the
10809 glyphs, so their contents can be complete garbage. (Bug#10164)
10810
10811 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10812
10813 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10814
10815 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10816
10817 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10818 attributes are tested _before_ calling verify_row_hash, to protect
10819 against GCC re-ordering of the tests. (Bug#10164)
10820
10821 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10822
10823 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10824
10825 * xterm.c (handle_one_xevent): Only set async_visible and friends
10826 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10827 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10828 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10829
10830 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10831
10832 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10833 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10834 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10835 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10836 All uses changed to use GCPRO1 etc.
10837 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10838 Revert to old implementation (i.e., before 2011-03-11).
10839
10840 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10841
10842 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10843 of scroll runs so as to avoid assigning disabled bogus rows and
10844 unnecessary graphics copy operations.
10845
10846 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10847
10848 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10849 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10850 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10851 (malloc, free, realloc, calloc): Redirect to e_* only when
10852 compiling Emacs.
10853
10854 * lisp.h (GCTYPEBITS): Move before first use.
10855 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10856 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10857 this macro definition.
10858
10859 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10860 _MSC_VER.
10861
10862 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10863
10864 * gtkutil.c (xg_create_frame_widgets):
10865 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10866 present with Gtk+ 2.0.
10867
10868 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10869
10870 * fileio.c (Finsert_file_contents): Undo previous change; see
10871 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10872
10873 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10874
10875 Rename locals to avoid shadowing.
10876 * fileio.c (Finsert_file_contents):
10877 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10878 * process.c (wait_reading_process_output):
10879 Rename inner 'proc' to 'p' to avoid shadowing.
10880 Indent for consistency with usual Emacs style.
10881
10882 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10883
10884 * xdisp.c (redisplay_window): If cursor row is not fully visible
10885 after recentering, and scroll-conservatively is set to a large
10886 number, scroll window by a few more lines to make the cursor fully
10887 visible and out of scroll-margin. (Bug#10105)
10888 (start_display): Don't move to the next line if the display should
10889 start at a newline that is part of a display vector or an overlay
10890 string. (Bug#10119)
10891
10892 2011-11-24 Juri Linkov <juri@jurta.org>
10893
10894 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10895 after the `MagickPingImage' call. (Bug#10112)
10896
10897 2011-11-23 Chong Yidong <cyd@gnu.org>
10898
10899 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10900
10901 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10902
10903 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10904 making another buffer current. (Bug#10114)
10905
10906 2011-11-23 Glenn Morris <rgm@gnu.org>
10907
10908 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10909
10910 2011-11-23 Chong Yidong <cyd@gnu.org>
10911
10912 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10913 using it (Bug#5984).
10914
10915 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10916
10917 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10918 and header-lines, as they don't have one computed for them.
10919 (Bug#10098)
10920
10921 * .gdbinit (prow): Make displayed values more self-explaining.
10922 Add row's hash code.
10923
10924 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10925
10926 * process.c (wait_reading_process_output): Fix asynchrounous
10927 GnuTLS socket handling on some versions of the GnuTLS library.
10928 (wait_reading_process_output): Add comment and URL.
10929
10930 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10931
10932 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10933
10934 2011-11-21 Chong Yidong <cyd@gnu.org>
10935
10936 * window.c (Fnext_window, Fprevious_window): Doc fix.
10937
10938 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10939
10940 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10941
10942 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10943
10944 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10945
10946 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10947
10948 * window.c (Fset_window_combination_limit): Rename argument
10949 STATUS to LIMIT.
10950 (Vwindow_combination_limit): Remove "status" from doc-string.
10951
10952 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10953
10954 * m/ibms390.h: Remove.
10955 * m/ibms390x.h: Don't include "ibms390.h".
10956
10957 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10958
10959 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10960 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10961
10962 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10963
10964 * casetab.c (Fset_case_table):
10965 * charset.c (Fcharset_after): Fix typos.
10966
10967 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10968
10969 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10970 Otherwise, valgrind does not work on some platforms.
10971 Problem reported by Andreas Schwab in
10972 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10973 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10974 is set, removing the need for VIRT_ADDRESS_VARIES.
10975 (PURE_P): Use a more-efficient implementation that needs just one
10976 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10977 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10978 to 4 (xorl, subq, cmpq, setbe).
10979 * alloc.c (pure): Always extern now, since that's the
10980 VIRT_ADDR_VARIES behavior.
10981 (PURE_POINTER_P): Use a single comparison, not two, for
10982 consistency with the new puresize.h.
10983 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10984 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10985 Remove VIRT_ADDR_VARIES no longer needed.
10986
10987 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10988
10989 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10990 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10991 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10992 behave as if the cursor position were at the window margin.
10993
10994 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10995 and the cursor position is out of bounds, behave as if the cursor
10996 position were at the window margin. (Bug#10075)
10997
10998 2011-11-18 Chong Yidong <cyd@gnu.org>
10999
11000 * window.c (Fwindow_combination_limit): Make first argument
11001 non-optional, since it is meaningless for live windows like the
11002 selected window.
11003
11004 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11005
11006 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11007
11008 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11009
11010 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11011 (graft_intervals_into_buffer): Simplify.
11012
11013 2011-11-18 Eli Zaretskii <eliz@gnu.org>
11014
11015 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11016 hash values of the two rows.
11017 (copy_row_except_pointers): Preserve the used[] arrays and the
11018 hash values of the two rows. (Bug#10035)
11019 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
11020
11021 * xdisp.c (row_hash): New function, body extracted from
11022 compute_line_metrics.
11023 (compute_line_metrics): Call row_hash, instead of computing the
11024 hash code inline.
11025
11026 * dispnew.c (verify_row_hash): Call row_hash for computing the
11027 hash code of a row, instead of duplicating code from xdisp.c.
11028
11029 * dispextern.h (row_hash): Add prototype.
11030
11031 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11032
11033 * frame.c (delete_frame): Don't delete the terminal when the last
11034 X frame is closed if emacs is built with GTK toolkit.
11035
11036 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
11037
11038 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11039
11040 2011-11-17 Martin Rudalics <rudalics@gmx.at>
11041
11042 * window.c (Vwindow_splits): Rename to
11043 Vwindow_combination_resize. Suggested by Juri Linkov.
11044 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11045 of Vwindow_splits.
11046
11047 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
11048
11049 * nsfns.m (Fns_font_name):
11050 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
11051
11052 2011-11-16 Martin Rudalics <rudalics@gmx.at>
11053
11054 * window.h (window): Rename slot "nest" to "combination_limit".
11055 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11056 (Fset_window_nest): Rename to Fset_window_combination_limit.
11057 (Vwindow_nest): Rename to Vwindow_combination_limit.
11058 (recombine_windows, make_parent_window, make_window)
11059 (Fsplit_window_internal, saved_window)
11060 (Fset_window_configuration, save_window_save): Rename all
11061 occurrences of window_nest to window_combination_limit.
11062
11063 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
11064
11065 * image.c (imagemagick_load_image): Fix typo.
11066
11067 2011-11-14 Eli Zaretskii <eliz@gnu.org>
11068
11069 * xdisp.c (display_line): Move the call to
11070 highlight_trailing_whitespace before the call to
11071 compute_line_metrics, since the latter needs to see the final
11072 faces of all the glyphs to compute ROW's hash value.
11073 Fixes assertion violations in row_equal_p. (Bug#10035)
11074
11075 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11076
11077 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11078 just return (bug#10044).
11079
11080 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11081
11082 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11083 with user-defined heap size. Bump the default size of the temacs
11084 heap to 27MB, to avoid memory warning when running temacs.
11085 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11086
11087 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11088 current_matrix and desired_matrix. (Bug#9990)
11089 (verify_row_hash) [XASSERTS]: New function.
11090 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11091 that the hash value of glyph rows is correct.
11092
11093 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11094
11095 * window.h (window): Remove splits slot.
11096 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11097 (Fdelete_other_windows_internal, make_parent_window)
11098 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11099 (Fset_window_configuration, save_window_save): Don't deal with
11100 split status of windows.
11101 (saved_window): Remove splits slot.
11102 (Vwindow_splits): Rewrite doc-string.
11103
11104 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11105
11106 * xfns.c (unwind_create_frame):
11107 * nsfns.m (unwind_create_frame):
11108 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11109 Vframe_list (Bug#9999).
11110
11111 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11112
11113 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11114
11115 2011-11-11 Kenichi Handa <handa@m17n.org>
11116
11117 * callproc.c (Fcall_process): Set the member dst_multibyte of
11118 process_coding.
11119
11120 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11121
11122 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11123 avoid a crash (bug#9496).
11124
11125 2011-11-09 Chong Yidong <cyd@gnu.org>
11126
11127 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11128 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11129
11130 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11131
11132 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11133
11134 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11135
11136 Avoid some portability problems by eschewing 'extern inline' functions.
11137 The trivial performance wins aren't worth the portability hassles; see
11138 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11139 et seq.
11140 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11141 (window_box_width, window_box_left, window_box_left_offset)
11142 (window_box_right, window_box_right_offset): Undo previous change,
11143 by removing the "extern"s.
11144 * intervals.c (adjust_intervals_for_insertion)
11145 (adjust_intervals_for_deletion): Undo previous change,
11146 making these static again.
11147 (offset_intervals, temp_set_point_both, temp_set_point)
11148 (copy_intervals_to_string): No longer inline.
11149 * xdisp.c (window_text_bottom_y, window_box_width)
11150 (window_box_height, window_box_left_offset)
11151 (window_box_right_offset, window_box_left, window_box_right)
11152 (window_box): No longer inline.
11153
11154 2011-11-08 Chong Yidong <cyd@gnu.org>
11155
11156 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11157 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11158 Signal an error if not a live window.
11159 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11160 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11161
11162 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11163
11164 * lisp.h (syms_of_abbrev): Remove declaration.
11165 Reported by CHENG Gao <chenggao@royau.me>.
11166
11167 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11168
11169 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11170 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11171 of temacs in GUI mode.
11172
11173 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11174
11175 * window.h: Declare delete_all_child_windows instead of
11176 delete_all_subwindows.
11177 * window.c (Fwindow_nest, Fset_window_nest)
11178 (Fset_window_new_total, Fset_window_new_normal)
11179 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11180 (delete_all_subwindows): Rename to delete_all_child_windows.
11181 (Fdelete_other_windows_internal, Fset_window_configuration):
11182 Call delete_all_child_windows instead of delete_all_subwindows.
11183 * frame.c (delete_frame): Call delete_all_child_windows instead
11184 of delete_all_subwindows.
11185
11186 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11187
11188 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11189 This is also needed for porting to any host where GC_MARK_STACK is
11190 not GC_MAKE_GCPROS_NOOPS.
11191 (which_symbols): Use it.
11192
11193 2011-11-07 Kenichi Handa <handa@m17n.org>
11194
11195 * coding.c (coding_set_destination): Check coding->src_pos only
11196 when coding->src_object is a buffer (bug#9910).
11197
11198 * process.c (send_process): Set the member src_multibyte of coding
11199 to 0 (bug#9911) when sending a unibyte text.
11200
11201 * callproc.c (Fcall_process): Set the member src_multibyte of
11202 process_coding to 0 (bug#9912).
11203
11204 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11205
11206 * xmenu.c (cleanup_widget_value_tree): New function.
11207 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11208 calling free_menubar_widget_value_tree directly (Bug#9830).
11209
11210 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11211
11212 Fix some portability problems with 'inline'.
11213 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11214 (window_box_width, window_box_left, window_box_left_offset)
11215 (window_box_right, window_box_right_offset): Declare extern.
11216 Otherwise, these inline functions do not conform to C99 and
11217 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11218 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11219 * intervals.c (adjust_intervals_for_insertion)
11220 (adjust_intervals_for_deletion): Now extern, because otherwise the
11221 extern inline functions 'offset_intervals' couldn't refer to it.
11222 (static_offset_intervals): Remove.
11223 (offset_intervals): Rewrite using the old contents of
11224 static_offset_intervals. The old version didn't conform to C99
11225 because an extern inline function contained a reference to an
11226 identifier with static linkage.
11227
11228 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11229
11230 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11231 GC.
11232
11233 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11234
11235 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11236 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11237 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11238 return Qleft_to_right.
11239
11240 2011-11-06 Chong Yidong <cyd@gnu.org>
11241
11242 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11243 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11244 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11245 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11246 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11247 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11248 (Fwindow_vscroll): Doc fix.
11249 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11250 argument, since it makes no sense to pass a live window and for
11251 consistency with window-child.
11252
11253 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11254
11255 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11256 support MSVC.
11257
11258 2011-11-05 Jason Rumney <jasonr@gnu.org>
11259
11260 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11261 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11262 fonts (Bug#6029).
11263 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11264 bitwise arithmetic preventing use of unicode-sip and non-truetype
11265 opentype fonts.
11266
11267 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11268
11269 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11270 "emacs"-only part.
11271
11272 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11273 initialization code to keep similarity to xfns.c after changes
11274 from 2011-11-05.
11275
11276 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11277
11278 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11279 (unwind_create_frame): New function (Bug#9943).
11280 (Fx_create_frame): Restructure code to be more similar to the one in
11281 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11282 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11283 Move terminal->reference_count++ just before making the frame official
11284 (Bug#9943).
11285
11286 * nsterm.m (x_free_frame_resources): New function.
11287 (x_destroy_window): Move code to x_free_frame_resources.
11288
11289 * xfns.c (unwind_create_frame): Fix comment.
11290 (Fx_create_frame, x_create_tip_frame):
11291 Move terminal->reference_count++ just before making the frame
11292 official. Move initialization of image_cache_refcount and
11293 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11294
11295 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11296
11297 Support MSVC build with newer versions of Visual Studio.
11298 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11299 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11300 nt/gmake.defs.
11301
11302 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11303 which are not supported by MSVC.
11304 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11305 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11306 bitfields.
11307 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11308 types in bitfields.
11309 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11310
11311 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11312
11313 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11314
11315 Support MSVC build with newer versions of Visual Studio.
11316 * w32.c: Don't include w32api.h for MSVC.
11317 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11318
11319 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11320 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11321 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11322 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11323 e_* cousins.
11324 (alloca) [_MSC_VER]: Define to _alloca.
11325
11326 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11327
11328 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11329
11330 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11331
11332 * xdisp.c (note_mouse_highlight): If either of
11333 previous/next-single-property-change returns nil, treat that as
11334 the beginning or the end of the buffer. (Bug#9955)
11335
11336 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11337
11338 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11339 label is not null (Bug#9951).
11340 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11341 may be NULL.
11342
11343 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11344
11345 * window.c (Fwindow_body_size): Mention in the doc string that the
11346 return value is in frame's canonical units. (Bug#9949)
11347
11348 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11349
11350 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11351
11352 * w32fns.c (unwind_create_frame): If needed, free the glyph
11353 matrices of the partially constructed frame. (Bug#9943)
11354 * xfns.c (unwind_create_frame): Likewise.
11355
11356 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11357
11358 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11359 Don't stop backward scan on the continuation glyph, even though
11360 its CHARPOS is positive.
11361 (mouse_face_from_buffer_pos, note_mouse_highlight):
11362 Rename cover_string to disp_string.
11363
11364 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11365
11366 * window.c (temp_output_buffer_show): Don't use
11367 Vtemp_buffer_show_specifiers.
11368 (Vtemp_buffer_show_specifiers): Remove unused variable.
11369
11370 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11371
11372 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11373 past the beginning of the current glyph matrix.
11374
11375 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11376
11377 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11378 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11379 HAVE_GTK3 (Bug#9869).
11380
11381 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11382 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11383
11384 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11385
11386 * xterm.c: Declare x_handle_net_wm_state to return int.
11387 (handle_one_xevent): Check if we are iconified but don't have
11388 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11389 (get_current_wm_state): Return non-zero if not hidden,
11390 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11391 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11392 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11393 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11394
11395 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11396
11397 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11398 so that this new function doesn't get optimized away by a
11399 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11400
11401 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11402
11403 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11404
11405 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11406
11407 Fix the `xbytecode' command.
11408 * .gdbinit (xprintbytestr): New command.
11409 (xwhichsymbols): Rename from `which'; all callers changed.
11410 (xbytecode): Print the byte-code string as well.
11411
11412 2011-10-29 Kim Storm <storm@cua.dk>
11413
11414 * alloc.c (which_symbols): New function.
11415
11416 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11417
11418 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11419 line. (Bug#9903)
11420
11421 2011-10-29 Glenn Morris <rgm@gnu.org>
11422
11423 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11424 Not clear what it was for, and it causes various bugs. (Bug#9839)
11425
11426 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11427
11428 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11429 possible random value that matches one of those tested as
11430 condition to clear the mouse face.
11431
11432 2011-10-28 Chong Yidong <cyd@gnu.org>
11433
11434 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11435
11436 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11437
11438 * window.c (make_window): Initialize phys_cursor_on_p.
11439
11440 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11441
11442 * lisp.h (struct Lisp_Symbol): Update comments.
11443
11444 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11445
11446 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11447
11448 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11449
11450 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11451 <oslsachem@gmail.com> for helping to debug this.
11452
11453 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11454 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11455 (g_b_init_get_glyph_outline_w): New static variables.
11456 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11457 (GetGlyphOutlineW_Proc): New typedefs.
11458 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11459 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11460 New functions.
11461 (w32font_open_internal, compute_metrics):
11462 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11463 instead of calling the "wide" APIs directly.
11464
11465 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11466
11467 * w32.h (syms_of_w32font): Add prototype.
11468
11469 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11470
11471 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11472 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11473 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11474 (Fmove_to_window_line): Doc fix.
11475
11476 2011-10-27 Chong Yidong <cyd@gnu.org>
11477
11478 * process.c (make_process): Set gnutls_state to NULL.
11479
11480 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11481 non-NULL, regardless of GNUTLS_INITSTAGE.
11482 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11483 an error. Set process slots as soon as we allocate them.
11484
11485 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11486
11487 2011-10-27 Chong Yidong <cyd@gnu.org>
11488
11489 * gnutls.c (emacs_gnutls_deinit): New function.
11490 Deallocate credentials structures as well as calling gnutls_deinit.
11491 (Fgnutls_deinit, Fgnutls_boot): Use it.
11492
11493 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11494 (deactivate_process): Call emacs_gnutls_deinit.
11495
11496 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11497
11498 * image.c (x_create_x_image_and_pixmap):
11499 * w32.c (sys_rename, w32_delayed_load):
11500 * w32font.c (fill_in_logfont):
11501 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11502
11503 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11504
11505 * w32fns.c (w32_default_color_map): New function,
11506 extracted from Fw32_default_color_map.
11507 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11508
11509 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11510
11511 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11512
11513 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11514
11515 * keyboard.c (test_undefined): New function (bug#9751).
11516 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11517
11518 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11519
11520 * sysdep.c (init_sys_modes): Fix the check for the controlling
11521 terminal (Bug#6649).
11522
11523 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11524
11525 * dispextern.h (struct bidi_it): New member next_en_type.
11526
11527 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11528 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11529 current character, check also for next_en_type being WEAK_EN.
11530 (bidi_resolve_weak): Don't enter the expensive loop if the current
11531 position is before next_en_pos. Record the bidi type of the first
11532 non-ET, non-BN character we find, in addition to its position.
11533 (bidi_level_of_next_char): Invalidate next_en_type when
11534 next_en_pos is over-stepped.
11535
11536 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11537
11538 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11539 * editfns.c: Rewrite current-time-zone so that it invokes
11540 the equivalent of (format-time-string "%Z") to get the time zone name.
11541 This fixes a bug when the time zone name contains characters that
11542 need converting from the system time locale to Emacs internal format.
11543 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11544 that patch fixed format-time-string to do the conversion, but
11545 I forgot to fix current-time-zone.
11546 (format_time_string): New function, containing most of
11547 what Fformat_time_string used to contain.
11548 (Fformat_time_string): Rewrite in terms of format_time_string.
11549 This doesn't change this function's behavior.
11550 (current-time-zone): Rewrite to use format_time_string.
11551 This fixes the bug reported by Michael Schierl in
11552 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11553 Jason Rumney's 2007-06-07 change worked around this bug, but
11554 didn't fix it.
11555 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11556
11557 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11558
11559 * xdisp.c (start_display): If the character at POS is displayed
11560 via a display vector, reset IT->current.dpvec_index to zero.
11561 (try_window_reusing_current_matrix): If a line ends in a display
11562 vector or the next line starts in a display vector, continue
11563 redrawing the window even though the character position of
11564 start_row was reached.
11565 (Bug#9771, part 2)
11566
11567 2011-10-18 Chong Yidong <cyd@gnu.org>
11568
11569 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11570 with nobreak-char-display too.
11571
11572 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11573
11574 Fix part 3 of bug#9771.
11575 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11576 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11577 non-neutral characters if the current character is a paragraph
11578 separator (a.k.a. Newline). This avoids running the same
11579 expensive loop twice, once when we consume the preceding newline
11580 and the other time when the line actually needs to be displayed.
11581 Avoid the loop when we see neutrals on the base embedding level
11582 following a character whose directionality is the same as the
11583 paragraph's. This avoids running the expensive loop when a line
11584 ends in a long sequence of neutrals, like control characters.
11585 Add assertion against STRONG_AL type. Slightly rearrange code
11586 that determines the type of a neutral given the first non-neutral
11587 that follows it.
11588 (bidi_level_of_next_char): Set next_en_pos to zero when
11589 invalidating its info.
11590
11591 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11592
11593 * xdisp.c (push_display_prop): Determine whether to record string
11594 or buffer position by IT->string, not by IT->method. Allow
11595 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11596 (move_it_vertically_backward): Don't look for character position
11597 immediately after the newline when in a continuation line.
11598 (Bug#9771, part 1)
11599
11600 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11601
11602 * window.c (coordinates_in_window): Rewrite and delabelize
11603 vertical border check. (Bug#5357) (Bug#9618)
11604
11605 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11606
11607 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11608 errors in XSetWindowBorder (bug#9310).
11609
11610 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11611
11612 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11613 avoid crash when xmalloc overrun checking is enabled.
11614
11615 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11616
11617 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11618 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11619 cursor motion with <left> and <right> arrow keys.
11620
11621 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11622 some callers set that themselves.
11623
11624 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11625
11626 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11627 display string and the previous row comes from the same string and
11628 is empty. (Bug#9739) (Bug#9738)
11629
11630 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11631
11632 * doc.c (get_doc_string): Encode file name (bug#9735).
11633
11634 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11635
11636 * bidi.c (bidi_level_of_next_char):
11637 * xdisp.c (get_visually_first_element): Remove old incorrect
11638 comments regarding the Unicode Line Separator character.
11639
11640 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11641
11642 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11643
11644 * alloc.c (Fgc_status): Do not access beyond zombies array
11645 boundary if nzombies > MAX_ZOMBIES.
11646 * alloc.c (dump_zombies): Add missing format specifier.
11647
11648 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11649
11650 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11651 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11652
11653 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11654 Some packages use them to denote characters with modifiers.
11655
11656 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11657
11658 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11659 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11660 matching a pp-number. Rename parameter var to var1.
11661
11662 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11663
11664 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11665
11666 2011-10-08 Glenn Morris <rgm@gnu.org>
11667
11668 * callint.c (Fcall_interactively): Give a more explicit error for the
11669 'c' case with a non-character input. (Bug#8479)
11670
11671 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11672
11673 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11674 lines.
11675 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11676 lines that are hscrolled on the left.
11677
11678 * dispnew.c (buffer_posn_from_coords): Account for a possible
11679 presence of header-line. (Bug#4426)
11680
11681 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11682
11683 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11684 Don't advertise functionality which we discourage or doesn't work.
11685
11686 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11687
11688 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11689 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11690 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11691 this makes Emacs dump core during garbage collection on rare
11692 occasions. sizeof is obviously inferior to offsetof here, so
11693 stick with offsetof.
11694 (GC_POINTER_ALIGNMENT): New macro.
11695 (mark_memory): Omit 3rd (offset) arg; caller changed.
11696 Don't assume EMACS_INT alignment is the same as pointer alignment.
11697
11698 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11699
11700 * keyboard.c (read_key_sequence_remapped): New var.
11701 (read_key_sequence): Compute remapping in the right buffer.
11702 (command_loop_1): Use read_key_sequence's remapping directly.
11703
11704 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11705
11706 * dired.c (file_name_completion): Don't expand file name.
11707 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11708 before checking file name handler.
11709
11710 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11711 they've been requested explicitly (bug#9591).
11712
11713 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11714
11715 * keymap.c (Fsingle_key_description): Use make_specified_string
11716 instead of build_string to build string from push_key_description.
11717 (Bug#5193)
11718
11719 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11720
11721 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11722 This fixes a Y2038 bug on 64-bit hosts.
11723 * buffer.c (reset_buffer):
11724 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11725 (Fclear_buffer_auto_save_failure):
11726 Use 0, not -1, to represent an unset failure time, since time_t
11727 might not be signed.
11728
11729 Remove dependency on glibc malloc internals.
11730 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11731 Move back here from lisp.h, but with their new implementations.
11732 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11733 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11734 * charset.c (charset_table_init): New static var.
11735 (syms_of_charset): Use it instead of xmalloc. This removes a
11736 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11737 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11738 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11739 Move back to alloc.c.
11740 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11741 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11742
11743 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11744
11745 * nsterm.m (windowDidResize): Call x_set_window_size only when
11746 ns_in_resize is true. Otherwise set pixelwidth/height and
11747 call change_frame_size (Bug#9628).
11748
11749 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11750
11751 Port --enable-checking=all to Fedora 14 x86-64.
11752 * charset.c (syms_of_charset): Also account for glibc malloc's
11753 internal overhead when calculating the initial malloc maximum.
11754
11755 Port --enable-checking=all to Fedora 14 x86.
11756 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11757 Move to lisp.h.
11758 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11759 (overrun_check_realloc, overrun_check_free):
11760 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11761 That way, xmalloc returns a properly-aligned pointer even if
11762 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11763 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11764 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11765 into account when calculating the initial malloc maximum.
11766 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11767 Move here from alloc.c, so that charset.c can use it too.
11768 Properly align; the old code wasn't right for common 32-bit hosts
11769 when configured with --enable-checking=all.
11770 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11771 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11772
11773 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11774
11775 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11776 use EDOM.
11777
11778 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11779
11780 * xdisp.c (compute_display_string_end): If there's no display
11781 string at CHARPOS, return -1.
11782
11783 * bidi.c (bidi_fetch_char): When compute_display_string_end
11784 returns a negative value, treat the character as a normal
11785 character not covered by a display string. (Bug#9624)
11786
11787 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11788
11789 * lread.c (Fread_from_string): Fix typo in docstring.
11790
11791 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11792
11793 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11794 newline, reseat the iterator instead of bidi-iterating there one
11795 character at a time. (Bug#9610)
11796 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11797 TO_CHARPOS if the bidi iterator is at base embedding level.
11798
11799 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11800
11801 * lread.c (readevalloop): Use correct code for NBSP.
11802 (read1): Likewise. (Bug#9608)
11803
11804 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11805
11806 * dbusbind.c (Fdbus_register_signal): When service is not
11807 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11808
11809 2011-09-25 Glenn Morris <rgm@gnu.org>
11810
11811 * buffer.c (truncate-lines): Doc fix.
11812
11813 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11814
11815 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11816 (Fset_window_next_buffers): Doc fix.
11817
11818 2011-09-24 Glenn Morris <rgm@gnu.org>
11819
11820 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11821
11822 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11823
11824 Fix minor problems found by static checking.
11825 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11826 * indent.c (Fvertical_motion): Fix == vs = typo.
11827
11828 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11829
11830 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11831 Default value is now t. Doc fix.
11832
11833 * indent.c (Fvertical_motion): Compute and apply the overshoot
11834 logic when moving up, not only when moving down. Fix the
11835 confusing name and values of the it_overshoot_expected variable;
11836 logic changes accordingly. (Bug#9254) (Bug#9549)
11837
11838 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11839 CHARPOS is covered by a display string which includes newlines.
11840 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11841 is covered by a display string with embedded newlines.
11842
11843 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11844
11845 * dbusbind.c (Fdbus_register_signal): Add match rule to
11846 Vdbus_registered_objects_table. (Bug#9581)
11847 (Fdbus_register_method, Vdbus_registered_objects_table):
11848 Fix docstring.
11849
11850 2011-09-24 Jim Meyering <meyering@redhat.com>
11851
11852 do not ignore write error for any output size
11853 The previous change was incomplete.
11854 While it makes emacs --batch detect the vast majority of stdout
11855 write failures, errors were still ignored whenever the output size is
11856 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11857 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11858 && echo FAIL: ignored write error
11859 FAIL: ignored write error
11860 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11861 && echo FAIL: ignored write error
11862 FAIL: ignored write error
11863 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11864
11865 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11866
11867 * emacs.c (Fkill_emacs): In noninteractive mode exit
11868 non-successfully if a write error occurred on stdout. (Bug#9574)
11869
11870 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11871
11872 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11873 the xassert test.
11874
11875 * dispextern.h (struct it): Update the comment documenting what
11876 can it->OBJECT be.
11877
11878 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11879
11880 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11881 a display string, extend search for cursor position to end of row.
11882 (find_row_edges): If the row ends in a newline from a display
11883 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11884 Handle the case of a display string with multiple newlines.
11885 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11886 non-empty line. Fixes confusing cursor motion with arrow keys at
11887 the beginning of a line that starts with whitespace.
11888
11889 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11890
11891 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11892 (bug#9493).
11893
11894 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11895
11896 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11897 boolean (Bug#9154).
11898
11899 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11900
11901 * xdisp.c (display_line): Record maximum and minimum buffer
11902 positions even if no glyphs were produced (e.g., by a zero-width
11903 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11904 buffer positions that will be removed from the glyph row because
11905 they don't fit.
11906 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11907 column is beyond frame width: don't subtract 1 "pixel" when
11908 computing width of the stretch.
11909 (reseat_at_next_visible_line_start): Undo the change made on
11910 2011-09-17 that saved paragraph information and restored it after
11911 the call to `reseat'. (Bug#9545)
11912
11913 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11914
11915 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11916 and turn window cursor on if cleared (Bug#9415).
11917
11918 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11919
11920 * search.c (boyer_moore): Take unibyte characters from pattern
11921 literally. (Bug#9458)
11922
11923 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11924
11925 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11926
11927 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11928
11929 Fix minor problem found by static checking.
11930 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11931 initialized, to pacify gcc -Wuninitialized.
11932
11933 * fileio.c: Report proper errno when syscall falls.
11934 (Finsert_file_contents): Save and restore errno,
11935 so that report_file_error outputs the correct diagnostic.
11936 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11937
11938 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11939
11940 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11941
11942 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11943
11944 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11945 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11946
11947 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11948
11949 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11950 about the current paragraph and restore it after the call to reseat.
11951
11952 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11953 (bidi_find_paragraph_start): Search back for paragraph beginning
11954 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11955 (bidi_move_to_visually_next): Only trigger paragraph-related
11956 computations when the last character is a newline or at EOB, not
11957 just any NEUTRAL_B. (Bug#9470)
11958
11959 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11960 truncated lines if point is covered by a display string. (Bug#9524)
11961
11962 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11963
11964 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11965 (cons_to_x_long): New function.
11966 (lisp_data_to_selection_data): Use it. Correct the test for
11967 short-versus-long data; it was negated. Break out of vector
11968 loop, for efficiency, when a long datum is discovered.
11969
11970 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11971
11972 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11973
11974 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11975
11976 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11977 GCC PR/17406) by declaring this function with external scope.
11978
11979 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11980
11981 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11982 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11983
11984 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11985
11986 * editfns.c (Fformat): Correctly handle text properties on "%%".
11987
11988 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11989
11990 * xterm.c (x_draw_composite_glyph_string_foreground):
11991 * w32term.c (x_draw_composite_glyph_string_foreground):
11992 * term.c (encode_terminal_code):
11993 * composite.c (composition_update_it, get_composition_id):
11994 * xdisp.c (get_next_display_element)
11995 (fill_composite_glyph_string): Add comments about special meaning
11996 of TAB characters in a composition.
11997
11998 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11999
12000 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
12001 This occurs when processing a multibyte format.
12002 Problem reported by Wolfgang Jenker.
12003
12004 2011-09-15 Johan Bockgård <bojohan@gnu.org>
12005
12006 * xdisp.c (try_cursor_movement): Only check for exact match if
12007 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12008
12009 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12010
12011 Remove unused external symbols.
12012 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12013 * xdisp.c (calc_pixel_width_or_height): Now static.
12014 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12015 * indent.c (check_display_width):
12016 * w32term.c: Fix comment to match code.
12017 * xterm.c, xterm.h (x_catching_errors): Remove.
12018
12019 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12020
12021 * xselect.c: Use signed conversions more consistently (Bug#9498).
12022 (selection_data_to_lisp_data): Assume incoming selection data are
12023 signed integers, not unsigned. This is to be consistent with
12024 outgoing selection data, which was modified to use signed integers
12025 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12026 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12027 expects long, not unsigned long.
12028
12029 2011-09-14 Eli Zaretskii <eliz@gnu.org>
12030
12031 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12032 computation of loop end. Reported by Johan Bockgård
12033 <bojohan@gnu.org>.
12034
12035 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
12036
12037 * frame.c (Fother_visible_frames_p): Function deleted.
12038
12039 2011-09-12 Eli Zaretskii <eliz@gnu.org>
12040
12041 * indent.c (compute_motion): Process display vector front to back
12042 rather than the other way around. (Bug#2496)
12043
12044 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12045
12046 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12047
12048 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
12049
12050 * minibuf.c (Fread_from_minibuffer): Doc fix.
12051
12052 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12053
12054 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12055 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12056
12057 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12058
12059 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12060 value for non-existent files.
12061
12062 2011-09-11 Eli Zaretskii <eliz@gnu.org>
12063
12064 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12065 set its "size" to -1. This will set the modtime_size field of
12066 the corresponding buffer to -1, which is what
12067 verify-visited-file-modtime expects for files that do not exist.
12068 (Bug#9139)
12069
12070 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12071
12072 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12073 here ...
12074 * lisp.h: ... from here. push_key_description is no longer
12075 defined in keyboard.c, so its declaration should not be in
12076 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12077 logically belongs with push_key_description.
12078
12079 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12080
12081 * buffer.h: Include <sys/types.h> instead of <time.h>.
12082 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12083 Problem reported by Herbert J. Skuhra.
12084
12085 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12086
12087 * xml.c (parse_region): Make the parsing work for
12088 non-comment-starting XML files again (bug#9144).
12089
12090 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12091
12092 * image.c (gif_load): Fix calculation of bottom and right corner.
12093 (Bug#9468)
12094
12095 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12096
12097 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12098 redisplay in small windows.
12099
12100 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12101
12102 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12103
12104 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12105
12106 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12107 Operate on live windows only.
12108
12109 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12110
12111 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12112
12113 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12114
12115 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12116 only under bidi iteration.
12117
12118 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12119
12120 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12121
12122 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12123
12124 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12125 Without this fix, the command to link temacs failed due to an
12126 undefined symbol __builtin_isnan. This is because
12127 /usr/include/iso/math_c99.h #defines isnan(x) to
12128 __builtin_isnan(x), but the bundled gcc, which identifies itself
12129 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12130 a __builtin_isnan.
12131 * floatfns.c (isnan): #undef, and then #define to a clone of
12132 what's in data.c.
12133 (Fisnan): Always define, since it's always available now.
12134 (syms_of_floatfns): Always define isnan at the Lisp level.
12135
12136 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12137
12138 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12139
12140 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12141
12142 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12143 The previous code assumed that file offsets (off_t values) fit in
12144 EMACS_INT variables, which is not true on typical 32-bit hosts.
12145 The code messed up by falsely reporting buffer overflow in cases
12146 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12147 when "big" contains more than 2**29 bytes, even though this
12148 inserts just one byte and does not overflow the buffer.
12149 (Finsert_file_contents): Store file offsets as off_t
12150 values, not as EMACS_INT values. Check for overflow when
12151 converting between EMACS_INT and off_t. When checking for
12152 buffer overflow or for overlap, take the offsets into account.
12153 Don't use EMACS_INT for small values where int suffices.
12154 When checking for overlap, fix a typo: ZV was used where
12155 ZV_BYTE was intended.
12156 (Fwrite_region): Don't assume off_t fits into 'long'.
12157 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12158
12159 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12160
12161 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12162
12163 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12164
12165 sprintf-related integer and memory overflow issues (Bug#9412).
12166
12167 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12168 (esprintf, exprintf, evxprintf): New functions.
12169 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12170 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12171 (modify_event_symbol): Do not assume that the length of
12172 name_alist_or_stem is safe to alloca and fits in int.
12173 (Fexecute_extended_command): Likewise for function name and binding.
12174 (Frecursion_depth): Wrap around reliably on integer overflow.
12175 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12176 since some callers pass EMACS_INT values.
12177 (Fsingle_key_description): Don't crash if symbol name contains more
12178 than MAX_ALLOCA bytes.
12179 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12180 (get_minibuffer): Arg is now EMACS_INT, not int.
12181 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12182 (esprintf, exprintf, evxprintf): New decls.
12183 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12184
12185 * dbusbind.c (signature_cat): New function.
12186 (xd_signature, Fdbus_register_signal):
12187 Do not overrun buffer; instead, report string overflow.
12188
12189 * dispnew.c (add_window_display_history): Don't overrun buffer.
12190 Truncate instead; this is OK since it's just a log.
12191
12192 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12193 even if the time zone offset is outlandishly large.
12194 Don't mishandle offset == INT_MIN.
12195
12196 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12197 when creating daemon; the previous buffer-overflow check was incorrect.
12198
12199 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12200 which has the guts of the old verror function.
12201
12202 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12203 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12204
12205 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12206 (font_unparse_xlfd): Don't blindly alloca long strings.
12207 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12208 fits in int, when using sprintf. Use single snprintf to count
12209 length of string rather than counting it via multiple sprintfs;
12210 that's simpler and more reliable.
12211 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12212 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12213 sprintf, in case result does not fit in int.
12214
12215 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12216 (fontset_from_font): Print it.
12217
12218 * frame.c (tty_frame_count): Now printmax_t, not int.
12219 (make_terminal_frame, set_term_frame_name): Print it.
12220 (x_report_frame_params): In X, window IDs are unsigned long,
12221 not signed long, so print them as unsigned.
12222 (validate_x_resource_name): Check for implausibly long names,
12223 and don't assume name length fits in 'int'.
12224 (x_get_resource_string): Don't blindly alloca invocation name;
12225 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12226 not fit in int.
12227
12228 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12229 (xg_check_special_colors, xg_set_geometry):
12230 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12231
12232 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12233 Use esprintf, not sprintf, in case result does not fit in int.
12234
12235 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12236 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12237 it as a large positive number.
12238 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12239 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12240
12241 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12242 in case result does not fit in int.
12243
12244 * print.c (float_to_string): Detect width overflow more reliably.
12245 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12246 buffer overrun. Don't assume list length fits in 'int'. Treat
12247 print length of 0 as 0, not as infinity; to be consistent with other
12248 uses of print length in this function. Don't overflow print length
12249 index. Don't assume hash table size fits in 'long', or that
12250 vectorlike size fits in 'unsigned long'.
12251
12252 * process.c (make_process): Use printmax_t, not int, to format
12253 process-name gensyms.
12254
12255 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12256
12257 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12258 to avoid potential buffer overrun.
12259
12260 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12261 if X resource line is longer than 512 bytes.
12262
12263 * xfns.c (x_window): Make sprintf buffer a bit bigger
12264 to avoid potential buffer overrun.
12265
12266 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12267
12268 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12269
12270 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12271
12272 Integer overflow fixes for scrolling, etc.
12273 Without these, Emacs silently mishandles large integers sometimes.
12274 For example, "C-u 4294967297 M-x recenter" was treated as if
12275 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12276
12277 * xdisp.c (try_window_id): Check Emacs fixnum range before
12278 converting to 'int'.
12279
12280 * window.c (window_scroll_line_based, Frecenter):
12281 Check that an Emacs fixnum is in range before assigning it to 'int'.
12282 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12283 values converted from Emacs fixnums.
12284 (Frecenter): Don't wrap around a line count if it is out of 'int'
12285 range; instead, treat it as an extreme value.
12286 (Fset_window_configuration, compare_window_configurations):
12287 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12288
12289 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12290 that can exceed INT_MAX. Check that EMACS_INT value is in range
12291 before assigning it to the (possibly-narrower) index.
12292 (match_limit): Don't assume that a fixnum can fit in 'int'.
12293
12294 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12295 exceed INT_MAX.
12296
12297 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12298 (Fvertical_motion): Don't wrap around LINES values that don't fit
12299 in 'int'. Instead, treat them as extreme values. This is good
12300 enough for windows, which can't have more than INT_MAX lines anyway.
12301
12302 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12303
12304 * Require libxml/parser.h to avoid compilation warning.
12305
12306 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12307
12308 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12309 since this reportedly can destroy thread storage.
12310
12311 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12312
12313 * syntax.c (find_defun_start): Update all cache variables if
12314 exiting early (Bug#9401).
12315
12316 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12317
12318 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12319
12320 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12321 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12322 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12323
12324 * term.c (tty_append_glyph): New function.
12325 (produce_stretch_glyph): Static function and its prototype deleted.
12326
12327 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12328 Add prototypes.
12329
12330 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12331
12332 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12333 when checking :margin (Bug#9390).
12334 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12335 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12336 so that the name doesn't mislead. All uses changed.
12337
12338 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12339
12340 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12341 set_tty_hooks.
12342
12343 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12344
12345 * xdisp.c (move_it_to): Don't bail out early when reaching
12346 position beyond to_charpos, if we are scanning backwards.
12347 (move_it_vertically_backward): When DY == 0, make sure we get to
12348 the first character in the line after the newline.
12349
12350 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12351
12352 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12353 (ccl_driver): Do not generate an out-of-range pointer.
12354 (Fccl_execute_on_string): Remove unnecessary check for
12355 integer overflow, noted by Stefan Monnier in
12356 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12357 Remove a FIXME that didn't need fixing.
12358 Simplify the newly-introduced buffer reallocation code.
12359
12360 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12361
12362 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12363
12364 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12365
12366 Integer and memory overflow issues (Bug#9196).
12367
12368 * doc.c (get_doc_string): Rework so that
12369 get_doc_string_buffer_size is the actual buffer size, rather than
12370 being 1 less than the actual buffer size; this makes xpalloc more
12371 convenient.
12372
12373 * image.c (x_allocate_bitmap_record, cache_image):
12374 * xselect.c (Fx_register_dnd_atom):
12375 Simplify previous changes by using xpalloc.
12376
12377 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12378 since either will do and ptrdiff_t is convenient with xpalloc.
12379
12380 * charset.c (charset_table_size)
12381 (struct charset_sort_data.priority): Now ptrdiff_t.
12382 (charset_compare): Don't overflow if priorities differ greatly.
12383 (Fsort_charsets): Don't assume list length fits in int.
12384 Check for size-calculation overflow when allocating sort data.
12385 (syms_of_charset): Allocate an initial charset table that is
12386 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12387
12388 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12389
12390 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12391 The actual value is always <= INT_MAX, and leaving it unsigned made
12392 overflow checking harder.
12393
12394 * dispextern.h (struct glyph_matrix.rows_allocated)
12395 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12396 with xpalloc. The values are still always <= INT_MAX.
12397
12398 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12399
12400 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12401 (SAFE_NALLOCA): New macro.
12402
12403 * region-cache.c (struct boundary.pos, find_cache_boundary)
12404 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12405 (set_cache_region, invalidate_region_cache)
12406 (revalidate_region_cache, know_region_cache, region_cache_forward)
12407 (region_cache_backward, pp_cache):
12408 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12409 so that ptrdiff_t * can be passed to xpalloc.
12410 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12411 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12412 (pp_cache): Don't assume cache_len fits in int.
12413 * region-cache.h: Adjust extern decls to match.
12414
12415 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12416 EMACS_INT, since either will do, for xpalloc.
12417
12418 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12419 (xnmalloc, xnrealloc, xpalloc): New functions.
12420
12421 * bidi.c (bidi_shelve_header_size): New constant.
12422 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12423 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12424
12425 * bidi.c (bidi_cache_shrink):
12426 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12427 (overlay_strings):
12428 Don't update size of array until after memory allocation succeeds,
12429 because xmalloc/xrealloc may not return.
12430 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12431 now that we have proper integer overflow checking.
12432 (record_overlay_string, overlay_strings): Catch overflows when
12433 calculating size of overlay_str_buf.
12434
12435 * callproc.c (Fcall_process): Check for size overflow when
12436 calculating size of args2.
12437 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12438 Normally we prefer signed values, but sticking with ptrdiff_t would
12439 require adding more-complicated checks.
12440
12441 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12442 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12443 Redo buffer-overflow calculations to avoid integer overflow.
12444 Add a FIXME comment where memory seems to be over-allocated.
12445
12446 * character.c (Fstring): Check for size-calculation overflow.
12447
12448 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12449 unnecessary integer overflow. Check for size overflow.
12450 (encode_coding_object): Don't update size until xmalloc succeeds.
12451
12452 * composite.c (get_composition_id): Check for overflow in glyph
12453 length calculations.
12454
12455 Integer and memory overflow fixes for display code.
12456 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12457 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12458 (scrolling_window): Check for overflow in size calculations.
12459 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12460 Don't assume glyph table len fits in int.
12461 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12462 (row_table_size): Now ptrdiff_t, not int.
12463 (scrolling_window): Avoid overflow in size calculations.
12464 Don't update size until allocation succeeds.
12465 * fns.c (concat): Check for overflow in size calculations.
12466 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12467 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12468 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12469
12470 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12471 (get_doc_string): Check for size calculation overflow.
12472 Don't update size until allocation succeeds.
12473 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12474 EMACS_INT, where ptrdiff_t will do.
12475 (Fsubstitute_command_keys): Check for string overflow.
12476
12477 * editfns.c (set_time_zone_rule): Don't assume environment length
12478 fits in int.
12479 (message_length): Now ptrdiff_t, not int.
12480 (Fmessage_box): Don't update size until allocation succeeds.
12481 Don't assume message length fits in int.
12482 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12483
12484 * emacs.c (main): Do not reallocate argv, since there is a null at
12485 the end that can be overwritten, and this way there's no need to
12486 worry about size-calculation overflow.
12487 (sort_args): Check for size-calculation overflow.
12488
12489 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12490 alloc succeeds.
12491 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12492
12493 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12494 (x_set_scroll_bar_width, x_figure_window_size):
12495 Check for integer overflow.
12496 (x_set_alpha): Do not assume XINT fits in int.
12497
12498 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12499 This is for the members text_lines, text_cols, total_lines, total_cols,
12500 where the system imposes an 'int' limit.
12501
12502 * fringe.c (Fdefine_fringe_bitmap):
12503 Don't update size until alloc works.
12504
12505 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12506 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12507
12508 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12509 Check for size-calculation overflow.
12510 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12511 do, as we prefer signed integers.
12512 (id_to_widget.max_size, id_to_widget.used)
12513 (xg_store_widget_in_map, xg_remove_widget_from_map)
12514 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12515 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12516 Use and return ptrdiff_t, not int.
12517 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12518 * gtkutil.h: Change prototypes to match the above.
12519
12520 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12521 are duplicate now that they've been promoted to lisp.h.
12522 (x_allocate_bitmap_record, x_alloc_image_color)
12523 (make_image_cache, cache_image, xpm_load):
12524 Don't update size until alloc is done.
12525 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12526 (x_detect_edges):
12527 Check for size calculation overflow.
12528 (ct_colors_allocated_max): New constant.
12529 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12530 overflow.
12531
12532 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12533 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12534 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12535 Use ptrdiff_t, not int, to count maps.
12536 (read_char_minibuf_menu_prompt): Check for overflow in size
12537 calculations. Don't update size until allocation succeeds.
12538 Redo calculations to avoid overflow.
12539 * keyboard.h: Change prototypes to match the above.
12540
12541 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12542 to count maps.
12543 (current_minor_maps): Check for size calculation overflow.
12544 * keymap.h: Change prototypes to match the above.
12545
12546 * lread.c (read1, init_obarray): Don't update size until alloc done.
12547
12548 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12549 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12550
12551 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12552 Now ptrdiff_t, not int.
12553 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12554 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12555
12556 * process.c (Fnetwork_interface_list): Check for overflow
12557 in size calculation.
12558
12559 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12560
12561 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12562 overflow. Don't bother calling xmalloc when xrealloc will do.
12563
12564 * search.c (Freplace_match): Check for size calculation overflow.
12565 (Fset_match_data): Don't assume list lengths fit in 'int'.
12566
12567 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12568 for command line length. Do not attempt to address one before the
12569 beginning of an array, as that's not portable.
12570
12571 * term.c (max_frame_lines): Remove; unused.
12572 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12573 not int.
12574 (encode_terminal_code, calculate_costs): Check for size
12575 calculation overflow.
12576 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12577 table lengths and related sizes. Don't update size until alloc
12578 done. Redo calculations to avoid overflow.
12579 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12580
12581 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12582 subtracting pointers.
12583 (gobble_line): Check for overflow more carefully. Don't update size
12584 until alloc done.
12585
12586 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12587 Don't update size until alloc done.
12588 Redo size calculations to avoid overflow.
12589 Check for size calculation overflow.
12590 (main) [DEBUG]: Fix typo in invoking tparam1.
12591
12592 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12593 Use ptrdiff_t, not int, for sizes.
12594 (store_mode_line_noprop_char): Don't update size until alloc done.
12595
12596 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12597 Use ptrdiff_t, not int, for sizes.
12598 (Finternal_make_lisp_face, cache_face):
12599 Check for size calculation overflow.
12600 (cache_face): Treat size calculation overflows as if they were
12601 memory exhaustion (the usual treatment), rather than aborting.
12602
12603 * xfns.c (x_encode_text, x_set_name_internal)
12604 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12605 sizes, since they can exceed INT_MAX in size. Check for size
12606 calculation overflow.
12607
12608 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12609 (xg_select): Check for size calculation overflow.
12610 Don't update size until alloc done.
12611
12612 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12613 as sprintf is limited to int lengths.
12614
12615 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12616 (X_LONG_MIN): New macros.
12617 Use them to make the following changes clearer.
12618 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12619 This change doesn't affect the value now, but it may help remind
12620 future maintainers not to raise the value too much later.
12621 (SELECTION_QUANTUM): Remove, replacing with ...
12622 (selection_quantum): ... new function, which avoids overflow.
12623 All uses changed.
12624 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12625 assumption that selection length fits in 'int'.
12626 (x_reply_selection_request, x_handle_selection_request)
12627 (x_get_window_property, receive_incremental_selection)
12628 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12629 (lisp_data_to_selection_data, clean_local_selection_data):
12630 Use ptrdiff_t, not int, to record length of selection.
12631 (x_reply_selection_request, x_get_window_property)
12632 (receive_incremental_selection, x_property_data_to_lisp):
12633 Redo calculations to avoid overflow.
12634 (x_reply_selection_request): When sending hint, ceiling it at
12635 X_LONG_MAX rather than relying on wraparound overflow to send
12636 something.
12637 (x_get_window_property, receive_incremental_selection)
12638 (lisp_data_to_selection_data, x_property_data_to_lisp):
12639 Check for size-calculation overflow.
12640 (x_get_window_property, receive_incremental_selection)
12641 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12642 Don't store size until memory allocation succeeds.
12643 (x_get_window_property): Plug memory leak on memory exhaustion.
12644 Don't double-block input; malloc is safe here. Don't assume 2**34
12645 - 4 fits in unsigned long. Add an xassert to check
12646 XGetWindowProperty overflow. Be more careful about overflow
12647 calculations, and distinguish size from memory overflow better.
12648 (receive_incremental_selection): When tracing, don't assume
12649 unsigned int is less than INT_MAX.
12650 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12651 harmful) conversions of unsigned short to int.
12652 (lisp_data_to_selection_data): Don't assume that integers
12653 in the range -65535 through -1 fit in an X unsigned short.
12654 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12655 result parameters unless successful. Rely on cons_to_unsigned
12656 to report problems with elements; the old code wasn't right anyway.
12657 (x_check_property_data): Check for int overflow; we cannot use
12658 a wider type due to X limits.
12659 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12660
12661 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12662
12663 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12664 (x_term_init): Check for size calculation overflow.
12665 (x_color_cells): Don't store size until memory allocation succeeds.
12666 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12667 Don't assume alloca size is less than MAX_ALLOCA.
12668 (x_term_init): Don't assume length fits in int (sprintf is limited
12669 to int size).
12670
12671 Use ptrdiff_t for composition IDs.
12672 * character.c (lisp_string_width):
12673 * composite.c (composition_table_size, n_compositions)
12674 (get_composition_id, composition_gstring_from_id):
12675 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12676 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12677 * window.c (Frecenter):
12678 Use ptrdiff_t, not int, for composition IDs.
12679 * composite.c (get_composition_id): Check for integer overflow.
12680 * composite.h: Adjust prototypes to match the above changes.
12681
12682 Use ptrdiff_t for hash table indexes.
12683 * category.c (hash_get_category_set):
12684 * ccl.c (ccl_driver):
12685 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12686 * coding.c (coding_system_charset_list, detect_coding_system):
12687 * coding.h (struct coding_system.id):
12688 * composite.c (get_composition_id, gstring_lookup_cache):
12689 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12690 * image.c (xpm_get_color_table_h):
12691 * lisp.h (hash_lookup, hash_put):
12692 * minibuf.c (Ftest_completion):
12693 Use ptrdiff_t for hash table indexes, not int (which is too
12694 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12695 32-bit --with-wide-int hosts).
12696
12697 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12698 Add a FIXME comment about memory leaks.
12699 (syms_of_charset): Don't assume xmalloc returns.
12700
12701 Don't assume that stated character widths fit in int.
12702 * character.c (Fchar_width, c_string_width, lisp_string_width):
12703 * character.h (CHAR_WIDTH):
12704 * indent.c (MULTIBYTE_BYTES_WIDTH):
12705 Use sanitize_char_width to avoid undefined and/or bad behavior
12706 with outlandish widths.
12707 * character.h (sanitize_tab_width): Rename from sanitize_width,
12708 now that we have two such functions. All uses changed.
12709 (sanitize_char_width): New inline function.
12710
12711 Don't assume that tab-width fits in int.
12712 * character.h (sanitize_width): New inline function.
12713 (SANE_TAB_WIDTH): New macro.
12714 (ASCII_CHAR_WIDTH): Use it.
12715 * indent.c (sane_tab_width): Remove. All uses replaced by
12716 SANE_TAB_WIDTH (current_buffer).
12717 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12718
12719 * fileio.c: Integer overflow issues with file modes.
12720 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12721
12722 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12723 Remove unreachable code.
12724 (read_hex, load_charset_map_from_file): Check for integer overflow.
12725
12726 * xterm.c: Don't go over XClientMessageEvent limit.
12727 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12728 (x_send_scroll_bar_event): Likewise. Check that the size does not
12729 exceed limits imposed by XClientMessageEvent, as well as the usual
12730 ptrdiff_t and size_t limits.
12731
12732 * keyboard.c: Overflow, signedness and related fixes.
12733 (make_lispy_movement): Use same integer type in forward decl
12734 that is used in the definition.
12735 (read_key_sequence, keyremap_step):
12736 Change bufsize argument back to int, undoing my 2011-03-30 change.
12737 We prefer signed types, and int is wide enough here.
12738 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12739 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12740 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12741 length, not size_t. Use ptrdiff_t for index, not int.
12742 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12743 possibility of integer overflow.
12744
12745 Overflow, signedness and related fixes for images.
12746
12747 * dispextern.h (struct it.stack[0].u.image.image_id)
12748 (struct_it.image_id, struct image.id, struct image_cache.size)
12749 (struct image_cache.used, struct image_cache.ref_count):
12750 * gtkutil.c (update_frame_tool_bar):
12751 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12752 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12753 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12754 * nsmenu.m (update_frame_tool_bar):
12755 * xdisp.c (calc_pixel_width_or_height):
12756 * xfns.c (image_cache_refcount):
12757 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12758 on typical 64-bit hosts.
12759
12760 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12761 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12762 Omit unnecessary casts to int.
12763 (parse_image_spec): Check that integers fall into 'int' range
12764 when the callers expect that.
12765 (image_ascent): Redo ascent calculation to avoid int overflow.
12766 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12767 (lookup_image): Remove unnecessary tests.
12768 (xbm_image_p): Locals are now of int, not EMACS_INT,
12769 since parse_image_check makes sure they fit into int.
12770 (png_load, gif_load, svg_load_image):
12771 Prefer int to unsigned where either will do.
12772 (tiff_handler): New function, combining the cores of the
12773 old tiff_error_handler and tiff_warning_handler.
12774 This function is rewritten to use vsnprintf and thereby avoid
12775 stack buffer overflows. It uses only the features of vsnprintf
12776 that are common to both POSIX and native Microsoft.
12777 (tiff_error_handler, tiff_warning_handler): Use it.
12778 (tiff_load, gif_load, imagemagick_load_image):
12779 Don't assume :index value fits in 'int'.
12780 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12781 (imagemagick_load_image): Check that crop parameters fit into
12782 the integer types that MagickCropImage accepts. Don't assume
12783 Vimagemagick_render_type has a nonnegative value. Don't assume
12784 size_t fits in 'long'.
12785 (gs_load): Use printmax_t to print the widest integers possible.
12786 Check for integer overflow when computing image height and width.
12787
12788 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12789
12790 * xdisp.c (redisplay_window): Don't force window start if point
12791 will be invisible in the resulting window. (Bug#9324)
12792
12793 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12794
12795 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12796 the display spec is of the form `(space ...)'.
12797 (handle_display_spec): Return the value returned by
12798 handle_single_display_spec, not just 1 or zero.
12799 (handle_single_display_spec): If the display spec is of the form
12800 `(space ...)', and specifies display in the text area, return 2
12801 rather than 1.
12802 (try_cursor_movement): Check for the need to scroll more
12803 accurately, and prefer exact match for point under bidi.
12804 Don't advance `row' beyond the last row of the window.
12805
12806 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12807 into disp_prop; all users changed.
12808
12809 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12810 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12811 for the text covered by the display property.
12812
12813 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12814
12815 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12816 Change return value to nil.
12817 (Frecord_buffer): Delete unused function.
12818
12819 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12820
12821 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12822 buffers, return left-to-right.
12823 (set_cursor_from_row): Consider candidate row a win if its glyph
12824 represents a newline and point is on that newline. Fixes cursor
12825 positioning on the newline at EOL of R2L text within L2R
12826 paragraph, and vice versa.
12827 (try_cursor_movement): Check continued rows, in addition to
12828 continuation rows. Fixes unwarranted scroll when point enters a
12829 continued line of R2L text within an L2R paragraph, or vice versa.
12830 (cursor_row_p): Consider the case of point being equal to
12831 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12832 from the end of a short line to the beginning of a continued line
12833 of R2L text within L2R paragraph.
12834 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12835 composed characters.
12836
12837 * bidi.c (bidi_check_type): Use xassert.
12838 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12839 members.
12840
12841 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12842
12843 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12844 a character.
12845
12846 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12847
12848 * nsfont.m (ns_otf_to_script): Fix typo.
12849
12850 2011-08-22 Kenichi Handa <handa@m17n.org>
12851
12852 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12853 extra slot even if the purpose is char-code-property-table.
12854
12855 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12856
12857 * xdisp.c (redisplay_window): When computing centering_position,
12858 account for the height of the header line. (Bug#8874)
12859
12860 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12861 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12862 candidate is selected by the mouse, and that candidate has a
12863 composed character under the mouse.
12864
12865 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12866 coordinates reported by pos-visible-in-window-p for a composed
12867 character in column zero.
12868
12869 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12870
12871 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12872
12873 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12874
12875 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12876 consider it a hit if to_charpos is anywhere in the range of the
12877 composed buffer positions.
12878
12879 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12880
12881 * image.c (gif_load): Don't assume that each subimage has the same
12882 dimensions as the base image. Handle disposal method that is
12883 "undefined" by the gif spec (Bug#9335).
12884
12885 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12886
12887 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12888 (Fcondition_case): Document `debug' symbol in error handler.
12889
12890 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12891
12892 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12893 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12894 from an Org mode buffer to a Speedbar frame.
12895
12896 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12897 a composition, take its buffer position from IT->cmp_it.charpos.
12898 Fixes cursor positioning at the beginning of a line that begins
12899 with a composed character.
12900
12901 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12902
12903 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12904 character bidirectional type, use STRONG_L instead. Fixes crashes
12905 in a buffer produced by `describe-categories'.
12906
12907 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12908 members before the level stack, so they would be saved and
12909 restored when copying iterator state. Fixes incorrect reordering
12910 around TABs covered by display properties.
12911
12912 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12913
12914 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12915
12916 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12917
12918 * eval.c (internal_condition_case, internal_condition_case_1)
12919 (internal_condition_case_2, internal_condition_case_n):
12920 Remove unnecessary aborts (Bug#9081).
12921
12922 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12923
12924 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12925 has no `load' handler, try opening the file locally. (Bug#9311)
12926
12927 2011-08-16 Ken Brown <kbrown@cornell.edu>
12928
12929 * gmalloc.c: Expand comment.
12930
12931 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12932
12933 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12934 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12935
12936 2011-08-16 Ken Brown <kbrown@cornell.edu>
12937
12938 Fix memory allocation problems in Cygwin build (Bug#9273).
12939
12940 * unexcw.c ( __malloc_initialized): Declare external variable.
12941 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12942
12943 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12944 New variables.
12945 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12946 dumped emacs.
12947 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12948 in the static heap.
12949 [CYGWIN] (special_realloc): New function.
12950 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12951 requests to realloc storage in the static heap.
12952
12953 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12954
12955 * bidi.c (bidi_initialize): Remove unused local.
12956
12957 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12958
12959 * bidimirror.h:
12960 * biditype.h: Remove file.
12961 * makefile.w32-in ($(BLD)/bidi.$(O)):
12962 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12963
12964 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12965
12966 * chartab.c: Improve commentary for the uniprop_table API.
12967
12968 * bidi.c (bidi_paragraph_init): Support zero value of
12969 bidi_ignore_explicit_marks_for_paragraph_level.
12970 (bidi_initialize): Use uniprop_table instead of including
12971 biditype.h and bidimirror.h.
12972
12973 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12974 coordinates of the iterator when restoring from ppos_it.
12975 (Bug#9296)
12976
12977 2011-08-14 Kenichi Handa <handa@m17n.org>
12978
12979 * process.c (create_process): Call setup_process_coding_systems
12980 after the pid of the process is set to -1 (Bug#8162).
12981
12982 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12983
12984 * xdisp.c (move_it_in_display_line_to): Don't invoke
12985 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12986 ppos_it. Fixes vertical cursor motion when line beginning is
12987 covered by an image. (Bug#9296)
12988
12989 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12990
12991 * nsterm.h (ns_run_ascript): Declare.
12992 (NSAPP_DATA2_RUNASSCRIPT): Define.
12993
12994 * nsfns.m (as_script, as_result, as_status): New static variables.
12995 (ns_run_ascript): New function.
12996 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12997 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12998 the event loop. Get status from as_status (Bug#7276).
12999
13000 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13001 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13002 the event loop (Bug#7276).
13003
13004 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13005
13006 * gnutls.c (QCgnutls_bootprop_priority)
13007 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13008 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13009 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13010 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13011 (QCgnutls_bootprop_verify_hostname_error)
13012 (QCgnutls_bootprop_callbacks_verify): Rename from
13013 Qgnutls_bootprop_..., all uses changed.
13014
13015 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13016 uses changed.
13017
13018 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13019
13020 * xfaces.c (Qframe_set_background_mode): Now static.
13021 * dispextern.h (Qframe_set_background_mode): Remove decl.
13022
13023 * process.c (Fnetwork_interface_info): Declare local only if needed.
13024
13025 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13026
13027 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13028 (Fnetwork_interface_list): Allocate in increments of bytes instead
13029 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13030 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13031 sockaddr.
13032 (struct ifflag_def): notrailers is smart on OSX.
13033 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13034 Get hardware address with getifaddrs if available.
13035
13036 2011-08-12 Eli Zaretskii <eliz@gnu.org>
13037
13038 * xdisp.c (iterate_out_of_display_property): xassert that
13039 IT->position is set to within IT->object's boundaries. Break from
13040 the loop as soon as EOB is reached; avoids infloops in redisplay
13041 when IT->position is set up wrongly due to some bug.
13042 Set IT->current to match the bidi iterator unconditionally.
13043 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13044 entry. Force push_it to save on the stack the current
13045 buffer/string position, to be restored by pop_it. Fix flags in
13046 the iterator structure wrt the object coming from a display
13047 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13048 properties. (Bug#9284)
13049
13050 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
13051
13052 * fontset.c (fontset_get_font_group): Add proper type checks.
13053 (Bug#9172)
13054
13055 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13056
13057 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13058 and LC_VERSION_MIN_MACOSX.
13059 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13060 (dump_it) [LC_FUNCTION_STARTS]: Use it.
13061
13062 2011-08-08 Eli Zaretskii <eliz@gnu.org>
13063
13064 * xdisp.c (forward_to_next_line_start): Allow to use the
13065 no-display-properties-and-no-overlays under bidi display.
13066 Set disp_pos in the bidi iterator to avoid searches for display
13067 properties and overlays.
13068
13069 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
13070
13071 * editfns.c (Fset_time_zone_rule): Document relationship with the
13072 setenv function.
13073
13074 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13075 the font entity extracted from the cache (Bug#8109).
13076
13077 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13078
13079 * composite.c (autocmp_chars): Don't reset point. That is done by
13080 restore_point_unwind (Bug#5984).
13081
13082 2011-08-07 Juri Linkov <juri@jurta.org>
13083
13084 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13085 to show the arg `TIME' instead of `TIMEVAL'.
13086
13087 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13088
13089 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13090 display property strides EOL and includes a newline, as in
13091 longlines-mode. (Bug#9254)
13092 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13093 word-wrap under bidirectional display. (Bug#9224)
13094
13095 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13096 is non-zero, even if the data buffer is NULL. Fixes a crash in
13097 vertical-motion with longlines-mode. (Bug#9254)
13098
13099 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13100
13101 * bidi.c <bidi_cache_total_alloc>: Now static.
13102 (bidi_initialize): Initialize bidi_cache_total_alloc.
13103
13104 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13105 cache. (Bug#9221)
13106
13107 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13108 amount allocated this far in `bidi_cache_total_alloc'.
13109 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13110 non-zero, only free the data buffer without restoring the cache
13111 contents. All callers changed.
13112
13113 * dispextern.h (bidi_unshelve_cache): Update prototype.
13114
13115 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13116 (move_it_in_display_line, move_it_to)
13117 (move_it_vertically_backward, move_it_by_lines): Replace the call
13118 to xfree to an equivalent call to bidi_unshelve_cache.
13119 (move_it_in_display_line_to): Fix logic of returning
13120 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13121
13122 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13123
13124 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13125 came from a string character with a `cursor' property. (Bug#9229)
13126
13127 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13128
13129 * Makefile.in (LIB_PTHREAD): New variable.
13130 (LIBES): Add LIB_PTHREAD (Bug#9216).
13131
13132 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13133 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13134
13135 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13136
13137 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13138
13139 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13140
13141 * xterm.c (x_find_topmost_parent): New function.
13142 (x_set_frame_alpha): Find topmost parent window with
13143 x_find_topmost_parent and set the property there also (bug#9181).
13144 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13145
13146 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13147
13148 * callproc.c (Fcall_process): Avoid vfork clobbering
13149 the local vars buffer, coding_systems, current_dir.
13150
13151 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13152
13153 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13154
13155 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13156
13157 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13158 so that it is not optimized away.
13159
13160 * xdisp.c (compute_display_string_pos): Remove unused local.
13161
13162 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13163
13164 Fix slow cursor motion and scrolling in large buffers with
13165 selective display, like Org Mode buffers. (Bug#9218)
13166
13167 * dispextern.h (struct bidi_it): New member disp_prop_p.
13168
13169 * xdisp.c: Remove one-slot cache of display string positions.
13170 (compute_display_string_pos): Accept an additional argument
13171 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13172 for a display string or property. If found, set DISP_PROP_P
13173 non-zero.
13174
13175 * bidi.c (bidi_fetch_char): Accept an additional argument
13176 DISP_PROP_P, and pass it to compute_display_string_pos.
13177 Only handle text covered by a display string if DISP_PROP_P is returned
13178 non-zero. All callers of bidi_fetch_char changed.
13179
13180 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13181
13182 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13183
13184 2010-12-03 Don March <don@ohspite.net>
13185
13186 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13187 last character M-[char] is translated to ESC [char] (bug#7541).
13188
13189 2011-08-02 Kenichi Handa <handa@m17n.org>
13190
13191 * lisp.h (uniprop_table): Extern it.
13192
13193 * chartab.c (uniprop_table): Make it non-static.
13194
13195 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13196
13197 * xdisp.c (forward_to_next_line_start): Accept additional argument
13198 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13199 on the newline.
13200 (reseat_at_next_visible_line_start): Use the bidi iterator state
13201 returned by forward_to_next_line_start to restore the state of
13202 it->bidi_it after backing up to previous newline. (Bug#9212)
13203
13204 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13205
13206 * regex.c (re_comp): Protoize.
13207 (re_exec): Fix return type.
13208 (regexec): Fix type of `ret'. (Bug#9203)
13209
13210 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13211
13212 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13213 This is needed if max-image-size is a floating-point number.
13214
13215 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13216
13217 * print.c (print_object): Print empty symbol as ##.
13218
13219 * lread.c (read1): Read ## as empty symbol.
13220
13221 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13222
13223 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13224 setting frame foreground color (Bug#9175).
13225 (x_set_background_color): Likewise.
13226
13227 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13228 contents (Bug#9176).
13229 (EmacsTooltip -init): Remove bezels and add shadows to
13230 tooltip windows.
13231
13232 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13233 or scroll bar (Bug#8470).
13234
13235 * nsfont.m (nsfont_open): Remove assignment to voffset and
13236 unnecessary vars hshink, expand, hd, full_height, min_height.
13237 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13238
13239 * nsterm.h (nsfont_info): Remove voffset field.
13240
13241 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13242
13243 Implement strike-through and overline on NextStep (Bug#8863).
13244
13245 * nsfont.m (nsfont_open): Use underline position provided by font,
13246 instead of hard-coded value of 2.
13247 (nsfont_draw): Call ns_draw_text_decoration instead.
13248
13249 * nsterm.h: Add declaration for ns_draw_text_decoration.
13250
13251 * nsterm.m (ns_draw_text_decoration): New function for drawing
13252 underline, overline, and strike-through.
13253 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13254 ns_draw_text_decoration. Change treatment of cursor drawing to
13255 accommodate underlining, etc.
13256
13257 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13258
13259 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13260 default.
13261
13262 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13263
13264 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13265 Without this fix, if a signal arrives just after memory fills up,
13266 'malloc' might be invoked reentrantly.
13267
13268 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13269 In other words, assume that every image size is allowed, on non-X
13270 hosts. This assumption is probably wrong, but it lets Emacs compile.
13271
13272 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13273
13274 * regex.c (re_iswctype): Convert return values to boolean.
13275
13276 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13277
13278 * xdisp.c (compute_display_string_pos): Don't use cached display
13279 string position if the buffer had its restriction changed.
13280 (Bug#9184)
13281
13282 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13283
13284 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13285
13286 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13287
13288 Integer signedness and overflow and related fixes. (Bug#9079)
13289
13290 * bidi.c: Integer size and overflow fixes.
13291 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13292 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13293 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13294 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13295 (bidi_find_other_level_edge):
13296 Use ptrdiff_t instead of EMACS_INT where either will do.
13297 This works better on 32-bit hosts configured --with-wide-int.
13298 (bidi_cache_ensure_space): Check for size-calculation overflow.
13299 Use % rather than repeated addition, for better worst-case speed.
13300 Don't set bidi_cache_size until after xrealloc returns, because it
13301 might not return.
13302 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13303 (bidi_cache_ensure_space): Also check that the bidi cache size
13304 does not exceed that of the largest Lisp string or buffer. See Eli
13305 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13306
13307 * alloc.c (__malloc_size_t): Remove.
13308 All uses replaced by size_t. See Andreas Schwab's note
13309 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13310
13311 * image.c: Improve checking for integer overflow.
13312 (check_image_size): Assume that f is nonnull, since
13313 it is always nonnull in practice. This is one less thing to
13314 worry about when checking for integer overflow later.
13315 (x_check_image_size): New function, which checks for integer
13316 overflow issues inside X.
13317 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13318 This removes the need for a memory_full check.
13319 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13320 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13321 (xbm_read_bitmap_data): Change locals back to 'int', since
13322 their values must fit in 'int'.
13323 (xpm_load_image, png_load, tiff_load):
13324 Invoke x_create_x_image_and_pixmap earlier,
13325 to avoid much needless work if the image is too large.
13326 (tiff_load): Treat overly large images as if
13327 x_create_x_image_and_pixmap failed, not as malloc failures.
13328 (gs_load): Use x_check_image_size.
13329
13330 * gtkutil.c: Omit integer casts.
13331 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13332 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13333
13334 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13335
13336 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13337 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13338 would wrongly return t on a 64-bit host.
13339
13340 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13341 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13342 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13343 and therefore cause GCC to emit a bogus diagnostic in some cases.
13344
13345 * image.c: Integer signedness and overflow and related fixes.
13346 This is not an exhaustive set of fixes, but it's time to
13347 record what I've got.
13348 (lookup_pixel_color, check_image_size): Remove redundant decls.
13349 (check_image_size): Don't assume that arbitrary EMACS_INT values
13350 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13351 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13352 (tiff_load, imagemagick_load_image):
13353 Check for overflow in size calculations.
13354 (x_create_x_image_and_pixmap): Remove unnecessary test for
13355 xmalloc returning NULL; that can't happen.
13356 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13357 (xpm_color_bucket): Use better integer hashing function.
13358 (xpm_cache_color): Don't possibly over-allocate memory.
13359 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13360 (gif_memory_source):
13361 Use ptrdiff_t, not int or size_t, to record sizes.
13362 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13363 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13364 either works, as we prefer signed integers.
13365 (tiff_read_from_memory, tiff_write_from_memory):
13366 Return tsize_t, not size_t, since that's what the TIFF API wants.
13367 (tiff_read_from_memory): Don't fail simply because the read would
13368 go past EOF; instead, return a short read.
13369 (tiff_load): Omit no-longer-needed casts.
13370 (Fimagemagick_types): Don't assume size fits into 'int'.
13371
13372 Improve hashing quality when configured --with-wide-int.
13373 * fns.c (hash_string): New function, taken from sxhash_string.
13374 Do not discard information about ASCII character case; this
13375 discarding is no longer needed.
13376 (sxhash-string): Use it. Change sig to match it. Caller changed.
13377 * lisp.h: Declare it.
13378 * lread.c (hash_string): Remove, since we now use fns.c's version.
13379 The fns.c version returns a wider integer if --with-wide-int is
13380 specified, so this should help the quality of the hashing a bit.
13381
13382 * emacs.c: Integer overflow minor fix.
13383 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13384 Define only if GNU_LINUX.
13385 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13386
13387 * dispnew.c: Integer signedness and overflow fixes.
13388 Remove unnecessary forward decls, that were a maintenance hassle.
13389 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13390 All uses changed.
13391 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13392 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13393 (prepare_desired_row, line_draw_cost):
13394 Use int, not unsigned, where either works.
13395 (save_current_matrix, restore_current_matrix):
13396 Use ptrdiff_t, not size_t, where either works.
13397 (init_display): Check for overflow more accurately, and without
13398 relying on undefined behavior.
13399
13400 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13401 Remove, replacing with the new symbols in lisp.h. All uses changed.
13402 * fileio.c (make_temp_name):
13403 * filelock.c (lock_file_1, lock_file):
13404 * xdisp.c (message_dolog):
13405 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13406 Use pMd etc. instead.
13407 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13408 replacing the pWIDE etc. symbols removed from editfns.c.
13409
13410 * keyboard.h (num_input_events): Now uintmax_t.
13411 This is (very slightly) less likely to mess up due to wraparound.
13412 All uses changed.
13413
13414 * buffer.c: Integer signedness fixes.
13415 (alloc_buffer_text, enlarge_buffer_text):
13416 Use ptrdiff_t rather than size_t when either will do, as we prefer
13417 signed integers.
13418
13419 * alloc.c: Integer signedness and overflow fixes.
13420 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13421 (__malloc_size_t): Default to size_t, not to int.
13422 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13423 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13424 Prefer ptrdiff_t to size_t when either would do, as we prefer
13425 signed integers.
13426 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13427 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13428 Now const. Initialize with values that are in range even if char
13429 is signed.
13430 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13431 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13432 These functions do the right thing with sizes > 2**32.
13433 (check_depth): Now ptrdiff_t, not int.
13434 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13435 Adjust to new way of storing sizes. Check for size overflow bugs
13436 in rest of code.
13437 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13438 slightly wrong anyway, as it missed one instance of
13439 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13440 (refill_memory_reserve): Omit needless cast to size_t.
13441 (mark_object_loop_halt): Mark as externally visible.
13442
13443 * xselect.c: Integer signedness and overflow fixes.
13444 (Fx_register_dnd_atom, x_handle_dnd_message):
13445 Use ptrdiff_t, not size_t, since we prefer signed.
13446 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13447 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13448 x_dnd_atoms_size and x_dnd_atoms_length.
13449
13450 * doprnt.c: Prefer signed to unsigned when either works.
13451 * eval.c (verror):
13452 * doprnt.c (doprnt):
13453 * lisp.h (doprnt):
13454 * xdisp.c (vmessage):
13455 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13456 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13457 prefer signed arithmetic to avoid comparison confusion.
13458 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13459 but is a bit tricky.
13460
13461 Assume freestanding C89 headers, string.h, stdlib.h.
13462 * data.c, doprnt.c, floatfns.c, print.c:
13463 Include float.h unconditionally.
13464 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13465 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13466 * regex.c: Likewise for stddef.h, string.h.
13467 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13468 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13469 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13470 (STDC_HEADERS): Remove obsolete defines.
13471 * sysdep.c: Include limits.h unconditionally.
13472
13473 Assume support for memcmp, memcpy, memmove, memset.
13474 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13475 * regex.c (memcmp, memcpy):
13476 Remove; we assume C89 now.
13477
13478 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13479 (__malloc_safe_bcopy): Remove; no longer needed.
13480
13481 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13482 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13483 well either way, and we prefer signed to unsigned.
13484
13485 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13486
13487 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13488 closes the connection while we're reading (bug#9182).
13489
13490 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13491
13492 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13493 are specified (Bug#9168).
13494
13495 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13496
13497 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13498 Found by GCC static checking and --with-wide-int on a 32-bit host.
13499
13500 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13501
13502 * xdisp.c (compute_display_string_pos): Fix logic of caching
13503 previous display string position. Initialize cached_prev_pos to
13504 -1. Fixes slow-down at the beginning of a buffer.
13505
13506 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13507
13508 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13509 for attrs[LFACE_FONTSET_INDEX].
13510
13511 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13512
13513 * xml.c (parse_region): Remove unused local
13514 that was recently introduced.
13515
13516 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13517
13518 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13519 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13520
13521 * xdisp.c (move_it_in_display_line_to): Record the best matching
13522 position for TO_CHARPOS while scanning the line, and restore it on
13523 exit if none of the characters scanned was an exact match.
13524 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13525 when exact match is impossible due to invisible text, and the
13526 lines are truncated.
13527
13528 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13529
13530 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13531 for OSX >= 10.7.
13532
13533 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13534
13535 Fix a significant slow-down of cursor motion with C-n, C-p,
13536 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13537 auto-repeat under bidi redisplay in fontified buffers.
13538 * xdisp.c (compute_stop_pos_backwards): New function.
13539 (next_element_from_buffer): Call compute_stop_pos_backwards to
13540 find a suitable prev_stop when we find ourselves before
13541 base_level_stop.
13542 (reseat): Don't look for prev_stop, as that could mean a very long
13543 run.
13544 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13545 <cached_disp_overlay_modiff>: Cache for last found display string
13546 position.
13547 (compute_display_string_pos): Return the cached position if asked
13548 about the same buffer in the same area of character positions, and
13549 the buffer wasn't changed since the time the display string
13550 position was cached.
13551
13552 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13553
13554 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13555 is an integer, which is important for empty lines. (Bug#9149)
13556
13557 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13558
13559 * frame.c (Fmodify_frame_parameters): In tty case, update the
13560 default face if necessary (Bug#4238).
13561
13562 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13563
13564 * editfns.c (Fstring_to_char): No need to explain what a character
13565 is in the docstring (Bug#6576).
13566
13567 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13568
13569 * xml.c (parse_region): Make sure we always return a tree.
13570
13571 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13572
13573 * xml.c (parse_region): If a document contains only comments,
13574 return that, too.
13575
13576 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13577
13578 * xml.c (make_dom): Return comments, too.
13579
13580 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13581
13582 Port to OpenBSD.
13583 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13584 and the surrounding thread.
13585 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13586 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13587 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13588 timer goes off.
13589 * s/openbsd.h (BROKEN_SIGIO): Define.
13590 * unexelf.c (unexec) [__OpenBSD__]:
13591 Don't update the .mdebug section of the Alpha COFF symbol table.
13592
13593 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13594
13595 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13596 (bug#8460).
13597
13598 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13599
13600 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13601 This fixes some race conditions on the permissions of any newly
13602 created file.
13603
13604 * alloc.c (valid_pointer_p): Use pipe, not open.
13605 This fixes some permissions issues when debugging.
13606
13607 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13608 If fchown fails to set both uid and gid, try to set just gid,
13609 as that is sometimes allowed. Adjust the file's mode to eliminate
13610 setuid or setgid bits that are inappropriate if fchown fails.
13611
13612 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13613
13614 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13615 to compare Lisp_Objects.
13616 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13617 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13618 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13619
13620 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13621
13622 * lread.c (read_integer): Unread even EOF character.
13623 (read1): Likewise. Properly record start position of symbol.
13624
13625 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13626 symbol character follows.
13627
13628 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13629
13630 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13631 This works around a problem with the previous change to Fcopy_file.
13632 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13633 and without this change, GCC might complain about discarding
13634 fchown's return value.
13635
13636 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13637
13638 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13639
13640 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13641
13642 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13643
13644 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13645
13646 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13647 it's used from the C level.
13648
13649 * process.c: Use the same condition for POLL_FOR_INPUT in both
13650 keyboard.c and process.c (bug#1858).
13651
13652 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13653
13654 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13655 (Fgnutls_boot): Use it.
13656
13657 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13658
13659 * doc.c (Fsubstitute_command_keys): Revert last change.
13660
13661 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13662
13663 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13664 quotes the next character, and doesn't affect other longer
13665 sequences (bug#8935).
13666
13667 * lread.c (syms_of_lread): Clarify that is isn't only
13668 `eval-buffer' and `eval-defun' that's affected by
13669 `lexical-binding' (bug#8460).
13670
13671 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13672
13673 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13674 bidi redisplay when a line includes both an image and is truncated.
13675
13676 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13677
13678 Fix minor problems found by static checking.
13679 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13680 (elsz): Now a signed constant, not a size_t var. We prefer signed
13681 types to unsigned, to avoid integer comparison confusion. Without
13682 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13683 "cannot optimize loop, the loop counter may overflow", a symptom
13684 of the confusion.
13685 * indent.c (Fvertical_motion): Mark locals as initialized.
13686 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13687
13688 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13689
13690 * search.c (Fre_search_backward): Mention `case-fold-search' in
13691 all the re_search_* functions (bug#8138).
13692
13693 * keyboard.c (Fopen_dribble_file): Document when the file is
13694 closed (bug#8056).
13695
13696 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13697
13698 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13699 bidi_cache_idx.
13700
13701 Support bidi reordering of display and overlay strings.
13702 * xdisp.c (compute_display_string_pos)
13703 (compute_display_string_end): Accept additional argument STRING.
13704 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13705 (reseat_to_string): Initialize bidi_it->string.s and
13706 bidi_it->string.schars.
13707 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13708 NULL (avoids a crash in bidi_paragraph_init).
13709 Initialize itb.string.lstring.
13710 (init_iterator): Call bidi_init_it only of a valid
13711 buffer position was specified. Initialize paragraph_embedding to
13712 L2R.
13713 (reseat_to_string): Initialize the bidi iterator.
13714 (display_string): If we need to ignore text properties of
13715 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13716 original value of -1 will not work with bidi.)
13717 (compute_display_string_pos): First arg is now struct
13718 `text_pos *'; all callers changed. Support display properties on
13719 Lisp strings.
13720 (compute_display_string_end): Support display properties on Lisp
13721 strings.
13722 (init_iterator, reseat_1, reseat_to_string): Initialize the
13723 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13724 when iterating on a string not from display properties).
13725 (compute_display_string_pos, compute_display_string_end):
13726 Fix calculation of the object to scan. Fixes an error when using
13727 arrow keys.
13728 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13729 base_level_stop; instead, set base_level_stop to BEGV.
13730 Fixes crashes in vertical-motion.
13731 (next_element_from_buffer): Improve commentary for when
13732 the iterator is before prev_stop.
13733 (init_iterator): Initialize bidi_p from the default value of
13734 bidi-display-reordering, not from buffer-local value. Use the
13735 buffer-local value only if initializing for buffer iteration.
13736 (handle_invisible_prop): Support invisible properties on strings
13737 that are being bidi-reordered.
13738 (set_iterator_to_next): Support bidi reordering of C strings and
13739 Lisp strings.
13740 (next_element_from_string): Support bidi reordering of Lisp
13741 strings.
13742 (handle_stop_backwards): Support Lisp strings as well.
13743 (display_string): Support display of R2L glyph rows.
13744 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13745 (init_iterator): Don't initialize it->bidi_p for strings
13746 here.
13747 (reseat_to_string): Initialize it->bidi_p for strings here.
13748 (next_element_from_string, next_element_from_c_string)
13749 (next_element_from_buffer): Add xassert's for correspondence
13750 between IT's object being iterated and it->bidi_it.string
13751 structure.
13752 (face_before_or_after_it_pos): Support bidi iteration.
13753 (next_element_from_c_string): Handle the case of the first string
13754 character that is not the first one in the visual order.
13755 (get_visually_first_element): New function, refactored from common
13756 parts of next_element_from_buffer, next_element_from_string, and
13757 next_element_from_c_string.
13758 (tool_bar_lines_needed, redisplay_tool_bar)
13759 (display_menu_bar): Force left-to-right direction. Add a FIXME
13760 comment for making that be controlled by a user option.
13761 (push_it, pop_it): Save and restore the state of the
13762 bidi iterator. Save and restore the bidi_p flag.
13763 (pop_it): Iterate out of display property for string iteration as
13764 well.
13765 (iterate_out_of_display_property): Support iteration over strings.
13766 (handle_single_display_spec): Set up it->bidi_it for iteration
13767 over a display string, and call bidi_init_it.
13768 (handle_single_display_spec, next_overlay_string)
13769 (get_overlay_strings_1, push_display_prop): Set up the bidi
13770 iterator for displaying display or overlay strings.
13771 (forward_to_next_line_start): Don't use the shortcut if
13772 bidi-iterating.
13773 (back_to_previous_visible_line_start): If handle_display_prop
13774 pushed the iterator stack, restore the internal state of the bidi
13775 iterator by calling bidi_pop_it same number of times.
13776 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13777 and we are bidi-iterating, don't decrement the iterator position;
13778 instead, set the first_elt flag in the bidi iterator, to produce
13779 the same effect.
13780 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13781 (push_display_prop): xassert that we are iterating a buffer.
13782 (push_it, pop_it): Save and restore paragraph_embedding member.
13783 (handle_single_display_spec, next_overlay_string)
13784 (get_overlay_strings_1, reseat_1, reseat_to_string)
13785 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13786 correctly. Don't assume unibyte strings are not bidi-reordered.
13787 (compute_display_string_pos)
13788 (compute_display_string_end): Fix handling the case of C string.
13789 (push_it, pop_it): Save and restore from_disp_prop_p.
13790 (handle_single_display_spec, push_display_prop): Set the
13791 from_disp_prop_p flag.
13792 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13793 (pop_it): Call iterate_out_of_display_property only if we are
13794 popping after iteration over a string that came from a display
13795 property. Fix a typo in popping stretch info. Add an assertion
13796 for verifying that the iterator position is in sync with the bidi
13797 iterator.
13798 (handle_single_display_spec, get_overlay_strings_1)
13799 (push_display_prop): Fix initialization of paragraph direction for
13800 string when that of the parent object is not yet determined.
13801 (reseat_1): Call bidi_init_it to resync the bidi
13802 iterator with IT's position. (Bug#7616)
13803 (find_row_edges): If ROW->start.pos gives position
13804 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13805 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13806 Reset the from_disp_prop_p flag.
13807 (SAVE_IT, RESTORE_IT): New macros.
13808 (pos_visible_p, face_before_or_after_it_pos)
13809 (back_to_previous_visible_line_start)
13810 (move_it_in_display_line_to, move_it_in_display_line)
13811 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13812 (try_scrolling, redisplay_window, display_line): Use them when
13813 saving a temporary copy of the iterator and restoring it back.
13814 (back_to_previous_visible_line_start, reseat_1)
13815 (init_iterator): Empty the bidi cache "stack".
13816 (move_it_in_display_line_to): If iterator ended up at
13817 EOL, but we never saw any buffer positions smaller than
13818 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13819 motion in bidi-reordered lines.
13820 (move_it_in_display_line_to): Record prev_method and prev_pos
13821 immediately before the call to set_iterator_to_next. Fixes cursor
13822 motion in bidi-reordered lines with stretch glyphs and strings
13823 displayed in margins. (Bug#8133) (Bug#8867)
13824 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13825 TO_CHARPOS.
13826 (pos_visible_p): Support positions in bidi-reordered lines.
13827 Save and restore bidi cache.
13828
13829 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13830 (bidi_paragraph_info): Delete unused struct.
13831 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13832 (bidi_cache_start): New variable.
13833 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13834 to zero.
13835 (bidi_cache_fetch_state, bidi_cache_search)
13836 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13837 (bidi_cache_find, bidi_peek_at_next_level)
13838 (bidi_level_of_next_char, bidi_find_other_level_edge)
13839 (bidi_move_to_visually_next): Compare cache index with
13840 bidi_cache_start rather than with zero.
13841 (bidi_fetch_char): Accept new argument STRING; all callers
13842 changed. Support iteration over a string. Support strings with
13843 display properties. Support unibyte strings. Fix the type of
13844 `len' according to what STRING_CHAR_AND_LENGTH expects.
13845 (bidi_paragraph_init, bidi_resolve_explicit_1)
13846 (bidi_resolve_explicit, bidi_resolve_weak)
13847 (bidi_level_of_next_char, bidi_move_to_visually_next):
13848 Support iteration over a string.
13849 (bidi_set_sor_type, bidi_resolve_explicit_1)
13850 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13851 can now be zero (for strings); special values 0 and -1 were
13852 changed to -1 and -2, respectively.
13853 (bidi_char_at_pos): New function.
13854 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13855 Call it instead of FETCH_MULTIBYTE_CHAR.
13856 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13857 initialized to valid values.
13858 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13859 values.
13860 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13861 the test for valid cached positions. Fix the logic for looking up
13862 the sentinel state in the cache. GCPRO the Lisp string we are
13863 iterating.
13864 (bidi_push_it, bidi_pop_it): New functions.
13865 (bidi_initialize): Initialize the bidi cache start stack pointer.
13866 (bidi_cache_ensure_space): New function, refactored from part of
13867 bidi_cache_iterator_state. Don't assume the required size is just
13868 one BIDI_CACHE_CHUNK away.
13869 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13870 (bidi_count_bytes, bidi_char_at_pos): New functions.
13871 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13872 always valid if bidi_cache_idx is valid.
13873 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13874 is valid if it's going to be used.
13875 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13876 (bidi_cache_fetch_state, bidi_cache_search)
13877 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13878 (bidi_cache_iterator_state, bidi_cache_find)
13879 (bidi_find_other_level_edge, bidi_cache_start_stack):
13880 All variables related to cache indices are now EMACS_INT.
13881
13882 * dispextern.h (struct bidi_string_data): New structure.
13883 (struct bidi_it): New member `string'. Make flag members be 1-bit
13884 fields, and put them last in the struct.
13885 (compute_display_string_pos, compute_display_string_end):
13886 Update prototypes.
13887 (bidi_push_it, bidi_pop_it): Add prototypes.
13888 (struct iterator_stack_entry): New members bidi_p,
13889 paragraph_embedding, and from_disp_prop_p.
13890 (struct it): Member bidi_p is now a bit field 1 bit wide.
13891 (bidi_shelve_cache, bidi_unshelve_cache):
13892 Declare prototypes.
13893
13894 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13895 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13896 and vector-like objects.
13897
13898 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13899 cache around display iteration.
13900
13901 * window.c (Fwindow_end, window_scroll_pixel_based)
13902 (displayed_window_lines, Frecenter): Save and restore the bidi
13903 cache around display iteration.
13904
13905 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13906
13907 * editfns.c (Fdelete_region): Clarify the use of the named
13908 parameters (bug#6788).
13909
13910 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13911
13912 * indent.c (Fvertical_motion): Set and restore w->pointm when
13913 saving and restoring the window's buffer (Bug#9006).
13914
13915 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13916
13917 * editfns.c (Fstring_to_char): Clarify just what is returned
13918 (bug#6576). Text by Eli Zaretskii.
13919
13920 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13921
13922 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13923
13924 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13925
13926 * buffer.c (mmap_find): Fix a typo.
13927
13928 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13929
13930 Fix execution of x selection hooks.
13931 * xselect.c (Qx_lost_selection_functions)
13932 (Qx_sent_selection_functions): New vars.
13933 (syms_of_xselect): DEFSYM them.
13934 (x_handle_selection_request): Pass Qx_sent_selection_functions
13935 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13936 (x_handle_selection_clear,x_clear_frame_selections):
13937 Pass Qx_lost_selection_functions rather than
13938 Vx_lost_selection_functions to Frun_hook_with_args.
13939
13940 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13941
13942 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13943 The old code sometimes used this field without initializing it.
13944
13945 * alloc.c (gc_sweep): Don't read past end of array.
13946 In theory, the old code could also have corrupted Emacs internals,
13947 though it'd be very unlikely.
13948
13949 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13950
13951 * character.c (Fcharacterp): Don't advertise optional ignored
13952 argument. (Bug#4026)
13953
13954 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13955
13956 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13957 key" (bug#4257).
13958
13959 * window.c (Fset_window_start): Doc fix (bug#4199).
13960 (Fset_window_hscroll): Ditto.
13961
13962 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13963
13964 Fix minor new problems caught by GCC 4.6.1.
13965 * term.c (init_tty): Remove unused local.
13966 * xsettings.c (store_monospaced_changed): Define this function only
13967 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13968 not used otherwise.
13969
13970 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13971
13972 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13973
13974 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13975
13976 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13977 are the mini-buffer and the echo area (bug#3320).
13978
13979 * term.c (init_tty): Remove support for supdup, c10 and perq
13980 terminals, which are no longer supported (bug#1482).
13981
13982 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13983
13984 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13985
13986 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13987
13988 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13989 for non-popups (Bug#3642).
13990
13991 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13992
13993 * alloc.c (reset_malloc_hooks): Protoize.
13994 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13995 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13996 * cm.c (losecursor): Likewise.
13997 * data.c (fmod): Likewise.
13998 * dispnew.c (swap_glyphs_in_rows): Likewise.
13999 * emacs.c (memory_warning_signal): Likewise.
14000 * floatfns.c (float_error): Likewise.
14001 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14002 (otf_open, font_otf_capability, generate_otf_features)
14003 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14004 Likewise.
14005 * image.c (pbm_read_file): Likewise.
14006 * indent.c (string_display_width): Likewise.
14007 * intervals.c (check_for_interval, search_for_interval)
14008 (inc_interval_count, count_intervals, root_interval)
14009 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14010 * lread.c (defalias): Likewise.
14011 * ralloc.c (r_alloc_check): Likewise.
14012 * regex.c (set_image_of_range_1, set_image_of_range)
14013 (regex_grow_registers): Likewise.
14014 * sysdep.c (strerror): Likewise.
14015 * termcap.c (valid_filename_p, tprint, main): Likewise.
14016 * tparam.c (main): Likewise.
14017 * unexhp9k800.c (run_time_remap, save_data_space)
14018 (update_file_ptrs, read_header, write_header, calculate_checksum)
14019 (copy_file, copy_rest, display_header): Likewise.
14020 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14021 Likewise.
14022 * xdisp.c (check_it): Likewise.
14023 * xfaces.c (register_color, unregister_color, unregister_colors):
14024 Likewise.
14025 * xfns.c (print_fontset_result): Likewise.
14026 * xrdb.c (member, fatal, main): Likewise.
14027
14028 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14029
14030 Fix minor problems found by static checking (Bug#9031).
14031 * chartab.c (char_table_set_range, map_sub_char_table):
14032 Remove unused locals.
14033 (uniprop_table): Now static.
14034 * composite.c (_work_char): Remove unused static var.
14035
14036 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
14037
14038 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14039
14040 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14041
14042 * gtkutil.c (qttip_cb): Remove code without function.
14043
14044 2011-07-09 Eli Zaretskii <eliz@gnu.org>
14045
14046 * w32.c (pthread_sigmask): New stub.
14047
14048 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
14049
14050 Use pthread_sigmask, not sigprocmask (Bug#9010).
14051 sigprocmask is portable only for single-threaded applications, and
14052 Emacs can be multi-threaded when it uses GTK.
14053 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14054 (LIBES): Use it.
14055 * callproc.c (Fcall_process):
14056 * process.c (create_process):
14057 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14058 Use pthread_sigmask, not sigprocmask.
14059
14060 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14061
14062 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14063 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14064 wrong (Bug#8591).
14065
14066 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14067
14068 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14069 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14070 (xg_hide_tooltip): Fix comment.
14071
14072 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14073 in registerServicesMenuSendTypes.
14074 (validRequestorForSendType): Don't check ns_return_types.
14075
14076 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14077 ns_return_type.
14078
14079 2011-07-08 Jason Rumney <jasonr@gnu.org>
14080
14081 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14082 SH_SHOW for hidden windows (Bug#5482).
14083
14084 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14085 frame struct members of non-existent frames (Bug#6284).
14086
14087 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14088
14089 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14090 variable firstTime not needed on OSX >= 10.6.
14091 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14092 >= 10.5. Use setKnobProportion, setDoubleValue.
14093
14094 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14095 (MAC_OS_X_VERSION_10_5): Define if not defined.
14096 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14097 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14098 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14099
14100 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14101 cString and lossyCString on OSX >= 10.4.
14102
14103 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14104 sizeToFit on OSX >= 10.2.
14105
14106 * nsimage.m (allocInitFromFile): Don't use deprecated method
14107 bestRepresentationForDevice on OSX >= 10.6.
14108
14109 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14110 to avoid warning.
14111
14112 * emacs.c: Declare unexec_init_emacs_zone.
14113
14114 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14115
14116 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14117
14118 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14119 on svcsMenu (Bug#8842).
14120
14121 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14122 ns_return_types.
14123 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14124
14125 * nsterm.m (QUTF8_STRING): Declare.
14126 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14127 (validRequestorForSendType): Return type is (id).
14128 Change indexOfObjectIdenticalTo to indexOfObject.
14129 Check if we have local selection before returning self (Bug#8842).
14130 (writeSelectionToPasteboard): Put local selection into paste board
14131 if we have a local selection (Bug#8842).
14132 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14133
14134 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14135 (ns_get_local_selection): Declare.
14136
14137 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14138
14139 * keymap.c (describe_map_tree): Don't insert a double newline at
14140 the end of the buffer (bug#1169) and return whether we inserted
14141 something.
14142
14143 * callint.c (Fcall_interactively): Change "reading args" to
14144 "providing args" to try to clarify what it does (bug#1010).
14145
14146 2011-07-07 Kenichi Handa <handa@m17n.org>
14147
14148 * composite.c (composition_compute_stop_pos): Ignore a static
14149 composition starting before CHARPOS (Bug#8915).
14150
14151 * xdisp.c (handle_composition_prop): Likewise.
14152
14153 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14154
14155 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14156 (Bug#9015)
14157
14158 2011-07-07 Kenichi Handa <handa@m17n.org>
14159
14160 * character.h (unicode_category_t): New enum type.
14161
14162 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14163 (Qchar_code_property_table): New variable.
14164 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14165 (UNIPROP_COMPRESSED_FORM_P): New macros.
14166 (char_table_ascii): Uncompress the compressed values.
14167 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14168 Uncompress the compressed values.
14169 (sub_char_table_ref_and_range): Likewise.
14170 (char_table_ref_and_range): Uncompress the compressed values.
14171 (sub_char_table_set): New arg is_uniprop. Callers changed.
14172 Uncompress the compressed values.
14173 (sub_char_table_set_range): Args changed. Callers changed.
14174 (char_table_set_range): Adjuted for the above change.
14175 (map_sub_char_table): Delete args default_val and parent. Add arg
14176 top. Give decoded values to a Lisp function.
14177 (map_char_table): Adjust for the above change. Give decoded
14178 values to a Lisp function. Gcpro more variables.
14179 (uniprop_table_uncompress)
14180 (uniprop_decode_value_run_length): New functions.
14181 (uniprop_decoder, uniprop_decoder_count): New variables.
14182 (uniprop_get_decoder, uniprop_encode_value_character)
14183 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14184 New functions.
14185 (uniprop_encoder, uniprop_encoder_count): New variables.
14186 (uniprop_get_encoder, uniprop_table)
14187 (Funicode_property_table_internal, Fget_unicode_property_internal)
14188 (Fput_unicode_property_internal): New functions.
14189 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14190 Sunicode_property_table_internal, Sget_unicode_property_internal,
14191 and Sput_unicode_property_internal. Defvar_lisp
14192 char-code-property-alist.
14193
14194 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14195 Vunicode_category_table.
14196
14197 * font.c (font_range): Adjust for the change of
14198 Vunicode_category_table.
14199
14200 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14201
14202 * m/iris4d.h: Remove file, move contents ...
14203 * s/irix6-5.h: ... here.
14204
14205 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14206
14207 Remove unportable assumption about struct layout (Bug#8884).
14208 * alloc.c (mark_buffer):
14209 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14210 (clone_per_buffer_values): Don't assume that
14211 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14212 This isn't true in general, and it's particularly not true
14213 if Emacs is configured with --with-wide-int.
14214 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14215 New macros, used in the buffer.c change.
14216
14217 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14218
14219 * xsettings.c: Use both GConf and GSettings if both are available.
14220 (store_config_changed_event): Add comment.
14221 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14222 (store_tool_bar_style_changed): New functions.
14223 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14224 (struct xsettings): Move font inside HAVE_XFT.
14225 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14226 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14227 Move inside HAVE_XFT.
14228 (something_changed_gsettingsCB): Rename from something_changedCB.
14229 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14230 also.
14231 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14232 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14233 (something_changed_gconfCB): Rename from something_changedCB.
14234 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14235 (parse_settings): Move check for font inside HAVE_XFT.
14236 (read_settings, apply_xft_settings): Add comment.
14237 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14238 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14239 call store_font_name_changed.
14240 (xft_settings_event): Add comment.
14241 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14242 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14243 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14244 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14245 (xsettings_initialize): Call init_gsettings last.
14246 (xsettings_get_system_font, xsettings_get_system_normal_font):
14247 Add comment.
14248
14249 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14250
14251 Random fixes. E.g., (random) never returned negative values.
14252 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14253 subseconds part to the entropy, as that's a bit more random.
14254 Prefer signed to unsigned, since the signedness doesn't matter and
14255 in general we prefer signed. When given a limit, use a
14256 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14257 latter isn't right if USE_2_TAGS_FOR_INTS.
14258 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14259 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14260
14261 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14262
14263 * textprop.c (text_property_stickiness):
14264 Obey Vtext_property_default_nonsticky.
14265 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14266 * w32fns.c (syms_of_w32fns):
14267 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14268
14269 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14270
14271 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14272 This is more efficient than Ffile_directory_p and avoids a minor race.
14273
14274 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14275
14276 * buffer.c (Foverlay_put): Say what the return value is
14277 (bug#7835).
14278
14279 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14280 is a directory before asking whether to use the file name
14281 (bug#7564).
14282 (barf_or_query_if_file_exists): Make the "File is a directory"
14283 error be more correct.
14284
14285 * fns.c (Frequire): Remove the mention of the .gz files, since
14286 that's installation-specific, but keep the mention of
14287 `get-load-suffixes'.
14288
14289 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14290
14291 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14292 Report string overflow if the output is too long.
14293
14294 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14295
14296 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14297 (syms_of_gnutls): Remove duplicate DEFSYM for
14298 Qgnutls_bootprop_verify_hostname_error, an error for
14299 Qgnutls_bootprop_verify_error (which is no longer used).
14300
14301 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14302 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14303 Also (re)move comments that are misplaced or no longer relevant.
14304
14305 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14306
14307 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14308
14309 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14310
14311 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14312 and background color parameters if they have been changed.
14313
14314 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14315
14316 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14317
14318 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14319
14320 * xsettings.c (SYSTEM_FONT): Define only when used.
14321 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14322
14323 * keymap.c (access_keymap_1): Now static.
14324
14325 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14326
14327 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14328 leave any prefix arg for the up event (Bug#1586).
14329
14330 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14331
14332 * lread.c (syms_of_lread): Mention single symbols defined by
14333 `defvar' or `defconst' (bug#7154).
14334
14335 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14336 (Frequire): Mention get-load-suffixes.
14337
14338 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14339
14340 * window.h (window): Remove clone_number slot.
14341 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14342 Remove.
14343 (make_parent_window, make_window, saved_window)
14344 (Fset_window_configuration, save_window_save): Don't deal with
14345 clone numbers.
14346 * buffer.c (Qclone_number): Remove declaration.
14347 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14348
14349 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14350
14351 Add multiple inheritance to keymaps.
14352 * keymap.c (Fmake_composed_keymap): New function.
14353 (Fset_keymap_parent): Simplify.
14354 (fix_submap_inheritance): Remove.
14355 (access_keymap_1): New function extracted from access_keymap to handle
14356 embedded parents and handle lists of maps.
14357 (access_keymap): Use it.
14358 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14359 (Fcopy_keymap): Handle embedded parents.
14360 (Fcommand_remapping, define_as_prefix): Simplify.
14361 (Fkey_binding): Simplify.
14362 (syms_of_keymap): Move minibuffer-local-completion-map,
14363 minibuffer-local-filename-completion-map,
14364 minibuffer-local-must-match-map, and
14365 minibuffer-local-filename-must-match-map to Elisp.
14366 (syms_of_keymap): Defsubr make-composed-keymap.
14367 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14368 (parse_menu_item): Trivial simplification.
14369
14370 2011-07-01 Glenn Morris <rgm@gnu.org>
14371
14372 * Makefile.in (SETTINGS_LIBS): Fix typo.
14373
14374 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14375
14376 * coding.c (Fencode_coding_string): Record the last coding system
14377 used, as the function doc string says (bug#8738).
14378
14379 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14380
14381 * xsettings.c (store_monospaced_changed): Take new font as arg and
14382 check for change against current_mono_font.
14383 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14384 (emacs_settings_constructor, emacs_settings_get_property)
14385 (emacs_settings_set_property, emacs_settings_class_init)
14386 (emacs_settings_init, gsettings_obj): Remove.
14387 (something_changedCB): New function for HAVE_GSETTINGS.
14388 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14389 with value as argument.
14390 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14391 g_settings_new (Bug#8967). Do not create gsettings_obj.
14392 Remove calls to g_settings_bind. Connect something_changedCB to
14393 "changed".
14394
14395 * xgselect.c: Add defined (HAVE_GSETTINGS).
14396 (xgselect_initialize): Ditto.
14397
14398 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14399 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14400 xg_select.
14401
14402 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14403
14404 * eval.c (struct backtrace): Simplify and port the data structure.
14405 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14406 signed bit field, as this assumption is not portable and it makes
14407 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14408 "char debug_on_exit : 1" as this is not portable either; instead,
14409 use the portable "unsigned int debug_on_exit : 1". Remove unused
14410 member evalargs. Remove obsolete comments about cc bombing out.
14411
14412 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14413
14414 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14415 Let HAVE_GSETTINGS override HAVE_GCONF.
14416 (store_monospaced_changed): New function.
14417 (EMACS_SETTINGS): A new type derived from GObject to handle
14418 GSettings notifications.
14419 (emacs_settings_constructor, emacs_settings_get_property)
14420 (emacs_settings_set_property, emacs_settings_class_init):
14421 New functions.
14422 (gsettings_client, gsettings_obj): New variables.
14423 (GSETTINGS_SCHEMA): New define.
14424 (something_changedCB): Call store_monospaced_changed.
14425 (init_gsettings): New function.
14426 (xsettings_initialize): Call init_gsettings.
14427 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14428 to NULL.
14429
14430 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14431 GCONF_CFLAGS/LIBS.
14432
14433 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14434
14435 * window.c (resize_root_window, grow_mini_window)
14436 (shrink_mini_window): Rename Qresize_root_window to
14437 Qwindow_resize_root_window and Qresize_root_window_vertically to
14438 Qwindow_resize_root_window_vertically.
14439
14440 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14441
14442 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14443
14444 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14445
14446 * makefile.w32-in: Redesign dependencies so they reflect more
14447 clearly which files are directly included by each source file,
14448 and not through other includes.
14449
14450 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14451
14452 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14453 (sort_overlays, overlay_strings): When an overlay's clone number
14454 matches the window's clone number process the overlay even if
14455 the overlay's window property doesn't match the current window.
14456
14457 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14458 (Fwindow_hchild): Rename to Fwindow_left_child.
14459 (Fwindow_next): Rename to Fwindow_next_sibling.
14460 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14461 (resize_window_check): Rename to window_resize_check.
14462 (resize_window_apply): Rename to window_resize_apply.
14463 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14464 (Fdelete_other_windows_internal, resize_frame_windows)
14465 (Fsplit_window_internal, Fdelete_window_internal)
14466 (grow_mini_window, shrink_mini_window)
14467 (Fresize_mini_window_internal): Fix callers accordingly.
14468
14469 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14470
14471 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14472 (emacs_fixed_set_min_size): Remove.
14473 (emacs_fixed_new): Take frame as argument.
14474
14475 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14476 (_EmacsFixedPrivate): Remove minwidth/height.
14477 Add struct frame *f.
14478 (emacs_fixed_init): Initialize priv->f.
14479 (get_parent_class, emacs_fixed_set_min_size): Remove.
14480 (emacs_fixed_new): Set priv->f to argument.
14481 (emacs_fixed_get_preferred_width)
14482 (emacs_fixed_get_preferred_height): Use min_width/height from
14483 frames size_hint to set minimum and natural (Bug#8919).
14484 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14485 and use min_width/height from frames size_hint to set
14486 min_width/height (Bug#8919).
14487
14488 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14489 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14490 Fix indentation.
14491
14492 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14493
14494 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14495 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14496 called at ZV.
14497
14498 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14499
14500 * process.c (wait_reading_process_output): Bypass select if
14501 waiting for a cell while ignoring keyboard input, and input is
14502 pending. Suggested by Jan Djärv (Bug#8869).
14503
14504 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14505
14506 Use gnulib's dup2 module instead of rolling our own.
14507 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14508
14509 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14510
14511 * dispnew.c (scrolling_window): Before scrolling, turn off a
14512 mouse-highlight in the window being scrolled.
14513
14514 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14515
14516 Move DEFSYM to lisp.h and use everywhere.
14517
14518 * character.h (DEFSYM): Move declaration...
14519 * lisp.h (DEFSYM): ...here.
14520
14521 * gnutls.c:
14522 * minibuf.c:
14523 * w32menu.c:
14524 * w32proc.c:
14525 * w32select.c: Don't include character.h.
14526
14527 * alloc.c (syms_of_alloc):
14528 * buffer.c (syms_of_buffer):
14529 * bytecode.c (syms_of_bytecode):
14530 * callint.c (syms_of_callint):
14531 * casefiddle.c (syms_of_casefiddle):
14532 * casetab.c (init_casetab_once):
14533 * category.c (init_category_once, syms_of_category):
14534 * ccl.c (syms_of_ccl):
14535 * cmds.c (syms_of_cmds):
14536 * composite.c (syms_of_composite):
14537 * dbusbind.c (syms_of_dbusbind):
14538 * dired.c (syms_of_dired):
14539 * dispnew.c (syms_of_display):
14540 * doc.c (syms_of_doc):
14541 * editfns.c (syms_of_editfns):
14542 * emacs.c (syms_of_emacs):
14543 * eval.c (syms_of_eval):
14544 * fileio.c (syms_of_fileio):
14545 * fns.c (syms_of_fns):
14546 * frame.c (syms_of_frame):
14547 * fringe.c (syms_of_fringe):
14548 * insdel.c (syms_of_insdel):
14549 * keymap.c (syms_of_keymap):
14550 * lread.c (init_obarray, syms_of_lread):
14551 * macros.c (syms_of_macros):
14552 * msdos.c (syms_of_msdos):
14553 * print.c (syms_of_print):
14554 * process.c (syms_of_process):
14555 * search.c (syms_of_search):
14556 * sound.c (syms_of_sound):
14557 * syntax.c (init_syntax_once, syms_of_syntax):
14558 * terminal.c (syms_of_terminal):
14559 * textprop.c (syms_of_textprop):
14560 * undo.c (syms_of_undo):
14561 * w32.c (globals_of_w32):
14562 * window.c (syms_of_window):
14563 * xdisp.c (syms_of_xdisp):
14564 * xfaces.c (syms_of_xfaces):
14565 * xfns.c (syms_of_xfns):
14566 * xmenu.c (syms_of_xmenu):
14567 * xsettings.c (syms_of_xsettings):
14568 * xterm.c (syms_of_xterm): Use DEFSYM.
14569
14570 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14571
14572 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14573
14574 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14575
14576 Integer and buffer overflow fixes (Bug#8873).
14577
14578 * print.c (printchar, strout): Check for string overflow.
14579 (PRINTPREPARE, printchar, strout):
14580 Don't set size unless allocation succeeds.
14581
14582 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14583 for sizes. Check for string overflow more accurately.
14584 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14585
14586 * macros.c: Integer and buffer overflow fixes.
14587 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14588 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14589 Use ptrdiff_t, not int, for sizes.
14590 Don't increment bufsize until after realloc succeeds.
14591 Check for size-calculation overflow.
14592 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14593
14594 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14595
14596 * lread.c: Integer overflow fixes.
14597 (read_integer): Radix is now EMACS_INT, not int,
14598 to improve quality of diagnostics for out-of-range radices.
14599 Calculate buffer size correctly for out-of-range radices.
14600 (read1): Check for integer overflow in radices, and in
14601 read-circle numbers.
14602 (read_escape): Avoid int overflow.
14603 (Fload, openp, read_buffer_size, read1)
14604 (substitute_object_recurse, read_vector, read_list, map_obarray):
14605 Use ptrdiff_t, not int, for sizes.
14606 (read1): Use EMACS_INT, not int, for sizes.
14607 Check for size overflow.
14608
14609 * image.c (cache_image): Check for size arithmetic overflow.
14610
14611 * lread.c: Integer overflow issues.
14612 (saved_doc_string_size, saved_doc_string_length)
14613 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14614 Now ptrdiff_t, not int.
14615 (read1): Don't assume doc string length fits in int. Check for
14616 out-of-range doc string lengths.
14617 (read_list): Don't assume file position fits in int.
14618 (read_escape): Check for hex character overflow.
14619
14620 2011-06-22 Leo Liu <sdl.web@gmail.com>
14621
14622 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14623 Move to minibuffer.el.
14624
14625 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14626
14627 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14628 The following patches are for when GLYPH_DEBUG && !XASSERT.
14629 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14630 * dispnew.c (flush_stdout):
14631 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14632 Mark as externally visible.
14633 * dispnew.c (check_window_matrix_pointers): Now static.
14634 * dispnew.c (window_to_frame_vpos):
14635 * xfns.c (unwind_create_frame):
14636 * xterm.c (x_check_font): Remove unused local.
14637 * scroll.c (CHECK_BOUNDS):
14638 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14639 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14640 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14641 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14642 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14643 Now static.
14644 (debug_method_add): Use va_list and vsprintf rather than relying
14645 on undefined behavior with wrong number of arguments.
14646 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14647 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14648 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14649 since we're not interested in debugging glyphs with old libraries.
14650 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14651 GCC 4.6.0's static checking.
14652
14653 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14654
14655 Integer overflow and signedness fixes (Bug#8873).
14656 A few related buffer overrun fixes, too.
14657
14658 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14659
14660 * dispextern.h (struct face.stipple):
14661 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14662 (x_bitmap_mask, x_allocate_bitmap_record)
14663 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14664 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14665 (x_create_bitmap_from_xpm_data):
14666 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14667 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14668 (.bitmaps_last):
14669 * xfaces.c (load_pixmap):
14670 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14671 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14672 (.bitmaps_last, struct x_output.icon_bitmap):
14673 Use ptrdiff_t, not int, for bitmap indexes.
14674 (x_allocate_bitmap_record): Check for size overflow.
14675 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14676
14677 Use ptrdiff_t, not int, for overlay counts.
14678 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14679 * editfns.c (overlays_around, get_pos_property):
14680 * textprop.c (get_char_property_and_overlay):
14681 * xdisp.c (next_overlay_change, note_mouse_highlight):
14682 * xfaces.c (face_at_buffer_position):
14683 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14684 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14685 (Fnext_overlay_change, Fprevious_overlay_change)
14686 (mouse_face_overlay_overlaps, Foverlays_in):
14687 Use ptrdiff_t, not int, for sizes.
14688 (overlays_at, overlays_in): Check for size-calculation overflow.
14689
14690 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14691
14692 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14693 (x_session_initialize): Do not assume string length fits in int.
14694
14695 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14696 This is unlikely, but can occur if DPI is outlandish.
14697
14698 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14699 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14700
14701 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14702 * xrdb.c (magic_file_p, search_magic_path):
14703 Omit last arg SUFFIX; it was always 0. All callers changed.
14704 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14705
14706 * xfont.c (xfont_match): Avoid need for strlen.
14707
14708 * xfns.c: Don't assume strlen fits in int.
14709 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14710
14711 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14712 not unsigned long, as we prefer signed integers. All callers changed.
14713 Detect integer overflow in repeat count.
14714 (message_dolog): Don't assume print length fits in 39 bytes.
14715 (display_mode_element): Don't assume strlen fits in int.
14716
14717 * termcap.c: Don't assume sizes fit in int and never overflow.
14718 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14719 (gobble_line): Check for size-calculation overflow.
14720
14721 * minibuf.c (Fread_buffer):
14722 * lread.c (intern, intern_c_string):
14723 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14724 Don't assume string length fits in int.
14725
14726 * keyboard.c (parse_tool_bar_item):
14727 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14728
14729 * font.c: Don't assume string length fits in int.
14730 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14731 Use ptrdiff_t, not int.
14732 (font_intern_prop): Don't assume string length fits in int.
14733 Don't assume integer property fits in fixnum.
14734 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14735
14736 * filelock.c: Fix some buffer overrun and integer overflow issues.
14737 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14738 Reformulate so as not to need the command string.
14739 Invoke gzip -cd rather than gunzip, as it's more portable.
14740 (lock_info_type, lock_file_1, lock_file):
14741 Don't assume pid_t and time_t fit in unsigned long.
14742 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14743 (current_lock_owner): Prefer signed type for sizes.
14744 Use memcpy, not strncpy, where memcpy is what is really wanted.
14745 Don't assume (via atoi) that time_t and pid_t fit in int.
14746 Check for time_t and/or pid_t out of range, e.g., via a network share.
14747 Don't alloca where an auto var works fine.
14748
14749 * fileio.c: Fix some integer overflow issues.
14750 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14751 Don't assume string length fits in int.
14752 (directory_file_name): Don't assume string length fits in long.
14753 (make_temp_name): Don't assume pid fits in int, or that its print
14754 length is less than 20.
14755
14756 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14757
14758 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14759
14760 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14761
14762 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14763 We prefer signed integers, even for size calculations.
14764
14765 * emacs.c: Don't assume string length fits in 'int'.
14766 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14767 (main): Don't invoke strlen when not needed.
14768
14769 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14770 (XD_DEBUG_MESSAGE): Don't waste a byte.
14771
14772 * callproc.c (getenv_internal_1, getenv_internal)
14773 (Fgetenv_internal):
14774 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14775
14776 * lread.c (invalid_syntax): Omit length argument.
14777 All uses changed. This doesn't fix a bug, but it simplifies the
14778 code away from its former Hollerith-constant appearance, and it's
14779 one less 'int' to worry about when looking at integer-overflow issues.
14780 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14781
14782 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14783 This didn't break anything, but it didn't help either.
14784 It's confusing to put a bogus integer in a place where the actual
14785 value does not matter.
14786 (LIST_END_P): Remove unused macro and its bogus comment.
14787 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14788
14789 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14790 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14791 implementation.
14792 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14793 We prefer signed types, and the value cannot exceed the EMACS_INT
14794 range anyway (because otherwise the length would not be representable).
14795 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14796 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14797 This avoids a GCC warning when WIDE_EMACS_INT.
14798
14799 * indent.c (sane_tab_width): New function.
14800 (current_column, scan_for_column, Findent_to, position_indentation)
14801 (compute_motion): Use it. This is just for clarity.
14802 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14803
14804 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14805
14806 * lisp.h (lint_assume): New macro.
14807 * composite.c (composition_gstring_put_cache):
14808 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14809
14810 * editfns.c, insdel.c:
14811 Omit unnecessary forward decls, to simplify future changes.
14812
14813 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14814
14815 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14816
14817 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14818 Use much-faster test for byte-length change.
14819 Don't assume string byte-length fits in 'int'.
14820 Check that character arg fits in 'int'.
14821 (mapcar1): Declare byte as byte, for clarity.
14822
14823 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14824
14825 * fns.c (concat): Catch string overflow earlier.
14826 Do not rely on integer wraparound.
14827
14828 * dispextern.h (struct it.overlay_strings_charpos)
14829 (struct it.selective): Now EMACS_INT, not int.
14830 * xdisp.c (forward_to_next_line_start)
14831 (back_to_previous_visible_line_start)
14832 (reseat_at_next_visible_line_start, next_element_from_buffer):
14833 Don't arbitrarily truncate the value of 'selective' to int.
14834
14835 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14836
14837 * composite.c: Don't truncate sizes to 'int'.
14838 (composition_gstring_p, composition_reseat_it)
14839 (composition_adjust_point): Use EMACS_INT, not int.
14840 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14841 not EMACS_UINT, for indexes.
14842
14843 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14844
14845 * buffer.c: Include <verify.h>.
14846 (struct sortvec.priority, struct sortstr.priority):
14847 Now EMACS_INT, not int.
14848 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14849 (struct sortstr.size, record_overlay_string)
14850 (struct sortstrlist.size, struct sortlist.used):
14851 Don't truncate size to int.
14852 (record_overlay_string): Check for size-calculation overflow.
14853 (init_buffer_once): Check at compile-time, not run-time.
14854
14855 2011-06-22 Jim Meyering <meyering@redhat.com>
14856
14857 Don't leak an XBM-image-sized buffer
14858 * image.c (xbm_load): Free the image buffer after using it.
14859
14860 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14861
14862 Port to Sun C.
14863 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14864 that Sun C diagnosed.
14865 * fns.c (secure_hash): Fix pointer signedness issue.
14866 * intervals.c (static_offset_intervals): New function.
14867 (offset_intervals): Use it.
14868
14869 2011-06-21 Leo Liu <sdl.web@gmail.com>
14870
14871 * deps.mk (fns.o):
14872 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14873 sha512.h.
14874
14875 * fns.c (secure_hash): Rename from crypto_hash_function and change
14876 the first arg to accept symbols.
14877 (Fsecure_hash): New primitive.
14878 (syms_of_fns): New symbols.
14879
14880 2011-06-20 Deniz Dogan <deniz@dogan.se>
14881
14882 * process.c (Fset_process_buffer): Clarify return value in
14883 docstring.
14884
14885 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14886
14887 * dispnew.c (add_window_display_history): Use BVAR.
14888
14889 * xdisp.c (debug_method_add): Use BVAR.
14890 (check_window_end, dump_glyph_matrix, dump_glyph)
14891 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14892
14893 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14894 Likewise.
14895
14896 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14897 check till after the cache is created in init_frame_faces.
14898
14899 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14900
14901 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14902
14903 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14904
14905 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14906 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14907 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14908
14909 Improve buffer-overflow checking (Bug#8873).
14910 * fileio.c (Finsert_file_contents):
14911 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14912 Remove the old (too-loose) buffer overflow checks.
14913 They weren't needed, since make_gap checks for buffer overflow.
14914 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14915 The old code merely checked for Emacs fixnum overflow, and relied
14916 on undefined (wraparound) behavior. The new code avoids undefined
14917 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14918
14919 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14920 Tune. Don't use wider integers than needed. Don't use alloca.
14921 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14922
14923 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14924
14925 * insdel.c, lisp.h (buffer_overflow): New function.
14926 (insert_from_buffer_1, replace_range, replace_range_2):
14927 * insdel.c (make_gap_larger):
14928 * editfns.c (Finsert_char):
14929 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14930
14931 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14932
14933 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14934
14935 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14936
14937 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14938 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14939
14940 * fileio.c: Don't assume EMACS_INT fits in off_t.
14941 (emacs_lseek): New static function.
14942 (Finsert_file_contents, Fwrite_region): Use it.
14943 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14944
14945 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14946
14947 * fns.c: Don't overflow int when computing a list length.
14948 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14949 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14950 truncation on 64-bit hosts. Check for QUIT every
14951 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14952 faster and is responsive enough.
14953 (Flength): Report an error instead of overflowing an integer.
14954 (Fsafe_length): Return a float if the value is not representable
14955 as a fixnum. This shouldn't happen except in contrived situations.
14956 (Fnthcdr, Fsort): Don't assume list length fits in int.
14957 (Fcopy_sequence): Don't assume vector length fits in int.
14958
14959 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14960 (header_size, word_size): New constants.
14961 (allocate_vectorlike): Don't check size overflow here.
14962 (allocate_vector): Check it here instead, since this is the only
14963 caller of allocate_vectorlike that could cause overflow.
14964 Check that the new vector's length is representable as a fixnum.
14965
14966 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14967 The previous code was bogus. For example, next_almost_prime (32)
14968 returned 39, which is undesirable as it is a multiple of 3; and
14969 next_almost_prime (24) returned 25, which is a multiple of 5 so
14970 why was the code bothering to check for multiples of 7?
14971
14972 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14973
14974 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14975
14976 Variadic C functions now count arguments with ptrdiff_t.
14977 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14978 Back then I didn't know that the Emacs coding style prefers signed int.
14979 Also, in the meantime I found a few more instances where arguments
14980 were being counted with int, which may truncate counts on 64-bit
14981 machines, or EMACS_INT, which may be unnecessarily wide.
14982 * lisp.h (struct Lisp_Subr.function.aMANY)
14983 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14984 Arg counts are now ptrdiff_t, not size_t.
14985 All variadic functions and their callers changed accordingly.
14986 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14987 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14988 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14989 * callint.c (Fcall_interactively): Check arg count for overflow,
14990 to avoid potential buffer overrun. Use signed char, not 'int',
14991 for 'varies' array, so that we needn't bother to check its size
14992 calculation for overflow.
14993 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14994 * eval.c (apply_lambda):
14995 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14996 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14997 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14998
14999 * callint.c (Fcall_interactively): Don't use index var as event count.
15000
15001 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15002 * mem-limits.h (SIZE): Remove; no longer used.
15003
15004 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
15005
15006 Remove unnecessary casts.
15007 * xterm.c (x_term_init):
15008 * xfns.c (x_set_border_pixel):
15009 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15010 These aren't needed now that we assume ANSI C.
15011
15012 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15013 It's more likely to cause problems (due to unsigned overflow)
15014 than to cure them.
15015
15016 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15017
15018 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15019
15020 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15021
15022 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15023
15024 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15025
15026 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15027
15028 GLYPH_CODE_FACE returns EMACS_INT, not int.
15029 * dispextern.h (merge_faces):
15030 * xfaces.c (merge_faces):
15031 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15032 Don't assume EMACS_INT fits in int.
15033
15034 * character.h (CHAR_VALID_P): Remove unused parameter.
15035 * fontset.c, lisp.h, xdisp.c: All uses changed.
15036
15037 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15038
15039 * fns.c (concat): Minor tuning based on overflow analysis.
15040 This doesn't fix any bugs. Use int to hold character, instead
15041 of constantly refetching from Emacs object. Use XFASTINT, not
15042 XINT, for value known to be a character. Don't bother comparing
15043 a single byte to 0400, as it's always less.
15044
15045 * floatfns.c (Fexpt):
15046 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15047
15048 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15049 for characters.
15050
15051 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15052
15053 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15054 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15055 incorrectly succeed when S was a string, because 4294967386 was
15056 truncated before it was used.
15057
15058 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15059 Otherwise, an out-of-range integer could cause undefined behavior
15060 on a 64-bit host.
15061
15062 * composite.c: Use int, not EMACS_INT, for characters.
15063 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15064 EMACS_INT, for values that are known to be in character range.
15065 This doesn't fix any bugs but is the usual style inside Emacs and
15066 may generate better code on 32-bit machines.
15067
15068 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15069 This is for reasons similar to the recent CHAR_STRING fix.
15070 * charset.c (Fencode_char): Check that character arg is actually
15071 a character. Pass an int to ENCODE_CHAR.
15072 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15073 wider than 'int', as a compile-time check to prevent future regressions
15074 in this area.
15075
15076 * character.c (char_string): Remove unnecessary casts.
15077
15078 Make sure a 64-bit char is never passed to CHAR_STRING.
15079 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15080 by silently ignoring the top 32 bits, allowing some values
15081 that were far too large to be valid characters.
15082 * character.h: Include <verify.h>.
15083 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15084 arguments are no wider than unsigned, as a compile-time check
15085 to prevent future regressions in this area.
15086 * data.c (Faset):
15087 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15088 (Fsubst_char_in_region):
15089 * fns.c (concat):
15090 * xdisp.c (decode_mode_spec_coding):
15091 Adjust to CHAR_STRING's new requirement.
15092 * editfns.c (Finsert_char, Fsubst_char_in_region):
15093 * fns.c (concat): Check that character args are actually
15094 characters. Without this test, these functions did the wrong
15095 thing with wildly out-of-range values on 64-bit hosts.
15096
15097 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15098 These casts should not be needed on 32-bit hosts, either.
15099 * keyboard.c (read_char):
15100 * lread.c (Fload): Remove casts to unsigned.
15101
15102 * lisp.h (UNSIGNED_CMP): New macro.
15103 This fixes comparison bugs on 64-bit hosts.
15104 (ASCII_CHAR_P): Use it.
15105 * casefiddle.c (casify_object):
15106 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15107 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15108 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15109 * dispextern.h (FACE_FROM_ID):
15110 * keyboard.c (read_char): Use UNSIGNED_CMP.
15111
15112 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15113 not to EMACS_INT, to avoid GCC warning.
15114
15115 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15116
15117 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15118 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15119 isn't needed on 32-bit machines.
15120
15121 * buffer.c (Fgenerate_new_buffer_name):
15122 Use EMACS_INT for count, not int.
15123 (advance_to_char_boundary): Return EMACS_INT, not int.
15124
15125 * data.c (Qcompiled_function): Now static.
15126
15127 * window.c (window_body_lines): Now static.
15128
15129 * image.c (gif_load): Rename local to avoid shadowing.
15130
15131 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15132 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15133 * alloc.c (make_save_value): Integer argument is now of type
15134 ptrdiff_t, not int.
15135 (mark_object): Use ptrdiff_t, not int.
15136 * lisp.h (pD): New macro.
15137 * print.c (print_object): Use it.
15138
15139 * alloc.c: Use EMACS_INT, not int, to count objects.
15140 (total_conses, total_markers, total_symbols, total_vector_size)
15141 (total_free_conses, total_free_markers, total_free_symbols)
15142 (total_free_floats, total_floats, total_free_intervals)
15143 (total_intervals, total_strings, total_free_strings):
15144 Now EMACS_INT, not int. All uses changed.
15145 (Fgarbage_collect): Compute overall total using a double, so that
15146 integer overflow is less likely to be a problem. Check for overflow
15147 when converting back to an integer.
15148 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15149 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15150 These were 'int' variables that could overflow on 64-bit hosts;
15151 they were never used, so remove them instead of repairing them.
15152 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15153 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15154 Previously, this ceilinged at INT_MAX, but that doesn't work on
15155 64-bit machines.
15156 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15157
15158 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15159 (allocate_vectorlike): Check for ptrdiff_t overflow.
15160 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15161 when a (possibly-narrower) signed value would do just as well.
15162 We prefer using signed arithmetic, to avoid comparison confusion.
15163
15164 * alloc.c: Catch some string size overflows that we were missing.
15165 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15166 for convenience in STRING_BYTES_MAX.
15167 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15168 The definition here is exact; the one in lisp.h was approximate.
15169 (allocate_string_data): Check for string overflow. This catches
15170 some instances we weren't catching before. Also, it catches
15171 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15172 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15173 and ptrdiff_t and EMACS_INT are both 64 bits.
15174
15175 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15176 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15177 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15178
15179 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15180
15181 * alloc.c (Fmake_string): Check for out-of-range init.
15182
15183 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15184
15185 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15186
15187 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15188
15189 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15190 xg_get_default_scrollbar_width.
15191
15192 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15193 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15194 (style_changed_cb): Call update_theme_scrollbar_width and call
15195 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15196 all frames (Bug#8505).
15197 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15198 Call gtk_window_set_resizable if HAVE_GTK3.
15199 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15200 and height if HAVE_GTK3 (Bug#8505).
15201 (scroll_bar_width_for_theme): New variable.
15202 (update_theme_scrollbar_width): New function.
15203 (xg_get_default_scrollbar_width): Move code to
15204 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15205 (xg_initialize): Call update_theme_scrollbar_width.
15206
15207 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15208
15209 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15210
15211 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15212
15213 * frame.c (make_frame): Call other_buffer_safely instead of
15214 other_buffer.
15215
15216 * window.c (temp_output_buffer_show): Call display_buffer with
15217 second argument Vtemp_buffer_show_specifiers and reset latter
15218 immediately after the call.
15219 (Vtemp_buffer_show_specifiers): New variable.
15220 (auto_window_vscroll_p, next_screen_context_lines)
15221 (Vscroll_preserve_screen_position): Remove leading asterisks from
15222 doc-strings.
15223
15224 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15225
15226 Fix minor problems found by GCC 4.6.0 static checking.
15227 * buffer.c (Qclone_number): Remove for now, as it's unused.
15228 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15229 (record_buffer): Remove unused local.
15230 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15231 (set_frame_buffer_list): Remove; unused.
15232 * frame.h (other_visible_frames): Remove decl.
15233 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15234 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15235 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15236 if HAVE_GPM.
15237 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15238 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15239 Define only if HAVE_GPM.
15240 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15241 (update_hints_inhibit): Remove; never set. All uses removed.
15242 * widgetprv.h (emacsFrameClassRec): Remove decl.
15243 * window.c (delete_deletable_window): Now returns void, since it
15244 wasn't returning anything.
15245 (compare_window_configurations): Remove unused locals.
15246 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15247 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15248 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15249 the same widths as pointers. This follows up on the 2011-05-06 patch.
15250 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15251 * xterm.h: Likewise.
15252 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15253
15254 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15255
15256 * makefile.w32-in: Update dependencies.
15257 (LISP_H): Add lib/intprops.h.
15258
15259 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15260
15261 * image.c (gif_load): Add animation frame delay to the metadata.
15262 (syms_of_image): Use DEFSYM. New symbol `delay'.
15263
15264 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15265
15266 * window.c (delete_deletable_window): Re-add.
15267 (Fset_window_configuration): Rewrite to handle dead buffers and
15268 consequently deletable windows.
15269 (window_tree, Fwindow_tree): Remove. Supply functionality in
15270 window.el.
15271 (compare_window_configurations): Simplify code.
15272
15273 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15274
15275 * image.c (imagemagick_load_image): Fix type mismatch.
15276 (Fimagemagick_types): Likewise.
15277
15278 * window.h (replace_buffer_in_windows): Declare.
15279
15280 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15281
15282 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15283 Qclone_number. Remove external declaration of Qdelete_window.
15284 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15285 code.
15286 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15287 Run Qbuffer_list_update_hook if allowed.
15288 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15289 buffer list implementation.
15290 (other_buffer_safely): New function.
15291 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15292 calls to replace_buffer_in_windows and
15293 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15294 if allowed.
15295 (record_buffer): Inhibit quitting and rewrite using quittable
15296 functions. Run Qbuffer_list_update_hook if allowed.
15297 (Frecord_buffer, Funrecord_buffer): New functions.
15298 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15299 Move switch-to-buffer to window.el.
15300 (bury-buffer): Move to window.el.
15301 (Vbuffer_list_update_hook): New variable.
15302
15303 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15304 section.
15305
15306 * window.h (resize_frame_windows): Move up in code.
15307 (Fwindow_frame): Remove EXFUN.
15308 (replace_buffer_in_all_windows): Remove prototype.
15309 (replace_buffer_in_windows_safely): Add prototype.
15310
15311 * window.c: Declare Qdelete_window static again. Move down
15312 declaration of select_count.
15313 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15314 (Fother_window): Move to window.el.
15315 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15316 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15317 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15318 window.el.
15319 (replace_buffer_in_windows): Implement by calling
15320 Qreplace_buffer_in_windows.
15321 (replace_buffer_in_all_windows): Remove with some functionality
15322 moved into replace_buffer_in_windows_safely.
15323 (replace_buffer_in_windows_safely): New function.
15324 (select_window_norecord, select_frame_norecord): Move in front
15325 of run_window_configuration_change_hook. Remove now obsolete
15326 declarations.
15327 (Fset_window_buffer): Rewrite doc-string.
15328 Call Qrecord_window_buffer.
15329 (keys_of_window): Move binding for other-window to window.el.
15330
15331 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15332
15333 * dispextern.h (struct image): Replace data member, whose int_val
15334 and ptr_val fields were not used by anything, with a single
15335 lisp_val object.
15336
15337 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15338 (gif_clear_image, gif_load, imagemagick_load_image)
15339 (gs_clear_image, gs_load): Callers changed.
15340
15341 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15342
15343 * buffer.h: Include <time.h>, for time_t.
15344 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15345
15346 Fix minor problems found by static checking.
15347
15348 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15349
15350 Make identifiers static if they are not used in other modules.
15351 * data.c (Qcompiled_function, Qframe, Qvector):
15352 * image.c (QimageMagick, Qsvg):
15353 * minibuf.c (Qmetadata):
15354 * window.c (resize_window_check, resize_root_window): Now static.
15355 * window.h (resize_window_check, resize_root_window): Remove decls.
15356
15357 * window.c (window_deletion_count, delete_deletable_window):
15358 Remove; unused.
15359 (window_body_lines): Now static.
15360 (Fdelete_other_windows_internal): Mark vars as initialized.
15361 Make sure 'resize_failed' is initialized.
15362 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15363 (resize_window_apply): Remove unused local.
15364 * window.h (delete_deletable_window): Remove decl.
15365
15366 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15367 (imagemagick_load_image): Fix pointer signedness problem by changing
15368 last arg from unsigned char * to char *. All uses changed.
15369 Also, fix a local for similar reasons.
15370 Remove unused locals. Remove locals to avoid shadowing.
15371 (fn_rsvg_handle_free): Remove; unused.
15372 (svg_load, svg_load_image): Fix pointer signedness problem.
15373 (imagemagick_load_image): Don't use garbage pointer image_wand.
15374
15375 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15376
15377 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15378
15379 * image.c (gif_load): Fix omitted cast error introduced by
15380 2011-06-06 change.
15381
15382 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15383
15384 * window.h (resize_proportionally, orig_total_lines)
15385 (orig_top_line): Remove from window structure.
15386 (set_window_height, set_window_width, change_window_heights)
15387 (Fdelete_window): Remove prototypes.
15388 (resize_frame_windows): Remove duplicate declaration.
15389
15390 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15391
15392 * window.h (resize_frame_windows, resize_window_check)
15393 (delete_deletable_window, resize_root_window)
15394 (resize_frame_windows): Declare prototypes.
15395
15396 * window.c (resize_window_apply): Make definition be "static" to
15397 match the prototype.
15398
15399 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15400
15401 * window.c: Remove declarations of Qwindow_size_fixed,
15402 window_min_size_1, window_min_size_2, window_min_size,
15403 size_window, window_fixed_size_p, enlarge_window, delete_window.
15404 Remove static from declaration of Qdelete_window, it's
15405 temporarily needed by Fbury_buffer.
15406 (replace_window): Don't assign orig_top_line and
15407 orig_total_lines.
15408 (Fdelete_window, delete_window): Remove. Window deletion is
15409 handled by window.el.
15410 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15411 Replace Fdelete_window calls with calls to Qdelete_window.
15412 (Fdelete_other_windows): Remove. Deleting other windows is
15413 handled by window.el.
15414 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15415 handled in window.el.
15416 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15417 Window minimum sizes are handled in window.el.
15418 (shrink_windows, size_window, set_window_height)
15419 (set_window_width, change_window_heights, window_height)
15420 (window_width, CURBEG, CURSIZE, enlarge_window)
15421 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15422 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15423 handled in window.el.
15424 (make_dummy_parent): Rename to make_parent_window and give it a
15425 second argument horflag.
15426 (make_window): Don't set resize_proportionally any more.
15427 (Fsplit_window): Remove. Windows are split in window.el.
15428 (save_restore_action, save_restore_orig_size)
15429 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15430 Resize mini windows in window.el.
15431 (grow_mini_window, shrink_mini_window): Implement by calling
15432 Qresize_root_window_vertically, resize_window_check and
15433 resize_window_apply.
15434 (saved_window, Fset_window_configuration, save_window_save):
15435 Do not handle orig_top_line, orig_total_lines, and
15436 resize_proportionally.
15437 (window_min_height, window_min_width): Move to window.el.
15438 (keys_of_window): Move bindings for delete-other-windows,
15439 split-window, delete-window and enlarge-window to window.el.
15440
15441 * buffer.c: Temporarily extern Qdelete_window.
15442 (Fbury_buffer): Temporarily call Qdelete_window instead of
15443 Fdelete_window (Fbury_buffer will move to window.el soon).
15444
15445 * frame.c (set_menu_bar_lines_1): Remove code handling
15446 orig_top_line and orig_total_lines.
15447
15448 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15449 set_window_height but set heights directly.
15450 (change_frame_size_1): Use resize_frame_windows.
15451
15452 * xdisp.c (init_xdisp): Don't use set_window_height but set
15453 heights directly.
15454
15455 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15456 Use resize_frame_windows instead of change_window_heights and run
15457 run_window_configuration_change_hook.
15458
15459 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15460 instead of change_window_heights and run
15461 run_window_configuration_change_hook.
15462
15463 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15464
15465 * window.c (replace_window): Rename second argument REPLACEMENT to
15466 NEW. New third argument SETFLAG. Rewrite.
15467 (delete_window, make_dummy_parent): Call replace_window with
15468 third argument 1.
15469 (window_list_1): Move down in code.
15470 (run_window_configuration_change_hook): Move set_buffer part
15471 before select_frame_norecord part in order to unwind correctly.
15472 Rename count1 to count.
15473 (recombine_windows, delete_deletable_window, resize_root_window)
15474 (Fdelete_other_windows_internal)
15475 (Frun_window_configuration_change_hook, make_parent_window)
15476 (resize_window_check, resize_window_apply, Fresize_window_apply)
15477 (resize_frame_windows, Fsplit_window_internal)
15478 (Fdelete_window_internal, Fresize_mini_window_internal):
15479 New functions.
15480 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15481
15482 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15483
15484 * window.h (window): Add some new members to window structure -
15485 normal_lines, normal_cols, new_total, new_normal, clone_number,
15486 splits, nest, prev_buffers, next_buffers.
15487 (WINDOW_TOTAL_SIZE): Move here from window.c.
15488 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15489
15490 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15491 Remove.
15492 (make_dummy_parent): Set new members of windows structure.
15493 (make_window): Move down in code. Handle new members of window
15494 structure.
15495 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15496 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15497 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15498 (Fset_window_prev_buffers, Fwindow_next_buffers)
15499 (Fset_window_next_buffers, Fset_window_clone_number):
15500 New functions.
15501 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15502 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15503 Doc-string fixes.
15504 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15505 Argument WINDOW can be now internal window too.
15506 (Fwindow_use_time): Move up in code.
15507 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15508 Rewrite doc-string.
15509 (Fset_window_configuration, saved_window)
15510 (Fcurrent_window_configuration, save_window_save): Handle new
15511 members of window structure.
15512 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15513 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15514 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15515 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15516 Qget_mru_window, Qresize_root_window,
15517 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15518 Qauto_buffer_name; staticpro them.
15519
15520 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15521
15522 * window.c (Fwindow_total_size, Fwindow_left_column)
15523 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15524 (Fwindow_list_1): New functions.
15525 (window_box_text_cols): Replace with window_body_cols.
15526 (Fwindow_width, Fscroll_left, Fscroll_right):
15527 Use window_body_cols instead of window_box_text_cols.
15528 (delete_window, Fset_window_configuration):
15529 Call delete_all_subwindows with window as argument.
15530 (delete_all_subwindows): Take a window as argument and not a
15531 structure. Rewrite.
15532 (window_loop): Remove handling of GET_LRU_WINDOW and
15533 GET_LARGEST_WINDOW.
15534 (Fget_lru_window, Fget_largest_window): Move to window.el.
15535
15536 * window.h: Extern window_body_cols instead of
15537 window_box_text_cols. delete_all_subwindows now takes a
15538 Lisp_Object as argument.
15539
15540 * indent.c (compute_motion, Fcompute_motion):
15541 Use window_body_cols instead of window_box_text_cols.
15542
15543 * frame.c (delete_frame): Call delete_all_subwindows with root
15544 window as argument.
15545
15546 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15547
15548 * fns.c (Fputhash): Document return value.
15549
15550 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15551
15552 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15553
15554 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15555
15556 Cons<->int and similar integer overflow fixes (Bug#8794).
15557
15558 Check for overflow when converting integer to cons and back.
15559 * charset.c (Fdefine_charset_internal, Fdecode_char):
15560 Use cons_to_unsigned to catch overflow.
15561 (Fencode_char): Use INTEGER_TO_CONS.
15562 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15563 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15564 * data.c (long_to_cons, cons_to_long): Remove.
15565 (cons_to_unsigned, cons_to_signed): New functions.
15566 These signal an error for invalid or out-of-range values.
15567 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15568 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15569 * font.c (Ffont_variation_glyphs):
15570 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15571 * lisp.h: Include <intprops.h>.
15572 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15573 (cons_to_signed, cons_to_unsigned): New decls.
15574 (long_to_cons, cons_to_long): Remove decls.
15575 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15576 (Fprimitive_undo): Use CONS_TO_INTEGER.
15577 * xfns.c (Fx_window_property): Likewise.
15578 * xselect.c: Include <limits.h>.
15579 (x_own_selection, selection_data_to_lisp_data):
15580 Use INTEGER_TO_CONS.
15581 (x_handle_selection_request, x_handle_selection_clear)
15582 (x_get_foreign_selection, Fx_disown_selection_internal)
15583 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15584 (lisp_data_to_selection_data): Use cons_to_unsigned.
15585 (x_fill_property_data): Use cons_to_signed.
15586 Report values out of range.
15587
15588 Check for buffer and string overflow more precisely.
15589 * buffer.h (BUF_BYTES_MAX): New macro.
15590 * lisp.h (STRING_BYTES_MAX): New macro.
15591 * alloc.c (Fmake_string):
15592 * character.c (string_escape_byte8):
15593 * coding.c (coding_alloc_by_realloc):
15594 * doprnt.c (doprnt):
15595 * editfns.c (Fformat):
15596 * eval.c (verror):
15597 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15598 since they may not be the same number.
15599 * editfns.c (Finsert_char):
15600 * fileio.c (Finsert_file_contents):
15601 Likewise for BUF_BYTES_MAX.
15602
15603 * image.c: Use ptrdiff_t, not int, for sizes.
15604 (slurp_file): Switch from int to ptrdiff_t.
15605 All uses changed.
15606 (slurp_file): Check that file size fits in both size_t (for
15607 malloc) and ptrdiff_t (for sanity and safety).
15608
15609 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15610 if b->modtime has its maximal value.
15611
15612 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15613
15614 Don't assume time_t can fit into int.
15615 * buffer.h (struct buffer.modtime): Now time_t, not int.
15616 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15617 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15618
15619 Minor fixes for signed vs unsigned integers.
15620 * character.h (MAYBE_UNIFY_CHAR):
15621 * charset.c (maybe_unify_char):
15622 * keyboard.c (read_char, reorder_modifiers):
15623 XINT -> XFASTINT, since the integer must be nonnegative.
15624 * ftfont.c (ftfont_spec_pattern):
15625 * keymap.c (access_keymap, silly_event_symbol_error):
15626 XUINT -> XFASTINT, since the integer must be nonnegative.
15627 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15628 since it makes no difference and we prefer signed.
15629 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15630 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15631 nonnegative.
15632
15633 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15634
15635 * window.h (Fwindow_frame): Declare.
15636
15637 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15638
15639 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15640 (SPARE_MEMORY): Always define.
15641 (LARGE_REQUEST): Remove.
15642 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15643
15644 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15645
15646 * lisp.h: Move EXFUNS for Fframe_root_window,
15647 Fframe_first_window and Fset_frame_selected_window to window.h.
15648
15649 * window.h: Move EXFUNS for Fframe_root_window,
15650 Fframe_first_window and Fset_frame_selected_window here from
15651 lisp.h.
15652
15653 * frame.c (Fwindow_frame, Fframe_first_window)
15654 (Fframe_root_window, Fframe_selected_window)
15655 (Fset_frame_selected_window): Move to window.c.
15656 (Factive_minibuffer_window): Move to minibuf.c.
15657 (Fother_visible_frames_p): New function.
15658
15659 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15660
15661 * window.c (decode_window, decode_any_window): Move up in code.
15662 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15663 (inhibit_frame_unsplittable): Remove unused variable.
15664 (Fwindow_buffer): Move up and rewrite doc-string.
15665 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15666 (Fwindow_prev): New functions.
15667 (Fwindow_frame): Move here from frame.c. Accept any window as
15668 argument.
15669 (Fframe_root_window, Fframe_first_window)
15670 (Fframe_selected_window): Move here from frame.c. Accept frame
15671 or arbitrary window as argument. Update doc-strings.
15672 (Fminibuffer_window): Move up in code.
15673 (Fwindow_minibuffer_p): Move up in code and simplify.
15674 (Fset_frame_selected_window): Move here from frame.c.
15675 Marginal rewrite.
15676 (Fselected_window, select_window, Fselect_window): Move up in
15677 code. Minor doc-string fixes.
15678
15679 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15680
15681 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15682 Do not assume that spare memory exists; that assumption is valid
15683 only if SYSTEM_MALLOC.
15684 (LARGE_REQUEST): New macro, so that the issue of large requests
15685 is separated from the issue of spare memory.
15686
15687 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15688
15689 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15690 format. (Bug#8806)
15691
15692 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15693
15694 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15695 before statements.
15696
15697 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15698
15699 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15700
15701 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15702
15703 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15704 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15705
15706 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15707
15708 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15709
15710 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15711
15712 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15713 (x_clipboard_manager_save): Add return value.
15714 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15715 New error handlers.
15716 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15717 Obey Vx_select_enable_clipboard_manager. Catch errors in
15718 x_clipboard_manager_save (Bug#8779).
15719 (Vx_select_enable_clipboard_manager): New variable.
15720 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15721
15722 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15723
15724 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15725
15726 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15727
15728 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15729 in the current matrix if keep_current_p is non-zero.
15730
15731 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15732
15733 * bidi.c (bidi_level_of_next_char): Fix last change.
15734
15735 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15736
15737 Support bidi reordering of text covered by display properties.
15738
15739 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15740 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15741 (bidi_cache_search, bidi_cache_iterator_state)
15742 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15743 (bidi_level_of_next_char, bidi_move_to_visually_next):
15744 Support character positions inside a run of characters covered by a
15745 display string.
15746 (bidi_paragraph_init, bidi_resolve_explicit_1)
15747 (bidi_level_of_next_char): Call bidi_fetch_char and
15748 bidi_fetch_char_advance instead of FETCH_CHAR and
15749 FETCH_CHAR_ADVANCE.
15750 (bidi_init_it): Initialize new members.
15751 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15752 definitions.
15753 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15754 instead of using explicit *_CHAR codes.
15755 (bidi_resolve_explicit, bidi_resolve_weak):
15756 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15757 bidirectional text is supported only in multibyte buffers.
15758 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15759 it to initialize the frame_window_p member of struct bidi_it.
15760 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15761 (bidi_resolve_explicit, bidi_resolve_weak)
15762 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15763 bidi_it->nchars is non-positive.
15764 (bidi_level_of_next_char): Don't try to lookup the cache for the
15765 next/previous character if nothing is cached there yet, or if we
15766 were just reseat()'ed to a new position.
15767
15768 * xdisp.c (set_cursor_from_row): Set start and stop points
15769 according to the row's direction when priming the loop that looks
15770 for the glyph on which to display cursor.
15771 (single_display_spec_intangible_p): Function deleted.
15772 (display_prop_intangible_p): Reimplement to call
15773 handle_display_spec instead of single_display_spec_intangible_p.
15774 Accept 3 additional arguments needed by handle_display_spec.
15775 This fixes incorrect cursor motion across display property with complex
15776 values: lists, `(when COND...)' forms, etc.
15777 (single_display_spec_string_p): Support property values that are
15778 lists with the argument STRING its top-level element.
15779 (display_prop_string_p): Fix the condition for processing a
15780 property that is a list to be consistent with handle_display_spec.
15781 (handle_display_spec): New function, refactored from the
15782 last portion of handle_display_prop.
15783 (compute_display_string_pos): Accept additional argument
15784 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15785 value of a `display' property is a "replacing spec".
15786 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15787 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15788 the display property, but just return a value indicating whether
15789 the display property will replace the characters it covers.
15790 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15791 frame_window_p members of struct bidi_it.
15792 (compute_display_string_pos, compute_display_string_end):
15793 New functions.
15794 (push_it): Accept second argument POSITION, where pop_it should
15795 jump to continue iteration.
15796 (reseat_1): Initialize bidi_it.disp_pos.
15797
15798 * keyboard.c (adjust_point_for_property): Adjust the call to
15799 display_prop_intangible_p to its new signature.
15800
15801 * dispextern.h (struct bidi_it): New member frame_window_p.
15802 (bidi_init_it): Update prototypes.
15803 (display_prop_intangible_p): Update prototype.
15804 (compute_display_string_pos, compute_display_string_end):
15805 Declare prototypes.
15806 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15807 EMACS_INT.
15808
15809 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15810
15811 Malloc failure behavior now depends on size of allocation.
15812 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15813 * lisp.h: Change signatures accordingly.
15814 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15815 All callers changed. (Bug#8762)
15816
15817 * gnutls.c: Use Emacs's memory allocators.
15818 Without this change, the gnutls library would invoke malloc etc.
15819 directly, which causes problems on non-SYNC_INPUT hosts, and which
15820 runs afoul of improving memory_full behavior. (Bug#8761)
15821 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15822 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15823 xfree instead of the default malloc, realloc, free.
15824 (Fgnutls_boot): No need to check for memory allocation failure,
15825 since xmalloc does that for us.
15826
15827 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15828 * category.c (hash_get_category_set):
15829 * ccl.c (ccl_driver):
15830 * charset.c (Fdefine_charset_internal):
15831 * charset.h (struct charset.hash_index):
15832 * composite.c (get_composition_id, gstring_lookup_cache)
15833 (composition_gstring_put_cache):
15834 * composite.h (struct composition.hash_index):
15835 * dispextern.h (struct image.hash):
15836 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15837 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15838 (hashfn_equal, hashfn_user_defined, make_hash_table)
15839 (maybe_resize_hash_table, hash_lookup, hash_put)
15840 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15841 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15842 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15843 * image.c (make_image, search_image_cache, lookup_image)
15844 (xpm_put_color_table_h):
15845 * lisp.h (struct Lisp_Hash_Table):
15846 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15847 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15848 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15849 * alloc.c (allocate_vectorlike):
15850 Check for overflow in vector size calculations.
15851 * ccl.c (ccl_driver):
15852 Check for overflow when converting EMACS_INT to int.
15853 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15854 need to be updated by these changes.
15855 * fns.c (make_hash_table, maybe_resize_hash_table):
15856 Check for integer overflow with large hash tables.
15857 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15858 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15859 (SXHASH_REDUCE): New macro.
15860 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15861 Use it instead of discarding useful hash info with large hash values.
15862 (sxhash_float): New function.
15863 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15864 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15865 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15866 Rewrite to use FIXNUM_BITS, as this simplifies things.
15867 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15868 Adjust signatures to match updated version of code.
15869 (consing_since_gc): Now EMACS_INT, since a single hash table can
15870 use more than INT_MAX bytes.
15871
15872 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15873
15874 Make it possible to build with GCC-4.6+ -O2 -flto.
15875
15876 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15877
15878 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15879
15880 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15881 Call minibuffer-inactive-mode.
15882
15883 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15884
15885 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15886 Update dependencies.
15887
15888 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15889
15890 * data.c (init_data): Remove code for UTS, this system is not
15891 supported anymore.
15892
15893 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15894
15895 Don't force ./temacs to start in terminal mode.
15896
15897 * frame.c (make_initial_frame): Initialize faces in all cases, not
15898 only when CANNOT_DUMP is defined.
15899 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15900
15901 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15902
15903 * dispnew.c (add_window_display_history): Use const for the string
15904 pointer. Remove declaration, not needed.
15905
15906 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15907
15908 Use 'inline', not 'INLINE'.
15909 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15910 * alloc.c, fontset.c (INLINE): Remove.
15911 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15912 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15913 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15914 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15915 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15916
15917 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15918
15919 Make it possible to run ./temacs.
15920
15921 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15922 syms_of_callproc does the same thing. Remove test for
15923 "initialized", do it in the caller.
15924 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15925
15926 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15927
15928 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15929 (read_minibuf): Use get_minibuffer.
15930 (syms_of_minibuf): Use DEFSYM.
15931 (Qmetadata): New var.
15932 * data.c (Qbuffer): Don't make it static.
15933 (syms_of_data): Use DEFSYM.
15934
15935 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15936
15937 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15938 (CCL_CODE_MIN): New macro.
15939
15940 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15941
15942 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15943
15944 * eval.c (Qdebug): Now static.
15945 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15946 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15947 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15948
15949 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15950
15951 * image.c: Various fixes to ImageMagick code comments.
15952 (Fimagemagick_types): Doc fix.
15953
15954 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15955
15956 Minor fixes prompted by GCC 4.6.0 warnings.
15957
15958 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15959
15960 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15961 (x_clipboard_manager_save_all): Move extern decl to ...
15962 * xterm.h: ... here, so that it can be checked for consistency.
15963
15964 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15965
15966 * xselect.c (x_clipboard_manager_save_frame)
15967 (x_clipboard_manager_save_all): New functions.
15968 (Fx_clipboard_manager_save): Lisp function deleted.
15969
15970 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15971 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15972
15973 * xterm.h: Update prototype.
15974
15975 2011-05-28 William Xu <william.xwl@gmail.com>
15976
15977 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15978 exiting (Bug#8239).
15979
15980 2011-05-28 Jim Meyering <meyering@redhat.com>
15981
15982 Avoid a sign-extension bug in crypto_hash_function.
15983 * fns.c (to_uchar): Define.
15984 (crypto_hash_function): Use it to convert some newly-signed
15985 variables to unsigned, to avoid sign-extension bugs. For example,
15986 without this change, (md5 "truc") would evaluate to
15987 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15988 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15989 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15990
15991 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15992
15993 Integer overflow fixes.
15994
15995 * dbusbind.c: Serial number integer overflow fixes.
15996 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15997 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15998 to hold a serial number that is too large for a fixnum.
15999 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16000 Check for serial numbers out of range. Decode any serial number
16001 that was so large that it became a float. (Bug#8722)
16002
16003 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16004 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16005 Use XFASTINT rather than XUINT when numbers are nonnegative.
16006 (xd_append_arg, Fdbus_method_return_internal):
16007 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16008 arguments, check that Lisp number is nonnegative, rather than
16009 silently wrapping negative numbers around. (Bug#8722)
16010 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
16011 (Bug#8722)
16012
16013 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16014
16015 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16016
16017 ccl: Add integer overflow checks.
16018 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16019 (IN_INT_RANGE): New macros.
16020 (ccl_driver): Use them to check for integer overflow when
16021 decoding a CCL program. Many of the new checks are whether XINT (x)
16022 fits in int; it doesn't always, on 64-bit hosts. The new version
16023 doesn't catch all possible integer overflows, but it's an
16024 improvement. (Bug#8719)
16025
16026 * alloc.c (make_event_array): Use XINT, not XUINT.
16027 There's no need for unsigned here.
16028
16029 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16030 This follows up to the 2011-05-06 change that substituted uintptr_t
16031 for EMACS_INT. This case wasn't caught back then.
16032
16033 Rework Fformat to avoid integer overflow issues.
16034 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16035 now (part of C89). Include <verify.h>.
16036 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16037 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16038 (Fformat): Avoid the prepass trying to compute sizes; it was only
16039 approximate and thus did not catch overflow reliably. Instead, walk
16040 through the format just once, formatting and computing sizes as we go,
16041 checking for integer overflow at every step, and allocating a larger
16042 buffer as needed. Keep track separately whether the format is
16043 multibyte. Keep only the most-recently calculated precision, rather
16044 than them all. Record whether each argument has been converted to
16045 string. Use EMACS_INT, not int, for byte and char and arg counts.
16046 Support field widths and precisions larger than INT_MAX. Avoid
16047 sprintf's undefined behavior with conversion specifications such as %#d
16048 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16049 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16050 formatting out-of-range floating point numbers with int
16051 formats. (Bug#8668)
16052
16053 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16054
16055 * data.c: Avoid integer truncation in expressions involving floats.
16056 * data.c: Include <intprops.h>.
16057 (arith_driver): When there's an integer overflow in an expression
16058 involving floating point, convert the integers to floating point
16059 so that the resulting value does not suffer from catastrophic
16060 integer truncation. For example, on a 64-bit host (* 4
16061 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16062 Do not rely on undefined behavior after integer overflow.
16063
16064 merge count_size_as_multibyte, parse_str_to_multibyte
16065 * character.c, character.h (count_size_as_multibyte):
16066 Rename from parse_str_to_multibyte; all uses changed.
16067 Check for integer overflow.
16068 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16069 since it's now a duplicate of the other. This is more of
16070 a character than a buffer op, so better that it's in character.c.
16071 * fns.c, print.c: Adjust to above changes.
16072
16073 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16074
16075 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16076
16077 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16078
16079 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16080 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16081 (x_clipboard_manager_save): Now static.
16082 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16083
16084 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16085 (crypto_hash_function): Now static.
16086 Fix pointer signedness problems. Avoid unnecessary initializations.
16087
16088 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16089
16090 * termhooks.h (Vselection_alist): Make it terminal-local.
16091
16092 * terminal.c (create_terminal): Initialize it.
16093
16094 * xselect.c: Support for clipboard managers.
16095 (Vselection_alist): Move to termhooks.h as terminal-local var.
16096 (LOCAL_SELECTION): New macro.
16097 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16098 (symbol_to_x_atom): Remove gratuitous arg.
16099 (x_handle_selection_request, lisp_data_to_selection_data)
16100 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16101 (x_own_selection, x_get_local_selection, x_convert_selection):
16102 New arg, specifying work frame. Use terminal-local Vselection_alist.
16103 (some_frame_on_display): Delete unused function.
16104 (Fx_own_selection_internal, Fx_get_selection_internal)
16105 (Fx_disown_selection_internal, Fx_selection_owner_p)
16106 (Fx_selection_exists_p): New optional frame arg.
16107 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16108 (x_handle_selection_clear): Don't treat other terminals with the
16109 same keyboard specially. Use the terminal-local Vselection_alist.
16110 (x_clear_frame_selections): Use Frun_hook_with_args.
16111
16112 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16113
16114 * xterm.h: Add support for those atoms.
16115
16116 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16117
16118 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16119 (converted_selections, conversion_fail_tag): New global variables.
16120 (x_selection_request_lisp_error): Free the above.
16121 (x_get_local_selection): Remove unnecessary code.
16122 (x_reply_selection_request): Args changed; handle arbitrary array
16123 of converted selections stored in converted_selections.
16124 Separate the XChangeProperty and SelectionNotify steps.
16125 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16126 (x_convert_selection): New function.
16127 (x_handle_selection_event): Simplify.
16128 (x_get_foreign_selection): Don't ignore incoming requests while
16129 waiting for an answer; this will fail when we implement
16130 SAVE_TARGETS, and seems unnecessary anyway.
16131 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16132 (Vx_sent_selection_functions): Doc fix.
16133
16134 2011-05-26 Leo Liu <sdl.web@gmail.com>
16135
16136 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16137
16138 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16139
16140 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16141
16142 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16143 for fringe update if it has periodic bitmap.
16144 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16145 and fringe_bitmap_periodic_p.
16146
16147 * fringe.c (get_fringe_bitmap_data): New function.
16148 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16149 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16150 row. Mark glyph row for fringe update if periodicity changed.
16151
16152 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16153 for fringe update unless it has periodic bitmap.
16154
16155 2011-05-25 Kenichi Handa <handa@m17n.org>
16156
16157 * xdisp.c (get_next_display_element): Set correct it->face_id for
16158 a static composition.
16159
16160 2011-05-24 Leo Liu <sdl.web@gmail.com>
16161
16162 * deps.mk (fns.o):
16163 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16164
16165 * fns.c (crypto_hash_function, Fsha1): New function.
16166 (Fmd5): Use crypto_hash_function.
16167 (syms_of_fns): Add Ssha1.
16168
16169 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16170
16171 * gnutls.c: Remove unused macros.
16172 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16173 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16174 Remove macros that are defined and never used.
16175 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16176
16177 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16178
16179 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16180 (Fx_get_selection_internal): Minor cleanup.
16181 (Fx_own_selection_internal): Rename arguments for consistency with
16182 select.el.
16183
16184 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16185
16186 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16187
16188 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16189
16190 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16191
16192 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16193
16194 * dispnew.c (scrolling_window): Don't exclude the case that the
16195 last enabled row in the desired matrix touches the bottom boundary.
16196
16197 2011-05-21 Glenn Morris <rgm@gnu.org>
16198
16199 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16200 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16201 and add some more files.
16202
16203 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16204
16205 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16206 report_file_error introduced by the change from 2011-05-07.
16207
16208 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16209
16210 * systime.h (Time): Define only if emacs is defined.
16211 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16212 where the include path doesn't have X11/X.h by default. See
16213 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16214
16215 2011-05-20 Kenichi Handa <handa@m17n.org>
16216
16217 * composite.c (find_automatic_composition): Fix previous change.
16218
16219 2011-05-20 Glenn Morris <rgm@gnu.org>
16220
16221 * lisp.mk: New file, split from Makefile.in.
16222 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16223 (shortlisp): Remove.
16224 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16225
16226 2011-05-19 Glenn Morris <rgm@gnu.org>
16227
16228 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16229 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16230 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16231 (lisp): Set the order to that of loadup.el.
16232 (shortlisp): Make it a copy of $lisp.
16233 (SOME_MACHINE_LISP): Remove.
16234 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16235 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16236
16237 2011-05-18 Kenichi Handa <handa@m17n.org>
16238
16239 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16240 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16241 (find_automatic_composition): Mostly rewrite for efficiency.
16242
16243 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16244
16245 * makefile.w32-in: Update dependencies.
16246
16247 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16248
16249 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16250 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16251
16252 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16253
16254 Fix some integer overflow issues, such as string length overflow.
16255
16256 * insdel.c (count_size_as_multibyte): Check for string overflow.
16257
16258 * character.c (lisp_string_width): Check for string overflow.
16259 Use EMACS_INT, not int, for string indexes and lengths; in
16260 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16261 the resulting string length overflows an EMACS_INT; instead,
16262 report a string overflow if no precision given. When checking for
16263 precision exhaustion, use a check that cannot possibly have
16264 integer overflow. (Bug#8675)
16265 * character.h (lisp_string_width): Adjust to new signature.
16266
16267 * alloc.c (string_overflow): New function.
16268 (Fmake_string): Use it. This doesn't change behavior, but saves
16269 a few bytes and will simplify future changes.
16270 * character.c (string_escape_byte8): Likewise.
16271 * lisp.h (string_overflow): New decl.
16272
16273 Fixups, following up to the user-interface timestamp change.
16274 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16275 for UI timestamps, instead of unsigned long.
16276 * msdos.c (mouse_get_pos): Likewise.
16277 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16278 * w32gui.h (Time): Define by including "systime.h" rather than by
16279 declaring it ourselves. (Bug#8664)
16280
16281 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16282 * image.c (clear_image_cache): Likewise.
16283
16284 * term.c (term_mouse_position): Don't assume time_t wraparound.
16285
16286 Be more systematic about user-interface timestamps.
16287 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16288 and sometimes 'EMACS_UINT', to represent these timestamps.
16289 This change causes it to use 'Time' uniformly, as that's what X uses.
16290 This makes the code easier to follow, and makes it easier to catch
16291 integer overflow bugs such as Bug#8664.
16292 * frame.c (Fmouse_position, Fmouse_pixel_position):
16293 Use Time, not unsigned long, for user-interface timestamps.
16294 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16295 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16296 * keyboard.h (last_event_timestamp): Likewise.
16297 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16298 * menu.h (xmenu_show): Likewise.
16299 * term.c (term_mouse_position): Likewise.
16300 * termhooks.h (struct input_event.timestamp): Likewise.
16301 (struct terminal.mouse_position_hook): Likewise.
16302 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16303 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16304 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16305 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16306 what it was before.
16307 * menu.h, termhooks.h: Include "systime.h", for Time.
16308
16309 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16310 Don't assume that the difference between two unsigned long values
16311 can fit into an integer. At this point, we know button_down_time
16312 <= event->timestamp, so the difference must be nonnegative, so
16313 there's no need to cast the result if double-click-time is
16314 nonnegative, as it should be; check that it's nonnegative, just in
16315 case. This bug is triggered when events are more than 2**31 ms
16316 apart (about 25 days). (Bug#8664)
16317
16318 * xselect.c (last_event_timestamp): Remove duplicate decl.
16319 (x_own_selection): Remove needless cast to unsigned long.
16320
16321 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16322 that always fit in int. Use a sentinel instead of a counter, to
16323 avoid a temp and to allay GCC's concerns about possible int overflow.
16324 * frame.h (struct frame): Use int for menu_bar_items_used
16325 instead of EMACS_INT, since it always fits in int.
16326
16327 * menu.c (grow_menu_items): Check for int overflow.
16328
16329 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16330
16331 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16332 Before, the code was not consistent. These values cannot exceed
16333 2**31 - 1 so there's no need to make them unsigned.
16334 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16335 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16336 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16337 as modifiers.
16338 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16339
16340 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16341 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16342 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16343 presumably because the widths might not match.
16344
16345 * window.c (size_window): Avoid needless test at loop start.
16346
16347 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16348
16349 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16350
16351 2011-05-12 Drew Adams <drew.adams@oracle.com>
16352
16353 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16354
16355 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16356
16357 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16358 `width' to `bar_area_x' and `bar_area_width', respectively.
16359 (x_scroll_run): Take account of fringe background extension.
16360
16361 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16362 Rename local vars `left' and `width' to `bar_area_x' and
16363 `bar_area_width', respectively.
16364 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16365 background extension.
16366
16367 2011-05-10 Jim Meyering <meyering@redhat.com>
16368
16369 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16370
16371 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16372
16373 * image.c (Finit_image_library): Return t for built-in image types,
16374 like pbm and xbm. (Bug#8640)
16375
16376 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16377
16378 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16379
16380 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16381
16382 * w32console.c (Fset_screen_color): Doc fix.
16383 (Fget_screen_color): New function.
16384 (syms_of_ntterm): Defsubr it.
16385
16386 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16387 unlink the temporary file if Fcall_process didn't create it in the
16388 first place.
16389 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16390 child process will be redirected to a file specified with `:file'.
16391 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16392 cue to call_process_cleanup not to close that handle.
16393
16394 2011-05-07 Ben Key <bkey76@gmail.com>
16395
16396 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16397 one of two shell specific rules, either bootstrap-temacs-CMD or
16398 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16399 to the previous implementation of the bootstrap-temacs rule.
16400 The bootstrap-temacs-CMD rule is similar to the previous
16401 implementation of the bootstrap-temacs rule except that it
16402 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16403 variable.
16404
16405 These changes, along with some changes to nt/configure.bat,
16406 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16407 earlier fix to add support for --cflags and --ldflags options
16408 that include quotes so that it works whether make uses cmd or
16409 sh as the shell.
16410
16411 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16412
16413 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16414 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16415 is a constant.
16416 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16417 a string. Handle both cases.
16418 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16419 (Fdbus_register_method): Use Qinvalid_function.
16420
16421 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16422
16423 * makefile.w32-in: Update dependencies.
16424 (LISP_H): Add inttypes.h and stdin.h.
16425 (PROCESS_H): Add unistd.h.
16426
16427 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16428
16429 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16430 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16431
16432 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16433
16434 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16435
16436 * term.c (vfatal): Remove stray call to va_end.
16437 It's not needed and the C Standard doesn't allow it here anyway.
16438
16439 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16440 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16441
16442 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16443 bytes.
16444
16445 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16446
16447 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16448
16449 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16450
16451 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16452
16453 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16454
16455 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16456 * charset.c (Fdefine_charset_internal): Don't initialize
16457 charset.code_space[15]. The value was garbage, on hosts with
16458 32-bit int (Bug#8600).
16459
16460 * lread.c (read_integer): Be more consistent with string-to-number.
16461 Use string_to_number to do the actual conversion; this avoids
16462 rounding errors and fixes some other screwups. Without this fix,
16463 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16464 (digit_to_number): Move earlier, for benefit of read_integer.
16465 Return -1 if the digit is out of range for the base, -2 if it is
16466 not a digit in any supported base. (Bug#8602)
16467
16468 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16469
16470 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16471 to match comment at start of function. This also removes a
16472 GCC warning about overflow in a 32+64-bit port.
16473
16474 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16475
16476 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16477 Reported by Stefan Monnier in
16478 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16479 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16480 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16481
16482 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16483 (EMACS_UINTPTR): Likewise, with uintptr_t.
16484
16485 * lisp.h: Prefer 64-bit EMACS_INT if available.
16486 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16487 on 32-bit hosts that have 64-bit int, so that they can access
16488 large files.
16489 However, temporarily disable this change unless the temporary
16490 symbol WIDE_EMACS_INT is defined.
16491
16492 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16493
16494 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16495 This removes an assumption that EMACS_INT and long are the same
16496 width as pointers. The assumption is true for Emacs porting targets
16497 now, but we want to make other targets possible.
16498 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16499 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16500 In the rest of the code, change types of integers that hold casted
16501 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16502 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16503 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16504 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16505 No need to cast type when ORing.
16506 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16507 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16508 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16509 assume EMACS_INT is the same width as char *.
16510 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16511 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16512 Remove no-longer-needed casts.
16513 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16514 (xg_tool_bar_help_callback, xg_make_tool_item):
16515 Use EMACS_INTPTR to hold an integer
16516 that will be cast to void *; this can avoid a GCC warning
16517 if EMACS_INT is not the same width as void *.
16518 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16519 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16520 (current_message_1, set_message_1):
16521 Use a local to convert to proper width without a cast.
16522 * xmenu.c (dialog_selection_callback): Likewise.
16523
16524 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16525 Also, don't assume VALBITS / RAND_BITS is less than 5,
16526 and don't rely on undefined behavior when shifting a 1 left into
16527 the sign bit.
16528 * lisp.h (get_random): Change signature to match.
16529
16530 * lread.c (hash_string): Use size_t, not int, for hash computation.
16531 Normally we prefer signed values; but hashing is special, because
16532 it's better to use unsigned division on hash table sizes so that
16533 the remainder is nonnegative. Also, size_t is the natural width
16534 for hashing into memory. The previous code used 'int', which doesn't
16535 retain enough info to hash well into very large tables.
16536 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16537
16538 * dbusbind.c: Don't possibly lose pointer info when converting.
16539 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16540 Use XPNTR rather than XHASH, so that the high-order bits of
16541 the pointer aren't lost when converting through void *.
16542
16543 * eval.c (Fautoload): Don't double-shift a pointer.
16544
16545 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16546
16547 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16548
16549 * gnutls.c (DEF_GNUTLS_FN):
16550 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16551
16552 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16553
16554 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16555 marker. (Bug#8610)
16556
16557 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16558
16559 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16560 New version that can reserve upto 2GB of heap space.
16561
16562 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16563
16564 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16565
16566 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16567
16568 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16569 `gnutls_certificate_set_x509_key_file'.
16570
16571 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16572
16573 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16574 Update dependencies.
16575
16576 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16577
16578 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16579 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16580 Remove unused parameter `fildes'.
16581 * process.c (read_process_output, send_process): Don't pass it.
16582
16583 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16584
16585 Fix previous change: the library cache is defined in w32.c.
16586 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16587 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16588
16589 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16590
16591 Implement dynamic loading of GnuTLS on Windows.
16592
16593 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16594 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16595 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16596 Declare.
16597
16598 * gnutls.c (Qgnutls_dll): Define.
16599 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16600 (gnutls_*): Declare function pointers.
16601 (init_gnutls_functions): New function to initialize function pointers.
16602 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16603 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16604 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16605 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16606 (emacs_gnutls_write, emacs_gnutls_read)
16607 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16608 (Fgnutls_available_p): New function.
16609 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16610 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16611 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16612
16613 * image.c: Include w32.h.
16614 (Vimage_type_cache): Delete.
16615 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16616 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16617 (w32_delayed_load): Move to w32.c.
16618
16619 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16620
16621 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16622 (w32_delayed_load): Move from image.c. When loading a library, record
16623 its filename in the :loaded-from property of the library id.
16624 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16625 Initialize and staticpro them.
16626 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16627
16628 * process.c: Include lisp.h before w32.h, not after.
16629 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16630 instead of gnutls_record_check_pending.
16631
16632 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16633
16634 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16635
16636 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16637 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16638 as passed in.
16639
16640 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16641
16642 * xterm.c (x_set_frame_alpha): Do not set property on anything
16643 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16644
16645 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16646
16647 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16648
16649 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16650
16651 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16652 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16653 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16654 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16655 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16656 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16657 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16658 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16659 (Qgnutls_bootprop_callbacks_verify): Make static.
16660
16661 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16662
16663 * callproc.c: Indentation fixup.
16664
16665 * sysdep.c (wait_for_termination_1): Make static.
16666 (wait_for_termination, interruptible_wait_for_termination):
16667 Move after wait_for_termination_1.
16668
16669 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16670
16671 * sysdep.c (interruptible_wait_for_termination): New function
16672 which is like wait_for_termination, but allows keyboard
16673 interruptions.
16674
16675 * callproc.c (Fcall_process): Add (:file "file") as an option for
16676 the STDOUT buffer.
16677 (Fcall_process_region): Ditto.
16678
16679 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16680
16681 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16682 rather than `XVECTOR (FOO)->size'.
16683
16684 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16685 inttypes.h, as a gnulib replacement is used if it not available in
16686 system headers.
16687
16688 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16689
16690 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16691 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16692 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16693
16694 * coding.c (coding_alloc_by_realloc): Error out if destination
16695 will grow beyond MOST_POSITIVE_FIXNUM.
16696 (decode_coding_emacs_mule): Abort if there isn't enough place in
16697 charbuf for the composition carryover bytes. Reserve an extra
16698 space for up to 2 characters produced in a loop.
16699 (decode_coding_iso_2022): Abort if there isn't enough place in
16700 charbuf for the composition carryover bytes.
16701
16702 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16703
16704 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16705 aborting when %lld or %lll format is passed.
16706 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16707 %llo or %llx format is passed. (Bug#8545)
16708
16709 * window.c (window_scroll_line_based): Use a marker instead of
16710 simple variables to record original value of point. (Bug#7952)
16711
16712 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16713 produced by %s or %c overflows available buffer space. (Bug#8545)
16714
16715 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16716
16717 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16718 (SIZE_MAX): Move defn after all includes, as they might #define it.
16719
16720 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16721
16722 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16723
16724 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16725
16726 * keyboard.c (Qdelayed_warnings_hook): Define.
16727 (command_loop_1): Run `delayed-warnings-hook'
16728 if Vdelayed_warnings_list is non-nil.
16729 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16730 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16731
16732 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16733
16734 * doprnt.c (doprnt): Don't return value smaller than the buffer
16735 size if the message was truncated. (Bug#8545).
16736
16737 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16738
16739 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16740 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16741
16742 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16743
16744 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16745
16746 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16747
16748 * makefile.w32-in: Update dependencies.
16749
16750 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16751
16752 Improve `doprnt' and its usage. (Bug#8545)
16753 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16754 `format_end'. Remove support for %l as a conversion specifier.
16755 Don't use xrealloc. Improve diagnostics when the %l size modifier
16756 is used. Update the commentary.
16757
16758 * eval.c (verror): Simplify calculation of size_t.
16759
16760 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16761 messages.
16762
16763 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16764
16765 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16766 change.
16767
16768 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16769
16770 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16771 This makes this file independent of the recent pseudovector change.
16772
16773 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16774
16775 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16776
16777 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16778 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16779 Remove unused local.
16780 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16781
16782 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16783 GCC 4.6.0 optimizes based on type-based alias analysis.
16784 For example, if b is of type struct buffer * and v of type struct
16785 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16786 != &v->size, and therefore "v->size = 1; b->size = 2; return
16787 v->size;" must therefore return 1. This assumption is incorrect
16788 for Emacs, since it type-puns struct Lisp_Vector * with many other
16789 types. To fix this problem, this patch adds a new type struct
16790 vectorlike_header that documents the constraints on layout of vectors
16791 and pseudovectors, and helps optimizing compilers not get fooled
16792 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16793 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16794 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16795 the size member.
16796 (XSETPVECTYPE): Rewrite in terms of new macro.
16797 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16798 This is a bit clearer, and further avoids the possibility of
16799 undesirable aliasing.
16800 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16801 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16802 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16803 since Lisp_Subr is a special case (no "next" field).
16804 (ASIZE): Now uses header.size rather than size.
16805 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16806 to avoid the hassle of writing XVECTOR (foo)->header.size.
16807 (struct vectorlike_header): New type.
16808 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16809 object, to help avoid aliasing.
16810 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16811 (SUBRP): Likewise, since Lisp_Subr is a special case.
16812 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16813 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16814 (struct Lisp_Hash_Table): Combine first two members into a single
16815 struct vectorlike_header member. All uses of "size" and "next" members
16816 changed to be "header.size" and "header.next".
16817 * buffer.h (struct buffer): Likewise.
16818 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16819 * frame.h (struct frame): Likewise.
16820 * process.h (struct Lisp_Process): Likewise.
16821 * termhooks.h (struct terminal): Likewise.
16822 * window.c (struct save_window_data, struct saved_window): Likewise.
16823 * window.h (struct window): Likewise.
16824 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16825 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16826 * buffer.c (init_buffer_once): Likewise.
16827 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16828 special case.
16829 * process.c (Fformat_network_address): Use local var for size,
16830 for brevity.
16831
16832 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16833
16834 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16835 * data.c (atof): Remove decl; no longer used or needed.
16836 (digit_to_number): Move to lread.c.
16837 (Fstring_to_number): Use new string_to_number function, to be
16838 consistent with how the Lisp reader treats infinities and NaNs.
16839 Do not assume that floating-point numbers represent EMACS_INT
16840 without losing information; this is not true on most 64-bit hosts.
16841 Avoid double-rounding errors, by insisting on integers when
16842 parsing non-base-10 numbers, as the documentation specifies.
16843 * lisp.h (string_to_number): New decl, replacing ...
16844 (isfloat_string): Remove.
16845 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16846 (read1): Do not accept +. and -. as integers; this
16847 appears to have been a coding error. Similarly, do not accept
16848 strings like +-1e0 as floating point numbers. Do not report
16849 overflow for integer overflows unless the base is not 10 which
16850 means we have no simple and reliable way to continue.
16851 Break out the floating-point parsing into a new
16852 function string_to_number, so that Fstring_to_number parses
16853 floating point numbers consistently with the Lisp reader.
16854 (digit_to_number): Move here from data.c. Make it static inline.
16855 (E_CHAR, EXP_INT): Remove, replacing with ...
16856 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16857 (string_to_number): New function, replacing isfloat_string.
16858 This function checks for valid syntax and produces the resulting
16859 Lisp float number too. Rework it so that string-to-number
16860 no longer mishandles examples like "1.0e+". Use strtoumax,
16861 so that overflow for non-base-10 numbers is reported only when
16862 there's no portable and simple way to convert to floating point.
16863
16864 * textprop.c (set_text_properties_1): Rewrite for clarity,
16865 and to avoid GCC warning about integer overflow.
16866
16867 * intervals.h (struct interval): Use EMACS_INT for members
16868 where EMACS_UINT might cause problems. See
16869 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16870 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16871 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16872 All uses changed.
16873 (offset_intervals): Tell GCC not to worry about length overflow
16874 when negating a negative length.
16875
16876 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16877 (overrun_check_free): Likewise.
16878
16879 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16880 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16881 word size.
16882
16883 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16884 (gnutls_make_error): Rename local to avoid shadowing.
16885 (gnutls_emacs_global_deinit): ifdef out; not used.
16886 (Fgnutls_boot): Use const for pointer to readonly storage.
16887 Comment out unused local. Fix pointer signedness problems.
16888
16889 * lread.c (openp): Don't stuff size_t into an 'int'.
16890 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16891 about possible signed overflow.
16892
16893 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16894 (GDK_KEY_g): Don't define if already defined.
16895 (xg_prepare_tooltip): Avoid pointer signedness problem.
16896 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16897
16898 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16899 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16900
16901 * xfns.c (Fx_window_property): Simplify a bit,
16902 to make a bit faster and to avoid GCC 4.6.0 warning.
16903 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16904
16905 * fns.c (internal_equal): Don't assume size_t fits in int.
16906
16907 * alloc.c (compact_small_strings): Tighten assertion a little.
16908
16909 Replace pEd with more-general pI, and fix some printf arg casts.
16910 * lisp.h (pI): New macro, generalizing old pEd macro to other
16911 conversion specifiers. For example, use "...%"pI"d..." rather
16912 than "...%"pEd"...".
16913 (pEd): Remove. All uses replaced with similar uses of pI.
16914 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16915 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16916 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16917 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16918 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16919 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16920 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16921 64-bit hosts.
16922 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16923 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16924 * print.c (safe_debug_print, print_object): Likewise.
16925 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16926 to int.
16927 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16928 avoiding the 0 flag, which is not portable.
16929 * process.c (Fmake_network_process): Use pI to avoid cast.
16930 * region-cache.c (pp_cache): Likewise.
16931 * xdisp.c (decode_mode_spec): Likewise.
16932 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16933 behavior on 64-bit hosts with printf arg.
16934 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16935 (x_stop_queuing_selection_requests): Likewise.
16936 (x_get_window_property): Don't truncate byte count to an 'int'
16937 when tracing.
16938
16939 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16940 here, since it parses constructs like leading '-' and spaces,
16941 which are not wanted; and it overflows with large numbers.
16942 Instead, simply match F[0-9]+, which is what is wanted anyway.
16943
16944 * alloc.c: Remove unportable assumptions about struct layout.
16945 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16946 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16947 (allocate_vectorlike, make_pure_vector): Use the new macros,
16948 plus offsetof, to remove unportable assumptions about struct layout.
16949 These assumptions hold on all porting targets that I know of, but
16950 they are not guaranteed, they're easy to remove, and removing them
16951 makes further changes easier.
16952
16953 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16954 This doesn't fix a bug but makes the code clearer.
16955 (string_overrun_cookie): Now const. Use initializers that
16956 don't formally overflow signed char, to avoid warnings.
16957 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16958 can cause Emacs to crash when string overrun checking is enabled.
16959 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16960 multiple of sizeof (EMACS_INT); it need not be, if
16961 alignof(EMACS_INT) < sizeof (EMACS_INT).
16962 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16963
16964 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16965
16966 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16967
16968 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16969
16970 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16971 supposed to be handshaking. (Bug#8556)
16972 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16973
16974 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16975
16976 * lisp.h (Qdebug): List symbol.
16977 * eval.c (Qdebug): Restore global linkage.
16978 * keyboard.c (debug-on-event): New variable.
16979 (handle_user_signal): Break into debugger when debug-on-event
16980 matches the current signal symbol.
16981
16982 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16983
16984 * alloc.c (check_sblock, check_string_bytes)
16985 (check_string_free_list): Convert to standard C.
16986
16987 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16988
16989 * w32.c (emacs_gnutls_push): Fix typo.
16990
16991 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16992
16993 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16994 "cast to pointer from integer of different size".
16995
16996 Improve doprnt and its use in verror. (Bug#8545)
16997 * doprnt.c (doprnt): Document the set of format control sequences
16998 supported by the function. Use SAFE_ALLOCA instead of always
16999 using `alloca'.
17000
17001 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17002 is one byte too soon. Don't use xrealloc; instead xfree and
17003 xmalloc anew.
17004
17005 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17006
17007 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17008 callbacks stage.
17009
17010 * gnutls.c: Renamed global_initialized to
17011 gnutls_global_initialized. Added internals for the
17012 :verify-hostname-error, :verify-error, and :verify-flags
17013 parameters of `gnutls-boot' and documented those parameters in the
17014 docstring. Start callback support.
17015 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17016 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17017 on error. Return error code.
17018 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17019 (emacs_gnutls_read): Likewise.
17020 (Fgnutls_boot): Return handshake error code.
17021 (emacs_gnutls_handle_error): New function.
17022 (wsaerror_to_errno): Likewise.
17023
17024 * w32.h (emacs_gnutls_pull): Add prototype.
17025 (emacs_gnutls_push): Likewise.
17026
17027 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17028 (emacs_gnutls_push): Likewise.
17029
17030 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17031
17032 * process.c (wait_reading_process_output): Check if GnuTLS
17033 buffered some data internally if no FDs are set for TLS
17034 connections.
17035
17036 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17037 (LIBS): Link to USER_LIBS.
17038 ($(BLD)/gnutls.$(0)): New target.
17039
17040 2011-04-24 Eli Zaretskii <eliz@gnu.org>
17041
17042 * xdisp.c (handle_single_display_spec): Rename the
17043 display_replaced_before_p argument into display_replaced_p, to
17044 make it consistent with the commentary. Fix typos in the
17045 commentary.
17046
17047 * textprop.c (syms_of_textprop): Remove dead code.
17048 (copy_text_properties): Delete obsolete commentary about an
17049 interface that was deleted long ago. Fix typos in the description
17050 of arguments.
17051
17052 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17053 to changes in oldXMenu/XMenu.h from 2011-04-16.
17054 <menu_help_message, prev_menu_help_message>: Constify.
17055 (IT_menu_make_room): menu->help_text is now `const char **';
17056 adjust.
17057
17058 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17059 to changes in oldXMenu/XMenu.h from 2011-04-16.
17060 (struct XMenu): Declare `help_text' `const char **'.
17061
17062 * xfaces.c <Qunspecified>: Make extern again.
17063
17064 * syntax.c: Include sys/types.h before including regex.h, as
17065 required by POSIX.
17066
17067 * doc.c (get_doc_string): Improve the format passed to `error'.
17068
17069 * doprnt.c (doprnt): Improve commentary.
17070
17071 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17072
17073 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17074 them with etags.
17075
17076 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17077 changes in globals.h immediately force recompilation.
17078 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17079 $(CURDIR)/s/ms-w32.h.
17080 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17081
17082 * character.c (Fchar_direction): Function deleted.
17083 (syms_of_character): Don't defsubr it.
17084 <char-direction-table>: Deleted.
17085
17086 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17087
17088 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17089 * doprnt.c: Include limits.h.
17090 (SIZE_MAX): New macro.
17091 (doprnt): Return a size_t value. 2nd arg is now size_t.
17092 Many local variables are now size_t instead of int or unsigned.
17093 Improve overflow protection. Support `l' modifier for integer
17094 conversions. Support %l conversion. Don't assume an EMACS_INT
17095 argument for integer conversions and for %c.
17096
17097 * lisp.h (doprnt): Restore prototype.
17098
17099 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17100 $(SRC)/character.h.
17101
17102 * Makefile.in (base_obj): Add back doprnt.o.
17103
17104 * deps.mk (doprnt.o): Add back prerequisites.
17105 (callint.o): Depend on character.h.
17106
17107 * eval.c (internal_lisp_condition_case): Include the handler
17108 representation in the error message.
17109 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17110 when breaking from the loop.
17111
17112 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17113
17114 * callint.c (Fcall_interactively): When displaying error message
17115 about invalid control letter, pass the character's codepoint, not
17116 a pointer to its multibyte form. Improve display of the character
17117 in octal and display also its hex code.
17118
17119 * character.c (char_string): Use %x to display the (unsigned)
17120 codepoint of an invalid character, to avoid displaying a bogus
17121 negative value.
17122
17123 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17124 `error', not SYMBOL_NAME itself.
17125
17126 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17127 character arguments to `error'.
17128
17129 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17130 to `error' in error message about FINAL_CHAR argument. Make sure
17131 FINAL_CHAR is a character, and use %c when it is passed as
17132 argument to `error'.
17133
17134 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17135
17136 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17137
17138 * w32.c: Include <time.h>.
17139 (sys_localtime): New function.
17140
17141 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17142
17143 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17144
17145 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17146
17147 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17148
17149 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17150 zombies (Bug#8467).
17151
17152 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17153
17154 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17155 gl_state.e_property when gl_state.object is Qt.
17156
17157 * insdel.c (make_gap_larger): Remove limitation of buffer size
17158 to <= INT_MAX.
17159
17160 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17161
17162 * xdisp.c (lookup_glyphless_char_display)
17163 (produce_glyphless_glyph): Handle cons cell entry in
17164 glyphless-char-display.
17165 (Vglyphless_char_display): Document it.
17166
17167 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17168 glyphless-char-display.
17169
17170 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17171
17172 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17173
17174 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17175
17176 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17177 definition for no-X builds.
17178
17179 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17180
17181 Static checks with GCC 4.6.0 and non-default toolkits.
17182
17183 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17184
17185 * process.c (keyboard_bit_set): Define only if SIGIO.
17186 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17187 (send_process): Repair possible setjmp clobbering.
17188
17189 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17190
17191 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17192
17193 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17194
17195 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17196 Define only if needed.
17197
17198 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17199 by pacifying GCC about it. Maybe it's time to retire it?
17200 * xfaces.c (USG, __TIMEVAL__): Likewise.
17201
17202 * dispextern.h (struct redisplay_interface): Rename param
17203 to avoid shadowing.
17204 * termhooks.h (struct terminal): Likewise.
17205 * xterm.c (xembed_send_message): Likewise.
17206
17207 * insdel.c (make_gap_smaller): Define only if
17208 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17209
17210 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17211 it.
17212
17213 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17214 so that we aren't warned about unused symbols.
17215
17216 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17217
17218 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17219
17220 * xfns.c (x_real_positions): Mark locals as initialized.
17221
17222 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17223
17224 * xterm.c: Fix problems found by static analysis with other toolkits.
17225 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17226 (x_dispatch_event): Declare static if USE_GTK, and
17227 define if USE_GTK || USE_X_TOOLKIT.
17228 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17229 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17230 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17231 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17232
17233 * xmenu.c (menu_help_callback): Pointer type fixes.
17234 Use const pointers when pointing at readonly data. Avoid pointer
17235 signedness clashes.
17236 (FALSE): Remove unused macro.
17237 (update_frame_menubar): Remove unused decl.
17238
17239 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17240
17241 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17242 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17243 (single_menu_item): Rename local to avoid shadowing.
17244
17245 * keyboard.c (make_lispy_event): Remove unused local var.
17246
17247 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17248 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17249
17250 * bitmaps: Change bitmaps from unsigned char back to the X11
17251 compatible char. Avoid the old compiler warnings about
17252 out-of-range initializers by using, for example, '\xab' rather
17253 than 0xab.
17254
17255 * xgselect.c (xgselect_initialize): Check vs interface
17256 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17257
17258 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17259
17260 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17261 to read-only memory.
17262
17263 * fns.c (vector): Remove; this old hack is no longer needed.
17264
17265 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17266 Remove unused var.
17267 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17268
17269 * xrdb.c (x_load_resources): Omit unused local.
17270
17271 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17272 (x_window): Rename locals to avoid shadowing.
17273 (USG): Use the kludged USG macro, to pacify gcc.
17274
17275 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17276 (x_term_init): Remove local to avoid shadowing.
17277
17278 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17279
17280 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17281 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17282
17283 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17284
17285 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17286
17287 Fix regex.c, syntax.c and friends for buffers > 2GB.
17288 * syntax.h (struct gl_state_s): Declare character position members
17289 EMACS_INT.
17290
17291 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17292
17293 * textprop.c (verify_interval_modification, interval_of):
17294 Declare arguments EMACS_INT.
17295
17296 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17297 EMACS_INT.
17298
17299 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17300
17301 * indent.c (Fvertical_motion): Local variable it_start is now
17302 EMACS_INT.
17303
17304 * regex.c (re_match, re_match_2, re_match_2_internal)
17305 (bcmp_translate, regcomp, regexec, print_double_string)
17306 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17307 (re_compile_pattern, re_exec): Declare arguments and local
17308 variables `size_t' and `ssize_t' and return values `regoff_t', as
17309 appropriate.
17310 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17311 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17312 <compile_stack_type>: `size' and `avail' are now `size_t'.
17313
17314 * regex.h <regoff_t>: Use ssize_t, not int.
17315 (re_search, re_search_2, re_match, re_match_2): Arguments that
17316 specify buffer/string position and length are now ssize_t and
17317 size_t. Return type is regoff_t.
17318
17319 2011-04-16 Ben Key <bkey76@gmail.com>
17320
17321 * nsfont.m: Fixed bugs in ns_get_family and
17322 ns_descriptor_to_entity that were caused by using free to
17323 deallocate memory blocks that were allocated by xmalloc (via
17324 xstrdup). This caused Emacs to crash when compiled with
17325 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17326 --enable-checking=xmallocoverrun). xfree is now used to
17327 deallocate these memory blocks.
17328
17329 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17330
17331 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17332
17333 emacs_write: Accept and return EMACS_INT for sizes.
17334 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17335 et seq.
17336 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17337 Accept and return EMACS_INT.
17338 (emacs_gnutls_write): Return the number of bytes written on
17339 partial writes.
17340 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17341 (emacs_read, emacs_write): Remove check for negative size, as the
17342 Emacs source code has been audited now.
17343 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17344 (emacs_read, emacs_write): Use it.
17345 * process.c (send_process): Adjust to the new signatures of
17346 emacs_write and emacs_gnutls_write. Do not attempt to store
17347 a byte offset into an 'int'; it might overflow.
17348 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17349
17350 * sound.c: Don't assume sizes fit in 'int'.
17351 (struct sound_device.period_size, alsa_period_size):
17352 Return EMACS_INT, not int.
17353 (struct sound_device.write, vox_write, alsa_write):
17354 Accept EMACS_INT, not int.
17355 (wav_play, au_play): Use EMACS_INT to store sizes and to
17356 record read return values.
17357
17358 2011-04-15 Ben Key <bkey76@gmail.com>
17359
17360 * keyboard.c (Qundefined): Don't declare static since it is used
17361 in nsfns.m.
17362 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17363 static since they are used in nsfont.m.
17364
17365 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17366
17367 * process.c (Qprocessp): Don't declare static.
17368 * lisp.h (Qprocessp): Declare again.
17369
17370 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17371
17372 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17373
17374 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17375
17376 Improve C-level modularity by making more things 'static'.
17377
17378 Don't publish debugger-only interfaces to other modules.
17379 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17380 (verify_bytepos, count_markers): Move decls to the only modules
17381 that need them.
17382 * region-cache.h (pp_cache): Likewise.
17383 * window.h (check_all_windows): Likewise.
17384 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17385
17386 * sysdep.c (croak): Now static, if
17387 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17388 * syssignal.h (croak): Declare only if not static.
17389
17390 * alloc.c (refill_memory_reserve): Now static if
17391 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17392 * lisp.h (refill_memory_reserve): Declare only if not static.
17393
17394 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17395 Define only if USE_LUCID.
17396
17397 * xrdb.c (x_customization_string, x_rm_string): Now static.
17398
17399 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17400 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17401
17402 * xdisp.c (draw_row_with_mouse_face): Now static.
17403 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17404
17405 * window.h (check_all_windows): Mark externally visible.
17406
17407 * window.c (window_deletion_count): Now static.
17408
17409 * undo.c: Make symbols static if they're not exported.
17410 (last_undo_buffer, last_boundary_position, pending_boundary):
17411 Now static.
17412
17413 * textprop.c (interval_insert_behind_hooks): Now static.
17414 (interval_insert_in_front_hooks): Likewise.
17415
17416 * term.c: Make symbols static if they're not exported.
17417 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17418 (max_frame_lines, tty_set_terminal_modes):
17419 (tty_reset_terminal_modes, tty_turn_off_highlight):
17420 (get_tty_terminal): Now static.
17421 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17422 * termhooks.h (term_mouse_moveto): Do not declare if
17423 HAVE_WINDOW_SYSTEM.
17424 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17425 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17426
17427 * sysdep.c: Make symbols static if they're not exported.
17428 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17429 Now static.
17430 (sigprocmask_set, full_mask): Remove; unused.
17431 (wait_debugging): Mark as visible.
17432 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17433 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17434
17435 * syntax.c (syntax_temp): Define only if !__GNUC__.
17436
17437 * sound.c (current_sound_device, current_sound): Now static.
17438
17439 * search.c (searchbufs, searchbuf_head): Now static.
17440
17441 * scroll.c (scroll_cost): Remove; unused.
17442 * dispextern.h (scroll_cost): Remove decl.
17443
17444 * region-cache.h (pp_cache): Mark as externally visible.
17445
17446 * process.c: Make symbols static if they're not exported.
17447 (process_tick, update_tick, create_process, chan_process):
17448 (Vprocess_alist, proc_buffered_char, datagram_access):
17449 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17450 (deactivate_process): Mark defn as static, as well as decl.
17451 * lisp.h (create_process): Remove decl.
17452 * process.h (chan_process, Vprocess_alist): Remove decls.
17453
17454 * print.c: Make symbols static if they're not exported.
17455 (print_depth, new_backquote_output, being_printed, print_buffer):
17456 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17457 (print_interval, print_number_index, initial_stderr_stream):
17458 Now static.
17459 * lisp.h (Fprinc): Remove decl.
17460 (debug_output_compilation_hack): Mark as externally visible.
17461
17462 * sysdep.c (croak): Move decl from here to syssignal.h.
17463 * syssignal.h (croak): Put it here, so the API can be checked when
17464 'croak' is called from dissociate_if_controlling_tty.
17465
17466 * minibuf.c: Make symbols static if they're not exported.
17467 (minibuf_save_list, choose_minibuf_frame): Now static.
17468 * lisp.h (choose_minibuf_frame): Remove decl.
17469
17470 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17471
17472 * lread.c: Make symbols static if they're not exported.
17473 (read_objects, initial_obarray, oblookup_last_bucket_number):
17474 Now static.
17475 (make_symbol): Remove; unused.
17476 * lisp.h (initial_obarray, make_symbol): Remove decls.
17477
17478 * keyboard.c: Make symbols static if they're not exported.
17479 (single_kboard, recent_keys_index, total_keys, recent_keys):
17480 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17481 (this_single_command_key_start, echoing, last_auto_save):
17482 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17483 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17484 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17485 (Vlispy_mouse_stem, double_click_count):
17486 Now static.
17487 (force_auto_save_soon): Define only if SIGDANGER.
17488 (ignore_mouse_drag_p): Now static if
17489 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17490 (print_help): Remove; unused.
17491 (stop_character, last_timer_event): Mark as externally visible.
17492 * keyboard.h (ignore_mouse_drag_p): Declare only if
17493 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17494 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17495 * lisp.h (echoing): Remove decl.
17496 (force_auto_save_soon): Declare only if SIGDANGER.
17497 * xdisp.c (redisplay_window): Simplify code, to make it more
17498 obvious that ignore_mouse_drag_p is not accessed if !defined
17499 USE_GTK && !defined HAVE_NS.
17500
17501 * intervals.c: Make symbols static if they're not exported.
17502 (merge_properties_sticky, merge_interval_right, delete_interval):
17503 Now static.
17504 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17505
17506 * insdel.c: Make symbols static if they're not exported.
17507 However, leave prepare_to_modify_buffer alone. It's never
17508 called from outside this function, but that appears to be a bug.
17509 (combine_after_change_list, combine_after_change_buffer):
17510 (adjust_after_replace, signal_before_change): Now static.
17511 (adjust_after_replace_noundo): Remove; unused.
17512 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17513 (signal_before_change): Remove decls.
17514
17515 * indent.c (val_compute_motion, val_vmotion): Now static.
17516
17517 * image.c: Make symbols static if they're not exported.
17518 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17519 if USE_GTK.
17520 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17521 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17522
17523 * fringe.c (standard_bitmaps): Now static.
17524 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17525
17526 * frame.c: Make symbols static if they're not exported.
17527 (x_report_frame_params, make_terminal_frame): Now static.
17528 (get_frame_param): Now static, unless HAVE_NS.
17529 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17530 (x_get_resource_string): Remove; not used.
17531 * frame.h (make_terminal_frame, x_report_frame_params):
17532 (x_get_resource_string); Remove decls.
17533 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17534 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17535
17536 * font.c, fontset.c: Make symbols static if they're not exported.
17537 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17538 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17539 * font.c (font_close_object): Now static.
17540 * font.h (font_close_object): Remove.
17541 * fontset.c (FONTSET_OBJLIST): Remove.
17542 (free_realized_fontset) #if-0 the body, which does nothing.
17543 (face_suitable_for_char_p): #if-0, as it's never called.
17544 * fontset.h (face_suitable_for_char_p): Remove decl.
17545 * xfaces.c (face_at_string_position):
17546 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17547 since 0 is always ASCII.
17548
17549 * fns.c (weak_hash_tables): Now static.
17550
17551 * fileio.c: Make symbols static if they're not exported.
17552 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17553 (Vwrite_region_annotation_buffers): Now static.
17554
17555 * eval.c: Make symbols static if they're not exported.
17556 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17557 * lisp.h (backtrace_list): Remove decl.
17558
17559 * emacs.c: Make symbols static if they're not exported.
17560 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17561 (fatal_error_code, fatal_error_signal_hook, standard_args):
17562 Now static.
17563 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17564 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17565 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17566 * lisp.h (fatal_error_signal_hook): Remove decl.
17567 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17568
17569 * editfns.c: Move a (normally-unused) function to its only use.
17570 * editfns.c, lisp.h (get_operating_system_release): Remove.
17571 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17572 worth the hassle of breaking this out.
17573
17574 * xterm.c: Make symbols static if they're not exported.
17575 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17576 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17577 (x_destroy_window, x_delete_display):
17578 Now static.
17579 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17580 (x_mouse_leave): Remove; unused.
17581 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17582 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17583 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17584 Remove decls.
17585 (x_mouse_leave): Declare only if WINDOWSNT.
17586 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17587 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17588 USE_X_TOOLKIT.
17589
17590 * ftxfont.c: Make symbols static if they're not exported.
17591 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17592 HAVE_FREETYPE.
17593 * font.h (ftxfont_driver): Likewise.
17594
17595 * xfns.c: Make symbols static if they're not exported.
17596 (x_last_font_name, x_display_info_for_name):
17597 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17598 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17599 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17600 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17601 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17602 (last_show_tip_args): Now static.
17603 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17604 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17605 (x_screen_planes): Remove; unused.
17606 * dispextern.h (x_screen_planes): Remove decl.
17607
17608 * dispnew.c: Make symbols static if they're not exported.
17609 * dispextern.h (redraw_garbaged_frames, scrolling):
17610 (increment_row_positions): Remove.
17611 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17612 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17613 Now static.
17614 (redraw_garbaged_frames): Remove; unused.
17615
17616 * xfaces.c: Make symbols static if they're not exported.
17617 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17618 Remove decls.
17619 * xterm.h (defined_color): Remove decls.
17620 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17621 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17622 (menu_face_changed_default, defined_color, free_realized_face):
17623 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17624 (ascii_face_of_lisp_face): Remove; unused.
17625
17626 * xdisp.c: Make symbols static if they're not exported.
17627 * dispextern.h (scratch_glyph_row, window_box_edges):
17628 (glyph_to_pixel_coords, set_cursor_from_row):
17629 (get_next_display_element, set_iterator_to_next):
17630 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17631 (show_mouse_face): Remove decls
17632 * frame.h (message_buf_print): Likewise.
17633 * lisp.h (pop_message, set_message, check_point_in_composition):
17634 Likewise.
17635 * xterm.h (set_vertical_scroll_bar): Likewise.
17636 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17637 (message_buf_print, scratch_glyph_row, displayed_buffer):
17638 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17639 (get_next_display_element, show_mouse_face, window_box_edges):
17640 (frame_to_window_pixel_xy, check_point_in_composition):
17641 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17642 (glyph_to_pixel_coords): Remove; unused.
17643
17644 * dired.c (file_name_completion): Now static.
17645
17646 * dbusbind.c (xd_in_read_queued_messages): Now static.
17647
17648 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17649 * data.c (circular_list_error): Remove.
17650
17651 * commands.h (last_point_position, last_point_position_buffer):
17652 (last_point_position_window): Remove decls.
17653 * keyboard.c: Make these variables static.
17654
17655 * coding.h (coding, code_convert_region, encode_coding_gap):
17656 Remove decls.
17657 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17658 (iso_code_class, detect_coding, code_convert_region): Now static.
17659 (encode_coding_gap): Remove; unused.
17660
17661 * chartab.c (chartab_chars, chartab_bits): Now static.
17662
17663 * charset.h (charset_iso_8859_1): Remove decl.
17664 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17665 Now static.
17666
17667 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17668 * ccl.c (Vccl_program_table): Now static.
17669 (check_ccl_update): Remove; unused.
17670
17671 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17672 * category.h: ... from here.
17673 * category.c (check_category_table, set_category_set): Now static.
17674
17675 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17676 * lisp.h: Remove these decls.
17677
17678 * buffer.c (buffer_count): Remove unused var.
17679
17680 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17681 so that it's not optimized away.
17682 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17683 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17684 exported only to the debugger.
17685
17686 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17687 * atimer.h (run_all_atimers): Remove; not exported.
17688
17689 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17690 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17691 was inaccessible from Lisp.
17692 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17693 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17694
17695 alloc.c: Import and export fewer symbols, and remove unused items.
17696 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17697 is defined.
17698 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17699 it's not optimized away by whole-program optimization.
17700 (message_enable_multibyte, free_misc): Remove.
17701 (catchlist, handlerlist, mark_backtrace):
17702 Declare only if BYTE_MARK_STACK.
17703 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17704 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17705 (message_enable_multibyte): Remove decl.
17706 (free_misc, interval_free_list, float_block, float_block_index):
17707 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17708 (cons_free_list, last_marked_index):
17709 Now static.
17710 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17711 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17712 (mark_backtrace): Define only if BYTE_MARK_STACK.
17713 * xdisp.c (message_enable_multibyte): Now static.
17714
17715 Declare Lisp_Object Q* variables to be 'static' if not exported.
17716 This makes it easier for human readers (and static analyzers)
17717 to see whether these variables are used from other modules.
17718 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17719 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17720 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17721 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17722 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17723 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17724 * xmenu.c, xselect.c:
17725 Declare Q* vars static if they are not used in other modules.
17726 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17727 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17728 Remove decls of unexported vars.
17729 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17730
17731 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17732
17733 Make Emacs functions such as Fatom 'static' by default.
17734 This makes it easier for human readers (and static analyzers)
17735 to see whether these functions can be called from other modules.
17736 DEFUN now defines a static function. To make the function external
17737 so that it can be used in other C modules, use the new macro DEFUE.
17738 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17739 (Finit_image_library):
17740 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17741 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17742 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17743 Remove decls, since these functions are now static.
17744 (Funintern, Fget_internal_run_time): New decls, since these functions
17745 were already external.
17746
17747 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17748 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17749 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17750 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17751 * keyboard.c, keymap.c, lread.c:
17752 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17753 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17754 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17755 Mark functions with DEFUE instead of DEFUN,
17756 if they are used in other modules.
17757 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17758 decls for now-static functions.
17759 * buffer.h (Fdelete_overlay): Remove decl.
17760 * callproc.c (Fgetenv_internal): Mark as internal.
17761 * composite.c (Fremove_list_of_text_properties): Remove decl.
17762 (Fcomposition_get_gstring): New forward static decl.
17763 * composite.h (Fcomposite_get_gstring): Remove decl.
17764 * dired.c (Ffile_attributes): New forward static decl.
17765 * doc.c (Fdocumntation_property): New forward static decl.
17766 * eval.c (Ffetch_bytecode): New forward static decl.
17767 (Funintern): Remove extern decl; now in .h file where it belongs.
17768 * fileio.c (Fmake_symbolic_link): New forward static decl.
17769 * image.c (Finit_image_library): New forward static decl.
17770 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17771 * intervals.h (Fprevious_property_change):
17772 (Fremove_list_of_text_properties): Remove decls.
17773 * keyboard.c (Fthis_command_keys): Remove decl.
17774 (Fcommand_execute): New forward static decl.
17775 * keymap.c (Flookup_key): New forward static decl.
17776 (Fcopy_keymap): Now static.
17777 * keymap.h (Flookup_key): Remove decl.
17778 * process.c (Fget_process): New forward static decl.
17779 (Fprocess_datagram_address): Mark as internal.
17780 * syntax.c (Fsyntax_table_p): New forward static decl.
17781 (skip_chars): Remove duplicate decl.
17782 * textprop.c (Fprevious_property_change): New forward static decl.
17783 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17784 Now internal.
17785 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17786 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17787
17788 * editfns.c (Fformat): Remove unreachable code.
17789
17790 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17791
17792 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17793 change. (Bug#8496)
17794
17795 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17796
17797 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17798 when at ZV. (Bug#8487)
17799
17800 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17801
17802 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17803 (Bug#8437)
17804 * keyboard.c (parse_tool_bar_item): Likewise.
17805 * sound.c (sound_cleanup, alsa_close): Likewise.
17806 * termcap.c (tgetent): Likewise.
17807 * xfns.c (x_default_font_parameter): Likewise.
17808 * xsettings.c (read_and_apply_settings): Likewise.
17809
17810 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17811 (overrun_check_free): Protoize.
17812
17813 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17814
17815 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17816 since callers should never pass a negative size.
17817 Change the signature to match that of plain 'read' and 'write'; see
17818 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17819 * lisp.h: Update prototypes of emacs_write and emacs_read.
17820
17821 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17822
17823 * xdisp.c (redisplay_window): Don't try to determine the character
17824 position of the scroll margin if the window start point w->startp
17825 is outside the buffer's accessible region. (Bug#8468)
17826
17827 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17828
17829 Fix write-region and its subroutines for buffers > 2GB.
17830 * fileio.c (a_write, e_write): Modify declaration of arguments and
17831 local variables to support buffers larger than 2GB.
17832 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17833
17834 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17835 argument, local variables, and return value.
17836
17837 * lisp.h: Update prototypes of emacs_write and emacs_read.
17838
17839 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17840
17841 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17842
17843 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17844
17845 Fix more problems found by GCC 4.6.0's static checks.
17846
17847 * xdisp.c (vmessage): Use a better test for character truncation.
17848
17849 * charset.c (load_charset_map): <, not <=, for optimization,
17850 and to avoid potential problems with integer overflow.
17851 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17852 * casetab.c (set_identity, shuffle): Likewise.
17853 * editfns.c (Fformat): Likewise.
17854 * syntax.c (skip_chars): Likewise.
17855
17856 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17857 This also lets GCC 4.6.0 generate slightly better loop code.
17858
17859 * callint.c (Fcall_interactively): <, not <=, for optimization.
17860 (Fcall_interactively): Count the number of arguments produced,
17861 not the number of arguments given. This is simpler and lets GCC
17862 4.6.0 generate slightly better code.
17863
17864 * ftfont.c: Distingish more carefully between FcChar8 and char.
17865 The previous code passed unsigned char * to a functions like
17866 strlen and xstrcasecmp that expect char *, which does not
17867 conform to the C standard.
17868 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17869 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17870 char * when the C standard requires it.
17871
17872 * keyboard.c (read_char): Remove unused var.
17873
17874 * eval.c: Port to Windows vsnprintf (Bug#8435).
17875 Include <limits.h>.
17876 (SIZE_MAX): Define if the headers do not.
17877 (verror): Do not give up if vsnprintf returns a negative count.
17878 Instead, grow the buffer. This ports to Windows vsnprintf, which
17879 does not conform to C99. Problem reported by Eli Zaretskii.
17880 Also, simplify the allocation scheme, by avoiding the need for
17881 calling realloc, and removing the ALLOCATED variable.
17882
17883 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17884
17885 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17886 But keep the doprint source code for now, as we might revamp it
17887 and use it again (Bug#8435).
17888 * lisp.h (doprnt): Remove.
17889 * Makefile.in (base_obj): Remove doprnt.o.
17890 * deps.mk (doprnt.o): Remove.
17891
17892 error: Print 32- and 64-bit integers portably (Bug#8435).
17893 Without this change, on typical 64-bit hosts error ("...%d...", N)
17894 was used to print both 32- and 64-bit integers N, which relied on
17895 undefined behavior.
17896 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17897 * lisp.h (error, verror): Mark as printf-like functions.
17898 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17899 Report overflow in size calculations when allocating printf buffer.
17900 Do not truncate output string at its first null byte.
17901 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17902 Truncate the output at a character boundary, since vsnprintf does not
17903 do that.
17904 * charset.c (check_iso_charset_parameter): Convert internal
17905 character to string before calling 'error', since %c now has the
17906 printf meaning.
17907 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17908 overflow when computing char to be passed to 'error'. Do not
17909 pass Lisp_Object to 'error'; pass the integer instead.
17910 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17911 formatted with plain %d.
17912
17913 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17914
17915 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17916
17917 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17918
17919 * xterm.c (x_catch_errors): Remove duplicate declaration.
17920
17921 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17922
17923 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17924
17925 2011-04-10 Jim Meyering <meyering@redhat.com>
17926
17927 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17928 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17929 return ssize_t not "int", and use size_t as the buffer length.
17930 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17931 * gnutls.h: Update declarations.
17932 * process.c (read_process_output): Use ssize_t, to match.
17933 (send_process): Likewise.
17934
17935 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17936
17937 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17938
17939 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17940
17941 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17942 Use unsigned char, to match FcChar8 type definition.
17943
17944 * xterm.c (handle_one_xevent):
17945 * xmenu.c (create_and_show_popup_menu):
17946 * xselect.c (x_decline_selection_request)
17947 (x_reply_selection_request): Avoid type-punned deref of X events.
17948
17949 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17950
17951 Fix some uses of `int' instead of EMACS_INT.
17952 * search.c (string_match_1, fast_string_match)
17953 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17954 (scan_buffer, find_next_newline_no_quit)
17955 (find_before_next_newline, search_command, Freplace_match)
17956 (Fmatch_data): Make some `int' variables be EMACS_INT.
17957
17958 * xdisp.c (display_count_lines): 3rd argument and return value now
17959 EMACS_INT. All callers changed.
17960 (pint2hrstr): Last argument is now EMACS_INT.
17961
17962 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17963 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17964 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17965 (decode_coding_utf_16, decode_coding_emacs_mule)
17966 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17967 (decode_coding_ccl, decode_coding_charset)
17968 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17969 (decode_coding_iso_2022, decode_coding_emacs_mule)
17970 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17971 <char_offset, last_offset>: Declare EMACS_INT.
17972 (encode_coding_utf_8, encode_coding_utf_16)
17973 (encode_coding_emacs_mule, encode_invocation_designation)
17974 (encode_designation_at_bol, encode_coding_iso_2022)
17975 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17976 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17977 Declare EMACS_INT.
17978 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17979 (encode_invocation_designation): Last argument P_NCHARS is now
17980 EMACS_INT.
17981 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17982 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17983
17984 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17985 All users changed.
17986
17987 * ccl.c (Fccl_execute_on_string): Declare some variables
17988 EMACS_INT.
17989
17990 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17991
17992 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17993
17994 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17995
17996 * process.c (Fformat_network_address): Doc fix.
17997
17998 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17999
18000 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
18001
18002 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
18003
18004 * keyboard.c (read_char): Call Lisp function help-form-show,
18005 instead of using internal_with_output_to_temp_buffer.
18006 (Qhelp_form_show): New var.
18007 (syms_of_keyboard): Use DEFSYM macro.
18008
18009 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18010
18011 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18012
18013 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
18014
18015 * process.c (Flist_processes): Remove to Lisp.
18016 (list_processes_1): Delete.
18017
18018 2011-04-06 Eli Zaretskii <eliz@gnu.org>
18019
18020 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18021
18022 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18023
18024 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
18025
18026 Fix more problems found by GCC 4.6.0's static checks.
18027
18028 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18029
18030 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18031
18032 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
18033
18034 * xdisp.c (vmessage): Mark as a printf-like function.
18035
18036 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18037
18038 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18039
18040 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18041 printf-like functions.
18042 (tiff_load): Add casts to remove these marks before passing them
18043 to system-supplied API.
18044
18045 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18046
18047 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18048 This avoids several warnings with gcc -Wstrict-overflow.
18049 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18050 directly, rather than having caller test rule sign. This avoids
18051 some unnecessary tests.
18052 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18053 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18054 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
18055
18056 * xfont.c (xfont_text_extents): Remove var that was set but not used.
18057 (xfont_open): Avoid unnecessary tests.
18058
18059 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18060
18061 * composite.h, composite.c (composition_gstring_put_cache):
18062 Use EMACS_INT, not int, for length.
18063
18064 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18065 breaking out part of COMPOSITION_DECODE_RULE.
18066 (COMPOSITION_DECODE_RULE): Use it.
18067 * composite.c (get_composition_id): Remove unused local vars,
18068 by using the new macro.
18069
18070 * textprop.c (set_text_properties_1): Change while to do-while,
18071 since the condition is always true at first.
18072
18073 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18074 (interval_deletion_adjustment): Return unsigned value.
18075 All uses changed.
18076
18077 * process.c (list_processes_1, create_pty, read_process_output):
18078 (exec_sentinel): Remove vars that were set but not used.
18079 (create_pty): Remove unnecessary "volatile"s.
18080 (Fnetwork_interface_info): Avoid possibility of int overflow.
18081 (read_process_output): Do adaptive read buffering even if carryover.
18082 (read_process_output): Simplify nbytes computation if buffered.
18083
18084 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18085
18086 * syntax.c (scan_words): Remove var that was set but not used.
18087 (update_syntax_table): Use unsigned instead of int.
18088
18089 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18090 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18091 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18092
18093 * print.c (print_error_message): Avoid int overflow.
18094
18095 * font.c (font_list_entities): Redo for clarity,
18096 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18097
18098 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18099 (font_score): Avoid potential overflow in diff calculation.
18100
18101 * fns.c (substring_both): Remove var that is set but not used.
18102 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18103
18104 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18105
18106 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18107 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18108 can always succeed if overflow has undefined behavior.
18109
18110 * search.c (boyer_moore, wordify): Remove vars set but not used.
18111 (wordify): Omit three unnecessary tests.
18112
18113 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18114 All callers changed. This avoids the need for an unused var.
18115
18116 * casefiddle.c (casify_region): Remove var that is set but not used.
18117
18118 * dired.c (file_name_completion): Remove var that is set but not used.
18119
18120 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18121
18122 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18123 (Finsert_file_contents): Remove unnecessary code checking fd.
18124
18125 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18126 Check for integer overflow on size calculations.
18127
18128 * buffer.c (Fprevious_overlay_change): Remove var that is set
18129 but not used.
18130
18131 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18132 Remove vars that are set but not used.
18133 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18134 (timer_check_2): Mark vars as initialized.
18135
18136 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18137
18138 * image.c (lookup_image): Remove var that is set but not used.
18139 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18140
18141 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18142 that are set but not used.
18143
18144 * xfns.c (make_invisible_cursor): Don't return garbage
18145 if XCreateBitmapFromData fails (Bug#8410).
18146
18147 * xselect.c (x_get_local_selection, x_handle_property_notify):
18148 Remove vars that are set but not used.
18149
18150 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18151 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18152
18153 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18154 Remove var that is set but not used.
18155 (scroll_bar_windows_size): Now size_t, not int.
18156 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18157 Check for overflow.
18158
18159 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18160 (map_tty_color) [!defined MSDOS]: Likewise.
18161
18162 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18163
18164 * coding.c: Remove vars that are set but not used.
18165 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18166 All callers changed.
18167 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18168 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18169 (decode_coding_charset): Remove vars that are set but not used.
18170
18171 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18172 that is set but not used.
18173
18174 * print.c (print_object): Remove var that is set but not used.
18175
18176 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18177 The gnulib version avoids calling malloc in the usual case,
18178 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18179 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18180 * filelock.c (current_lock_owner): Likewise.
18181 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18182 * sysdep.c: Include allocator.h, careadlinkat.h.
18183 (emacs_no_realloc_allocator): New static constant.
18184 (emacs_readlink): New function.
18185 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18186 ../lib/careadlinkat.h.
18187
18188 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18189
18190 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18191 first non-nil return value).
18192
18193 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18194
18195 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18196 if not defined (Bug#8403).
18197
18198 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18199
18200 * xdisp.c (display_count_lines): Remove parameter `start',
18201 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18202 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18203 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18204 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18205 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18206 and thereabouts. All callers changed.
18207 (get_per_char_metric): Remove parameter `f', unused since
18208 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18209
18210 2011-04-02 Jim Meyering <meyering@redhat.com>
18211
18212 do not dereference NULL upon failed strdup
18213 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18214 (ns_get_family): Likewise.
18215
18216 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18217
18218 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18219
18220 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18221
18222 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18223 later (Bug#8403).
18224
18225 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18226
18227 Add lexical binding.
18228
18229 * window.c (Ftemp_output_buffer_show): New fun.
18230 (Fsave_window_excursion):
18231 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18232
18233 * lread.c (lisp_file_lexically_bound_p): New function.
18234 (Fload): Bind Qlexical_binding.
18235 (readevalloop): Remove `evalfun' arg.
18236 Bind Qinternal_interpreter_environment.
18237 (Feval_buffer): Bind Qlexical_binding.
18238 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18239 Mark as dynamic.
18240 (syms_of_lread): Declare `lexical-binding'.
18241
18242 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18243
18244 * keyboard.c (eval_dyn): New fun.
18245 (menu_item_eval_property): Use it.
18246
18247 * image.c (parse_image_spec): Use Ffunctionp.
18248
18249 * fns.c (concat, mapcar1): Accept byte-code-functions.
18250
18251 * eval.c (Fsetq): Handle lexical vars.
18252 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18253 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18254 (FletX, Flet): Obey lexical binding.
18255 (Fcommandp): Handle closures.
18256 (Feval): New `lexical' arg.
18257 (eval_sub): New function extracted from Feval. Use it almost
18258 everywhere where Feval was used. Look up vars in lexical env.
18259 Handle closures.
18260 (Ffunctionp): Move from subr.el.
18261 (Ffuncall): Handle closures.
18262 (apply_lambda): Remove `eval_flags'.
18263 (funcall_lambda): Handle closures and new byte-code-functions.
18264 (Fspecial_variable_p): New function.
18265 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18266 but without exporting it to Lisp.
18267
18268 * doc.c (Fdocumentation, store_function_docstring):
18269 * data.c (Finteractive_form): Handle closures.
18270
18271 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18272 interactive spec.
18273
18274 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18275 New byte-codes.
18276 (exec_byte_code): New function extracted from Fbyte_code to handle new
18277 calling convention for byte-code-functions. Add new byte-codes.
18278
18279 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18280
18281 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18282
18283 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18284
18285 * xdisp.c (redisplay_internal): Fix prototype.
18286
18287 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18288
18289 * xdisp.c (SCROLL_LIMIT): New macro.
18290 (try_scrolling): Use it when setting scroll_limit.
18291 Limit scrolling to 100 screen lines.
18292 (redisplay_window): Even when falling back on "recentering",
18293 position point in the window according to scroll-conservatively,
18294 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18295
18296 (try_scrolling): When point is above the window, allow searching
18297 as far as scroll_max, or one screenful, to compute vertical
18298 distance from PT to the scroll margin position. This prevents
18299 try_scrolling from unnecessarily failing when
18300 scroll-conservatively is set to a value slightly larger than the
18301 window height. Clean up the case of PT below the margin at bottom
18302 of window: scroll_max can no longer be INT_MAX. When aggressive
18303 scrolling is in use, don't let point enter the opposite scroll
18304 margin as result of the scroll.
18305 (syms_of_xdisp) <scroll-conservatively>: Document the
18306 threshold of 100 lines for never-recentering scrolling.
18307
18308 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18309
18310 * dispextern.h (move_it_by_lines):
18311 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18312 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18313 (message_log_check_duplicate): Remove parameters `prev_bol' and
18314 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18315 (redisplay_internal): Remove parameter `preserve_echo_area',
18316 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18317
18318 * indent.c (Fvertical_motion):
18319 * window.c (window_scroll_pixel_based, Frecenter):
18320 Don't pass `need_y_p' to `move_it_by_lines'.
18321
18322 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18323
18324 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18325 steal a few bits to be more compact.
18326 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18327 Remove unneeded casts.
18328
18329 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18330
18331 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18332
18333 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18334 binding" message (bug#7967).
18335
18336 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18337
18338 Fix more problems found by GCC 4.6.0's static checks.
18339
18340 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18341 Remove unused local var.
18342
18343 * editfns.c (Fmessage_box): Remove unused local var.
18344
18345 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18346 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18347 Omit unused local vars.
18348 * window.c (shrink_windows): Omit unused local var.
18349 * menu.c (digest_single_submenu): Omit unused local var.
18350 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18351 Omit unused local var.
18352
18353 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18354 Don't assume string length fits in int.
18355 (keyremap_step, read_key_sequence): Use size_t for sizes.
18356 (read_key_sequence): Don't check last_real_key_start redundantly.
18357
18358 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18359 instead of alloca (Bug#8344).
18360
18361 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18362 (Fbacktrace_frame): Don't assume nframes fits in int.
18363
18364 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18365
18366 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18367 concerns.
18368
18369 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18370
18371 * cm.c (calccost): Turn while-do into do-while, for clarity.
18372
18373 * keyboard.c (syms_of_keyboard): Use the same style as later
18374 in this function when indexing through an array. This also
18375 works around GCC bug 48267.
18376
18377 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18378
18379 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18380
18381 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18382 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18383
18384 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18385 This avoids undefined behavior on integer overflow, and is a bit
18386 more convenient anyway since it is compared to a size_t variable.
18387
18388 Variadic C functions now count arguments with size_t, not int.
18389 This avoids an unnecessary limitation on 64-bit machines, which
18390 caused (substring ...) to crash on large vectors (Bug#8344).
18391 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18392 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18393 All variadic functions and their callers changed accordingly.
18394 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18395 * data.c (arith_driver, float_arith_driver): Likewise.
18396 * editfns.c (general_insert_function): Likewise.
18397 * eval.c (struct backtrace.nargs, interactive_p)
18398 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18399 (funcall_lambda, mark_backtrace): Likewise.
18400 * fns.c (concat): Likewise.
18401 * frame.c (x_set_frame_parameters): Likewise.
18402 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18403 0 if not found, not -1. All callers changed.
18404
18405 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18406 (stack_copy_size): Now size_t, not int.
18407 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18408
18409 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18410
18411 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18412 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18413 All callers changed.
18414
18415 * lisp.h (multibyte_char_to_unibyte):
18416 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18417 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18418 * character.h (CHAR_TO_BYTE8):
18419 * cmds.c (internal_self_insert):
18420 * editfns.c (general_insert_function):
18421 * keymap.c (push_key_description):
18422 * search.c (Freplace_match):
18423 * xdisp.c (message_dolog, set_message_1): All callers changed.
18424
18425 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18426
18427 * keyboard.c (safe_run_hook_funcall): New function.
18428 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18429 don't set the hook to nil, but remove the offending function instead.
18430 (Qcommand_hook_internal): Remove, unused.
18431 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18432 Vcommand_hook_internal.
18433
18434 * eval.c (enum run_hooks_condition): Remove.
18435 (funcall_nil, funcall_not): New functions.
18436 (run_hook_with_args): Call each function through a `funcall' argument.
18437 Remove `cond' argument, now redundant.
18438 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18439 (Frun_hook_with_args_until_failure): Adjust accordingly.
18440 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18441
18442 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18443
18444 * dispextern.h (string_buffer_position): Remove declaration.
18445
18446 * print.c (strout): Remove parameter `multibyte', unused since
18447 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18448
18449 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18450 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18451 All callers changed.
18452
18453 * w32.c (_wsa_errlist): Use braces for struct initializers.
18454
18455 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18456 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18457 All callers changed.
18458 (string_buffer_position): Likewise. Also, make static (it's never
18459 used outside xdisp.c).
18460 (cursor_row_p): Remove parameter `w', unused since
18461 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18462 (decode_mode_spec): Remove parameter `precision', introduced during
18463 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18464 All callers changed.
18465
18466 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18467
18468 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18469
18470 2011-03-27 Anders Lindgren <andlind@gmail.com>
18471
18472 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18473 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18474 (ns_update_auto_hide_menu_bar): New functions.
18475 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18476 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18477 ns_constrain_all_frames.
18478 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18479 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18480
18481 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18482
18483 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18484
18485 2011-03-27 Glenn Morris <rgm@gnu.org>
18486
18487 * syssignal.h: Replace RETSIGTYPE with void.
18488 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18489 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18490 Replace SIGTYPE with void everywhere.
18491 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18492 * s/template.h (SIGTYPE): Remove commented out definition.
18493
18494 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18495
18496 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18497 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18498
18499 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18500
18501 * w32.c (read_unc_volume): Use parameter `henum', instead of
18502 global variable `wget_enum_handle'.
18503
18504 * keymap.c (describe_vector): Remove parameters `indices' and
18505 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18506 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18507
18508 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18509
18510 * keyboard.c (timer_check): Remove parameter `do_it_now',
18511 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18512 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18513 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18514
18515 * keyboard.c (read_char):
18516 * w32menu.c (w32_menu_display_help):
18517 * xmenu.c (show_help_event, menu_help_callback):
18518 Adjust calls to `show_help_echo'.
18519
18520 * gtkutil.c (xg_maybe_add_timer):
18521 * keyboard.c (readable_events):
18522 * process.c (wait_reading_process_output):
18523 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18524
18525 * insdel.c (adjust_markers_gap_motion):
18526 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18527 (gap_left, gap_right): Don't call it.
18528
18529 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18530
18531 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18532 incurred during fontification.
18533
18534 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18535
18536 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18537 (DEFVAR_PER_BUFFER): Don't pass it.
18538
18539 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18540 (scrolling_window): Don't pass it.
18541
18542 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18543
18544 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18545
18546 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18547 and `suffix'.
18548 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18549 of variables specific to SELinux and computation of `encoded_absname'.
18550
18551 * image.c (XPutPixel): Remove unused variable `height'.
18552
18553 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18554
18555 * unexw32.c (get_section_info): Remove unused variable `section'.
18556
18557 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18558 (system_process_attributes): Remove unused variable `sess'.
18559 (sys_read): Remove unused variable `err'.
18560
18561 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18562 (w32_wnd_proc): Remove unused variable `isdead'.
18563 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18564 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18565 (x_create_tip_frame): Remove unused variable `tem'.
18566
18567 * w32inevt.c (w32_console_read_socket):
18568 Remove unused variable `no_events'.
18569
18570 * w32term.c (x_draw_composite_glyph_string_foreground):
18571 Remove unused variable `width'.
18572
18573 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18574
18575 * w32term.c (x_set_glyph_string_clipping):
18576 Don't pass uninitialized region to CombineRgn.
18577
18578 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18579
18580 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18581 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18582 (Fx_close_connection): Remove unused variable `i'.
18583
18584 * w32font.c (w32font_draw): Return number of glyphs.
18585 (w32font_open_internal): Remove unused variable `i'.
18586 (w32font_driver): Add missing initializer.
18587
18588 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18589 (fill_in_menu): Remove unused variable `items_added'.
18590
18591 * w32term.c (last_mouse_press_frame): Remove static global variable.
18592 (w32_clip_to_row): Remove unused variable `f'.
18593 (x_delete_terminal): Remove unused variable `i'.
18594
18595 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18596 (NOTHING): Remove unused static global variable.
18597 (uniscribe_check_otf): Remove unused variable `table'.
18598 (uniscribe_font_driver): Add missing initializers.
18599
18600 2011-03-23 Julien Danjou <julien@danjou.info>
18601
18602 * term.c (Fsuspend_tty, Fresume_tty):
18603 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18604 * window.c (temp_output_buffer_show):
18605 * insdel.c (signal_before_change):
18606 * frame.c (Fhandle_switch_frame):
18607 * fileio.c (Fdo_auto_save):
18608 * emacs.c (Fkill_emacs):
18609 * editfns.c (save_excursion_restore):
18610 * cmds.c (internal_self_insert):
18611 * callint.c (Fcall_interactively):
18612 * buffer.c (Fkill_all_local_variables):
18613 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18614 Use Frun_hooks.
18615 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18616 unconditionally since it does the check itself.
18617
18618 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18619
18620 Fix more problems found by GCC 4.5.2's static checks.
18621
18622 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18623 the first time through the loop, since we know p0 < p1 then.
18624 This also avoids a gcc -Wstrict-overflow warning.
18625
18626 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18627 leading to a memory leak, possible in functions like
18628 load_charset_map_from_file that can allocate an unbounded number
18629 of objects (Bug#8318).
18630
18631 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18632 that could (at least in theory) be that large.
18633
18634 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18635 This is less likely to overflow, and avoids undefined behavior if
18636 overflow does occur. All callers changed. Use strtoul to scan
18637 for the unsigned long integer.
18638 (pint2hrstr): Simplify and tune code slightly.
18639 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18640
18641 * scroll.c (do_scrolling): Work around GCC bug 48228.
18642 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18643
18644 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18645 This also avoids a warning with gcc -Wstrict-overflow.
18646 (validate_x_resource_name): Simplify count usage.
18647 This also avoids a warning with gcc -Wstrict-overflow.
18648
18649 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18650 fail (Bug#8306).
18651
18652 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18653
18654 * process.c (Fmake_network_process): Use socklen_t, not int,
18655 where POSIX says socklen_t is required in portable programs.
18656 This fixes a porting bug on hosts like 64-bit HP-UX, where
18657 socklen_t is wider than int (Bug#8277).
18658 (Fmake_network_process, server_accept_connection):
18659 (wait_reading_process_output, read_process_output):
18660 Likewise.
18661
18662 * process.c: Rename or move locals to avoid shadowing.
18663 (list_processes_1, Fmake_network_process):
18664 (read_process_output_error_handler, exec_sentinel_error_handler):
18665 Rename or move locals.
18666 (Fmake_network_process): Define label "retry_connect" only if needed.
18667 (Fnetwork_interface_info): Fix pointer signedness.
18668 (process_send_signal): Add cast to avoid pointer signedness problem.
18669 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18670 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18671
18672 Make tparam.h and terminfo.c consistent.
18673 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18674 Include tparam.h instead, since it declares them.
18675 * cm.h (PC): Remove extern decl; tparam.h now does this.
18676 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18677 * terminfo.c: Include tparam.h, to check interfaces.
18678 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18679 (tparam): Adjust signature to match interface in tparam.h;
18680 this removes some undefined behavior. Check that outstring and len
18681 are zero, which they always are with Emacs.
18682 * tparam.h (PC, BC, UP): New extern decls.
18683
18684 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18685 (xftfont_open): Rename locals to avoid shadowing.
18686
18687 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18688 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18689 (OTF_TAG_SYM): Omit macro if not needed.
18690 (ftfont_list): Remove unused local.
18691 (get_adstyle_property, ftfont_pattern_entity):
18692 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18693 Rename locals to avoid shadowing.
18694
18695 * xfont.c (xfont_list_family): Mark var as initialized.
18696
18697 * xml.c (make_dom): Now static.
18698
18699 * composite.c (composition_compute_stop_pos): Rename local to
18700 avoid shadowing.
18701 (composition_reseat_it): Remove unused locals.
18702 (find_automatic_composition, composition_adjust_point): Likewise.
18703 (composition_update_it): Mark var as initialized.
18704 (find_automatic_composition): Mark vars as initialized,
18705 with a FIXME (Bug#8290).
18706
18707 character.h: Rename locals to avoid shadowing.
18708 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18709 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18710 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18711 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18712 to avoid shadowing.
18713
18714 * textprop.c (property_change_between_p): Remove; unused.
18715
18716 * intervals.c (interval_start_pos): Now static.
18717
18718 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18719
18720 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18721 Rename locals to avoid shadowing.
18722
18723 * sound.c (wav_play, au_play, Fplay_sound_internal):
18724 Fix pointer signedness.
18725 (alsa_choose_format): Remove unused local var.
18726 (wav_play): Initialize a variable to 0, to prevent undefined
18727 behavior (Bug#8278).
18728
18729 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18730
18731 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18732
18733 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18734 clobbering (Bug#8298).
18735 * sysdep.c (sys_subshell): Likewise.
18736 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18737
18738 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18739 This should get cleaned up, so that child_setup has the
18740 same signature on all platforms.
18741
18742 * callproc.c (call_process_cleanup): Now static.
18743 (relocate_fd): Rename locals to avoid shadowing.
18744
18745 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18746
18747 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18748 not to be necessary, and produces flickering.
18749
18750 2011-03-20 Glenn Morris <rgm@gnu.org>
18751
18752 * config.in: Remove file.
18753
18754 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18755
18756 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18757 are now in src/globals.h.
18758 (syms_of_minibuf): Remove spurious & from previous change.
18759
18760 2011-03-20 Leo Liu <sdl.web@gmail.com>
18761
18762 * minibuf.c (completing-read-function): New variable.
18763 (completing-read-default): Rename from completing-read.
18764 (completing-read): Call completing-read-function.
18765
18766 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18767
18768 * xfaces.c (Fx_load_color_file):
18769 Read color file from absolute filename (bug#8250).
18770
18771 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18772
18773 * makefile.w32-in: Update dependencies.
18774
18775 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18776
18777 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18778
18779 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18780
18781 Fix more problems found by GCC 4.5.2's static checks.
18782
18783 * process.c (make_serial_process_unwind, send_process_trap):
18784 (sigchld_handler): Now static.
18785
18786 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18787 That way, the code declares only the vars that it needs.
18788 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18789 * s/cygwin.h (PTY_ITERATION): Likewise.
18790 * s/darwin.h (PTY_ITERATION): Likewise.
18791 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18792
18793 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18794 * process.c (allocate_pty): Don't declare stb unless it's needed.
18795
18796 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18797 (CONSTANTLIM): Remove; unused.
18798 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18799 Define only if needed.
18800
18801 * unexelf.c (unexec): Name an expression,
18802 to avoid gcc -Wbad-function-cast warning.
18803 Use a different way to cause a compilation error if anyone uses
18804 n rather than nn, a way that does not involve shadowing.
18805 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18806
18807 * deps.mk (unexalpha.o): Remove; unused.
18808
18809 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18810 * unexec.h: New file.
18811 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18812 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18813 Depend on unexec.h.
18814 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18815 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18816 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18817 Change as necessary to match prototype in unexec.h.
18818
18819 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18820 shadowing.
18821 (back_comment, skip_chars): Mark vars as initialized.
18822
18823 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18824 Rename locals to avoid shadowing.
18825
18826 * lread.c (read1): Rewrite so as not to use empty "else".
18827 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18828
18829 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18830
18831 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18832 warning when compiling print.c.
18833
18834 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18835 instead of using an uninitialized var.
18836 (font_sort_entities): Mark var as initialized.
18837
18838 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18839
18840 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18841 pointers to constants.
18842 (font_parse_fcname): Remove unused vars.
18843 (font_delete_unmatched): Now static.
18844 (font_get_spec): Remove; unused.
18845 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18846 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18847 Rename or move locals to avoid shadowing.
18848
18849 * fns.c (require_nesting_list, require_unwind): Now static.
18850 (Ffillarray): Rename locals to avoid shadowing.
18851
18852 * floatfns.c (domain_error2): Define only if needed.
18853 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18854
18855 * alloc.c (mark_backtrace): Move decl from here ...
18856 * lisp.h: ... to here, so that it can be checked.
18857
18858 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18859 (Fdefvar): Rewrite so as not to use empty "else".
18860 (lisp_indirect_variable): Name an expression,
18861 to avoid gcc -Wbad-function-cast warning.
18862 (Fdefvar): Rename locals to avoid shadowing.
18863
18864 * callint.c (quotify_arg, quotify_args): Now static.
18865 (Fcall_interactively): Rename locals to avoid shadowing.
18866 Use const pointer when appropriate.
18867
18868 * lisp.h (get_system_name, get_operating_system_release):
18869 Move decls here, to check interfaces.
18870 * process.c (get_operating_system_release): Move decl to lisp.h.
18871 * xrdb.c (get_system_name): Likewise.
18872 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18873 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18874 some of which prompt warnings from gcc -Wbad-function-cast.
18875 (Fformat_time_string, Fencode_time, Finsert_char):
18876 (Ftranslate_region_internal, Fformat):
18877 Rename or remove local vars to avoid shadowing.
18878 (Ftranslate_region_internal): Mark var as initialized.
18879
18880 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18881 avoid shadowing.
18882
18883 * lisp.h (eassert): Check that the argument compiles, even if
18884 ENABLE_CHECKING is not defined.
18885
18886 * data.c (Findirect_variable): Name an expression, to avoid
18887 gcc -Wbad-function-cast warning.
18888 (default_value, arithcompare, arith_driver, arith_error): Now static.
18889 (store_symval_forwarding): Rename local to avoid shadowing.
18890 (Fmake_variable_buffer_local, Fmake_local_variable):
18891 Mark variables as initialized.
18892 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18893
18894 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18895 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18896 Rename locals to avoid shadowing.
18897 (mark_stack): Move local variables into the #ifdef region where
18898 they're used.
18899 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18900 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18901 needed otherwise.
18902 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18903 (GC_STRING_CHARS): Remove; not used.
18904 (Fmemory_limit): Cast sbrk's returned value to char *.
18905
18906 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18907 avoids undefined behavior in theory.
18908
18909 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18910
18911 Use functions, not macros, for up- and down-casing (Bug#8254).
18912 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18913 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18914 to use the following functions instead of these macros.
18915 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18916 EMACS_INT, since callers assume the returned value fits in int.
18917 (upcase1): Likewise, for UPCASE_TABLE.
18918 (uppercasep, lowercasep, upcase): New static inline functions.
18919 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18920 the race-condition problem in the old DOWNCASE.
18921
18922 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18923 Rename locals to avoid shadowing.
18924 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18925 (regex_compile, re_search_2, re_match_2_internal):
18926 Remove unused local vars.
18927 (FREE_VAR): Rewrite so as not to use empty "else",
18928 which gcc can warn about.
18929 (regex_compile, re_match_2_internal): Mark locals as initialized.
18930 (RETALLOC_IF): Define only if needed.
18931 (WORDCHAR_P): Likewise. This one is never needed, but is used
18932 only in a comment talking about a compiler bug, so put inside
18933 the #if 0 of that comment.
18934 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18935 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18936 Remove; unused.
18937
18938 * search.c (boyer_moore): Rename locals to avoid shadowing.
18939 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18940 (PREV_CHAR_BOUNDARY): Likewise.
18941
18942 * search.c (simple_search): Remove unused var.
18943
18944 * dired.c (compile_pattern): Move decl from here ...
18945 * lisp.h: ... to here, so that it can be checked.
18946 (struct re_registers): New forward decl.
18947
18948 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18949
18950 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18951 All uses changed.
18952 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18953 Rename locals to avoid shadowing.
18954 (Fvertical_motion): Mark locals as initialized.
18955
18956 * casefiddle.c (casify_object, casify_region): Now static.
18957 (casify_region): Mark local as initialized.
18958
18959 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18960
18961 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18962 New macros, so that the caller can use some names other than
18963 gcpro1, gcpro2, etc.
18964 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18965 of the new macros.
18966 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18967 argument, for consistency with GCPRO2_VAR, etc: it is now the
18968 prefix of the variable, not the variable itself. All uses
18969 changed.
18970 * dired.c (directory_files_internal, file_name_completion):
18971 Rename locals to avoid shadowing.
18972
18973 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18974 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18975 dired.c's scmp function, had undefined behavior.
18976 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18977 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18978 * buffer.h: ... to here, because these macros use current_buffer,
18979 and the new implementation with inline functions needs to have
18980 current_buffer in scope now, rather than later when the macros
18981 are used.
18982 (downcase, upcase1): New static inline functions.
18983 (DOWNCASE, UPCASE1): Reimplement using these functions.
18984 This avoids undefined behavior in expressions like
18985 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18986 from race conditions in accessing the global variables
18987 case_temp1 and case_temp2.
18988 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18989 * lisp.h (case_temp1, case_temp2): Remove their decls.
18990 * character.h (ASCII_CHAR_P): Move from here ...
18991 * lisp.h: ... to here, so that the inline functions mentioned
18992 above can use them.
18993
18994 * dired.c (directory_files_internal_unwind): Now static.
18995
18996 * fileio.c (file_name_as_directory, directory_file_name):
18997 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18998 Now static.
18999 (file_name_as_directory): Use const pointers when appropriate.
19000 (Fexpand_file_name): Likewise. In particular, newdir might
19001 point at constant storage, so make it a const pointer.
19002 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
19003 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19004 signedness issues.
19005 (Fset_file_times, Finsert_file_contents, auto_save_error):
19006 Rename locals to avoid shadowing.
19007
19008 * minibuf.c (choose_minibuf_frame_1): Now static.
19009 (Ftry_completion, Fall_completions): Rename or remove locals
19010 to avoid shadowing.
19011
19012 * marker.c (bytepos_to_charpos): Remove; unused.
19013
19014 * lisp.h (verify_bytepos, count_markers): New decls,
19015 so that gcc does not warn that these functions aren't declared.
19016
19017 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19018 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
19019 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
19020 (copy_text): Remove unused local var.
19021
19022 * filelock.c (within_one_second): Now static.
19023 (lock_file_1): Rename local to avoid shadowing.
19024
19025 * buffer.c (fix_overlays_before): Mark locals as initialized.
19026 (fix_start_end_in_overlays): Likewise. This function should be
19027 simplified by using pointers-to-pointers, but that's a different
19028 matter.
19029 (switch_to_buffer_1): Now static.
19030 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19031 (report_overlay_modification): Rename locals to avoid shadowing.
19032
19033 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
19034 Fix pointer signedness issue.
19035 (sys_subshell): Mark local as volatile if checking for lint,
19036 to suppress a gcc -Wclobbered warning that does not seem to be right.
19037 (MAXPATHLEN): Define only if needed.
19038
19039 * process.c (serial_open, serial_configure): Move decls from here ...
19040 * systty.h: ... to here, so that they can be checked.
19041
19042 * fns.c (get_random, seed_random): Move extern decls from here ...
19043 * lisp.h: ... to here, so that they can be checked.
19044
19045 * sysdep.c (reset_io): Now static.
19046 (wait_for_termination_signal): Remove; unused.
19047
19048 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19049 (copy_keymap_item, append_key, push_text_char_description):
19050 Now static.
19051 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
19052 (DENSE_TABLE_SIZE): Remove; unused.
19053 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19054 (describe_map_tree):
19055 Rename locals to avoid shadowing.
19056
19057 * keyboard.c: Declare functions static if they are not used elsewhere.
19058 (echo_char, echo_dash, cmd_error, top_level_2):
19059 (poll_for_input, handle_async_input): Now static.
19060 (read_char, kbd_buffer_get_event, make_lispy_position):
19061 (make_lispy_event, make_lispy_movement, apply_modifiers):
19062 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19063 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19064 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
19065 (read_key_sequence, read_char): Mark locals as initialized.
19066 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
19067
19068 * keyboard.h (make_ctrl_char): New decl.
19069 (mark_kboards): Move decl here ...
19070 * alloc.c (mark_kboards): ... from here.
19071
19072 * lisp.h (force_auto_save_soon): New decl.
19073
19074 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19075 (DEFINE_DUMMY_FUNCTION): New macro.
19076 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19077 Use it.
19078 (main): Add casts to avoid warnings
19079 if GCC considers string literals to be constants.
19080
19081 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19082
19083 * dbusbind.c: Pointer signedness fixes.
19084 (xd_signature, xd_append_arg, xd_initialize):
19085 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19086 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19087 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19088 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19089
19090 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19091 if GCC considers string literals to be constants.
19092 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19093
19094 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19095
19096 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19097 (print_preprocess, print_object): New macro to fix last change.
19098
19099 * print.c (print_preprocess): Don't forget font objects.
19100
19101 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19102
19103 * emacs.c (USAGE3): Doc fixes.
19104
19105 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19106
19107 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19108 structure.
19109
19110 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19111
19112 * lisp.h (VWindow_system, Qfile_name_history):
19113 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19114 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19115 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19116
19117 * w32select.c: Don't #include "keyboard.h".
19118 (run_protected): Add extern declaration for waiting_for_input.
19119
19120 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19121 * w32console.c (detect_input_pending, read_input_pending)
19122 (encode_terminal_code):
19123 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19124 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19125 (w32_system_caret_y, Qfile_name_history):
19126 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19127 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19128 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19129 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19130 * w32proc.c (Qlocal, report_file_error):
19131 * w32term.c (Vwindow_system, updating_frame):
19132 * w32uniscribe.c (initialized, uniscribe_font_driver):
19133 Remove unneeded extern declarations.
19134
19135 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19136
19137 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19138
19139 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19140
19141 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19142 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19143 These macros can no longer be used for assignment.
19144
19145 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19146 Assign struct members directly, instead of using BUF_BEGV etc.
19147 (record_buffer_markers, fetch_buffer_markers): New functions for
19148 recording and fetching special buffer markers.
19149 (set_buffer_internal_1, set_buffer_temp): Use them.
19150
19151 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19152
19153 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19154
19155 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19156 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19157
19158 * xdisp.c (hscroll_window_tree):
19159 (reconsider_clip_changes): Use PT instead of BUF_PT.
19160
19161 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19162
19163 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19164 $(EMACS_ROOT)/lib/intprops.h.
19165
19166 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19167
19168 Fix more problems found by GCC 4.5.2's static checks.
19169
19170 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19171 to unsigned char * to avoid compiler diagnostic.
19172 (xg_free_frame_widgets): Make it clear that a local variable is
19173 needed only if USE_GTK_TOOLTIP.
19174 (gdk_window_get_screen): Make it clear that this macro is needed
19175 only if USE_GTK_TOOLTIP.
19176 (int_gtk_range_get_value): New function, which avoids a diagnostic
19177 from gcc -Wbad-function-cast.
19178 (xg_set_toolkit_scroll_bar_thumb): Use it.
19179 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19180 diagnostic from gcc -Wbad-function-cast.
19181 (get_utf8_string, xg_get_file_with_chooser):
19182 Rename locals to avoid shadowing.
19183 (create_dialog): Move locals to avoid shadowing.
19184
19185 * xgselect.c (xg_select): Remove unused var.
19186
19187 * image.c (four_corners_best): Mark locals as initialized.
19188 (gif_load): Initialize transparent_p to zero (Bug#8238).
19189 Mark another local as initialized.
19190 (my_png_error, my_error_exit): Mark with NO_RETURN.
19191
19192 * image.c (clear_image_cache): Now static.
19193 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19194 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19195 (x_edge_detection): Remove unnecessary cast that
19196 gcc -Wbad-function-cast diagnoses.
19197 (gif_load): Fix pointer signedness.
19198 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19199 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19200
19201 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19202
19203 Improve quality of tests for time stamp overflow.
19204 For example, without this patch (encode-time 0 0 0 1 1
19205 1152921504606846976) returns the obviously-bogus value (-948597
19206 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19207 reports time overflow. See
19208 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19209 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19210 * editfns.c: Include limits.h and intprops.h.
19211 (TIME_T_MIN, TIME_T_MAX): New macros.
19212 (time_overflow): Move earlier, to before first use.
19213 (hi_time, lo_time): New functions, for an accurate test for
19214 out-of-range times.
19215 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19216 (Fget_internal_run_time): Don't assume time_t fits in int.
19217 (make_time): Use list2 instead of Fcons twice.
19218 (Fdecode_time): More accurate test for out-of-range times.
19219 (check_tm_member): New function.
19220 (Fencode_time): Use it, to test for out-of-range times.
19221 (lisp_time_argument): Don't rely on undefined left-shift and
19222 right-shift behavior when checking for time stamp overflow.
19223
19224 * editfns.c (time_overflow): New function, refactoring common code.
19225 (Fformat_time_string, Fdecode_time, Fencode_time):
19226 (Fcurrent_time_string): Use it.
19227
19228 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19229 * dired.c (make_time): Move to ...
19230 * editfns.c (make_time): ... here.
19231 * systime.h: Note the move.
19232
19233 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19234
19235 * fringe.c (update_window_fringes): Remove unused variables.
19236
19237 * unexmacosx.c (copy_data_segment): Also copy __got section.
19238 (Bug#8223)
19239
19240 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19241
19242 * termcap.c [MSDOS]: Include "msdos.h".
19243 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19244 Constify `char *' arguments and their references according to
19245 prototypes in tparam.h.
19246
19247 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19248
19249 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19250 Adapt all references accordingly.
19251
19252 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19253
19254 2011-03-11 Tom Tromey <tromey@redhat.com>
19255
19256 * buffer.c (syms_of_buffer): Remove obsolete comment.
19257
19258 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19259
19260 * termhooks.h (encode_terminal_code): Declare prototype.
19261
19262 * msdos.c (encode_terminal_code): Don't declare prototype.
19263
19264 * term.c (encode_terminal_code): Now external again, used by
19265 w32console.c and msdos.c.
19266
19267 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19268 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19269
19270 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19271
19272 Fix some minor problems found by GCC 4.5.2's static checks.
19273
19274 * fringe.c (update_window_fringes): Mark locals as initialized
19275 (Bug#8227).
19276 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19277
19278 * alloc.c (mark_fringe_data): Move decl from here ...
19279 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19280 to check its interface.
19281 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19282
19283 * fontset.c (free_realized_fontset): Now static.
19284 (Fset_fontset_font): Rename local to avoid shadowing.
19285 (fontset_font): Mark local as initialized.
19286 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19287
19288 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19289
19290 * xselect.c (x_disown_buffer_selections): Remove; not used.
19291 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19292 (x_own_selection, Fx_disown_selection_internal): Rename locals
19293 to avoid shadowing.
19294 (x_handle_dnd_message): Remove local to avoid shadowing.
19295
19296 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19297 so that the caller can use some name other than gcpro1.
19298 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19299 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19300 (Fx_backspace_delete_keys_p):
19301 Use them to avoid shadowing, and rename vars to avoid shadowing.
19302 (x_decode_color, x_set_name, x_window): Now static.
19303 (Fx_create_frame): Add braces to silence GCC warning.
19304 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19305 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19306 Remove unused locals.
19307 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19308 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19309 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19310 macros.
19311
19312 * xterm.h (x_mouse_leave): New decl.
19313
19314 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19315 Remove unused functions.
19316 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19317 (x_calc_absolute_position): Now static.
19318 (XTread_socket): Don't define label "out" unless it's used.
19319 Don't declare local "event" unless it's used.
19320 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19321 unless they are used.
19322 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19323 (x_fatal_error_signal): Remove; not used.
19324 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19325 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19326 (x_error_catcher, x_connection_closed, x_error_handler):
19327 (x_error_quitter, xembed_send_message, x_iconify_frame):
19328 (my_log_handler): Rename locals to avoid shadowing.
19329 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19330 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19331
19332 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19333 Rename or move locals to avoid shadowing.
19334 (tty_defined_color, merge_face_heights): Now static.
19335 (free_realized_faces_for_fontset): Remove; not used.
19336 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19337 does not deduce is never used uninitialized.
19338 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19339 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19340
19341 * terminal.c (store_terminal_param): Now static.
19342
19343 * xmenu.c (menu_highlight_callback): Now static.
19344 (set_frame_menubar): Remove unused local.
19345 (xmenu_show): Rename parameter to avoid shadowing.
19346 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19347 since they might point to immutable storage.
19348 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19349 since it's unused otherwise.
19350
19351 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19352 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19353 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19354 avoids a gcc -Wuninitialized diagnostic.
19355 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19356 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19357 does not deduce are never used uninitialized.
19358
19359 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19360
19361 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19362 * window.c (window_loop, size_window):
19363 (run_window_configuration_change_hook, enlarge_window): Likewise.
19364
19365 * window.c (display_buffer): Now static.
19366 (size_window): Mark variables that gcc -Wuninitialized
19367 does not deduce are never used uninitialized.
19368 * window.h (check_all_windows): New decl, to forestall
19369 gcc -Wmissing-prototypes diagnostic.
19370 * dispextern.h (bidi_dump_cached_states): Likewise.
19371
19372 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19373 shadowing.
19374 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19375 Include <limits.h>.
19376 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19377 and to avoid gcc -Wuninitialized warning.
19378 (load_charset_map): Mark variables that gcc -Wuninitialized
19379 does not deduce are never used uninitialized.
19380 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19381
19382 * coding.c (coding_set_source, coding_set_destination):
19383 Use "else { /* comment */ }" rather than "else /* comment */;"
19384 for clarity, and to avoid gcc -Wempty-body warning.
19385 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19386 a block, when the outer 'i' will do.
19387 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19388 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19389 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19390 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19391 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19392 Rename locals to avoid shadowing.
19393 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19394 * coding.c (emacs_mule_char, encode_invocation_designation):
19395 Now static, since they're not used elsewhere.
19396 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19397 (decode_coding_object, encode_coding_object, detect_coding_system):
19398 (decode_coding_emacs_mule): Mark variables that gcc
19399 -Wuninitialized does not deduce are never used uninitialized.
19400 (detect_coding_iso_2022): Initialize a local variable that might
19401 be used uninitialized. Leave a FIXME because it's not clear that
19402 this initialization is needed. (Bug#8211)
19403 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19404 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19405 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19406 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19407 Remove unused macros.
19408
19409 * category.c (hash_get_category_set): Remove unused local var.
19410 (copy_category_table): Now static, since it's not used elsewhere.
19411 * character.c (string_count_byte8): Likewise.
19412
19413 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19414 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19415
19416 * chartab.c (copy_sub_char_table): Now static, since it's not used
19417 elsewhere.
19418 (sub_char_table_ref_and_range, char_table_ref_and_range):
19419 Rename locals to avoid shadowing.
19420 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19421
19422 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19423 (BIDI_BOB): Remove unused macro.
19424
19425 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19426 deduce are never used uninitialized.
19427 * term.c (encode_terminal_code): Likewise.
19428
19429 * term.c (encode_terminal_code): Now static. Remove unused local.
19430
19431 * tparam.h: New file.
19432 * term.c, tparam.h: Include it.
19433 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19434 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19435 Move these decls to tparam.h, and make them agree with what
19436 is actually in tparam.c. The previous trick of using incompatible
19437 decls in different modules does not conform to the C standard.
19438 All callers of tparam changed to use tparam's actual API.
19439 * tparam.c (tparam1, tparam, tgoto):
19440 Use const pointers where appropriate.
19441
19442 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19443 * cm.h (struct cm): Likewise.
19444 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19445 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19446 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19447 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19448 (turn_on_face, init_tty): Likewise.
19449 * termchar.h (struct tty_display_info): Likewise.
19450
19451 * term.c (term_mouse_position): Rename local to avoid shadowing.
19452
19453 * alloc.c (mark_ttys): Move decl from here ...
19454 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19455
19456 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19457
19458 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19459
19460 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19461
19462 * search.c (compile_pattern_1): Remove argument regp, unused since
19463 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19464 (compile_pattern): Don't pass it.
19465
19466 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19467
19468 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19469 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19470 for ! HAVE_GTK3.
19471 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19472
19473 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19474
19475 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19476 gdk_window_get_screen, gdk_window_get_geometry,
19477 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19478 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19479 (xg_get_pixbuf_from_pixmap): New function.
19480 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19481 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19482 Call xg_get_pixbuf_from_pixmap instead of
19483 gdk_pixbuf_get_from_drawable.
19484 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19485 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19486 (xg_check_special_colors): Use GtkStyleContext and its functions
19487 for HAVE_GTK3.
19488 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19489 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19490 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19491 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19492 Call gtk_widget_get_preferred_size.
19493 (xg_frame_resized): gdk_window_get_geometry only takes 5
19494 parameters.
19495 (xg_win_to_widget, xg_event_is_for_menubar):
19496 Call gdk_x11_window_lookup_for_display.
19497 (xg_set_widget_bg): New function.
19498 (delete_cb): New function.
19499 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19500 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19501 (xg_set_background_color): Call xg_set_widget_bg.
19502 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19503 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19504 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19505 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19506 if ! HAVE_GTK3.
19507 (update_frame_tool_bar): Call gtk_widget_hide.
19508 (xg_initialize): Use GDK_KEY_g.
19509
19510 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19511 if ! HAVE_GTK3
19512 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19513
19514 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19515 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19516 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19517
19518 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19519
19520 * w32xfns.c (select_palette): Check success of RealizePalette against
19521 GDI_ERROR, not zero.
19522
19523 See ChangeLog.11 for earlier changes.
19524
19525 ;; Local Variables:
19526 ;; coding: utf-8
19527 ;; End:
19528
19529 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19530
19531 This file is part of GNU Emacs.
19532
19533 GNU Emacs is free software: you can redistribute it and/or modify
19534 it under the terms of the GNU General Public License as published by
19535 the Free Software Foundation, either version 3 of the License, or
19536 (at your option) any later version.
19537
19538 GNU Emacs is distributed in the hope that it will be useful,
19539 but WITHOUT ANY WARRANTY; without even the implied warranty of
19540 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19541 GNU General Public License for more details.
19542
19543 You should have received a copy of the GNU General Public License
19544 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.