b30b21634359d106724abf3bb7fbc46dc4c2e216
[bpt/emacs.git] / src / ChangeLog
1 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
2
3 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4 (keyDown): Remap keypad keys to X11 virtual key codes.
5
6 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
7
8 Fix data-loss with --batch (Bug#9574).
9 * emacs.c: Include <close-stream.h>.
10 (close_output_streams): New function.
11 (main): Pass it to atexit, so that Emacs closes stdout and stderr
12 and handles errors appropriately.
13 (Fkill_emacs): Don't worry about flushing, as close_output_stream
14 does that now.
15
16 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
17 The symptom is a diagnostic "GLib-WARNING **: In call to
18 g_spawn_sync(), exit status of a child process was requested but
19 SIGCHLD action was set to SIG_IGN and ECHILD was received by
20 waitpid(), so exit status can't be returned." The diagnostic
21 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
22 The real bug is a race condition between Emacs and glib: Emacs
23 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
24 so that glib can't find it. Work around the bug by invoking
25 waitpid only on subprocesses that Emacs itself creates.
26 * process.c (create_process, record_child_status_change):
27 Don't use special value -1 in pid field, as the caller now must
28 know the pid rather than having the callee infer it. The
29 inference was sometimes incorrect anyway, due to another race.
30 (create_process): Set new 'alive' member if child is created.
31 (process_status_retrieved): New function.
32 (record_child_status_change): Use it.
33 Accept negative 1st argument, which means to wait for the
34 processes that Emacs already knows about. Move special-case code
35 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
36 processes that have already been waited for, by testing and
37 clearing new 'alive' member.
38 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
39 now does this internally.
40 (handle_child_signal): Let record_child_status_change do all
41 the work, since we do not want to reap all exited child processes,
42 only the child processes that Emacs itself created.
43 * process.h (Lisp_Process): New boolean member 'alive'.
44
45 Omit duplicate definitions no longer needed with gcc -g3.
46 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
47 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
48 Define only as macros. There's no longer any need to also define
49 these symbols as enums or as constants, since we now assume
50 gcc -g3 when debugging.
51
52 2012-11-03 Eli Zaretskii <eliz@gnu.org>
53
54 * lisp.mk: Adjust comments to the fact that term/internal is now
55 loaded from loadup.el.
56
57 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
58 (msdos_fatal_signal): New function.
59 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
60 its argument list.
61
62 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
63 for GCC versions before 4.
64 (emacs_raise): Define to call msdos_fatal_signal.
65
66 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
67 iterator when starting in the middle of a display or overlay
68 string. (Bug#12745)
69
70 2012-11-03 Chong Yidong <cyd@gnu.org>
71
72 * process.c (wait_reading_process_output): Clean up the last
73 change.
74
75 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
76
77 * process.c (wait_reading_process_output): Avoid a race condition
78 with SIGIO delivery (Bug#11536).
79
80 2012-11-03 Chong Yidong <cyd@gnu.org>
81
82 * buffer.c (cursor_type): Untabify docstring.
83
84 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
85
86 * frame.h (struct frame): Drop can_have_scroll_bars member
87 which is meaningless for a long time. Adjust comments.
88 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
89 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
90
91 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
92
93 * window.c (decode_next_window_args): Update window arg after
94 calling decode_live_window and so fix crash reported at
95 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
96 by Juanma Barranquero <lekktu@gmail.com>.
97 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
98 * font.c (Ffont_at): Likewise.
99
100 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
101
102 * widget.c (resize_cb): New function.
103 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
104 (EmacsFrameResize): Check if all is up to date before changing frame
105 size.
106
107 2012-11-02 Eli Zaretskii <eliz@gnu.org>
108
109 Implement backtrace output for fatal errors on MS-Windows.
110 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
111 (BACKTRACE_LIMIT_MAX): New macro.
112 (w32_backtrace): New function.
113 (emacs_abort): Use w32_backtrace when the user chooses not to
114 attach a debugger. Update the text of the abort dialog.
115
116 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
117
118 Window-related stuff cleanup here and there.
119 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
120 Use decode_any_window.
121 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
122 * xdisp.c (Fformat_mode_line): Likewise.
123 * font.c (Ffont_at): Use decode_live_window.
124 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
125 * window.c (decode_next_window_args): Likewise.
126 (decode_any_window): Remove static.
127 * window.h (decode_any_window): Add prototype.
128 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
129 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
130 respectively.
131
132 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
133
134 Remove pad from struct input_event.
135 * termhooks.h (struct input_event): Remove padding field.
136 Adjust comment.
137 * keyboard.c (event_to_kboard): Simplify because frame_or_window
138 member is never cons for a long time. Adjust comment.
139 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
140 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
141 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
142 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
143
144 2012-11-01 Eli Zaretskii <eliz@gnu.org>
145
146 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
147
148 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
149
150 Fix crash when using Emacs as commit editor for git (Bug#12697).
151 * callproc.c (setpgrp): Remove macro, as we now use setpgid
152 and it is configured in conf_post.h.
153 (Fcall_process): Don't invoke both setsid and setpgid; the former
154 is enough, if it exists.
155 * callproc.c (Fcall_process, child_setup):
156 * process.c (create_process): Use setpgid.
157 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
158 for the real thing.
159 * dispnew.c (init_display): Initialize the foreground group
160 if we are running a tty display.
161 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
162 * lisp.h (init_foreground_group): New decl.
163 * sysdep.c (inherited_pgroup): New static var.
164 (init_foreground_group, tcsetpgrp_without_stopping)
165 (narrow_foreground_group, widen_foreground_group): New functions.
166 (init_sys_modes): Narrow foreground group.
167 (reset_sys_modes): Widen foreground group.
168
169 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
170
171 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
172
173 2012-10-31 Martin Rudalics <rudalics@gmx.at>
174
175 * minibuf.c (read_minibuf): Restore current buffer since
176 choose_minibuf_frame calling Fset_frame_selected_window may
177 change it (Bug#12766).
178
179 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
180
181 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
182
183 2012-10-30 Kenichi Handa <handa@gnu.org>
184
185 * font.c (Ffont_at): If WINDOW is specified and it is not
186 displaying the current buffer, signal an error.
187
188 2012-10-29 Daniel Colascione <dancol@dancol.org>
189
190 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
191 preparation for fixing bug#12739, move these functions from
192 here...
193
194 * coding.h, coding.c: ... to here, and compile them only when
195 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
196 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
197
198 2012-10-28 Eli Zaretskii <eliz@gnu.org>
199
200 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
201 (timer_loop, getitimer, setitimer): Use it instead of
202 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
203 'clock'.
204 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
205 literal 10000.
206
207 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
208
209 * nsterm.m (NO_APPDEFINED_DATA): New define.
210 (last_appdefined_event_data): New variable
211 (last_appdefined_event): Remove.
212 (ns_select): Initialize t from last_appdefined_event_data instead
213 of [last_appdefined_event data1].
214 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
215 remove last_appdefined_event (Bug#12698).
216
217 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
218
219 * frame.c (x_set_font): Catch internal error.
220
221 2012-10-27 Eli Zaretskii <eliz@gnu.org>
222
223 Avoid overflow in w32 implementation of interval timers.
224 When possible, for ITIMER_PROF count only times the main thread
225 actually executes.
226 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
227 'volatile ULONGLONG' types. All the other data which was
228 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
229 (GetThreadTimes_Proc): New typedef.
230 (w32_get_timer_time): New function, returns a suitable time value
231 for the timer.
232 (timer_loop): Enter critical section when accessing ULONGLONG
233 values of the itimer_data struct, as these accesses are no longer
234 atomic. Call 'w32_get_timer_time' instead of 'clock'.
235 Remove unused variable.
236 (init_timers): Initialize s_pfn_Get_Thread_Times.
237 (start_timer_thread): Don't assign itimer->caller_thread here.
238 (getitimer): Assign itimer->caller_thread here.
239 (setitimer): Always call getitimer to get the value of ticks_now.
240 (sys_spawnve): Avoid compiler warning about format mismatch.
241
242 2012-10-26 Eli Zaretskii <eliz@gnu.org>
243
244 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
245 mouse movement events if the menu bar is active. This avoids
246 producing a busy "hour-glass" cursor by Windows if the mouse
247 pointer is positioned over a tooltip shown for some menu item.
248
249 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
250
251 Don't assume process IDs fit in int.
252 * emacs.c (shut_down_emacs) [!DOS_NT]:
253 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
254 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
255 Use pid_t, not int, to store process IDs, as 'int'
256 is not wide enough on a few platforms (e.g., AIX and IRIX).
257
258 2012-10-23 Kenichi Handa <handa@gnu.org>
259
260 The following change is to make face-font-rescale-alist work
261 correctly for non-ASCII fonts.
262
263 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
264 (font_open_for_lface): Handle Vface_font_rescale_alist.
265
266 2012-10-23 Chong Yidong <cyd@gnu.org>
267
268 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
269
270 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
271
272 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
273 for screen font.
274 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
275
276 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
277 event (Bug#12681).
278
279 2012-10-21 Glenn Morris <rgm@gnu.org>
280
281 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
282
283 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
284
285 Port to OpenBSD 5.1.
286 * frame.c (Fmouse_position, Fmouse_pixel_position):
287 * xdisp.c (produce_stretch_glyph):
288 Declare local vars only when they're needed.
289 This is clearer and avoids a warning on OpenBSD about unused vars.
290 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
291 This is safer, and avoids OpenBSD warnings about unused vars.
292 * keyboard.c (record_menu_key): Remove unnecessary decl.
293 (poll_timer): Define only if POLL_FOR_INPUT is defined.
294 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
295 as our definition clashes with OpenBSD's.
296 * xfaces.c (load_face_colors, check_lface_attrs)
297 (get_lface_attributes_no_remap, get_lface_attributes)
298 (lface_fully_specified_p, x_supports_face_attributes_p)
299 (tty_supports_face_attributes_p, face_fontset, realize_face)
300 (realize_x_face, realize_tty_face):
301 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
302 merely Lisp_Object *. This is more informative and avoids
303 a warning on OpenBSD about accessing beyond an object's size.
304
305 2012-10-20 Chong Yidong <cyd@gnu.org>
306
307 * lread.c (Fload): Doc fix (Bug#12592).
308
309 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
310
311 * font.c (Ffont_at): Fix previous change.
312
313 2012-10-19 Eli Zaretskii <eliz@gnu.org>
314
315 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
316 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
317 for the reasons.
318
319 * alloc.c (NSTATICS): Decrease to 0x800.
320
321 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
322
323 * fns.c (Fnreverse): Include the problem element when signalling an
324 error (bug#12677).
325
326 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
327
328 * nsterm.m (ns_select): Check writefds before call to
329 FD_ISSET (Bug#12668).
330
331 2012-10-18 Daniel Colascione <dancol@dancol.org>
332
333 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
334 (staticpro): If we run out of staticpro slots, die with an
335 informative error instead of just calling emacs_abort.
336
337 2012-10-18 Martin Rudalics <rudalics@gmx.at>
338
339 Fix two flaws reported by Dmitry Antipov.
340 * window.c (Ftemp_output_buffer_show): Remove.
341 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
342 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
343
344 2012-10-17 Eli Zaretskii <eliz@gnu.org>
345
346 * makefile.w32-in ($(BLD)/w32.$(O)):
347 ($(BLD)/vm-limit.$(O)):
348 ($(BLD)/term.$(O)):
349 ($(BLD)/unexw32.$(O)):
350 ($(BLD)/fileio.$(O)):
351 ($(BLD)/dispnew.$(O)): Update dependencies.
352
353 * w32term.h (w32_initialize_display_info, initialize_w32_display):
354 Add prototypes.
355
356 * w32proc.c: Include ctype.h.
357
358 * w32.h (init_environment, check_windows_init_file)
359 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
360 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
361 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
362 (sys_link): Add prototypes.
363
364 * w32.c: Include w32select.h.
365 (sys_access, e_malloc, sys_select): Add prototypes.
366 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
367
368 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
369
370 * unexw32.c: Include lisp.h and w32.h.
371
372 * term.c [WINDOWSNT]: Include w32term.h.
373
374 * process.c [WINDOWSNT]: Add prototype of sys_select.
375
376 * fileio.c [WINDOWSNT]: Include w32.h.
377
378 * dispnew.c [WINDOWSNT]: Include w32.h.
379
380 * cygw32.c (Fcygwin_convert_path_to_windows)
381 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
382 Lisp_Object values. (Bug#12661)
383
384 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
385 to Lisp_Object. (Bug#12661)
386
387 2012-10-17 Kenichi Handa <handa@gnu.org>
388
389 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
390 invalidate.
391
392 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
393
394 * buffer.c (Fkill_buffer): When unchaining the marker,
395 reset its buffer pointer to NULL (Bug#12652).
396
397 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
398
399 Do not verify indirection counters of killed buffers (Bug#12579).
400 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
401 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
402
403 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
404
405 * alloc.c (Fmake_byte_code): Fix typo in comment.
406 * print.c (print_interval): Define as static to match prototype.
407 * indent.c (disptab_matches_widthtab, recompute_width_table):
408 Convert to eassert.
409
410 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
411
412 * editfns.c (get_system_name): Remove.
413 * lisp.h (get_system_name): Remove prototype.
414 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
415 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
416
417 2012-10-15 Daniel Colascione <dancol@dancol.org>
418
419 * dbusbind.c: Add comment explaining reason for previous change.
420
421 2012-10-15 Martin Rudalics <rudalics@gmx.at>
422
423 * window.c (Fwindow_end): Rewrite check whether cached position
424 can be used (Bug#12600).
425 (resize_frame_windows, grow_mini_window, shrink_mini_window):
426 Set windows_or_buffers_changed.
427
428 2012-10-15 Daniel Colascione <dancol@dancol.org>
429
430 * dbusbind.c: Fix cygw32 build break when compiling with dbus
431 enabled by undefining the symbol "interface", which the platform
432 headers define to something incompatible.
433
434 2012-10-14 Daniel Colascione <dancol@dancol.org>
435
436 * image.c (init_tiff_functions, init_imagemagick_functions)
437 (init_svg_functions): Fix cygw32 build break by using these
438 functions only when WINDOWSNT _and_ HAVE_NTGUI.
439
440 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
441
442 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
443
444 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
445
446 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
447
448 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
449
450 * coding.c (detect_coding): Set coding->id before calling
451 this->detector.
452
453 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
454
455 * fileio.c: Formatting fixes.
456
457 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
458
459 Fix some stat-related races.
460 * fileio.c (Fwrite_region): Avoid race condition if a file is
461 removed or renamed by some other process immediately after Emacs
462 writes it but before Emacs stats it. Do not assume that stat (or
463 fstat) succeeds.
464 * image.c (slurp_file): Resolve the file name with fopen + fstat
465 rather than stat + fopen.
466 (pbm_read_file) [0]: Remove unused code with stat race.
467 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
468 Remove ineffective code with stat race.
469
470 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
471
472 * doc.c (get_doc_string): Don't signal an error if the file is missing.
473
474 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
475
476 * nsterm.m (hold_event_q): New static variable.
477 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
478 ! q_event_ptr.
479 (hold_event): New function.
480 (ns_read_socket): If hold_event_q have events, store them and
481 return (Bug#12384).
482 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
483 is zero (Bug#12384).
484
485 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
486
487 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
488
489 2012-10-12 Eli Zaretskii <eliz@gnu.org>
490
491 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
492
493 * fileio.c (check_existing): New function.
494 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
495 instead of calling 'stat', when what's needed is to check whether
496 a file exists. This avoids expensive system calls on MS-Windows.
497 (Bug#12587)
498
499 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
500
501 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
502 determine whether a file exists and is not a directory.
503
504 * lisp.h (check_existing): Add prototype.
505
506 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
507
508 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
509
510 2012-10-12 Glenn Morris <rgm@gnu.org>
511
512 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
513
514 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
515
516 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
517
518 * eval.c (Fautoload): Remember previous autoload status in load-history.
519
520 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
521
522 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
523 * lread.c (load_each_byte, new_backquote_flag, readchar)
524 (read_filtered_event, lisp_file_lexically_bound_p)
525 (safe_to_load_version, Fload, complete_filename_p, openp)
526 (build_load_history, readevalloop, read_escape, read1)
527 (string_to_number, read_vector, read_list):
528 * macros.c (Fstart_kbd_macro):
529 * marker.c (CONSIDER):
530 * menu.c (parse_single_submenu, digest_single_submenu)
531 (find_and_return_menu_selection, Fx_popup_menu):
532 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
533 (Ftry_completion):
534 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
535 (ns_menu_show):
536 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
537 (xmenu_show, xdialog_show):
538 Use bool for booleans.
539 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
540 as it's not a predicate. All uses changed. Omit unnecessary
541 buffer termination.
542
543 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
544
545 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
546 (save_excursion_restore): Do not restore mark if it was not saved.
547
548 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
549
550 * marker.c (cached_modiff): EMACS_INT, not int.
551
552 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
553 instead of having a wrong decl.
554 * nsmenu.m (waiting_for_input): Remove wrong decl.
555
556 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
557
558 keyboard.c, keymap.c: Use bool for booleans.
559 * dispnew.c (sit_for): Distinguish between 3-way display_option
560 and boolean do_display.
561 * keyboard.c (single_kboard, this_command_key_count_reset)
562 (waiting_for_input, echoing, immediate_quit, input_pending)
563 (interrupt_input, interrupts_deferred, pop_kboard)
564 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
565 (command_loop_1, adjust_point_for_property)
566 (safe_run_hooks_error, input_polling_used, read_char):
567 (help_char_p, readable_events, kbd_buffer_events_waiting)
568 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
569 (lucid_event_type_list_p, get_input_pending):
570 (gobble_input, menu_separator_name_p, menu_bar_item)
571 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
572 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
573 (keyremap_step, test_undefined, read_key_sequence)
574 (detect_input_pending, detect_input_pending_ignore_squeezables)
575 (detect_input_pending_run_timers, requeued_events_pending_p)
576 (quit_throw_to_read_char, Fset_input_interrupt_mode):
577 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
578 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
579 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
580 (accessible_keymaps_1, Fkey_description, push_key_description):
581 (shadow_lookup, struct where_is_internal_data)
582 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
583 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
584 (describe_map, describe_vector):
585 * menu.c (single_menu_item):
586 * nsmenu.m (ns_update_menubar):
587 * process.c (wait_reading_process_output):
588 * search.c (scan_buffer, scan_newline):
589 Use bool for boolean.
590 * keyboard.c (timers_run, swallow_events)
591 (detect_input_pending_run_timers):
592 * process.c (wait_reading_process_output):
593 Use unsigned for counter where wraparound-on-overflow is desired,
594 since unsigned is guaranteed to have that behavior and signed is not.
595 (read_char): Use ptrdiff_t for string length.
596 (get_input_pending): Remove first argument, since it was always
597 the same pointer-to-int (now pointer-to-boolean) &input_pending,
598 and behave as if it had that value. Return new value of
599 input_pending. All callers changed.
600 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
601 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
602 a string length.
603 * keymap.c (push_key_description): Omit last arg, which was always 1.
604 All callers changed.
605
606 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
607
608 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
609
610 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
611 ($(BLD)/term.$(O)): Update dependencies.
612
613 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
614
615 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
616 * lisp.h (enum pvec_type): Adjust comments and omit explicit
617 initializer for PVEC_NORMAL_VECTOR.
618
619 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
620
621 Clean out old termopts cruft.
622 * termopts.h (flow_control, meta_key): Remove unused decls.
623 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
624 Don't include termopts.h.
625
626 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
627
628 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
629
630 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
631
632 * commands.h (immediate_quit): Remove duplicate decl.
633
634 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
635
636 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
637 caching.
638 (nsfont_open): Remove setting of Vfonts_in_cache.
639 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
640
641 2012-10-09 Eli Zaretskii <eliz@gnu.org>
642
643 * w32fns.c (w32_last_error): Change the return value to DWORD, to
644 match what GetLastError returns. Explain why the function is
645 needed.
646
647 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
648 'is_tooltip_frame', to avoid confusion with its global namesake.
649
650 2012-10-08 Daniel Colascione <dancol@dancol.org>
651
652 * xdisp.c (start_hourglass): Call w32_note_current_window when
653 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
654 build that caused Emacs to display the hourglass cursor forever.
655
656 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
657 which is broken under remote desktop, calculate the number of
658 colors available for a display based on the display's number of
659 planes and number of bits per pixel per plane. (bug#10397).
660
661 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
662
663 * nsfont.m (Vfonts_in_cache): New variable.
664 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
665 are used. Add cached fonts to Vfonts_in_cache.
666 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
667
668 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
669
670 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
671 in nt/config.nt.
672 (FONT_H): Define after FRAME_H.
673 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
674 Update dependencies.
675
676 * w32term.c: Remove leftover declaration of keyboard_codepage.
677
678 2012-10-08 Eli Zaretskii <eliz@gnu.org>
679
680 * makefile.w32-in (FONT_H): Add $(FRAME_H).
681 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
682 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
683 (GLOBAL_SOURCES): Add cygw32.c.
684 ($(BLD)/unexw32.$(O)):
685 ($(BLD)/w32.$(O)):
686 ($(BLD)/w32console.$(O)):
687 ($(BLD)/w32fns.$(O)):
688 ($(BLD)/w32heap.$(O)):
689 ($(BLD)/w32menu.$(O)):
690 ($(BLD)/w32proc.$(O)): Add w32common.h.
691
692 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
693 'const char *'.
694 (x_to_w32_color): Don't modify the argument, modify a copy instead.
695
696 2012-10-08 Daniel Colascione <dancol@dancol.org>
697
698 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
699 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
700 accidental message numbering hole. Change other messages to
701 match.
702
703 * w32select.h (HAVE_W32SELECT): Remove.
704
705 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
706 w32common.h instead of w32heap.h.
707
708 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
709 (get_allocation_unit, get_processor_type, get_w32_major_version)
710 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
711 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
712 (OS_NT, os_subtype, cache_system_info): Move declarations to
713 w32common.
714
715 * w32heap.c: Include w32common.h.
716 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
717 (w32_minor_version, w32_build_number, w32_subtype):
718 Remove duplicate definitions.
719
720 * w32fns.c: Include w32common.h; include w32heap.h only in
721 WINDOWSNT.
722
723 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
724 Use `report_file_error' instead of `error' in order to better
725 inform users of what went wrong. Increase NTGUI_UNICODE file
726 dialog box file name length to 32k, the maximum allowed by the NT
727 kernel.
728
729 * w32common.h: New file.
730 (ROUND_UP, ROUND_DOWN, get_page_size)
731 (get_allocation_unit, get_processor_type, get_w32_major_version)
732 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
733 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
734 (OS_NT, os_subtype, cache_system_info): Move here.
735
736 * unexw32.c, unexcw.c: Include w32common.h.
737
738 * emacs.c (main): Use (defined (WINDOWSNT) || defined
739 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
740 to call syms_of_w32select.
741
742 * cygw32.h: Remove obsolete EXFUN declarations.
743
744 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
745
746 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
747 of w32inevt.o from SOME_MACHINE_OBJECTS.
748
749 2012-10-08 Daniel Colascione <dancol@dancol.org>
750
751 * image.c: Permanent fix for JPEG compilation issue --- limit
752 jpeglib `boolean' redefinition to Cygwin builds.
753
754 2012-10-08 Eli Zaretskii <eliz@gnu.org>
755
756 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
757
758 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
759 Cygwin.
760
761 2012-10-08 Daniel Colascione <dancol@dancol.org>
762
763 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
764 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
765 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
766 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
767 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
768 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
769 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
770 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
771 now a supported configuration.
772
773 * Makefile.in: consolidate image variables into LIBIMAGE; add
774 W32_OBJ and W32_LIBS. Compile new files.
775
776 * conf_post.h:
777 (_DebPrint) declare tracing facility for W32 debugging. We need
778 to unify tracing later.
779
780 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
781 unconditional use of W32 Unicode functions. Cygwin runs only on
782 100% Unicode operating systems.
783
784 * cygw32.c: New file. Define Cygwin-specific facilities.
785 (Fcygwin_convert_path_to_windows)
786 (Fcygwin_convert_path_from_windows): New user functions for
787 accessing Cygwin path-munging routines.
788
789 * cygw32.h: New file.
790 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
791 UTF-16LE strings temporarily inside non-Lisp-visible string
792 objects.
793
794 (w32_strerror): Just what it says on the tin.
795
796 * emacs.c: Make the NS fork-then-exec code for daemon-launching
797 also run for Cygwin; both systems have the same problem with using
798 GUI facilities in a forked child. Also call syms_of_cygw32,
799 syms_of_w32select in correct places.
800
801 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
802 needs fork-then-exec for daemon launching.
803
804 * font.h: Include frame.h.
805
806 * image.c: Use the image library cache machinery only when we're
807 compiling for native WINDOWSNT; Cygwin can use shared libraries
808 like any other Unixlike system.
809
810 * keyboard.c: Clarify a comment regarding the input loop.
811
812 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
813 functions directly instead of trying to detect at runtime that our
814 host operating system supports them. We make this change for two
815 reasons: Cygwin lacks support for the multibyte character
816 conversion functions used by the legacy menu code, and Cygwin
817 never needs to rely on non-Unicode APIs.
818
819 * unexw32.c (hinst): Declare extern.
820
821 * w32.c: Change header order;
822 (w32_strerror): Move to w32fns.c because we need it for
823 non-WINDOWSNT builds.
824
825 * w32.h: Add #error macro to make sure we don't include w32.h for
826 Cygwin builds. Remove w32select declarations.
827
828 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
829 w32fns.c. w32console.c is WINDOWSNT-only.
830
831 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
832 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
833 POSIXy alternative.
834 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
835 (w32_major_version, w32_minor_version, w32_build_number)
836 (os_subtype, sound_type): Define here
837 (w32_defined_color): Make color parameter const for consistency
838 with other _defined_color functions.
839 (w32_createwindow): Unconditionally call w32_init_class instead of
840 doing so only when hprevinst is non-NULL. Plumbing hprevinst
841 through the code is complex and unnecessary because class
842 registration is practically free.
843 (w32_name_of_message): New EMACSDEBUG-only function.
844 (Fset_message_beep): Move here
845 (Fx_open_connection): Require that the display name for Windows be
846 "w32" for consistency, emacsclient disambiguation, and maybe, one
847 day, multi-window-system support.
848 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
849 Cygwin files for W32 GUI facilities, since these clearly don't
850 expect Cygwin names.
851 (_DebPrint): Define.
852 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
853 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
854 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
855 (w32_last_error): Remove.
856
857 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
858
859 * w32heap.c (syspage_mask): Declare here.
860 (cache_system_info): Remove.
861
862 * w32inevt.c (faked_key): Define globally, not statically.
863 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
864 (w32_console_toggle_lock_key): Move to w32fns.c.
865
866 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
867
868 * w32proc.c (_DebPrint): Move to w32fns.c.
869 * w32select.c: Include string.h, stdio.h for Cygwin.
870 * w32select.h: New File.
871
872 * w32term.c: Include io.h for non-CYGWIN builds; needed for
873 get_osfhandle.
874 (w32_message_fd): New variable. Under Cygwin, holds the file
875 descriptor the system used to tell us about pending thread
876 messages.
877
878 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
879 that prevented compilation under non-WINDOWSNT systems.
880
881 (w32_initialize): Open /dev/windows and assign it to
882 w32_message_fd. Provide w32 feature.
883
884 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
885 (WM_EMACS_INPUT_READY): add.
886 (prepend_msg, w32_message_fd): Declare globally.
887
888 * w32xfns.c:
889 (keyboard_handle): Use only when WINDOWSNT.
890 (notify_msg_ready): New function. Posts a message to the main
891 thread's message queue under CYGWIN, which wakes up the main
892 thread from select(2) by making the /dev/windows file descriptor
893 ready. Under WINDOWSNT, it sets an event the same way the old
894 code did.
895
896 (post, prepend_msg): Actually call notify_msg_ready instead of
897 setting the input event directly.
898
899 2012-10-07 Eli Zaretskii <eliz@gnu.org>
900
901 * ralloc.c (relinquish): If a heap is ready to be relinquished,
902 but it still has blocs in it, don't return it to the system,
903 instead of aborting. (Bug#12402)
904
905 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
906
907 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
908
909 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
910 MAC_OS_X_VERSION_10_6.
911 (syms_of_nsterm): Remove comment about Panther and above for
912 ns-antialias-text.
913 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
914 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
915 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
916
917 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
918 MAC_OS_X_VERSION_10_4.
919
920 * nsmenu.m (fillWithWidgetValue:): Remove code for <
921 MAC_OS_X_VERSION_10_2.
922
923 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
924
925 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
926 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
927
928 * nsterm.m (ns_in_resize): Remove (Bug#12479).
929 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
930 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
931 Remove ns_in_resize check.
932 (ns_clear_frame_area): Remove resize handle code.
933
934 * nsfns.m (ns_in_resize): Remove.
935 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
936 Remove ns_in_resize check.
937
938 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
939
940 Improve sys_siglist detection.
941 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
942 defined as a macro, as is done in Solaris.
943 (sys_siglist_entries): New macro.
944 (save_strsignal): Use it.
945 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
946 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
947
948 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
949
950 * nsfns.m (Fx_create_frame): Call x_default_parameter with
951 fullscreen/Fullscreen.
952
953 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
954 tobar_height is new.
955
956 * nsterm.m (x_make_frame_visible): Check for fullscreen.
957 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
958 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
959 (windowDidResize:): Check for correct window if old style fullscreen.
960 Capitalize word in comment. Remove incorrect comment.
961 (initFrameFromEmacs:): tbar_height renamed tibar_height.
962 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
963 error in drawing background.
964 (toggleFullScreen:): Remove comment. Rearrange calls.
965 Set toolbar values to zero, save old height in tobar_height.
966 Restore tool bar height when leaving fullscreen.
967 (canBecomeMainWindow): New function.
968
969 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
970
971 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
972
973 2012-10-05 Eli Zaretskii <eliz@gnu.org>
974
975 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
976
977 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
978 that time stamps of directories could also be changed.
979 Don't request the too broad GENERIC_WRITE, only the more restrictive
980 FILE_WRITE_ATTRIBUTES access rights.
981
982 * fileio.c (Fset_file_times): Special-case ignoring errors for
983 directories only on MSDOS, not on MS-Windows.
984
985 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
986
987 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
988
989 2012-10-04 Eli Zaretskii <eliz@gnu.org>
990
991 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
992 see whether CreateFile failed.
993
994 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
995
996 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
997 to avoid similar races.
998 * keyboard.c (pending_signals): Now bool, not int.
999
1000 Port timers to OpenBSD, plus check for timer failures.
1001 OpenBSD problem reported by Han Boetes.
1002 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1003 and/or setitimer.
1004 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1005 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1006 like OpenBSD, which has timer_settime but does not declare it.
1007 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1008 whether to use itimerspec-related primitives. All uses of
1009 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1010
1011 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1012
1013 * profiler.c (handle_profiler_signal): Fix a malloc race
1014 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1015
1016 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1017
1018 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1019
1020 2012-10-02 Eli Zaretskii <eliz@gnu.org>
1021
1022 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1023 consistent with the change in return value of 'safe_strsignal'.
1024
1025 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1026
1027 Prefer plain 'static' to 'static inline' (Bug#12541).
1028 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1029 (bidi_set_sor_type, bidi_push_embedding_level)
1030 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1031 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1032 (bidi_cache_search, bidi_cache_ensure_space)
1033 (bidi_cache_iterator_state, bidi_cache_find)
1034 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1035 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1036 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1037 Now 'static', not 'static inline'.
1038
1039 Count overruns when profiling; change units to ns.
1040 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1041 Give extra weight to samples after overruns, to attempt to count
1042 the time more accurately.
1043 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1044 the underlying primitives nominally do ns.
1045 (Fprofiler_cpu_start): Document the change. Mention that
1046 the sampling intervals are only approximate.
1047
1048 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1049
1050 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1051
1052 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1053 case for the special 0 coding-system.
1054
1055 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1056 (Fmake_overlay): Remove redundant tests.
1057 (fix_start_end_in_overlays): Remove redundant recentering.
1058
1059 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
1060
1061 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1062 Update dependencies.
1063
1064 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1065
1066 Fix a malloc race condition involving strsignal.
1067 A signal can arrive in the middle of a malloc, and Emacs's signal
1068 handler can invoke strsignal, which can invoke malloc, which is
1069 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1070 Fix it by altering the signal handler so that it does not invoke
1071 strsignal.
1072 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1073 * process.c (status_message): Use const pointer, in case strsignal
1074 is #defined to safe_strsignal.
1075 * sysdep.c (sys_siglist, init_signals): Always define and
1076 initialize a substitute sys_siglist if the system does not define
1077 one, even if HAVE_STRSIGNAL.
1078 (safe_strsignal): Rename from strsignal. Always define,
1079 using sys_siglist. Return a const pointer.
1080 * syssignal.h (safe_strsignal): New decl.
1081 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1082
1083 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1084
1085 * w32proc.c (timer_loop): Fix code that waits for timer
1086 expiration, to avoid high CPU usage.
1087
1088 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1089
1090 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1091 (sweep_weak_table): Remove redundant prototypes.
1092
1093 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1094
1095 * emacs.c: Move the inclusion of TERM_HEADER after including
1096 windows.h on WINDOWSNT. This avoids compilation problems with
1097 MSVC.
1098
1099 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1100
1101 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1102 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1103 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1104 as the previous version used 'void *'.
1105
1106 * ralloc.c (ROUNDUP): Fix last change.
1107 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1108 'size_t'.
1109
1110 * w32proc.c <disable_itimers>: New static flag.
1111 (init_timers): Initialize it to zero, after creating the critical
1112 sections used by the timer threads.
1113 (term_timers): Set to 1 before deleting the critical sections.
1114 (getitimer, setitimer): If disable_itimers is non-zero, return an
1115 error indication without doing anything. Reported by Fabrice
1116 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1117 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1118 return results.
1119 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1120 support timers.
1121
1122 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1123 term_ntproc after all the other bookkeeping, to get timers working
1124 as long as possible.
1125
1126 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1127
1128 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1129 Suggested by Juri Linkov in
1130 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1131
1132 Prefer plain 'static' to 'static inline' (Bug#12541).
1133 With static functions, modern compilers inline pretty well by
1134 themselves; advice from programmers often hurts as much as it helps.
1135 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1136 this change shrinks the text size of the Emacs executable by 1.1%
1137 without affecting CPU significantly in my benchmark.
1138 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1139 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1140 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1141 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1142 (bset_auto_fill_function, bset_auto_save_file_format)
1143 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1144 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1145 (bset_cache_long_line_scans, bset_case_fold_search)
1146 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1147 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1148 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1149 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1150 (bset_header_line_format, bset_indicate_buffer_boundaries)
1151 (bset_indicate_empty_lines, bset_invisibility_spec)
1152 (bset_left_fringe_width, bset_major_mode, bset_mark)
1153 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1154 (bset_name, bset_overwrite_mode, bset_pt_marker)
1155 (bset_right_fringe_width, bset_save_length)
1156 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1157 (bset_scroll_up_aggressively, bset_selective_display)
1158 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1159 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1160 (set_buffer_overlays_after):
1161 * category.c (bset_category_table):
1162 * charset.c (read_hex):
1163 * coding.c (produce_composition, produce_charset)
1164 (handle_composition_annotation, handle_charset_annotation)
1165 (char_encodable_p):
1166 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1167 (assign_row, set_frame_matrix_frame, make_current)
1168 (add_row_entry):
1169 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1170 * fns.c (maybe_resize_hash_table):
1171 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1172 * gmalloc.c (register_heapinfo):
1173 * image.c (lookup_image_type):
1174 * intervals.c (set_interval_object, set_interval_left)
1175 (set_interval_right, copy_interval_parent, rotate_right)
1176 (rotate_left, balance_possible_root_interval):
1177 * keyboard.c (kset_echo_string, kset_kbd_queue)
1178 (kset_keyboard_translate_table, kset_last_prefix_arg)
1179 (kset_last_repeatable_command, kset_local_function_key_map)
1180 (kset_overriding_terminal_local_map, kset_real_last_command)
1181 (kset_system_key_syms, clear_event, set_prop):
1182 * lread.c (digit_to_number):
1183 * marker.c (attach_marker, live_buffer, set_marker_internal):
1184 * nsterm.m (ns_compute_glyph_string_overhangs):
1185 * process.c (pset_buffer, pset_command)
1186 (pset_decode_coding_system, pset_decoding_buf)
1187 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1188 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1189 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1190 * syntax.c (bset_syntax_table, dec_bytepos):
1191 * terminal.c (tset_param_alist):
1192 * textprop.c (interval_has_some_properties)
1193 (interval_has_some_properties_list):
1194 * window.c (wset_combination_limit, wset_dedicated)
1195 (wset_display_table, wset_hchild, wset_left_fringe_width)
1196 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1197 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1198 (wset_right_fringe_width, wset_right_margin_cols)
1199 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1200 (wset_vertical_scroll_bar_type, wset_window_parameters):
1201 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1202 (wset_column_number_displayed, wset_region_showing)
1203 (window_box_edges, run_window_scroll_functions)
1204 (append_glyph_string_lists, prepend_glyph_string_lists)
1205 (append_glyph_string, set_glyph_string_background_width)
1206 (append_glyph, append_composite_glyph)
1207 (take_vertical_position_into_account):
1208 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1209 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1210 (lface_hash, lface_same_font_attributes_p, lookup_face):
1211 * xml.c (libxml2_loaded_p):
1212 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1213 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1214 Now 'static', not 'static inline'.
1215
1216 * bidi.c: Tune.
1217 (bidi_copy_it): Do the whole copy with a single memcpy.
1218 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1219
1220 Revert the FOLLOW-SYMLINKS change for file-attributes.
1221 Doing it right would require several changes to Tramp, and there's
1222 not enough time to get that tested before the freeze today.
1223 * dired.c (directory_files_internal, Ffile_attributes):
1224 Undo last change.
1225
1226 * frame.c (x_report_frame_params): Port better to wider ints.
1227 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1228 or that pointers can be printed in 15 decimal digits.
1229 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1230
1231 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1232
1233 Support x64 build on MS-Windows.
1234 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1235 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1236 compatibility with x64.
1237 (x_get_focus_frame): Add prototype.
1238
1239 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1240 defining an XRectangle structure.
1241
1242 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1243 arithmetics for compatibility with x64.
1244
1245 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1246 compatibility with x64.
1247
1248 * w32heap.h: Adjust prototypes and declarations.
1249
1250 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1251 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1252 DWORD, long, and unsigned long, for compatibility with x64.
1253 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1254 (sbrk): Argument is now of type ptrdiff_t.
1255
1256 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1257 less than 0x0500.
1258 (w32_msg_pump): Use WPARAM type for 'result'.
1259
1260 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1261 architecture.
1262 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1263 compatibility with x64.
1264
1265 * vm-limit.c (lim_data): Now size_t.
1266 (check_memory_limits): Adjust prototypes of real_morecore and
1267 __morecore to receive argument of type ptrdiff_t. Use size_t for
1268 five_percent and data_size.
1269
1270 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1271 variables, for compatibility with x64.
1272 (rva_to_section, offset_to_section, relocate_offset)
1273 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1274 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1275 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1276 for compatibility with x64.
1277
1278 * sysdep.c (STDERR_FILENO): Define if not already defined.
1279
1280 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1281 (__morecore): Argument type is now ptrdiff_t.
1282 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1283 (relinquish): Use ptrdiff_t type for 'excess'.
1284 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1285
1286 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1287 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1288 instead of a literal number.
1289
1290 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1291 (min): Define only if not already defined.
1292
1293 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1294 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1295 hosts.
1296
1297 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1298 'bitmaps' is a pointer.
1299
1300 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1301
1302 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1303
1304 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1305
1306 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1307 * dired.c (directory_files_internal, Ffile_attributes):
1308 New arg follow_symlinks. All uses changed.
1309
1310 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1311
1312 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1313
1314 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1315
1316 Support atimers and CPU profiler via profile.c on MS-Windows.
1317 * w32proc.c (sig_mask, crit_sig): New static variables.
1318 (sys_signal): Support SIGALRM and SIGPROF.
1319 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1320 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1321 sigfillset, and sigprocmask are no longer no-ops.
1322 (sigismember): New function.
1323 (struct itimer_data): New definition.
1324 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1325 (crit_prof): New static variables.
1326 (MAX_SINGLE_SLEEP): New definition.
1327 (timer_loop, stop_timer_thread, term_timers, init_timers)
1328 (start_timer_thread, getitimer, setitimer): New functions.
1329 (alarm): No longer a no-op, calls setitimer.
1330
1331 * w32.c (term_ntproc): Call term_timers.
1332 (init_ntproc): Make sure all signals are unblocked at startup, to
1333 erase any traces of dumping. Call init_timers.
1334
1335 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1336 Windows-specific code to display the hourglass mouse pointer is no
1337 longer used.
1338 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1339 to hourglass timer expiration.
1340 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1341 Remove, no longer used.
1342 (w32_note_current_window, show_hourglass, hide_hourglass):
1343 New functions, in support of hourglass cursor display similar to other
1344 window systems.
1345 (syms_of_w32fns): Don't initialize hourglass_timer.
1346
1347 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1348 WINDOWSNT as well.
1349 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1350
1351 * w32.h (init_timers, term_timers): Add prototypes.
1352
1353 2012-09-30 Kenichi Handa <handa@gnu.org>
1354
1355 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1356 to the buffer relocation which may be caused by ccl_driver.
1357
1358 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1359
1360 * xfns.c (Fx_file_dialog): Update comment.
1361
1362 * w32fns.c (Fx_file_dialog): Update comment.
1363
1364 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1365 Initialize panel name field if OSX >= 10.6.
1366
1367 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1368
1369 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1370
1371 * nsterm.m (NEW_STYLE_FS): New define.
1372 (ns_fullscreen_hook, windowWillEnterFullScreen)
1373 (windowDidEnterFullScreen, windowWillExitFullScreen)
1374 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1375 (setFSValue): New functions.
1376 (EmacsFSWindow): New implementation.
1377 (canBecomeKeyWindow): New function for EmacsFSWindow.
1378 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1379 (dealloc): Release nonfs_window if in fullscreen.
1380 (updateFrameSize:): Call windowDidMove to update top/left.
1381 (windowWillResize:toSize:): Check if frame is still maximized.
1382 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1383 next_maximized, maximized_width, maximized_height and nonfs_window.
1384 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1385 tbar_height.
1386 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1387 fullscreen. Set maximized_width/height. Act on next_maximized.
1388
1389 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1390 (EmacsView): Add variables for fullscreen.
1391 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1392 (EmacsFSWindow): New interface for fullscreen.
1393
1394 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1395
1396 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1397
1398 2012-09-30 Chong Yidong <cyd@gnu.org>
1399
1400 * fns.c (Frandom): Doc fix.
1401
1402 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1403
1404 * window.c (Vwindow_combination_limit): New default value.
1405 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1406
1407 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1408
1409 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1410 Suggested by Eli Zaretskii in
1411 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1412
1413 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1414
1415 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1416 HAVE_TIMER_SETTIME is defined.
1417
1418 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1419
1420 Profiler improvements: more-accurate timers, overflow checks.
1421 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1422 signal.h, setjmp.h. Include systime.h instead.
1423 (saturated_add): New function.
1424 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1425 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1426 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1427 New static vars.
1428 (enum profiler_cpu_running): New enum.
1429 (profiler_cpu_running): Now of that enum type, not bool.
1430 All uses changed to store the new value.
1431 (handle_profiler_signal): Rename from sigprof_handler_1,
1432 for consistency with other handlers. Do not check whether
1433 cpu_log is a hash-table if garbage collecting, since it
1434 doesn't matter in that case.
1435 (deliver_profiler_signal): Rename from sigprof_handler,
1436 for consistency with other handlers.
1437 (setup_cpu_timer): New function, with much of what used to be in
1438 Fprofiler_cpu_start. Check for out-of-range argument.
1439 Prefer timer_settime if available, and prefer
1440 thread cputime clocks, then process cputime clocks, then
1441 monotonic clocks, to the old realtime clock. Use make_timeval
1442 to round more-correctly when falling back to setitimer.
1443 (Fprofiler_cpu_start): Use it.
1444 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1445 Don't assume that passing NULL as the 2nd argument of setitimer
1446 is the same as passing a pointer to all-zero storage.
1447 Ignore SIGPROF afterwards.
1448 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1449 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1450 non-fatal signal handlers. Ignore SIGPROF on startup.
1451 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1452 in profiler.c, since sysdep.c now uses it.
1453
1454 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1455 Suggested by Eli Zaretskii in
1456 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1457
1458 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1459
1460 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1461
1462 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1463
1464 * lisp.h (struct backtrace): Remove indirection for `function' field.
1465 * xdisp.c (redisplay_internal):
1466 * profiler.c (record_backtrace, sigprof_handler_1):
1467 * alloc.c (Fgarbage_collect):
1468 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1469 (Fbacktrace_frame): Adjust accordingly.
1470
1471 2012-09-28 Glenn Morris <rgm@gnu.org>
1472
1473 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1474 (Frun_hook_with_args_until_failure): Doc fixes.
1475
1476 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1477
1478 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1479 Qautomatic_redisplay and change the symbol name. All users changed.
1480
1481 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1482
1483 * profiler.c (sigprof_handler): Fix race condition.
1484
1485 2012-09-28 Glenn Morris <rgm@gnu.org>
1486
1487 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1488
1489 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1490
1491 Check more robustly for timer_settime.
1492 * Makefile.in (LIB_TIMER_TIME): New macro.
1493 (LIBES): Add it.
1494 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1495 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1496 call timer_settime.
1497
1498 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1499
1500 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1501
1502 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1503
1504 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1505
1506 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1507
1508 * character.h (MAYBE_UNIFY_CHAR): Remove.
1509 * charset.c, charset.h (maybe_unify_char): Now static.
1510 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1511 Since this stuff is now private to charset.c, there's no need for
1512 a public macro and no need to inline by hand.
1513
1514 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1515 Stefan Monnier <monnier@iro.umontreal.ca>
1516 Juanma Barranquero <lekktu@gmail.com>
1517
1518 * profiler.c: New file.
1519 * Makefile.in (base_obj): Add profiler.o.
1520 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1521 ($(BLD)/profiler.$(O)): New target.
1522 * emacs.c (main): Call syms_of_profiler.
1523 * alloc.c (Qautomatic_gc): New constant.
1524 (MALLOC_PROBE): New macro.
1525 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1526 (total_bytes_of_live_objects): New function.
1527 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1528 Call malloc_probe for the memory profiler.
1529 (syms_of_alloc): Define Qautomatic_gc.
1530 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1531 race condition.
1532 (struct backtrace): Move definition...
1533 * lisp.h (struct backtrace): ..here.
1534 (Qautomatic_gc, profiler_memory_running): Declare vars.
1535 (malloc_probe, syms_of_profiler): Declare functions.
1536 * xdisp.c (Qautomatic_redisplay): New constant.
1537 (redisplay_internal): Record itself in backtrace_list.
1538 (syms_of_xdisp): Define Qautomatic_redisplay.
1539
1540 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1541 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1542
1543 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1544
1545 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1546
1547 Prefer POSIX timers if available.
1548 They avoid a race if the timer is too close to the current time.
1549 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1550 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1551 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1552
1553 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1554
1555 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1556 CHAR_STRING_ADVANCE.
1557 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1558 STRING_CHAR_ADVANCE.
1559
1560 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1561
1562 Move Vlibrary_cache to emacs.c and reset before dumping.
1563
1564 * lisp.h (reset_image_types): Declare.
1565 [WINDOWSNT] (Vlibrary_cache): Declare.
1566
1567 * image.c (reset_image_types): New function.
1568
1569 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1570 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1571 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1572
1573 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1574 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1575
1576 * w32.h (Vlibrary_cache): Do not declare.
1577
1578 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1579
1580 * w32proc.c (sys_signal): Handle all signals defined by the
1581 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1582 handlers for signals supported by Windows. Don't override
1583 term_ntproc as the handler for SIGABRT.
1584 (sigaction): Rewrite to call sys_signal instead of duplicating its
1585 code.
1586 (sys_kill): Improve commentary.
1587
1588 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1589 consistency with a signature of a signal handler. All callers
1590 changed.
1591 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1592 install term_ntproc as a signal handler for SIGABRT, as that
1593 should be done by the dumped Emacs.
1594
1595 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1596
1597 * w32select.c (term_w32select): Protect against repeated
1598 invocation by setting clipboard_owner to NULL after calling
1599 DestroyWindow.
1600
1601 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1602 and term_ntproc to their modified signatures.
1603
1604 * character.c (char_string, string_char): Remove calls to
1605 MAYBE_UNIFY_CHAR. See the discussion starting at
1606 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1607 for the details.
1608
1609 2012-09-25 Chong Yidong <cyd@gnu.org>
1610
1611 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1612
1613 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1614
1615 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1616 when encountering an unknown bytecode.
1617
1618 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1619
1620 image.c, indent.c: Use bool for booleans.
1621 * dispextern.h (struct image_type): Members valid_p, load, init
1622 now return bool, not int. All uses changed.
1623 * image.c: Omit unnecessary static decls.
1624 (x_create_bitmap_mask, x_build_heuristic_mask):
1625 Return void, not int, since callers don't care about the return value.
1626 (x_create_bitmap_mask, define_image_type, valid_image_p)
1627 (struct image_keyword, parse_image_spec, image_spec_value)
1628 (check_image_size, image_background)
1629 (image_background_transparent, x_clear_image_1)
1630 (postprocess_image, lookup_image, x_check_image_size)
1631 (x_create_x_image_and_pixmap, xbm_image_p)
1632 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1633 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1634 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1635 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1636 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1637 (png_image_p, init_png_functions, png_load_body, png_load)
1638 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1639 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1640 (init_gif_functions, gif_load, imagemagick_image_p)
1641 (imagemagick_load_image, imagemagick_load, svg_image_p)
1642 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1643 (gs_load):
1644 * nsimage.m (ns_load_image):
1645 * nsterm.m (ns_defined_color):
1646 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1647 * xfns.c (x_defined_color):
1648 * xterm.c (x_alloc_lighter_color_for_widget)
1649 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1650 (x_alloc_lighter_color):
1651 * indent.c (disptab_matches_widthtab, current_column)
1652 (scan_for_column, string_display_width, indented_beyond_p)
1653 (compute_motion, vmotion, Fvertical_motion):
1654 Use bool for booleans.
1655
1656 2012-09-24 Chong Yidong <cyd@gnu.org>
1657
1658 * chartab.c (Fset_char_table_default): Obsolete function removed.
1659
1660 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1661
1662 Move pid_t related decls out of lisp.h.
1663 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1664 (interruptible_wait_for_termination):
1665 Move these decls from lisp.h to syswait.h, since they use pid_t.
1666 Needed on FreeBSD; see Herbert J. Skuhra in
1667 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1668 * callproc.c: Include syswait.h.
1669
1670 gnutls.c, gtkutil.c: Use bool for boolean.
1671 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1672 (emacs_gnutls_handle_error):
1673 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1674 (xg_hide_tooltip, xg_create_frame_widgets)
1675 (create_dialog, xg_uses_old_file_dialog)
1676 (xg_get_file_with_chooser, xg_get_file_with_selection)
1677 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1678 (xg_item_label_same_p, xg_update_menubar)
1679 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1680 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1681 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1682 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1683 (update_frame_tool_bar, free_frame_tool_bar):
1684 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1685 * nsmenu.m (ns_update_menubar):
1686 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1687 * xfns.c (Fx_show_tip) [USE_GTK]:
1688 Use bool for boolean.
1689 * gtkutil.c (xg_update_frame_menubar):
1690 * xmenu.c (update_frame_menubar):
1691 Return void, not int, since caller ignores return value.
1692 * gtkutil.c (xg_change_toolbar_position):
1693 Return void, not 1.
1694
1695 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1696
1697 * makefile.w32-in (BLOCKINPUT_H): Remove.
1698 (SYSSIGNAL_H): New macro.
1699 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1700 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1701 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1702 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1703 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1704 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1705 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1706 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1707 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1708 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1709 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1710 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1711 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1712 ($(BLD)/w32xfns.$(O)): Update dependencies.
1713
1714 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1715
1716 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1717 fatal_error_backtrace.
1718
1719 * w32proc.c (sys_kill): Undo last change: don't do anything when
1720 invoked to deliver SIGABRT to our own process. This is now
1721 handled by emacs_raise.
1722
1723 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1724
1725 * w32term.c (w32_read_socket): Remove leftover reference to
1726 interrupt_input_pending.
1727
1728 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1729
1730 Do not use SA_NODEFER.
1731 Problem reported by Dani Moncayo in
1732 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1733 * alloc.c (die):
1734 * sysdep.c (emacs_abort): Do not reset signal handler.
1735 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1736 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1737 wanted even on POSIXish hosts, and it doesn't work on Windows.
1738
1739 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1740
1741 * xterm.c (x_term_init): Call fixup_locale before and after calling
1742 gtk_init (Bug#12392).
1743
1744 2012-09-23 Chong Yidong <cyd@gnu.org>
1745
1746 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1747 Vdynamic_library_alist.
1748
1749 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1750 (Fgnutls_available_p): Caller changed.
1751
1752 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1753 (Flibxml_parse_xml_region): Likewise.
1754
1755 * dispextern.h (struct image_type): Remove arg from init function.
1756
1757 * image.c (Finit_image_library, lookup_image_type)
1758 (define_image_type): Remove now-unneeded second arg.
1759 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1760 (init_tiff_functions, init_gif_functions, init_svg_functions):
1761 Arglist and w32_delayed_load calling convention changed.
1762 (gs_type): Remove init_gs_functions; there is no such function.
1763 (valid_image_p, make_image): Fix caller to lookup_image_type.
1764
1765 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1766
1767 Simplify and avoid signal-handling races (Bug#12471).
1768 * alloc.c (die):
1769 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1770 Avoid recursive loop if there's a fatal error in the function itself.
1771 * atimer.c (pending_atimers):
1772 * blockinput.h: Don't include "atimer.h"; no longer needed.
1773 (interrupt_input_pending): Remove. All uses removed.
1774 pending_signals now counts both atimers and ordinary interrupts.
1775 This is less racy than having three separate pending-signal flags.
1776 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1777 (input_blocked_p):
1778 Rename from their upper-case counterparts BLOCK_INPUT,
1779 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1780 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1781 This makes it easier to access volatile variables more accurately.
1782 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1783 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1784 that's more reliable if the code is buggy and sets
1785 interrupt_input_blocked to a negative value. All uses changed.
1786 * atimer.c (deliver_alarm_signal):
1787 Remove. No need to deliver this to the parent; any thread can
1788 handle this signal now. All uses replaced by underlying handler.
1789 * atimer.c (turn_on_atimers):
1790 * dispnew.c (handle_window_change_signal):
1791 * emacs.c (handle_danger_signal):
1792 * keyboard.c (kbd_buffer_get_event):
1793 Don't reestablish signal handler; not needed with sigaction.
1794 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1795 (UNBLOCK_INPUT_TO):
1796 Rework to avoid unnecessary accesses to volatile variables.
1797 (UNBLOCK_INPUT_TO): Now a function.
1798 (totally_unblock_input, unblock_input): New decls.
1799 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1800 (init_data): Remove. Necessary stuff now done in init_signal.
1801 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1802 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1803 (fatal_error_code): Remove; no longer needed.
1804 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1805 it doesn't always backtrace. All uses changed. No need to reset
1806 signal to default, since sigaction and/or die does that for us now.
1807 Use emacs_raise (FOO), not kill (getpid (), FOO).
1808 (main): Check more-accurately whether we're dumping.
1809 Move fatal-error setup to sysdep.c
1810 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1811 * gtkutil.c (xg_get_file_name, xg_get_font):
1812 Remove no-longer-needed signal-mask manipulation.
1813 * keyboard.c, process.c (POLL_FOR_INPUT):
1814 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1815 * keyboard.c (read_avail_input): Remove.
1816 All uses replaced by gobble_input.
1817 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1818 (kbd_buffer_store_event_hold, gobble_input):
1819 (record_asynch_buffer_change) [USABLE_SIGIO]:
1820 (store_user_signal_events):
1821 No need to mess with signal mask.
1822 (gobble_input): If blocking input and there are terminals, simply
1823 set pending_signals to 1 and return. All hooks changed to not
1824 worry about whether input is blocked.
1825 (process_pending_signals): Clear pending_signals before processing
1826 them, in case a signal comes in while we're processing.
1827 By convention callers now test pending_signals before calling us.
1828 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1829 New functions, to support changes to blockinput.h.
1830 (handle_input_available_signal): Now extern.
1831 (reinvoke_input_signal): Remove. All uses replaced by
1832 handle_async_input.
1833 (quit_count): Now volatile, since a signal handler uses it.
1834 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1835 All callers changed. Block SIGINT only if not already blocked.
1836 Clear sigmask reliably, even if Fsignal returns, which it can.
1837 Omit unnecessary accesses to volatile var.
1838 (quit_throw_to_read_char): No need to restore sigmask.
1839 * keyboard.c (gobble_input, handle_user_signal):
1840 * process.c (wait_reading_process_output):
1841 Call signal-handling code rather than killing ourselves.
1842 * lisp.h: Include <float.h>, for...
1843 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1844 (pending_signals): Now volatile.
1845 (syms_of_data): Now const if IEEE floating point.
1846 (handle_input_available_signal) [USABLE_SIGIO]:
1847 (terminate_due_to_signal, record_child_status_change): New decls.
1848 * process.c (create_process): Avoid disaster if memory is exhausted
1849 while we're processing a vfork, by tightening the critical section
1850 around the vfork.
1851 (send_process_frame, process_sent_to, handle_pipe_signal)
1852 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1853 ignores SIGPIPE.
1854 (send_process): No need for setjmp/longjmp any more, since the
1855 SIGPIPE stuff is now gone. Instead, report an error if errno
1856 is EPIPE.
1857 (record_child_status_change): Now extern. PID and W are now args.
1858 Return void, not bool. All callers changed.
1859 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1860 Remove. All uses removed. This bug should be fixed now in a
1861 different way.
1862 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1863 and record the child status change directly. This avoids the
1864 need to futz with the signal mask.
1865 (process_fatal_action): Move here from emacs.c.
1866 (emacs_sigaction_flags): New function, containing
1867 much of what used to be in emacs_sigaction_init.
1868 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1869 caught by emacs, to make races less likely.
1870 (deliver_process_signal): Rename from handle_on_main_thread.
1871 All uses changed.
1872 (BACKTRACE_LIMIT_MAX): Now at top level.
1873 (thread_backtrace_buffer, threadback_backtrace_pointers):
1874 New static vars.
1875 (deliver_thread_signal, deliver_fatal_thread_signal):
1876 New functions, for more-accurate delivery of thread-specific signals.
1877 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1878 (deliver_arith_signal): Handle in this thread, not
1879 in the main thread, since it's triggered by this thread.
1880 (maybe_fatal_sig): New function.
1881 (init_signals): New arg DUMPING so that we can be more accurate
1882 about whether we're dumping. Caller changed.
1883 Treat thread-specific signals differently from process-general signals.
1884 Block all signals while handling fatal error; that's safer.
1885 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1886 on IEEE hosts.
1887 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1888 Ignore SIGPIPE unless batch.
1889 (emacs_backtrace): Output backtrace for the appropriate thread,
1890 which is not necessarily the main thread.
1891 * syssignal.h: Include <stdbool.h>.
1892 (emacs_raise): New macro.
1893 * xterm.c (x_connection_signal): Remove; no longer needed
1894 now that we use sigaction.
1895 (x_connection_closed): No need to mess with sigmask now.
1896 (x_initialize): No need to reset SIGPIPE handler here, since
1897 init_signals does this for us now.
1898
1899 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1900
1901 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1902 background rect may be larger (Bug#12245).
1903
1904 2012-09-23 Chong Yidong <cyd@gnu.org>
1905
1906 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1907
1908 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1909
1910 * .gdbinit: Just stop at fatal_error_backtrace.
1911 See Stefan Monnier's request in
1912 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1913 Remove no-longer-used query of system type.
1914
1915 2012-09-22 Chong Yidong <cyd@gnu.org>
1916
1917 * search.c (Freplace_match): Doc fix (Bug#12325).
1918
1919 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1920
1921 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1922 (Fline_end_position): Doc fix.
1923
1924 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1925
1926 2012-09-22 Chong Yidong <cyd@gnu.org>
1927
1928 * dispextern.h (struct image_type): Add new slot, storing a type
1929 initialization function.
1930
1931 * image.c (define_image_type): Call the image initializer function
1932 if it is defined. Arguments and return value changed.
1933 (valid_image_p, make_image): Callers changed.
1934 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1935 (gif_type, imagemagick_type, svg_type, gs_type):
1936 Add initialization functions.
1937 (Finit_image_library): Call lookup_image_type.
1938 (CHECK_LIB_AVAILABLE): Macro deleted.
1939 (lookup_image_type): Call define_image_type here, rather than via
1940 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1941 (syms_of_image): Move define_image_type calls for xbm_type and
1942 pbm_type to lookup_image_type.
1943
1944 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1945
1946 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1947 'idle_timers' from here ...
1948 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1949 lists, to avoid infloops when the timer does something stupid,
1950 like reinvoke itself with the same or smaller time-out.
1951 (Bug#12447)
1952
1953 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1954
1955 * window.c (Fsplit_window_internal): Handle only Qt value of
1956 Vwindow_combination_limit separately.
1957 (Qtemp_buffer_resize): New symbol.
1958 (Vwindow_combination_limit): New default value.
1959 Rewrite doc-string.
1960
1961 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1962
1963 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1964 the new overlay string. (Bug#10159)
1965
1966 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1967
1968 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1969 or that fprintf is async-signal-safe. POSIX doesn't require
1970 either assumption.
1971
1972 2012-09-22 Chong Yidong <cyd@gnu.org>
1973
1974 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1975 (Bug#8207).
1976
1977 2012-09-22 Kenichi Handa <handa@gnu.org>
1978
1979 * composite.c (composition_reseat_it): Handle the case that a
1980 grapheme cluster is not covered by a single font (Bug#12352).
1981
1982 2012-09-21 Chong Yidong <cyd@gnu.org>
1983
1984 * image.c (define_image_type): Avoid adding duplicate types to
1985 image_types (Bug#12463). Suggested by Jörg Walter.
1986
1987 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1988
1989 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1990 (print_load_command_name): Add case LC_DATA_IN_CODE.
1991 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1992
1993 2012-09-21 Glenn Morris <rgm@gnu.org>
1994
1995 * eval.c (Frun_hook_with_args_until_success)
1996 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1997
1998 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1999
2000 * fileio.c (Ffile_selinux_context): Only call freecon when
2001 lgetfilecon succeeded.
2002 (Fset_file_selinux_context): Likewise. (Bug#12444)
2003
2004 2012-09-21 Eli Zaretskii <eliz@gnu.org>
2005
2006 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2007 reordering, locate the cursor by calling set_cursor_from_row; if
2008 that fails, clear the desired glyph matrix before returning a
2009 failure indication to the caller. Fixes leaving garbled display
2010 when fast scrolling with a down-key. (Bug#12403)
2011 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2012 scrolling through multibyte text.
2013
2014 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2015
2016 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2017 calling mark_vectorlike since that's the one that marks the window.
2018 (mark_discard_killed_buffers): Mark the final cdr.
2019 * window.h (struct window): Move prev/next_buffers to the
2020 non-standard fields.
2021 * window.c (make_window): Initialize prev/next_buffers manually.
2022
2023 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2024
2025 Omit unused arg EXPECTED from socket hooks.
2026 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2027 * nsterm.m (ns_term_init):
2028 * termhooks.h (struct terminal.read_socket_hook):
2029 * w32inevt.c (w32_console_read_socket):
2030 * w32term.c (w32_read_socket):
2031 * xterm.c (XTread_socket):
2032 Omit unused arg EXPECTED. All callers changed.
2033 (store_user_signal_events): Return void, not int, since callers no
2034 longer care about the return value. All uses changed.
2035
2036 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2037
2038 * w32gui.h (XParseGeometry): Do not declare.
2039
2040 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2041
2042 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
2043 Ignore 'expected'. See Eli Zaretskii in
2044 <http://bugs.gnu.org/12471#8> (last line).
2045
2046 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2047 (XParseGeometry): Now static. Substitute extremal values for
2048 values that are out of range.
2049
2050 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2051
2052 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2053
2054 * nsfns.m (XParseGeometry): Remove.
2055 (Fx_create_frame): Call x_set_offset to correctly interpret
2056 top_pos in geometry.
2057
2058 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
2059 (Fx_parse_geometry): If there is a space in string, call
2060 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2061
2062 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2063
2064 * search.c (scan_buffer): Use character positions in calls to
2065 region_cache_forward and region_cache_backward, not byte
2066 positions. (Bug#12196)
2067
2068 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2069 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2070
2071 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2072 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2073 emacs_blocked_malloc, now deleted.
2074
2075 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2076
2077 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2078 The workaround was for improving performance on Solaris 2.4, but
2079 is getting in the way now. Emacs will still work if someone is
2080 still running Solaris 2.4 in a museum somewhere; Sun dropped
2081 support for Solaris 2.4 in 2003.
2082 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2083 * process.c (create_process) [HAVE_WORKING_VFORK]:
2084 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2085 since Emacs no longer uses vfork on that platform.
2086
2087 2012-09-17 Glenn Morris <rgm@gnu.org>
2088
2089 * emacs.c: Use COPYRIGHT.
2090
2091 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 Remove configure's --without-sync-input option (Bug#12450).
2094 When auditing signal-handling in preparation for cleaning it up,
2095 I found that SYNC_INPUT has race conditions and would be a real
2096 pain to fix. Since it's an undocumented and deprecated
2097 configure-time option, now seems like a good time to remove it.
2098 Also see <http://bugs.gnu.org/11080#16>.
2099 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2100 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2101 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2102 (malloc_hysteresis):
2103 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2104 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2105 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2106 (dont_register_blocks, bytes_used_when_reconsidered)
2107 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2108 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2109 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2110 Remove. All uses removed.
2111 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2112 implementation, one that depends on whether the new macro
2113 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2114 is defined.
2115 * atimer.c (run_timers, handle_alarm_signal):
2116 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2117 (handle_async_input, process_pending_signals)
2118 (handle_input_available_signal, init_keyboard):
2119 * nsterm.m (ns_read_socket):
2120 * process.c (wait_reading_process_output):
2121 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2122 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2123 (emacs_write):
2124 * xterm.c (XTread_socket):
2125 Assume SYNC_INPUT.
2126 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2127 * eval.c (handling_signal): Remove. All uses removed.
2128 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2129 All uses replaced with the SYNC_INPUT version.
2130 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2131 Remove decls.
2132 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2133 Now static.
2134
2135 * font.c (Ffont_shape_gstring): Remove unused local.
2136
2137 2012-09-16 Glenn Morris <rgm@gnu.org>
2138
2139 * Makefile.in (clean): No longer run nextstep's clean.
2140
2141 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2142 (ns_frag): Remove.
2143 (ns-app): Move here from ns.mk, and simplify.
2144 (clean): Simplify nextstep entry.
2145 * ns.mk: Remove file.
2146
2147 2012-09-17 Kenichi Handa <handa@gnu.org>
2148
2149 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2150 not covert the last few charactes.
2151
2152 2012-09-16 Kenichi Handa <handa@gnu.org>
2153
2154 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2155 here, but just check the validity of glyphs in the glyph-string.
2156
2157 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2158
2159 * window.c (Fwindow_parameter, Fset_window_parameter):
2160 Accept any window as argument (Bug#12452).
2161
2162 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2163
2164 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2165 to ns_term_init to avoid memory leak.
2166
2167 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2168 explicit retain/release.
2169 (ns_term_init): Only allow one display. Initialize outerpool and
2170 ns_*_types.
2171
2172 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2173
2174 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2175 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2176 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2177 the Microsoft problem in a different way, by altering ../nt/config.nt.
2178
2179 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2180
2181 * w32xfns.c:
2182 * w32uniscribe.c:
2183 * w32term.c:
2184 * w32select.c:
2185 * w32reg.c:
2186 * w32proc.c:
2187 * w32menu.c:
2188 * w32inevt.c:
2189 * w32heap.c:
2190 * w32font.c:
2191 * w32fns.c:
2192 * w32console.c:
2193 * w32.c:
2194 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2195 by lisp.h. This completes removal of setjmp.h inclusion
2196 erroneously announced in the previous commit. (Bug#12446)
2197
2198 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2199 more accurate.
2200
2201 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2202 not defined as a macro. The latter happens on MS-Windows.
2203 (Bug#12446)
2204
2205 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2206
2207 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2208 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2209 Some instances of '#include <setjmp.h>' removed, if the
2210 only reason for the instance was because "lisp.h" was included.
2211 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2212 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2213 and _longjmp with the new symbols. Emacs already uses _setjmp if
2214 available, so this change affects only POSIXish hosts that have
2215 sigsetjmp but not _setjmp, such as some versions of Solaris and
2216 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2217 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2218 (png_load_body) [HAVE_PNG]:
2219 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2220 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2221 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2222 since PNG requires jmp_buf. This is the only exception to the
2223 general rule that we now use sys_setjmp and sys_longjmp.
2224 This exception is OK since this code does not change the signal
2225 mask or longjmp out of a signal handler.
2226
2227 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2228
2229 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2230 Include "syssignal.h", for 'main_thread'.
2231
2232 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2233
2234 Avoid out-of-range marker position (Bug#12426).
2235 * insdel.c (replace_range, replace_range_2):
2236 Adjust markers before overlays, as suggested by comments.
2237 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2238 Remove redundant check before calling offset_intervals.
2239
2240 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2241
2242 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2243 current buffer (Bug#12387).
2244
2245 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2246
2247 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2248
2249 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 Use a more backwards-compatible timer format (Bug#12430).
2252 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2253 vector element, not from the 4th, since PSECS is now at the end.
2254 (Fcurrent_idle_time): Doc fix.
2255
2256 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2257
2258 Function to mark objects and remove killed buffers at once.
2259 * alloc.c (discard_killed_buffers): Rename to ...
2260 (mark_discard_killed buffers) ... new name. Add marking
2261 of remaining objects. Fix comment. Adjust users.
2262 (mark_object): Do not touch frame buffer lists here.
2263 * frame.c (delete_frame): Reset frame buffer lists here.
2264
2265 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2266
2267 Better workaround for GNOME bug when --enable-gcc-warnings.
2268 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2269 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2270 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2271
2272 Simplify SIGIO usage (Bug#12408).
2273 The code that dealt with SIGIO was crufty and confusing, e.g., it
2274 played tricks like "#undef SIGIO" but these tricks were not used
2275 consistently. Simplify mostly by not #undeffing standard symbols,
2276 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2277 or not as we please) rather than "defined SIGIO" (standard symbol
2278 that we probably shouldn't #undef).
2279 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2280 Modules that need it can include it.
2281 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2282 * dispextern.h (ignore_sigio): New decl.
2283 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2284 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2285 * emacs.c (shut_down_emacs):
2286 * keyboard.c (kbd_buffer_store_event_hold):
2287 Use ignore_sigio rather than invoking 'signal' directly.
2288 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2289 for FIONREAD.
2290 (FIONREAD, SIGIO): Do not #undef.
2291 (tty_read_avail_input): Use #error rather than a syntax error.
2292 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2293 for I_PIPE, used by SETUP_SLAVE_PTY.
2294 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2295 * sysdep.c (croak): Remove; no longer needed. This bit of
2296 temporary code, with Fred N. Fish's comment that it's temporary,
2297 has been in Emacs since at least 1992!
2298 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2299 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2300 * syssignal.h (croak): Remove decl.
2301 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2302 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2303 now that we're termios-only.
2304 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2305 * term.c (dissociate_if_controlling_tty): Use #error rather than
2306 a run-time error.
2307
2308 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2309 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2310 to work around GNOME bug 683906.
2311 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2312 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2313 This works around GCC bug 54561.
2314
2315 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2316
2317 More fixes for 'volatile' and setjmp/longjmp.
2318 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2319 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2320 (png_load_body) [HAVE_PNG]:
2321 (jpeg_load_body) [HAVE_JPEG]:
2322 New function, with most of the old parent function's body.
2323 (png_load) [HAVE_PNG]:
2324 (jpeg_load) [HAVE_JPEG]:
2325 Invoke the new function, to avoid longjmp munging our locals.
2326 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2327 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2328 longjmp is passed 2, as the C standard doesn't guarantee this.
2329 Instead, store the failure code into mgr->failure_code.
2330
2331 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2332
2333 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2334 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2335 (syms_of_keyboard): Remove support for unread-command-char.
2336
2337 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2338
2339 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2340 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2341 violation. (Bug#12426)
2342
2343 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2344
2345 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2346
2347 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2348
2349 * eval.c: Add `inhibit-debugger'.
2350 (Qinhibit_debugger): New symbol.
2351 (call_debugger): Bind it instead of Qdebug_on_error.
2352 (maybe_call_debugger): Test Vinhibit_debugger.
2353 (syms_of_eval): Define inhibit-debugger.
2354 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2355 (syms_of_xdisp): Remove inhibit-debug-on-message.
2356
2357 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2358
2359 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2360 If a nonvolatile local variable is written before a _longjmp to
2361 the frame containing the variable, and is read after the _longjmp,
2362 the value read is indeterminate. Some local variables of type
2363 'struct handler' and 'struct catchtag' are used in this way, so
2364 mark each of their slots as volatile if the slot can be set before
2365 _longjmp and read afterwards.
2366 * lisp.h (struct handler): var and chosen_clause are now volatile.
2367 (struct catchtag): val, next, and pdlcount are now volatile.
2368
2369 * bidi.c (bidi_push_it, bidi_pop_it):
2370 * fns.c (copy_hash_table):
2371 * image.c (define_image_type):
2372 * keyboard.c (kbd_buffer_store_event_hold):
2373 * process.c (Fprocess_send_eof):
2374 * xfaces.c (x_create_gc) [HAVE_NS]:
2375 * xgselect.c (xg_select):
2376 Prefer assignment to memcpy when either will do.
2377
2378 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2379 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2380 time an item is removed. No need to mark this function 'inline';
2381 the compiler knows better than we do.
2382
2383 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2384
2385 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2386 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2387 to change_frame_size (Bug#12388).
2388 (windowDidResize:): Pass YES to updateFrameSize.
2389
2390 * nsterm.h: Add delay parameter to updateFrameSize.
2391
2392 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2393
2394 Discard killed buffers from deleted window and frame objects.
2395 This reduces an amount of references to killed buffers and
2396 helps GC to reclaim them faster.
2397 * alloc.c (discard_killed_buffers): New function.
2398 (mark_object): Use it for deleted windows and frames.
2399 (mark_object): If symbol's value is set up for a killed buffer
2400 or deleted frame, restore its global binding.
2401 * data.c (swap_in_global_binding): Add GC notice.
2402 (swap_in_symval_forwarding): Use convenient set_blv_where.
2403 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2404 * window.h: ... to here.
2405
2406 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2407
2408 Convenient macro to check whether the buffer is live.
2409 * buffer.h (BUFFER_LIVE_P): New macro.
2410 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2411 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2412
2413 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2414
2415 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2416 composition cases (Bug#12364).
2417
2418 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2419 overhang of succeeding glyphs overlapping box cursor.
2420
2421 * w32term.c (x_draw_glyph_string): Likewise.
2422
2423 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2424
2425 Simplify, document, and port floating-point (Bug#12381).
2426 The porting part of this patch fixes bugs on non-IEEE platforms
2427 with frexp, ldexp, logb.
2428 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2429 Now static.
2430 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2431 support, by removing commented-out code and briefly listing the
2432 C89 functions excluded. The commented-out stuff was confusing
2433 maintenance, e.g., we thought we needed cbrt but it was commented out.
2434 (logb): Remove decl; no longer needed.
2435 (isfinite): New macro, if not already supplied.
2436 (isnan): Don't replace any existing macro.
2437 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2438 are present on all C89 platforms.
2439 (Ffrexp): Do not special-case zero, as frexp does the right thing
2440 for that case.
2441 (Flogb): Do not use logb, as it doesn't have the desired meaning
2442 on hosts that use non-base-2 floating point. Instead, stick with
2443 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2444 frexp, to avoid getting an unspecified result.
2445
2446 * xdisp.c (Qinhibit_debug_on_message): Now static.
2447
2448 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2449
2450 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2451 NSBezierPath (Bug#12131).
2452
2453 2012-09-10 Chong Yidong <cyd@gnu.org>
2454
2455 * fns.c (Fdelq, Fdelete): Doc fix.
2456
2457 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2458
2459 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2460 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2461
2462 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2463
2464 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2465 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2466 Use it.
2467
2468 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2469
2470 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2471 left fringe if the window has a left margin. This avoids leaving
2472 traces of the cursor because its leftmost pixel is not drawn over.
2473
2474 * dispnew.c (update_window_line): When the left margin area of a
2475 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2476 that screen line. (Bug#12277)
2477
2478 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2479
2480 Assume C89 or later for math functions (Bug#12381).
2481 This simplifies the code, and makes it a bit smaller and faster,
2482 and (most important) makes it easier to clean up signal handling
2483 since we can stop worring about floating-point exceptions in
2484 library code. That was a problem before C89, but the problem
2485 went away many years ago on all practical Emacs targets.
2486 * data.c, image.c, lread.c, print.c:
2487 Don't include <math.h>; no longer needed.
2488 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2489 might be autoconfigured, as that never happens.
2490 * data.c (fmod):
2491 * doprnt.c (DBL_MAX_10_EXP):
2492 * print.c (DBL_DIG):
2493 Remove. C89 or later always defines these.
2494 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2495 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2496 (arith_error, domain_error, domain_error2):
2497 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2498 no longer needed -- we simply return what C returns. All uses removed.
2499 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2500 the wrapped code.
2501 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2502 Remove. All uses expanded, as these macros are no longer used
2503 more than once and are now more trouble than they're worth.
2504 (Ftan): Use tan, not sin / cos.
2505 (Flogb): Assume C89 frexp.
2506 (fmod_float): Assume C89 fmod.
2507 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2508 (init_floatfns): Remove. All uses removed.
2509
2510 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2511
2512 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2513 compositeToPoint for OSX < 10.6 (Bug#12390).
2514
2515 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2516
2517 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2518 This produces more-accurate results.
2519
2520 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2521
2522 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2523 changes (Bug#12088).
2524
2525 2012-09-08 Chong Yidong <cyd@gnu.org>
2526
2527 * syntax.c (Fstring_to_syntax): Doc fix.
2528
2529 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2530
2531 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2532 in the internal border.
2533 (x_set_window_size): Remove static variables and their usage.
2534 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2535 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2536 Remove fringe/internal border adjustment (Bug#11052).
2537 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2538 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2539 (ns_fix_rect_ibw): Remove.
2540 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2541 (ns_dumpglyphs_box_or_relief): Ditto.
2542 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2543 adjustment.
2544 (ns_dumpglyphs_image): Ditto.
2545 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2546 border adjustment.
2547 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2548 their usage. Add fringe_extended_p and its use as in other terms.
2549 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2550 scroll bar was removed.
2551 (updateFrameSize): New function.
2552 (windowDidResize): Move code to updateFrameSize and call it.
2553
2554 * nsterm.h (EmacsView): Add updateFrameSize.
2555
2556 2012-09-07 Chong Yidong <cyd@gnu.org>
2557
2558 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2559
2560 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2561
2562 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2563
2564 More signal-handler cleanup (Bug#12327).
2565 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2566 Problem introduced when merging patches. Noted by Eli Zaretskii in
2567 <http://bugs.gnu.org/12327#67>.
2568 * floatfns.c: Comment fix.
2569 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2570 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2571 and anyway the declaration is harmless even if SIGDANGER is not defined.
2572 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2573 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2574 source files not surprisingly expected syssignal.h to define, or
2575 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2576 Include <sys/ioctl.h>, for FIONREAD.
2577 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2578 This eliminates a problem whereby other files mysteriously had
2579 to include "syssignal.h" before including "systty.h" if they
2580 wanted to use "#ifdef SIGIO".
2581
2582 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2583
2584 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2585
2586 * w32.c (sigemptyset): Empty the set.
2587 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2588
2589 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2590
2591 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2592
2593 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2594 (mark_object): Likewise for frame objects.
2595
2596 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2597
2598 * syssignal.h (handle_on_main_thread): Always declare,
2599 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2600 This ports to platforms without HAVE_PTHREAD.
2601
2602 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 Signal-handler cleanup (Bug#12327).
2605 Emacs's signal handlers were written in the old 4.2BSD style with
2606 sigblock and sigmask and so forth, and this led to some
2607 inefficiencies and confusion. Rewrite these to use
2608 pthread_sigmask etc. without copying signal sets around. Also,
2609 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2610 'signal', and instead use functions that do not attempt to take
2611 over the system name space. This patch causes Emacs's text
2612 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2613 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2614 Do not include <signal.h> or "syssignal.h", as these
2615 modules do not use signals.
2616 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2617 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2618 Do not include <signal.h>, as "syssignal.h" does that for us now.
2619 * atimer.c (sigmask_atimers): New function.
2620 (block_atimers, unblock_atimers): New functions,
2621 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2622 All uses replaced.
2623 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2624 no longer needed here.
2625 * emacs.c (main): Inspect existing signal handler with sigaction,
2626 so that there's no need to block and unblock SIGHUP.
2627 * sysdep.c (struct save_signal): New member 'action', replacing
2628 old member 'handler'.
2629 (save_signal_handlers, restore_signal_handlers):
2630 Use sigaction instead of 'signal' to save and restore.
2631 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2632 New function. All users of 'signal' modified to use set_sighandler
2633 if they're writeonly, and to use sys_signal if they're read+write.
2634 (emacs_sigaction_init, forwarded_signal): New functions.
2635 (sys_signal): Remove. All uses replaced by calls to sigaction
2636 and emacs_sigaction_init, or by direct calls to 'signal'.
2637 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2638 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2639 all uses replaced by pthread_sigmask etc. calls.
2640 * syssignal.h: Include <signal.h>.
2641 (emacs_sigaction_init, forwarded_signal): New decls.
2642 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2643 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2644 (sigmask, sys_sigmask): Remove; no longer needed.
2645 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2646 (sigblock, sigunblock, sigfree):
2647 (sigsetmask) [!defined sigsetmask]:
2648 Remove. All uses replaced by pthread_sigmask.
2649 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2650 no longer need to be replaced, and its typical old uses
2651 are now done via emacs_sigaction_init and sigaction.
2652 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2653 (sys_sigdel): Remove; unused.
2654 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2655
2656 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2657
2658 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2659 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2660
2661 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2662
2663 Explicitly mark buffer_defaults and buffer_local_symbols.
2664 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2665 mark_local_symbols here.
2666 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2667 since special buffers aren't marked here any more.
2668 (allocate_buffer): Chain new buffer with all_buffers here...
2669 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2670 not here.
2671 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2672 (syms_of_buffer): Remove staticpro of the above.
2673 (init_buffer_once): Set names for buffer_defaults and
2674 buffer_local_symbols.
2675
2676 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 Use bool for booleans in font-related modules.
2679 * font.c (font_intern_prop, font_style_to_value)
2680 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2681 (generate_otf_features, font_check_otf_features, font_check_otf)
2682 (font_match_p, font_list_entities, font_at):
2683 * fontset.c (fontset_id_valid_p, reorder_font_vector
2684 (fontset_find_font, Fset_fontset_font)
2685 (face_suitable_for_char_p) [0]:
2686 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2687 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2688 (m17n_flt_initialized, ftfont_shape_by_flt):
2689 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2690 * nsfont.m (nsfont_draw):
2691 * w32font.c (w32font_draw):
2692 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2693 Use bool for booleans.
2694 * font.h: Adjust to above API changes.
2695 (struct font, struct font_driver, struct font_driver_list):
2696 Use bool for booleans.
2697 (struct font): Remove useless member encoding_type.
2698 All users removed.
2699 * fontset.c, xftfont.c: Omit unnecessary static decls.
2700
2701 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2702
2703 * alloc.c (mark_object): Revert window marking code
2704 since it's unsafe for the Fset_window_configuration.
2705
2706 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2707
2708 Fix race conditions with signal handlers and errno (Bug#12327).
2709 Be more systematic about preserving errno whenever a signal
2710 handler returns, even if it's not in the main thread. Do this by
2711 renaming signal handlers to distinguish between signal delivery
2712 and signal handling. All uses changed.
2713 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2714 * data.c (deliver_arith_signal): Rename from arith_error.
2715 * dispnew.c (deliver_window_change_signal): Rename from
2716 window_change_signal.
2717 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2718 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2719 * keyboard.c (deliver_input_available_signal): Rename from
2720 input_available_signal.
2721 (deliver_user_signal): Rename from handle_user_signal.
2722 (deliver_interrupt_signal): Rename from interrupt_signal.
2723 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2724 (deliver_child_signal): Rename from sigchld_handler.
2725 * atimer.c (handle_alarm_signal):
2726 * data.c (handle_arith_signal):
2727 * dispnew.c (handle_window_change_signal):
2728 * emacs.c (handle_fatal_signal, handle_danger_signal):
2729 * keyboard.c (handle_input_available_signal):
2730 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2731 * process.c (handle_pipe_signal, handle_child_signal):
2732 New functions, with the actual signal-handling code taken from the
2733 original respective signal handlers, sans the sporadic attempts to
2734 preserve errno, since that's now done by handle_on_main_thread.
2735 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2736 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2737 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2738 Move to sysdep.c.
2739 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2740 Move initialization of main_thread to sysdep.c's init_signals.
2741 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2742 our usage, and simplifies the mainline code.
2743 (record_child_status_change): New static function, as a helper
2744 for handle_child_signal, and with most of the old child handler's
2745 contents.
2746 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2747 (handle_child_signal): Use the above.
2748 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2749 Moved here from emacs.c.
2750 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2751 code moved here from emacs.c's main function.
2752 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2753 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2754 This lets callers save and restore errno properly.
2755
2756 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2757
2758 Remove redundant or unused things here and there.
2759 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2760 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2761 * editfns.c (Fcompare_buffer_substrings): Likewise.
2762 * frame.h (struct terminal, struct font_driver_list):
2763 Remove redundant declarations.
2764 * window.h (Qleft, Qright): Likewise.
2765
2766 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2767
2768 Do not mark objects from deleted buffers, windows and frames.
2769 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2770 (mark_object): Likewise for windows and frames.
2771
2772 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2773
2774 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2775 buffer_defaults and buffer_local_symbols as valid objects.
2776 Return special value to denote them.
2777
2778 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2779
2780 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2781 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2782 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2783 (file_name_absolute_p, Fsubstitute_in_file_name):
2784 (check_executable, check_writable, Ffile_accessible_directory_p)
2785 (Fset_file_selinux_context, Fdefault_file_modes)
2786 (Finsert_file_contents, choose_write_coding_system)
2787 (Fwrite_region, build_annotations, a_write, e_write)
2788 (Fdo_auto_save):
2789 * filelock.c (boot_time_initialized, get_boot_time)
2790 (get_boot_time_1, lock_file_1, within_one_second):
2791 * floatfns.c (in_float):
2792 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2793 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2794 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2795 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2796 * window.c (compare_window_configurations):
2797 Use bool for booleans.
2798 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2799 (Fdefault_file_modes): Now mode_t, not int, for modes.
2800 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2801 (internal_delete_file): Now returns void, not a (boolean) int,
2802 since nobody was looking at the return value.
2803 * lisp.h, window.h: Adjust to above API changes.
2804
2805 * xdisp.c (set_message): Simplify and reindent last change.
2806
2807 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2808
2809 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2810
2811 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2812
2813 * eval.c (call_debugger): Make the function non-static so that we
2814 can call it from set_message.
2815
2816 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2817 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2818
2819 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2820
2821 Give more-useful info on a fatal error (Bug#12328).
2822 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2823 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2824 of doing the work ourselves.
2825 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2826 do most of the work.
2827 (fatal_error_backtrace): New function, taken from the guts
2828 of the old fatal_error_signal, but with a new option to output
2829 a backtrace.
2830 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2831 info about the signal than just its number.
2832 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2833 * sysdep.c: Include <execinfo.h>
2834 (emacs_backtrace): New function, taken partly from the previous
2835 code of the 'die' function.
2836 (emacs_abort): Call fatal_error_backtrace rather than abort.
2837
2838 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2839
2840 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2841 eager (load-time) macro-expansion.
2842 * lisp.mk (lisp): Add macroexp.
2843
2844 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2845
2846 Simplify redefinition of 'abort' (Bug#12316).
2847 Do not try to redefine the 'abort' function. Instead, redo
2848 the code so that it calls 'emacs_abort' rather than 'abort'.
2849 This removes the need for the NO_ABORT configure-time macro
2850 and makes it easier to change the abort code to do a backtrace.
2851 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2852 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2853 Remove; sysdep.c's emacs_abort now takes its place.
2854 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2855 'abort' changed to use 'emacs_abort'.
2856 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2857 (abort) [!defined abort]: Rename to ...
2858 (emacs_abort): ... new name.
2859 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2860 the place of the old 'abort' in emacs.c.
2861 * w32.c, w32fns.c (abort): Do not #undef.
2862 * w32.c (emacs_abort): Rename from w32_abort.
2863
2864 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2865
2866 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2867 offsets[j].dv, since the y axis of the screen coordinates points
2868 down, while the y axis of the font definition coordinates points
2869 up. This fixes display of Arabic diacritics such as KASRA and
2870 KASRATAN. (Bug#11860)
2871
2872 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2873
2874 Be more systematic about _setjmp vs setjmp.
2875 * alloc.c (test_setjmp, mark_stack):
2876 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2877 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2878 (png_load, my_error_exit, jpeg_load):
2879 * process.c (send_process_trap, send_process):
2880 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2881 The underscored versions are up to 30x faster on some hosts.
2882 Formerly, the code used setjmp+longjmp sometimes and
2883 _setjmp+_longjmp at other times, with no particular reason to
2884 prefer setjmp+longjmp.
2885
2886 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2887
2888 Fix minor problem found by static checking.
2889 * buffer.c (Fdelete_all_overlays): Return nil.
2890
2891 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2892
2893 * buffer.c (Fdelete_all_overlays): New function.
2894
2895 2012-09-03 Chong Yidong <cyd@gnu.org>
2896
2897 * gtkutil.c: Add extern decl for Qxft.
2898
2899 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2900
2901 * emacs.c, eval.c: Use bool for boolean.
2902 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2903 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2904 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2905 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2906 (main, decode_env_path, Fdaemon_initialized):
2907 * eval.c (call_debugger, Finteractive_p, interactive_p):
2908 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2909 (maybe_call_debugger, Fbacktrace):
2910 * process.c (read_process_output, exec_sentinel):
2911 Use bool for booleans.
2912 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2913 All callers changed.
2914 * eval.c (interactive_p): Omit always-true boolean argument
2915 EXCLUDE_SUBRS_P. All callers changed.
2916 * dispextern.h, lisp.h: Reflect above API changes.
2917 * firstfile.c (dummy): Use the address of 'main', whose signature
2918 won't change, instead of the address of 'initialize', whose
2919 signature just changed from int to bool.
2920 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2921 * msdos.c (fatal_error_in_progress): ... from here.
2922 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2923 of incrementing it.
2924 (redisplay_internal, unwind_redisplay): Simply clear
2925 REDISPLAYING_P when unwinding, instead of saving its previous,
2926 always-false value and then restoring it.
2927
2928 Clean up some extern decls.
2929 Mostly, this hoists extern decls out of .c files and into .h files.
2930 That way, we're more likely to catch errors if the interfaces change.
2931 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2932 declare xg_mark_data.
2933 * dispextern.h (x_frame_parm_handlers):
2934 * font.h (Qxft):
2935 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2936 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2937 (Qultra_bold, Qoblique, Qitalic):
2938 Move extern decl here from .c file.
2939 * alloc.c (xg_mark_data) [USE_GTK]:
2940 * doc.c (Qclosure):
2941 * eval.c (Qlexical_binding):
2942 * fns.c (time) [!HAVE_UNISTD_H]:
2943 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2944 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2945 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2946 * lread.c (Qinternal_interpreter_environment):
2947 * minibuf.c (Qbuffer):
2948 * process.c (QCfamily, QCfilter):
2949 * widget.c (free_frame_faces):
2950 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2951 * xfont.c (x_clear_errors):
2952 * xterm.c (x_frame_parm_handlers):
2953 Remove now-redundant extern decls.
2954 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2955 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2956 Now static.
2957 * xfaces.c: Remove unnecessary static decls.
2958 * xterm.c (updating_frame): Remove decl of nonexistent object.
2959
2960 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2961 when building globals.h, as the objects that are not built on
2962 this host are not needed to compile C files on this host.
2963
2964 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2965
2966 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2967
2968 * frame.h: Add missing prototype for x_wm_set_size_hint.
2969
2970 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2971
2972 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2973 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2974 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2975 (Fsubstitute_command_keys):
2976 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2977 (save_excursion_save, save_excursion_restore)
2978 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2979 (format_time_string, general_insert_function)
2980 (make_buffer_string, make_buffer_string_both)
2981 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2982 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2983 (copy_text, insert_1, insert_1_both, insert_from_string)
2984 (insert_from_string_before_markers, insert_from_string_1)
2985 (insert_from_buffer, insert_from_buffer_1, replace_range)
2986 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2987 (del_range_2, modify_region):
2988 * intervals.c (intervals_equal, balance_possible_root_interval)
2989 (adjust_intervals_for_insertion, merge_properties_sticky)
2990 (graft_intervals_into_buffer, lookup_char_property)
2991 (adjust_for_invis_intang, set_point_both)
2992 (get_property_and_range, compare_string_intervals)
2993 (set_intervals_multibyte_1, set_intervals_multibyte):
2994 * keyboard.c (decode_timer):
2995 Use bool for boolean.
2996 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2997 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2998
2999 2012-09-02 Chong Yidong <cyd@gnu.org>
3000
3001 * keymap.c (push_key_description): Print M-TAB as C-M-i
3002 (Bug#11758).
3003
3004 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
3005
3006 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3007 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3008 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3009 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3010 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3011 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3012 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3013
3014 2012-09-01 Eli Zaretskii <eliz@gnu.org>
3015
3016 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3017 more than one grapheme cluster passed to the shaper: compute the
3018 offset adjustment values separately for each cluster. (Bug#11860)
3019
3020 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3021 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3022 about implicit conversions from integer to pointer.
3023
3024 2012-09-01 Daniel Colascione <dancol@dancol.org>
3025
3026 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3027 system used too early.
3028
3029 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3030
3031 Better seed support for (random).
3032 * emacs.c (main): Call init_random.
3033 * fns.c (Frandom): Set the seed from a string argument, if given.
3034 Remove long-obsolete Gentzel cruft.
3035 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3036 (init_random): New function.
3037
3038 2012-09-01 Daniel Colascione <dancol@dancol.org>
3039
3040 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3041 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3042 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3043 x_wm_set_size_hint, x_query_colors, x_real_positions,
3044 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3045 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3046 all of which have been moved to common code.
3047
3048 * xfaces.c: Include TERM_HEADER instead of listing all possible
3049 window-system headers.
3050
3051 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3052 to match header.
3053
3054 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3055 directly accessing frame internals.
3056
3057 * w32font.h: Include font.h. Define syms_of_w32font and
3058 globals_of_w32font.
3059
3060 * process.c: Include TERM_HEADER instead of listing all possible
3061 window-system headers.
3062
3063 * nsterm.h: Remove declarations now in frame.h.
3064 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3065
3066 * menu.c: Include TERM_HEADER instead of listing all possible
3067 window-system headers.
3068
3069 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3070 window system.
3071
3072 * keyboard.c: Include TERM_HEADER instead of listing all possible
3073 window-system headers.
3074
3075 * image.c: Include TERM_HEADER instead of listing all possible
3076 window-system headers. Declare Vlibrary_cache when compiling for
3077 Windows.
3078
3079 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3080 window system declarations.
3081
3082 * frame.h: Move common functions here: set_frame_menubar,
3083 x_set_window_size, x_sync, x_get_focus_frame,
3084 x_set_mouse_position, x_set_mouse_pixel_position,
3085 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3086 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3087 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3088 x_activate_menubar, x_real_positions, x_bitmap_icon,
3089 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3090 and x_query_colors.
3091
3092 * frame.c: Include TERM_HEADER instead of listing all possible
3093 window-system headers.
3094
3095 * font.c: Include TERM_HEADER instead of listing all possible
3096 window-system headers.
3097
3098 * emacs.c: Include TERM_HEADER.
3099
3100 * dispnew.c: Include TERM_HEADER instead of listing all possible
3101 window-system headers.
3102
3103 * ccl.h: Include character.h.
3104
3105 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3106 the current window system; include in list of objects to link into
3107 Emacs.
3108
3109 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3110
3111 Remove mark_ttys function and fix tty_display_info initialization.
3112 * lisp.h (mark_ttys): Remove prototype.
3113 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3114 to mark_ttys because all possible values of 'top_frame' slot are
3115 the frames which are reachable from Vframe_list.
3116 * term.c (mark_ttys): Remove.
3117 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3118
3119 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3120
3121 Change struct frame bitfields from unsigned char to unsigned.
3122 * frame.h (struct frame): Change type of 'display_preempted',
3123 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3124 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3125 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3126 bitfields from unsigned char to unsigned.
3127
3128 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3129
3130 Remove unused member of struct x_output and struct w32_output.
3131 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3132 * w32term.h (struct w32_output): Likewise.
3133
3134 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3135
3136 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3137 does not become zero (Bug#12234).
3138
3139 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3140
3141 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3142 for GCC 4.7.1 x86-64.
3143
3144 2012-08-30 Glenn Morris <rgm@gnu.org>
3145
3146 * lread.c (init_lread): For out-of-tree builds, only add the
3147 source directory's site-lisp dir to the load-path if it exists,
3148 consistent with in-tree builds. (Bug#12302)
3149
3150 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3151
3152 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3153 button_values to NULL. Call setStykeMask so dialogs get a close button.
3154 (windowShouldClose:): Set window_closed.
3155 (dealloc): New member, free button_values.
3156 (process_dialog:): Make member function. Remove window argument,
3157 replace window with self. Count buttons and allocate and store values
3158 in button_values.
3159 (addButton:value:row:): value is int with the name tag. Call setTag
3160 with tag. Remove return self, declare return value as void.
3161 (addString:row:): Remove return self, declare return value as void.
3162 (addSplit): Remove return self, declare return value as void.
3163 (clicked:): Remove return self, declare return value as void.
3164 Set dialog_return to button_values[seltag]. Code formatting change.
3165 (initFromContents:isQuestion:): Adjust call to process_dialog.
3166 Code formatting change.
3167 (timeout_handler:): Set timer_fired to YES.
3168 (runDialogAt:): Set timer_fired to NO.
3169 Handle click on close button as quit.
3170
3171 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3172 Add window_closed and button_values. Add void as return value for
3173 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3174 Add process_dialog as new member.
3175
3176 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3177
3178 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3179 is not one of the heaps we manage. (Bug#12242)
3180
3181 2012-08-28 Glenn Morris <rgm@gnu.org>
3182
3183 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3184
3185 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3186
3187 * window.c (Fset_window_configuration): Remove handling of
3188 auto-buffer-name window parameter. Install revision of reverted
3189 fix.
3190
3191 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3192
3193 Do not allow to set major mode for a dead buffer.
3194 * buffer.c (Fset_buffer_major_mode): Signal an error
3195 if the buffer is dead.
3196 (Fother_buffer, other_buffer_safely): Remove redundant
3197 nested declaration.
3198
3199 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3200
3201 Always use set_buffer_if_live to restore original buffer at unwind.
3202 * buffer.h (record_unwind_current_buffer): New function.
3203 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3204 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3205 * undo.c, window.c: Adjust users.
3206 * buffer.c (set_buffer_if_live): Fix comment.
3207
3208 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3209
3210 Fix usage of set_buffer_internal.
3211 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3212 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3213 * coding.c (decode_coding): Omit redundant test.
3214 * fileio.c (decide_coding_unwind): Likewise.
3215 * fns.c (secure_hash): Likewise.
3216 * insdel.c (modify_region): Likewise.
3217 * keyboard.c (command_loop_1): Likewise.
3218 * print.c (PRINTFINISH): Likewise.
3219 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3220
3221 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3222
3223 * dispnew.c: Use bool for boolean.
3224 (frame_garbaged, display_completed, delayed_size_change)
3225 (fonts_changed_p, add_window_display_history)
3226 (add_frame_display_history, verify_row_hash)
3227 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3228 (row_equal_p, realloc_glyph_pool)
3229 (allocate_matrices_for_frame_redisplay)
3230 (showing_window_margins_p)
3231 (adjust_frame_glyphs_for_frame_redisplay)
3232 (build_frame_matrix_from_leaf_window, make_current)
3233 (mirrored_line_dance, mirror_line_dance, update_frame)
3234 (update_window_tree, update_single_window)
3235 (check_current_matrix_flags, update_window, update_text_area)
3236 (update_window_line, set_window_update_flags, scrolling_window)
3237 (update_frame_1, scrolling, buffer_posn_from_coords)
3238 (do_pending_window_change, change_frame_size)
3239 (change_frame_size_1, sit_for):
3240 Use bool for boolean.
3241 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3242 and remove last int (actually boolean) argument, which was always 0.
3243 All callers changed.
3244 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3245 * dispextern.h (struct composition_it): Use bool for boolean.
3246 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3247 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3248 * dired.c (file_name_completion):
3249 Use bool for boolean. (This was missed in an earlier change.)
3250
3251 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3252
3253 * window.c (Fset_window_configuration): Revert first part of
3254 last change.
3255
3256 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3257
3258 * nsterm.h (NSPanel): New class variable dialog_return.
3259
3260 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3261 Initialize dialog_return.
3262 (windowShouldClose:): Use stop instead of stopModalWithCode.
3263 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3264 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3265 event.
3266 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3267 modal loop returns.
3268
3269 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3270
3271 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3272 * composite.c (find_composition, composition_gstring_p)
3273 (composition_reseat_it, find_automatic_composition):
3274 * data.c (let_shadows_buffer_binding_p)
3275 (let_shadows_global_binding_p, set_internal, make_blv)
3276 (Fmake_variable_buffer_local, Fmake_local_variable)
3277 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3278 (cons_to_signed, arith_driver):
3279 * dbusbind.c (xd_in_read_queued_messages):
3280 * dired.c (directory_files_internal, file_name_completion):
3281 Use bool for booleans.
3282 * dired.c (file_name_completion):
3283 * process.h (fd_callback):
3284 Omit int (actually boolean) argument. It wasn't being used.
3285 All uses changed.
3286 * composite.h, lisp.h: Reflect above API changes.
3287
3288 * cmds.c, coding.c: Use bool for booleans.
3289 * cmds.c (move_point, Fself_insert_command):
3290 * coding.h (struct composition status, struct coding_system):
3291 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3292 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3293 (emacs_mule_char, decode_coding_emacs_mule)
3294 (encode_coding_emacs_mule, detect_coding_iso_2022)
3295 (decode_coding_iso_2022, encode_invocation_designation)
3296 (encode_designation_at_bol, encode_coding_iso_2022)
3297 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3298 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3299 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3300 (encode_coding_raw_text, detect_coding_charset)
3301 (decode_coding_charset, encode_coding_charset, detect_eol)
3302 (detect_coding, get_translation_table, produce_chars)
3303 (consume_chars, reused_workbuf_in_use)
3304 (make_conversion_work_buffer, code_conversion_save)
3305 (decode_coding_object, encode_coding_object)
3306 (detect_coding_system, char_encodable_p)
3307 (Funencodable_char_position, code_convert_region)
3308 (code_convert_string, code_convert_string_norecord)
3309 (Fset_coding_system_priority):
3310 * fileio.c (Finsert_file_contents):
3311 Use bool for booleans.
3312 * coding.h, lisp.h: Reflect above API changes.
3313 * coding.c: Remove unnecessary static function decls.
3314 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3315 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3316 not a boolean 'int', since callers never look at the return value.
3317 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3318 * coding.h (decoding_buffer_size, encoding_buffer_size)
3319 (emacs_mule_string_char): Remove unused extern decls.
3320 (struct iso_2022_spec, struct coding_system):
3321 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3322 (struct emacs_mule_spec): Remove unused field 'full_support'.
3323 All initializations removed.
3324 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3325
3326 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3327
3328 Fix spare memory change (Bug#12286).
3329 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3330 (valid_lisp_object_p): Likewise.
3331
3332 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3333
3334 * window.c (Fset_window_configuration): Record any window's old
3335 buffer if it's replaced (see Bug#8789). If the new current
3336 buffer doesn't appear in the selected window, go to its old
3337 point (Bug#12208).
3338
3339 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3340
3341 Special MEM_TYPE_SPARE to denote reserved memory.
3342 * alloc.c (enum mem_type): New memory type.
3343 (refill_memory_reserve): Use new type for spare memory.
3344 This prevents live_cons_p and live_string_p from incorrect
3345 detection of uninitialized objects from spare memory as live.
3346
3347 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3348
3349 Spelling fixes.
3350 * Makefile.in (.PHONY): versioclean -> versionclean.
3351
3352 Remove unused external symbols.
3353 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3354 * window.c (Qwindow_valid_p, decode_valid_window):
3355 Now static, not extern.
3356 * data.c (Qinterval): Remove; unused.
3357 (syms_of_data): Do not define 'interval'.
3358 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3359 * window.h (decode_valid_window):
3360 Remove decls.
3361
3362 * character.c, charset.c, chartab.c: Use bool for booleans.
3363 * character.c (lisp_string_width, string_count_byte8)
3364 (string_escape_byte8):
3365 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3366 (load_charset_map_from_file, map_charset_chars)
3367 (Fdefine_charset_internal, define_charset_internal)
3368 (Fdeclare_equiv_charset, find_charsets_in_text)
3369 (Ffind_charset_region, char_charset, Fiso_charset):
3370 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3371 (sub_char_table_set, sub_char_table_set_range)
3372 (char_table_set_range, optimize_sub_char_table)
3373 (map_sub_char_table):
3374 Use bool for boolean.
3375 * character.c (str_to_unibyte): Omit last boolean argument; it was
3376 always 0. All callers changed.
3377 * character.h, charset.h: Adjust to match previous changes.
3378 * character.h (char_printable_p): Remove decl of nonexistent function.
3379 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3380 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3381 are all boolean, so make them single-bit bitfields.
3382
3383 * lisp.h (ASET): Remove attempt to detect side effects.
3384 It was meant to be temporary and it often doesn't work,
3385 because when IDX has side effects the behavior of IDX==IDX
3386 is undefined. See Stefan Monnier in
3387 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3388
3389 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3390
3391 * lisp.h (functionp): New function (extracted from Ffunctionp).
3392 (FUNCTIONP): Use it.
3393 * eval.c (Ffunctionp): Use it.
3394
3395 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3396
3397 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3398 as that's faster and simpler than static storage. Don't bother
3399 with the g_main_context_query overhead if g_main_context_pending
3400 says no events are pending.
3401 (gfds, gfds_size): Remove these static vars.
3402 (xgselect_initialize): Remove; no longer needed.
3403 All uses and decls removed.
3404
3405 * emacs.c (fatal_error_signal_hook): Remove.
3406 All uses removed. This leftover from old code was always 0.
3407
3408 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3409 * casefiddle.c (casify_object, casify_region):
3410 * casetab.c (set_case_table):
3411 * category.c, category.h (word_boundary_p):
3412 * category.h (CHAR_HAS_CATEGORY):
3413 Use bool for booleans, instead of int.
3414
3415 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3416
3417 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3418
3419 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3420
3421 On assertion failure, print backtrace if available.
3422 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3423 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3424 * Makefile.in (LIB_EXECINFO): New macro.
3425 (LIBES): Use it.
3426
3427 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3428 * bytecode.c (exec_byte_code):
3429 * callint.c (check_mark, Fcall_interactively):
3430 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3431 (getenv_internal, sync_process_alive, call_process_exited):
3432 * lisp.h (USE_SAFE_ALLOCA):
3433 Use bool for booleans, instead of int.
3434 * lisp.h, process.h: Adjust prototypes to match above changes.
3435 * callint.c (Fcall_interactively): Don't assume the mark's
3436 offset fits in 'int'.
3437
3438 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3439
3440 * buffer.c, buffer.h: Use bool for boolean.
3441 * buffer.c (reset_buffer_local_variables)
3442 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3443 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3444 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3445 (overlay_touches_p, overlay_strings, Foverlay_put)
3446 (report_overlay_modification, call_overlay_mod_hooks):
3447 (mmap_enlarge, mmap_set_vars):
3448 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3449 Use bool for booleans, instead of int.
3450 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3451 since the 1-or-0 return value is always ignored anyway.
3452 (mmap_initialized_p):
3453 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3454 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3455
3456 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3457
3458 * bidi.c: Use bool for boolean.
3459 This is a bit more readable, and makes the text segment of bidi.o
3460 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3461 Presumably it's faster too.
3462 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3463 Now bool.
3464 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3465 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3466 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3467 (bidi_explicit_dir_char, bidi_level_of_next_char)
3468 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3469 Use bool for booleans, instead of int.
3470 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3471 (bidi_unshelve_cache): Adjust decls to match code.
3472
3473 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3474
3475 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3476 argument.
3477
3478 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3481 * atimer.h: Include <stdbool.h>.
3482
3483 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3484
3485 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3486 compile time tests instead of run time tests on systems that do
3487 not use them.
3488 (FRAME_MAC_P): Remove leftover from deleted code.
3489 * frame.c (syms_of_frame): Remove leftover from deleted code.
3490
3491 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3492
3493 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3494
3495 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3496
3497 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3498 Otherwise, the compiler complains about (A?B:C) where B is void
3499 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3500 (fontset_add): Return void, for FONTSET_ADD.
3501
3502 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3503
3504 * alloc.c: Use bool for booleans.
3505 (gc_in_progress, abort_on_gc)
3506 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3507 (dont_register_blocks) [GC_MALLOC_CHECK]:
3508 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3509 (check_string_bytes, make_specified_string, memory_full)
3510 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3511 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3512 (mark_stack, valid_pointer_p, make_pure_string)
3513 (Fgarbage_collect, survives_gc_p, gc_sweep):
3514 Use bool for booleans, instead of int.
3515 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3516 Remove unused local.
3517 * alloc.c (PURE_POINTER_P):
3518 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3519 * editfns.c (Fformat):
3520 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3521 (Fdo_auto_save):
3522 * fns.c (sweep_weak_table):
3523 * lisp.h (suppress_checking, push_message, survives_gc_p)
3524 (make_pure_string, gc_in_progress, abort_on_gc):
3525 * lread.c (readchar, read1):
3526 * print.c (Fprin1_to_string):
3527 * xdisp.c (push_message):
3528 Use bool for booleans affected directly or indirectly by
3529 alloc.c's changes.
3530
3531 Make recently-introduced setters macros.
3532 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3533 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3534 (set_fontset_default, set_fontset_fallback): Rename from their
3535 upper-case counterparts, and make them functions rather than macros.
3536 This is more consistent with the other recently-introduced setters.
3537 These don't need to be inline, since they're local.
3538
3539 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3540
3541 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3542 the loop (Bug#12247).
3543
3544 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3545
3546 * lisp.h (vcopy): Use memcpy rather than our own loop.
3547 This fixes a performance regression introduced by the recent
3548 addition of vcopy. This means 'vcopy' will need to be modified
3549 for a copying collector, but that's OK. Also, tighten the
3550 checking in the assertion.
3551
3552 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3553
3554 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3555 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3556 non-base glyph for the width of the base character, according to
3557 what x_draw_composite_glyph_string_foreground expects.
3558 Generate WADJUST value according to composition_gstring_width's
3559 expectations, to produce correct width of the composed character.
3560 Reverse the sign of the DU offset produced by ScriptPlace.
3561
3562 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3563
3564 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3565
3566 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3567
3568 Avoid direct writes to contents member of struct Lisp_Vector.
3569 * lisp.h (vcopy): New function to copy data into vector.
3570 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3571 * fns.c (Ffillarray): Use ASET.
3572 * keyboard.c (timer_check_2): Use AREF and ASET.
3573 (append_tool_bar_item, Frecent_keys): Use vcopy.
3574 * lread.c (read_vector): Use ASET.
3575 * msdos.c (Frecent_doskeys): Use vcopy.
3576 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3577 (Finternal_merge_in_global_face): Use ASET and vcopy.
3578 * xfont.c (xfont_list_pattern): Likewise.
3579
3580 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3581
3582 * window.c (Fwindow_point): For the selected window always return
3583 the position of its buffer's point.
3584 (Fset_window_point): For the selected window always go in its
3585 buffer to the specified position.
3586
3587 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3588
3589 Setter macros for fontsets.
3590 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3591 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3592 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3593 Adjust users.
3594
3595 2012-08-20 Glenn Morris <rgm@gnu.org>
3596
3597 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3598 Don't assume that `ln -f' works.
3599
3600 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3601
3602 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3603 and later about non-assignments with no effect. See discussion at
3604 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3605 details.
3606
3607 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3608
3609 Inline setter functions for Lisp_Objects slots of struct specbinding.
3610 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3611 Adjust users.
3612
3613 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3614
3615 * window.c (select_window): Always make selected window's buffer
3616 current.
3617
3618 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3619
3620 Use AREF and ASET for docstrings of category tables.
3621 * category.h (CATEGORY_DOCSTRING): Use AREF.
3622 (SET_CATEGORY_DOCSTRING): Use ASET.
3623 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3624
3625 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3626
3627 Inline setter functions for hash table members.
3628 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3629 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3630 (set_hash_key_and_value, set_hash_index, set_hash_next)
3631 (set_hash_hash): New functions.
3632 * charset.c, fns.c: Adjust users.
3633
3634 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3635
3636 Inline getter and setter functions for per-buffer values.
3637 * buffer.h (per_buffer_default, set_per_buffer_default)
3638 (per_buffer_value, set_per_buffer_value): New functions.
3639 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3640 * buffer.c, data.c: Adjust users.
3641
3642 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3643
3644 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3645
3646 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3647
3648 Rely on <config.h> + <unistd.h> to declare 'environ',
3649 as gnulib does this if the system doesn't.
3650 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3651 Remove declaration. MS-Windows declares it on stdlib.h which is
3652 included by conf_post.h.
3653 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3654 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3655 * vm-limit.c: Include <unistd.h>, for 'environ'.
3656
3657 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3658 (start_of_data): Remove decl; mem-limits.h provides it.
3659
3660 * xdisp.c (handle_invisible_prop): Make it a bit faster
3661 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3662
3663 2012-08-19 Chong Yidong <cyd@gnu.org>
3664
3665 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3666 ends (Bug#3874).
3667
3668 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3669
3670 * .gdbinit: Use call instead of set when calling a function in the
3671 inferior.
3672
3673 * data.c (set_internal): Don't use set_blv_found.
3674 (Fkill_local_variable): Likewise.
3675
3676 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3677
3678 * nsfont.m (ns_ascii_average_width): Ensure the string
3679 ascii_printable is initialized with a null-terminated character
3680 array. Otherwise, it can contain undesired extra characters.
3681
3682 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3683
3684 port new setting code to Sun C 5.8 2005/10/13
3685 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3686 Return void, not Lisp_Object. Otherwise, the compiler
3687 complains about (A?B:C) where B is void and C is Lisp_Object
3688 when compiling CHAR_TABLE_SET, due to the recent change to
3689 the API of sub_char_table_set_contents.
3690
3691 2012-08-18 Chong Yidong <cyd@gnu.org>
3692
3693 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3694 for the string case (Bug#3874).
3695
3696 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3697
3698 * buffer.h (BSET): Remove (Bug#12215).
3699 Replace all uses with calls to new setter functions.
3700 (bset_bidi_paragraph_direction, bset_case_canon_table)
3701 (bset_case_eqv_table, bset_directory, bset_display_count)
3702 (bset_display_time, bset_downcase_table)
3703 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3704 (bset_last_selected_window, bset_local_var_alist)
3705 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3706 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3707 (bset_width_table):
3708 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3709 (bset_auto_fill_function, bset_auto_save_file_format)
3710 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3711 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3712 (bset_cache_long_line_scans, bset_case_fold_search)
3713 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3714 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3715 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3716 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3717 (bset_header_line_format, bset_indicate_buffer_boundaries)
3718 (bset_indicate_empty_lines, bset_invisibility_spec)
3719 (bset_left_fringe_width, bset_major_mode, bset_mark)
3720 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3721 (bset_name, bset_overwrite_mode, bset_pt_marker)
3722 (bset_right_fringe_width, bset_save_length)
3723 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3724 (bset_scroll_up_aggressively, bset_selective_display)
3725 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3726 (bset_word_wrap, bset_zv_marker):
3727 * category.c (bset_category_table):
3728 * syntax.c (bset_syntax_table):
3729 New setter functions.
3730
3731 * process.h (PSET): Remove (Bug#12215).
3732 Replace all uses with calls to new setter functions.
3733 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3734 (PROCESS_INLINE): New macro.
3735 (pset_childp): New setter function.
3736 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3737 * process.c (PROCESS_INLINE):
3738 Define to EXTERN_INLINE, so that the corresponding functions
3739 are compiled into code.
3740 (pset_buffer, pset_command, pset_decode_coding_system)
3741 (pset_decoding_buf, pset_encode_coding_system)
3742 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3743 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3744 (pset_type, pset_write_queue): New setter functions.
3745
3746 * window.h (WSET): Remove (Bug#12215).
3747 Replace all uses with calls to new setter functions.
3748 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3749 (WINDOW_INLINE): New macro.
3750 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3751 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3752 (wset_total_lines, wset_vertical_scroll_bar)
3753 (wset_window_end_pos, wset_window_end_valid)
3754 (wset_window_end_vpos): New setter functions.
3755 * window.c (WINDOW_INLINE):
3756 Define to EXTERN_INLINE, so that the corresponding functions
3757 are compiled into code.
3758 (wset_combination_limit, wset_dedicated, wset_display_table)
3759 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3760 (wset_new_normal, wset_new_total, wset_next_buffers)
3761 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3762 (wset_prev_buffers, wset_right_fringe_width)
3763 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3764 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3765 (wset_window_parameters):
3766 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3767 (wset_column_number_displayed, wset_region_showing):
3768 New setter functions.
3769
3770 * termhooks.h (TSET): Remove (Bug#12215).
3771 Replace all uses with calls to new setter functions.
3772 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3773 (TERMHOOKS_INLINE): New macro.
3774 (tset_charset_list, tset_selection_alist): New setter functions.
3775 * terminal.c (TERMHOOKS_INLINE):
3776 Define to EXTERN_INLINE, so that the corresponding functions
3777 are compiled into code.
3778 (tset_param_alist): New setter function.
3779
3780 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3781
3782 * keyboard.h (KSET): Remove (Bug#12215).
3783 Replace all uses with calls to new setter functions.
3784 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3785 (KEYBOARD_INLINE): New macro.
3786 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3787 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3788 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3789 New setter functions.
3790 * keyboard.c (KEYBOARD_INLINE):
3791 Define to EXTERN_INLINE, so that the corresponding functions
3792 are compiled into code.
3793 (kset_echo_string, kset_kbd_queue)
3794 (kset_keyboard_translate_table, kset_last_prefix_arg)
3795 (kset_last_repeatable_command, kset_local_function_key_map)
3796 (kset_overriding_terminal_local_map, kset_real_last_command)
3797 (kset_system_key_syms): New setter functions.
3798
3799 * frame.h (FSET): Remove (Bug#12215).
3800 Replace all uses with calls to new setter functions.
3801 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3802 (FRAME_INLINE): New macro.
3803 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3804 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3805 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3806 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3807 (fset_param_alist, fset_root_window, fset_scroll_bars)
3808 (fset_selected_window, fset_title, fset_tool_bar_items)
3809 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3810 * frame.c (FRAME_INLINE):
3811 Define to EXTERN_INLINE, so that the corresponding functions
3812 are compiled into code.
3813 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3814
3815 A few more naming-convention fixes for getters and setters.
3816 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3817 and rename from buffer_overlays_set_before.
3818 (set_buffer_overlays_after): Move here from buffer.h, and rename
3819 from buffer_overlays_set_after.
3820 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3821 All uses changed.
3822 (set_buffer_intervals): Rename from buffer_set_intervals.
3823 * intervals.c (set_interval_object): Move here from intervals.h,
3824 and rename from interval_set_object.
3825 (set_interval_left): Move here from intervals.h, and rename from
3826 interval_set_left.
3827 (set_interval_right): Move here from intervals.h, and rename from
3828 interval_set_right.
3829 (copy_interval_parent): Move here from intervals.h, and rename from
3830 interval_copy_parent.
3831 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3832 (set_interval_plist): Rename from interval_set_plist.
3833 Return void, not Lisp_Object, since no caller uses the result.
3834 * lisp.h (string_intervals): Rename from string_get_intervals.
3835 (set_string_intervals): Rename from string_set_intervals.
3836
3837 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3838 (set_char_table_contents): Rename from char_table_set_contents.
3839 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3840 All uses changed. See the end of
3841 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3842
3843 * lisp.h (CSET): Remove (Bug#12215).
3844 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3845 (set_char_table_purpose): New functions,
3846 replacing CSET. All uses changed. For example, replace
3847 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3848 "set_char_table_parent (char_table, parent);".
3849 The old version was confusing because it used the same name
3850 'parent' for two different things.
3851
3852 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3853
3854 Functions to get and set Lisp_Object fields of buffer-local variables.
3855 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3856 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3857 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3858 * data.c, eval.c, frame.c: Adjust users.
3859
3860 2012-08-17 Chong Yidong <cyd@gnu.org>
3861
3862 * xfaces.c (merge_face_vectors): If the target font specfies a
3863 font spec, make the font's attributes take precedence over
3864 directly-specified attributes.
3865 (merge_face_ref): Recognize :font.
3866
3867 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3868
3869 Do not use memcpy for copying intervals.
3870 * intervals.c (reproduce_interval): New function.
3871 (reproduce_tree, reproduce_tree_obj): Use it.
3872 (reproduce_tree_obj): Remove prototype.
3873
3874 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 * lisp.h (duration_to_sec_usec): Remove unused decl.
3877
3878 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3879
3880 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3881 to an allocated instance of NSString, not to the class itself.
3882
3883 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3884
3885 * makefile.w32-in (C_CTYPE_H): New macro.
3886 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3887 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3888 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3889
3890 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3891
3892 Use ASCII tests for character types.
3893 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3894 * xfns.c, xterm.c:
3895 Don't include <ctype.h>; was not needed.
3896 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3897 * sysdep.c, xfaces.c:
3898 Include <c-ctype.h> instead of <ctype.h>.
3899 * nsterm.m: Include <c-ctype.h>.
3900 * charset.c (read_hex):
3901 * doc.c (Fsnarf_documentation):
3902 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3903 (DRIVE_LETTER) [DOS_NT]:
3904 (Ffile_name_directory, Fexpand_file_name)
3905 (Fsubstitute_in_file_name):
3906 * font.c (font_parse_xlfd, font_parse_fcname):
3907 * frame.c (x_set_font_backend):
3908 * gtkutil.c (xg_get_font):
3909 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3910 * nsimage.m (hexchar):
3911 * nsterm.m (ns_xlfd_to_fontname):
3912 * sysdep.c (system_process_attributes):
3913 * xfaces.c (hash_string_case_insensitive):
3914 Use C-locale tests instead of locale-specific tests for character
3915 types, since we want the ASCII interpretation here, not the
3916 interpretation suitable for whatever happens to be the current locale.
3917
3918 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3919
3920 Consistently check windows for validity/liveness
3921 (Bug#11984, Bug#12025, Bug#12026).
3922 * lisp.h (CHECK_VALID_WINDOW): New macro.
3923 * window.c (decode_window): Rename to decode_live_window.
3924 (decode_valid_window, Fwindow_valid_p): New functions.
3925 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3926 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3927 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3928 (Fwindow_prev_sibling, Fwindow_combination_limit)
3929 (Fset_window_combination_limit, Fwindow_use_time)
3930 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3931 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3932 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3933 (Fwindow_hscroll, Fset_window_hscroll)
3934 (Fwindow_redisplay_end_trigger)
3935 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3936 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3937 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3938 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3939 (Fwindow_end, Fset_window_point, Fset_window_start)
3940 (Fpos_visible_in_window_p, Fwindow_line_height)
3941 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3942 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3943 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3944 (Fset_window_parameter, Fwindow_display_table)
3945 (Fset_window_display_table, Fdelete_other_windows_internal)
3946 (Fset_window_buffer, Fset_window_new_total)
3947 (Fset_window_new_normal, Fdelete_window_internal)
3948 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3949 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3950 (Fwindow_scroll_bars): Check whether argument window is a valid or
3951 live window. Update doc-strings.
3952 (syms_of_window): New symbol Qwindow_valid_p.
3953 * keyboard.c (Fposn_at_x_y): Check whether argument
3954 frame_or_window denotes a valid window.
3955
3956 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3957
3958 Fix previous char table change.
3959 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3960 * chartab.c (optimize_sub_char_table): Likewise.
3961
3962 2012-08-16 Chong Yidong <cyd@gnu.org>
3963
3964 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3965
3966 * xfont.c (xfont_open):
3967 * xftfont.c (xftfont_open): Set the font's max_width field.
3968
3969 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3970 min_width to space_width and average_width to the average over
3971 printable ASCII characters.
3972 (ns_char_width): Code cleanup.
3973 (ns_ascii_average_width): New utility function.
3974
3975 * font.h (struct font): Update comments.
3976
3977 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3978
3979 Simple interface to set Lisp_Object fields of character tables.
3980 * lisp.h (CSET): New macro.
3981 (char_table_set_extras, char_table_set_contents)
3982 (sub_char_table_set_contents): New function.
3983 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3984 * syntax.c: Adjust users.
3985
3986 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3987
3988 * eval.c (eval_sub): Bind lexical-binding.
3989 * lread.c (Qlexical_binding): Make non-static.
3990
3991 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3992
3993 * nsmenu.m (popupSession): Remove.
3994 (pop_down_menu): Remove endModalSession.
3995 (timeout_handler:): New method.
3996 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3997 Call runModalForWindow. Check timer_fired when it returns.
3998 If not set, cancel timer and break out of loop.
3999 Otherwise loop again, with a new timeout.
4000
4001 * nsterm.m: Include fcntl.h if present.
4002 (fd_entry, t_readfds, inNsSelect): Remove.
4003 (select_writefds, select_valid, select_timeout, selfds)
4004 (select_mutex, apploopnr): Add.
4005 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4006 Otherwise call kbd_buffer_store_event.
4007 (ns_send_appdefined): Remove release of fd_entry.
4008 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4009 Increment and decrement apploopnr.
4010 (ns_select): If no file descriptors, just do a NSTimer.
4011 Otherwise copy read/write masks and start select thread (fd_handler).
4012 Start main loop and wait for application defined event.
4013 Inform select thread to stop selecting after main loop is exited.
4014 (ns_term_init): Create selfds pipe and set non-blocking.
4015 Initialize select_mutex. Start the select thread (fd_handler).
4016 (fd_handler:): Loop forever, wait for info from the main thread
4017 to either start or stop selecting. When select returns, send
4018 and appdefined event.
4019 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4020 If not call kbd_buffer_store_event.
4021
4022 * nsterm.h (EmacsApp): fd_handler takes id argument.
4023 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4024
4025 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4026
4027 2012-08-15 Eli Zaretskii <eliz@gnu.org>
4028
4029 * region-cache.c (move_cache_gap): Update gap_len using the actual
4030 growth of the boundaries array. Do not change cache_len.
4031 (Bug#12196)
4032
4033 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4034
4035 Generalize and cleanup font subsystem checks.
4036 * font.h (FONT_DEBUG, font_assert): Remove.
4037 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4038 Change font_assert to eassert. Use eassert where appropriate.
4039
4040 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4041
4042 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4043
4044 2012-08-15 Chong Yidong <cyd@gnu.org>
4045
4046 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4047 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4048 extract the font descriptor instead of just the font name.
4049 In that case, return a font spec instead of a string.
4050 (x_last_font_name): Move to this file from xfns.c.
4051
4052 * xfns.c (Fx_select_font): The return value can also be a font
4053 spec. Move x_last_font_name management to gtkutil.c.
4054
4055 * xfaces.c: Make font weight and style symbols non-static.
4056
4057 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4058
4059 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4060 (bug#12117).
4061
4062 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4063
4064 * alloc.c (Fgarbage_collect): Use plural form consistently.
4065
4066 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4067
4068 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4069 iteration through the command loop. Fixes a problem whereby mouse
4070 movements are ignored until the first mouse click.
4071
4072 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 Use bool, not int, for Lisp booleans.
4075 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4076 makes Emacs a bit smaller and presumably a bit faster.
4077 * lisp.h: Include <stdbool.h>.
4078 (struct Lisp_Boolfwd, defvar_bool):
4079 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4080 * regex.c [!emacs]: Include <stdbool.h>.
4081 (false, true): Remove; <stdbool.h> does this for us now.
4082
4083 2012-08-14 Chong Yidong <cyd@gnu.org>
4084
4085 * character.c (Fcharacterp): Doc fix (Bug#12076).
4086
4087 * data.c (Findirect_variable): Doc fix (Bug#11040).
4088
4089 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4090
4091 * editfns.c (Fformat): Doc fix (Bug#12059).
4092 (Fsave_current_buffer): Doc fix (Bug#11542).
4093
4094 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4095
4096 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4097 (bug#12022).
4098
4099 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4100
4101 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4102 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4103 * minibuf.c (choose_minibuf_frame, read_minibuf):
4104 * w32fns.c (x_create_tip_frame):
4105 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4106 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4107
4108 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4109
4110 * intervals.c (offset_intervals): Remove obsolete comment.
4111
4112 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4113
4114 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4115
4116 2012-08-14 Gergely Risko <gergely@risko.hu>
4117
4118 * coding.c (decode_coding): Record buffer modification before
4119 disabling undo_list (Bug#11773).
4120
4121 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4122
4123 Revert and cleanup some recent overlay changes.
4124 * buffer.h (enum overlay_type): Remove.
4125 (buffer_get_overlays, buffer_set_overlays): Likewise.
4126 (buffer_set_overlays_before, buffer_set_overlays_after):
4127 New function. Adjust users.
4128 (unchain_both): Add eassert.
4129
4130 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4131
4132 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4133
4134 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4135
4136 * gtkutil.c (xg_mark_data): Don't assume C99.
4137
4138 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4139
4140 * gtkutil.c (xg_frame_tb_info): New struct.
4141 (TB_INFO_KEY): New define.
4142 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4143 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4144 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4145 if not present.
4146 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4147 is up to date. Otherwise store new data.
4148 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4149
4150 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4151
4152 Use KSET for write access to Lisp_Object members of struct kboard.
4153 * keyboard.h (KSET): New macro.
4154 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4155 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4156 * xterm.c: Adjust users.
4157
4158 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4159
4160 Use BSET for write access to Lisp_Object members of struct buffer.
4161 * buffer.h (BSET): New macro.
4162 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4163 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4164 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4165 * window.c, xdisp.c, xfns.c: Adjust users.
4166
4167 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4168
4169 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4170
4171 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4172
4173 * nsterm.m (not_in_argv): New function.
4174 (application:openFile, application:openTempFile:):
4175 (application:openFileWithoutUI:, application:openFiles:): Open file
4176 if not_in_argv returns non-zero (bug#12171).
4177
4178 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4179 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4180 Define for Gtk+ versions less than 3.2.
4181 (xg_get_font_name): Use those functions/macros here.
4182 Reported by Frans Oilinki <moilinki@gmail.com>.
4183
4184 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4185
4186 * unexmacosx.c (copy_data_segment): Copy initialized data in
4187 statically linked libraries from input file rather than memory.
4188
4189 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4190 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4191 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4192
4193 2012-08-10 Glenn Morris <rgm@gnu.org>
4194
4195 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4196 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4197
4198 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4199
4200 Fix last change to allow compilation with low optimization levels.
4201 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4202 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4203
4204 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4205
4206 Use common inline syntax in intervals.h.
4207 * intervals.h (INTERVALS_INLINE): New macro.
4208 Change all users from LISP_INLINE.
4209
4210 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4211
4212 Define Qnone once for all platforms.
4213 * frame.c (Qnone): Define here.
4214 (syms_of_frame): DEFSYM it.
4215 * lisp.h (Qnone): New declaration.
4216 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4217 * xfns.c: Remove duplication. Adjust users.
4218
4219 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4220
4221 Remove unused macros from intervals.h.
4222 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4223 * intervals.c: Adjust comment.
4224
4225 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4226
4227 * w32fns.c <w32_unicode_gui>: New static variable.
4228 (globals_of_w32fns): Initialize it according to os_subtype.
4229 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4230 testing os_subtype.
4231
4232 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4233 Eli Zaretskii <eliz@gnu.org>
4234
4235 Fix bug #10299 with Unicode characters sent by customized
4236 keyboards created by MSKLC.
4237 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4238 (w32_init_class): Use it to initialize the Emacs class with either
4239 ANSI or Unicode API calls.
4240 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4241 later.
4242 (w32_wnd_proc): If the character code sent by WM_CHAR or
4243 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4244 original message. Call DefWindowProcW on NT and later.
4245
4246 2012-08-10 Glenn Morris <rgm@gnu.org>
4247
4248 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4249
4250 * lisp.h (DIRECTORY_SEP): Let configure set it.
4251
4252 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4253
4254 Use TSET for write access to Lisp_Object slots of struct terminal.
4255 * termhooks.h (TSET): New macro.
4256 * coding.c, terminal.c, xselect.c: Adjust users.
4257
4258 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4259
4260 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4261 the failing expression, include them in the error message.
4262 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4263 * lisp.h (internal_condition_case_n): Update declaration.
4264
4265 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4266
4267 Inline functions to examine and change buffer overlays.
4268 * buffer.c (unchain_both): New function.
4269 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4270 (buffer_has_overlays): New function.
4271 (enum overlay_type): New enum.
4272 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4273 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4274
4275 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4276
4277 Inline functions to examine and change buffer intervals.
4278 * alloc.c (mark_interval_tree): Remove.
4279 (MARK_INTERVAL_TREE): Simplify.
4280 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4281 * intervals.c (buffer_balance_intervals): New function.
4282 (graft_intervals_into_buffer): Adjust indentation.
4283 (set_intervals_multibyte): Simplify.
4284 * buffer.h (BUF_INTERVALS): Remove.
4285 (buffer_get_intervals, buffer_set_intervals): New function.
4286 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4287 * intervals.c, textprop.c: Adjust users.
4288
4289 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4290
4291 Inline functions to examine and change string intervals.
4292 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4293 (string_get_intervals, string_set_intervals): New function.
4294 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4295 * lread.c, print.c, textprop.c: Adjust users.
4296
4297 2012-08-08 Glenn Morris <rgm@gnu.org>
4298
4299 * lisp.mk (lisp): Remove language/persian.elc.
4300
4301 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4302
4303 Cleanup intervals.
4304 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4305 (NULL_INTERVAL_P): Likewise. Adjust users.
4306 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4307 Adjust comment. Move under #if 0.
4308 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4309 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4310
4311 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 Check total length of intervals with eassert.
4314 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4315 * intervals.c: Change all users to eassert.
4316
4317 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4318
4319 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4320 Rename fields to match removal of FGET and WGET and disuse of
4321 INTERNAL_FIELD in Lisp_Cons.
4322
4323 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4324
4325 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4326 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4327 name since all xname users are fixed long time ago. Do not
4328 use INTERNAL_FIELD.
4329 (set_symbol_name, set_symbol_function, set_symbol_plist):
4330 (set_symbol_next, set_overlay_plist): New function.
4331 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4332 (struct Lisp_Overlay): Likewise.
4333 (CVAR, MVAR, SVAR): Remove.
4334 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4335 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4336 * xterm.c: Adjust users.
4337 * .gdbinit: Change to use name field of struct Lisp_Symbol
4338 where appropriate.
4339
4340 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4341
4342 Basic functions to set Lisp_Object and pointer slots of intervals.
4343 * intervals.h (interval_set_parent, interval_set_object):
4344 (interval_set_left, interval_set_right, interval_set_plist):
4345 (interval_copy_parent): New function.
4346 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4347 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4348 Adjust indentation.
4349 (INTERVAL_SIZE): Remove. Adjust users.
4350 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4351
4352 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4353
4354 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4355 * process.h (PGET): Remove.
4356 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4357 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4358
4359 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4360
4361 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4362 * window.h (WGET): Remove.
4363 (struct window): Do not use INTERNAL_FIELD.
4364 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4365 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4366 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4367 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4368 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4369 Adjust users.
4370
4371 2012-08-07 Chong Yidong <cyd@gnu.org>
4372
4373 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4374 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4375 (Fdelete_window_internal): Signal an error if the window is not on
4376 a live frame (Bug#12025).
4377
4378 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4379
4380 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4381 * frame.h (FGET): Remove.
4382 (struct frame): Do not use INTERNAL_FIELD.
4383 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4384 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4385 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4386 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4387
4388 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4389
4390 * w32.c: Silence compiler warnings.
4391 (map_w32_filename): Remove unused variable `is_fat'.
4392 (chase_symlinks): Add parentheses around expression.
4393
4394 2012-08-06 Glenn Morris <rgm@gnu.org>
4395
4396 * sysdep.c: Respect BROKEN_GETWD.
4397
4398 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4399 Let configure handle it.
4400 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4401
4402 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4403
4404 Use GCALIGNMENT where appropriate.
4405 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4406 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4407 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4408
4409 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4410
4411 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4412 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4413
4414 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4415
4416 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4417 that should be sufficient for everyone.
4418
4419 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4420
4421 * keyboard.c (timer_check_2): Add break so timer_check returns next
4422 timeout.
4423
4424 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4425
4426 Fix Windows build errors introduced after converting to WGET and WSET.
4427 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4428 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4429
4430 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4431
4432 * nsterm.m (ns_frame_rehighlight): Use FSET.
4433
4434 * nsmenu.m (ns_update_menubar): Use FSET.
4435
4436 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4437
4438 Separate read and write access to Lisp_Object slots of Lisp_Process.
4439 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4440 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4441
4442 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4443
4444 Separate read and write access to Lisp_Object slots of struct window.
4445 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4446 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4447 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4448 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4449 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4450 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4451 Adjust users.
4452
4453 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4454
4455 Fix Windows build errors introduced after converting to FGET and FSET.
4456 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4457 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4458 (w32_judge_scroll_bars): Change to use FSET.
4459 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4460
4461 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4462
4463 Fix replacement typo.
4464 * window.c (replace_window): Set root_window instead of
4465 selected_window. This fixes a total window subsystem
4466 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4467
4468 2012-08-06 Glenn Morris <rgm@gnu.org>
4469
4470 * lisp.mk (lisp): Add language/persian.elc.
4471
4472 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4473
4474 Separate read and write access to Lisp_Object slots of struct frame.
4475 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4476 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4477 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4478 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4479 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4480
4481 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4482
4483 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4484
4485 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4486
4487 Generalize common compile-time constants.
4488 * lisp.h (header_size, bool_header_size, word_size): Now here.
4489 (struct Lisp_Vector): Add comment.
4490 (struct Lisp_Bool_Vector): Move up to define handy constants.
4491 (VECSIZE, PSEUDOVECSIZE): Simplify.
4492 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4493 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4494 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4495 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4496 * xfont.c, xmenu.c: Use word_size where appropriate.
4497
4498 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4499
4500 * search.c (Freplace_match): Treat \? in the replacement text
4501 literally (Bug#8161).
4502
4503 2012-08-05 Chong Yidong <cyd@gnu.org>
4504
4505 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4506 * frame.c (Vdelete_frame_functions):
4507 * emacs.c (Vkill_emacs_hook): Doc fix.
4508
4509 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4510
4511 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4512 --with-x-toolkit=no builds.
4513 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4514
4515 2012-08-04 Chong Yidong <cyd@gnu.org>
4516
4517 * syntax.c (Fmodify_syntax_entry): Doc fix.
4518
4519 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4520
4521 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4522 * w32.c (init_environment): Change the default values of many
4523 environment variables in dflt_envvars[] to NULL, to avoid pushing
4524 them into environment when they were not already defined.
4525 Remove the code that deletes site-lisp subdirectories from the default
4526 value of EMACSLOADPATH, as it is no longer needed.
4527 (check_windows_init_file): Now external, not static.
4528 Use Vload_path as is, without adding anything, as this function is now
4529 called when Vload_path is already set up.
4530
4531 * w32.h (check_windows_init_file): Add prototype.
4532
4533 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4534 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4535 compatibility with Posix platforms.
4536 (main): Move the call to check_windows_init_file to here from
4537 w32.c.
4538 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4539 any, in the DEFALT argument into the root of the Emacs build or
4540 installation tree, as appropriate.
4541
4542 * callproc.c (init_callproc_1): Call decode_env_path instead of
4543 doing its equivalent by hand.
4544 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4545 the code that sets Vexec_path run on MS-Windows.
4546
4547 * lread.c (init_lread): Add comments to #ifdef's.
4548
4549 * msdos.c (dos_set_window_size, IT_update_begin)
4550 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4551 instead of direct references.
4552
4553 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4554
4555 Export DEFAULT_REHASH_* to GDB.
4556 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4557 Now constants, not macros.
4558
4559 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4560
4561 Remove unnecessary casts involving pointers.
4562 These casts are no longer needed now that we assume C89 or later,
4563 since they involve casting to or from void *.
4564 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4565 (make_pure_float, make_pure_vector):
4566 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4567 * macros.c (Fstart_kbd_macro):
4568 * menu.c (find_and_return_menu_selection):
4569 * minibuf.c (read_minibuf_noninteractive):
4570 * sysdep.c (closedir):
4571 * xdisp.c (x_produce_glyphs):
4572 * xfaces.c (compare_fonts_by_sort_order):
4573 * xfns.c (x_real_positions, select_visual):
4574 * xselect.c (x_stop_queuing_selection_requests)
4575 (x_get_window_property, x_get_window_property_as_lisp_data):
4576 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4577 Remove unnecessary pointer casts.
4578 * alloc.c (record_xmalloc): New function.
4579 * lisp.h (record_xmalloc): New decl.
4580 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4581 more like a function. This is because the pointer cast is not
4582 needed. All uses changed.
4583 * print.c (print_string, print_error_message): Avoid length recalc.
4584
4585 Improve fix for macroexp crash with debugging (Bug#12118).
4586 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4587 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4588 not supposed to be invoked from the garbage collector.
4589 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4590 (gc_aset): New function, which is like ASET but can be
4591 used in the garbage collector.
4592 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4593 (set_hash_index): Use it instead of ASET.
4594
4595 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4596
4597 Support symlinks on latest versions of MS-Windows.
4598 * w32.c: Include winioctl.h and aclapi.h.
4599 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4600 (revert_to_self): Forward declarations of static functions.
4601 <static BOOL g_b_init_get_security_info>:
4602 <g_b_init_create_symbolic_link>: New static flags.
4603 (globals_of_w32): Initialize them to zero.
4604 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4605 (map_w32_filename): Improve commentary. Simplify switch.
4606 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4607 headers (most versions of MinGW w32api don't).
4608 (get_security_info, create_symbolic_link)
4609 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4610 New functions.
4611 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4612 in the argument file name.
4613 (sys_access): Call unc_volume_file_attributes only if
4614 GetFileAttributes fails with network-related error codes.
4615 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4616 have the required privileges.
4617 (get_file_security_desc_by_name): Rename from
4618 get_file_security_desc.
4619 (stat_worker): New function, with most of the guts of 'stat', and
4620 with addition of handling of symlinks and support for 'lstat'.
4621 If possible, get file's attributes and security information by
4622 handle, not by name. Produce S_IFLNK bit for symlinks, when
4623 called from 'lstat'.
4624 (stat, lstat): New functions, call 'stat_worker'.
4625 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4626 symlinks when the underlying filesystem supports them.
4627
4628 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4629
4630 Fix macroexp crash on Windows with debugging (Bug#12118).
4631 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4632 checking subscripts; problem introduced with the recent
4633 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4634 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4635 since it's used in non-static inline functions now.
4636
4637 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4638 Don't assume buffer size fits in 'int'. Remove unused local.
4639
4640 Use C99-style 'extern inline' if available.
4641 * buffer.h (BUFFER_INLINE):
4642 * category.h (CATEGORY_INLINE):
4643 * character.h (CHARACTER_INLINE):
4644 * charset.h (CHARSET_INLINE):
4645 * composite.h (COMPOSITE_INLINE):
4646 * dispextern.h (DISPEXTERN_INLINE):
4647 * lisp.h (LISP_INLINE):
4648 * systime.h (SYSTIME_INLINE):
4649 New macro, replacing 'static inline' in this header.
4650 * buffer.h, category.h, character.h, charset.h, composite.h:
4651 * dispextern.h, lisp.h, systime.h:
4652 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4653 * alloc.c (LISP_INLINE):
4654 * buffer.c (BUFFER_INLINE):
4655 * category.c (CATEGORY_INLINE):
4656 * character.c (CHARACTER_INLINE):
4657 * charset.c (CHARSET_INLINE):
4658 * composite.c (COMPOSITE_INLINE):
4659 * dispnew.c (DISPEXTERN_INLINE):
4660 * sysdep.c (SYSTIME_INLINE):
4661 Define to EXTERN_INLINE, so that the corresponding functions
4662 are compiled into code.
4663 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4664 (INLINE_HEADER_END): New macros.
4665 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4666 since it's used in non-static inline functions now.
4667 (VALMASK) [!USE_LSB_TAG]: Likewise.
4668
4669 2012-08-02 Glenn Morris <rgm@gnu.org>
4670
4671 * s/: Remove empty directory.
4672
4673 * s/ms-w32.h: Move to ../nt/inc.
4674 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4675 Update for new ms-w32.h location.
4676
4677 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4678
4679 Port to Solaris 8.
4680 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4681
4682 2012-08-02 Glenn Morris <rgm@gnu.org>
4683
4684 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4685 hard-coding the path separator.
4686
4687 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4690 This how ASET and AREF are supposed to work, and makes
4691 it easier to think about future improvements. See
4692 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4693 * charset.h (set_charset_attr): New function.
4694 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4695 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4696 (aref_addr): New function. All uses of &AREF(...) changed.
4697 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4698 (set_hash_index): New functions. All lvalue-style uses of
4699 HASH_KEY etc. changed.
4700 * keyboard.c (set_prop): New function. All lvalue-style uses
4701 of PROP changed.
4702
4703 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4704
4705 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4706 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4707 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4708 * nsfns.m (ns_set_name_as_filename): Likewise.
4709 * nsmenu.m (ns_update_menubar): Likewise.
4710 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4711
4712 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4713
4714 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4715 Adapt to latest changes in field names of the corresponding Lisp
4716 objects.
4717
4718 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4719
4720 2012-08-01 Glenn Morris <rgm@gnu.org>
4721
4722 * s/msdos.h: Remove file.
4723 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4724 * Makefile.in (S_FILE): Remove.
4725 (config_h): Remove S_FILE.
4726
4727 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4728
4729 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4730 Remove; moved to nt/config.nt.
4731
4732 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4733
4734 Use INTERNAL_FIELD for conses and overlays.
4735 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4736 Remove obsolete comment.
4737 (MVAR): New macro.
4738 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4739 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4740
4741 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4742
4743 Use INTERNAL_FIELD for symbols.
4744 * lisp.h (SVAR): New macro. Adjust users.
4745 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4746 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4747
4748 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4749
4750 Use INTERNAL_FIELD for processes.
4751 * process.h (PVAR): New macro. Adjust style.
4752 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4753 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4754
4755 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4756
4757 Use INTERNAL_FIELD for windows.
4758 * window.h (WVAR): New macro.
4759 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4760 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4761 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4762 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4763 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4764 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4765
4766 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4767
4768 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4769
4770 2012-08-01 Glenn Morris <rgm@gnu.org>
4771
4772 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4773 Move to configure.ac.
4774
4775 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4776
4777 * makefile.w32-in (CONFIG_H): Update dependencies.
4778 (CONF_POST_H): New macro.
4779
4780 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4781
4782 2012-07-31 Glenn Morris <rgm@gnu.org>
4783
4784 * Makefile.in (S_FILE): No longer set by configure.
4785
4786 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4787 is available.
4788 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4789
4790 * process.h (NULL_DEVICE):
4791 * emacs.c (SEPCHAR):
4792 * editfns.c (USER_FULL_NAME): Let configure set them.
4793
4794 * s/README, s/template.h: Remove files.
4795
4796 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4797
4798 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4799 Move to configure.ac.
4800
4801 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4802
4803 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4804 resulting renaming of 'struct frame' members.
4805
4806 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4807
4808 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4809 after introduction of FVAR.
4810
4811 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4812
4813 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4814
4815 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4816 instead of compositeToPoint.
4817 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4818
4819 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4820
4821 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4822
4823 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4824 * lisp.h (INTERNAL_FIELD): New macro.
4825 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4826 (BVAR): Change to use INTERNAL_FIELD.
4827 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4828 (KVAR): Change to use INTERNAL_FIELD.
4829 * frame.h (FVAR): New macro.
4830 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4831 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4832 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4833 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4834 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4835
4836 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4837
4838 Miscellaneous fixes for non-default X toolkits.
4839 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4840 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4841 Move under #ifdef USE_LUCID.
4842 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4843 definition and usage to avoid warnings.
4844
4845 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4846
4847 * nsterm.m (openFiles): Fix previous checkin.
4848
4849 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4850
4851 * indent.c (compute_motion): Remove unused local.
4852
4853 2012-07-31 Glenn Morris <rgm@gnu.org>
4854
4855 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4856
4857 * conf_post.h [USG5_4]:
4858 Move remaining contents of s/usg5-4-common.h here.
4859 * s/usg5-4-common.h: Remove file.
4860
4861 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4862 * s/irix6-5.h: Remove file.
4863
4864 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4865 * s/darwin.h: Remove file.
4866
4867 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4868 * s/hpux10-20.h: Remove file, which is now empty.
4869
4870 2012-07-30 Glenn Morris <rgm@gnu.org>
4871
4872 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4873 * Makefile.in (config_h): Add conf_post.h.
4874 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4875
4876 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4877
4878 * nsterm.m (ns_do_open_file): New variable.
4879 (ns_term_init): Set ns_do_open_file to YES after run returns.
4880 (openFile, openTempFile, openFileWithoutUI, openFiles):
4881 Open files only if ns_do_open_file.
4882
4883 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4884
4885 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4886 This no-op macro hasn't been needed for many years.
4887 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4888
4889 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4890 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4891 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4892 gdb_make_enums_visible.
4893 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4894 (DIRECTORY_SEP): Now a constant, not a macro.
4895
4896 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4897
4898 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4899 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4900
4901 * w32term.c <w32_keyboard_codepage>: Renamed from
4902 keyboard_codepage and now external. All users changed.
4903
4904 * w32term.h: Add declaration of w32_keyboard_codepage.
4905
4906 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4907 the codepage to translate keys to Unicode. If this argument is
4908 -1, use the value returned by GetConsoleCP. All callers changed.
4909
4910 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4911
4912 Update .PHONY listings in makefiles.
4913 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4914 bootstrap-clean, distclean, maintainer-clean, versioclean,
4915 extraclean, frc.
4916
4917 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4918 This is a bit clearer. Fix some commentary typos.
4919
4920 2012-07-30 Glenn Morris <rgm@gnu.org>
4921
4922 * s/netbsd.h: Let configure include signal.h if needed.
4923 Remove file, which is now empty.
4924
4925 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4926 Let configure set them.
4927 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4928 No more need to undefine.
4929
4930 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4931
4932 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4933 non-single-byte char when adding meta modifier. (Bug#12090)
4934
4935 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4936
4937 Convert safe_call to use variable number of arguments.
4938 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4939 (safe_call2): Fix comment.
4940 * lisp.h (safe_call): Adjust prototype.
4941 * coding.c (encode_coding_object): Change to use safe_call2.
4942 * xfaces.c (merge_face_heights): Change to use safe_call1.
4943
4944 2012-07-30 Glenn Morris <rgm@gnu.org>
4945
4946 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4947 does that unconditionally. Remove file, which is now empty.
4948
4949 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4950 Remove empty files.
4951
4952 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4953
4954 Export to GDB most of lisp.h's remaining object-like macros.
4955 * lisp.h (min, max): Move earlier, because they're used earlier now.
4956 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4957 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4958 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4959 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4960 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4961 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4962 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4963 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4964 Now constants, for GDB. They need not be macros.
4965 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4966 Now constants, for GDB, as well as macros, for static initializers.
4967 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4968 Move to after the definition of struct Lisp_Char_Table,
4969 since the former now needs that type defined.
4970 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4971 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4972 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4973 New enums, for gdb_make_enums_visible.
4974 (GLYPH_MODE_LINE_FACE): Remove; unused.
4975 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4976 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4977 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4978 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4979 enum maxargs, enum MAX_ALLOCA.
4980 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4981 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4982 no longer needed, now that they are done in lisp.h.
4983
4984 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4985
4986 Cleanup string bytes checking.
4987 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4988 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4989 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4990 (check_sblock, compact_small_strings): Simplify.
4991
4992 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4993
4994 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4995 These macros are confusing and no longer need to be defined, as
4996 the enum values now suffice. All uses replaced with definiens.
4997 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4998
4999 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
5000
5001 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5002 ($(BLD)/w32console.$(O)): Update dependencies.
5003
5004 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5005
5006 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5007 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5008 time. Adjust users.
5009 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5010
5011 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5012
5013 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5014 setting sitelisp (Bug#12010).
5015
5016 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5017
5018 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
5019
5020 * w32heap.c (cache_system_info):
5021 * w32.c (sys_rename):
5022 * w32proc.c (find_child_console, sys_kill): All users changed.
5023
5024 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5025
5026 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5027
5028 2012-07-29 Eli Zaretskii <eliz@gnu.org>
5029
5030 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5031
5032 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5033
5034 Cleanup statistics calculation in Fgarbage_collect.
5035 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5036 Fix zombies percentage calculation. Simplify elapsed time calculation.
5037
5038 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5039
5040 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5041 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5042 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5043 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5044 (replace_range, replace_range_2, del_range_2): Change to eassert.
5045 * marker.c (byte_char_debug_check): Adjust style.
5046
5047 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5048
5049 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5050 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5051 long-ago-commented-out code that talks about "WIN32".
5052 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5053 All uses changed.
5054
5055 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5056
5057 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5058 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5059 Simplify by using alignof.
5060 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5061 * lisp.h: Include <stdalign.h>.
5062 (GCALIGNMENT): New macro and constant.
5063 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5064 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5065 (stdalign): New macro, if not already defined.
5066
5067 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5068
5069 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5070 * w32inevt.c: Include w32inevt.h.
5071 (w32_read_console_input): New inline function, calls either
5072 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5073 w32_console_unicode_input.
5074 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5075 (w32_kbd_patch_key, key_event): Use the codepage returned by
5076 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5077 (key_event): use uChar.UnicodeChar only if
5078 w32_console_unicode_input is non-zero.
5079
5080 * w32console.c: Include w32heap.h.
5081 <w32_console_unicode_input>: New global variable.
5082 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5083 family of Windows, zero otherwise.
5084
5085 * w32inevt.h: Declare w32_console_unicode_input.
5086
5087 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5088 --without-x. (Bug#11742)
5089
5090 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5091
5092 Adjust GDB to reflect pvec_type changes (Bug#12036).
5093 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5094 2012-07-04 changes to pseudovector representation.
5095 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5096
5097 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5098
5099 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5100 bus address.
5101 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5102
5103 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5104
5105 * alloc.c (listn): Fix the order the arguments are consed onto the
5106 list.
5107
5108 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5109 enumeration constants, as PURE and HEAP are too general, and clash
5110 with other headers and sources, such as gmalloc.c and the
5111 MS-Windows system headers. All users changed.
5112
5113 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5114
5115 Revert last save_excursion_save and save_excursion_restore changes.
5116 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5117 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5118
5119 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5120
5121 Fix recently-introduced typos in Windows port.
5122 Reported by Martin Rudalics <rudalics@gmx.at>.
5123 * w32.c (init_environment): Replace comma with semicolon.
5124 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5125
5126 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5127
5128 Improve GDB symbol export (Bug#12036).
5129 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5130 arms of an 'if', not using conditional expressions; otherwise GDB
5131 complains about the types in the unevaluated arm when the argument
5132 is an integer literal.
5133 (xgetint): Simplify expression.
5134 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5135 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5136 Zaretskii in <http://bugs.gnu.org/12036#13>.
5137 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5138 needed now that we have gdb_make_enums_visible.
5139 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5140 (enum enum_USE_LSB_TAG):
5141 New enum types, packaging up enums that need to be exported to GDB.
5142
5143 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5144
5145 Utility function to make a list from specified amount of objects.
5146 * lisp.h (enum constype): New datatype.
5147 (listn): New prototype.
5148 * alloc.c (listn): New function.
5149 (Fmemory_use_count, syms_of_alloc): Use it.
5150 * buffer.c (syms_of_buffer): Likewise.
5151 * callint.c (syms_of_callint): Likewise.
5152 * charset.c (define_charset_internal): Likewise.
5153 * coding.c (syms_of_coding): Likewise.
5154 * keymap.c (syms_of_keymap): Likewise.
5155 * search.c (syms_of_search): Likewise.
5156 * syntax.c (syms_of_syntax): Likewise.
5157 * w32.c (init_environment): Likewise.
5158 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5159 * xdisp.c (syms_of_xdisp): Likewise.
5160 * xfns.c (syms_of_xfns): Likewise.
5161
5162 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5163
5164 Fast save_excursion_save and save_excursion_restore.
5165 * lisp.h (struct Lisp_Excursion): New data type.
5166 (PVEC_EXCURSION): New pseudovector type.
5167 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5168 to deal with it. Adjust comments.
5169 (init_marker, attach_marker): New prototype.
5170 (unchain_marker): Adjust prototype.
5171 * marker.c (attach_marker): Change to global.
5172 (init_marker): New function.
5173 * alloc.c (Fmake_marker, build_marker): Use it.
5174 (build_marker): More easserts.
5175 (mark_object): Handle struct Lisp_Excursion.
5176 * editfns.c (save_excursion_save, save_excursion_restore):
5177 Reimplement to use struct Lisp_Excursion. Add comments.
5178
5179 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5180
5181 Fix export of symbols to GDB (Bug#12036).
5182 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5183 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5184 emacs.c, as this is a more-suitable home. Had this been done earlier
5185 the fix for 12036 would have avoided some of the problems noted in
5186 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5187 would have been more obvious.
5188 * emacs.c: Do not include <verify.h>; no longer needed.
5189 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5190 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5191 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5192 Remove; now done in lisp.h.
5193 * lisp.h (PUBLISH_TO_GDB): New macro.
5194 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5195 (DATA_SEG_BITS): Use it.
5196 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5197 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5198 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5199 not be usable in #if. This simplifies things.
5200
5201 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5202
5203 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5204
5205 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5206
5207 Simplify export of symbols to GDB (Bug#12036).
5208 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5209 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5210 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5211 Adjust to changes in lisp.h and emacs.c, by using
5212 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5213 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5214 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5215 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5216 instead of gdb_valbits.
5217 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5218 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5219 instead of gdb_array_mark_flag.
5220 (xboolvector): Get size from $->size, not $->header.size.
5221 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5222 (xreload, hook-run, hookpost-run): Remove.
5223 * emacs.c: Include <verify.h>.
5224 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5225 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5226 Remove.
5227 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5228 (gdb_USE_LSB_TAG): New enum constants.
5229 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5230 Also define these as enum constants, so they're visible to GDB.
5231 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5232 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5233 as constants, so they're visible to GDB.
5234 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5235 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5236 Now enum constants, not macros, so they're visible to GDB.
5237 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5238 more convenient now. All uses changed.
5239 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5240 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5241
5242 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5243
5244 Explicitly free restriction data that are not needed anymore.
5245 * editfns.c (save_restriction_restore): Free restriction data.
5246
5247 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5248
5249 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5250 add argument, tune behavior, and adjust all callers.
5251
5252 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 Use typedef for EMACS_INT, EMACS_UINT.
5255 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5256 than macros. This simplifies debugging in the usual case, since
5257 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5258 and it allows expressions involving EMACS_INT casts.
5259 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5260
5261 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5262
5263 * nsterm.m (ns_read_socket): Return early if there is a modal
5264 window (Bug#12043).
5265
5266 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5267
5268 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5269 that FOCUS-FRAME can be omitted.
5270
5271 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5272
5273 Adjust buffer text indirection counters at the end of Fkill_buffer.
5274 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5275 buffer is definitely dead. This should really fix an issue reported
5276 by Christoph Scholtes again. (Bug#12007).
5277 (init_buffer_once): Initialize indirection counters of
5278 buffer_defaults and buffer_local_symbols (for sanity and safety).
5279
5280 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5281
5282 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5283 and continuation glyphs on tooltip frames, leave them at zero.
5284 Avoids continued lines in tooltips. (Bug#11832)
5285
5286 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5287
5288 Simplify copy_overlay.
5289 * buffer.c (copy_overlay): Simplify. Use build_marker.
5290 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5291
5292 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5293
5294 * print.c (print_object): Don't crash when a frame's name is nil
5295 or invalid. (Bug#12025)
5296
5297 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5298 it signals an error when a tooltip frame is being created.
5299
5300 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5301
5302 Cleanup miscellaneous objects allocation and initialization.
5303 * alloc.c (allocate_misc): Change to static. Add argument to
5304 specify the subtype. Adjust comment and users.
5305 (build_overlay): New function.
5306 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5307 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5308 (allocate_misc): Remove prototype.
5309 (build_overlay): Add prototype.
5310
5311 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5312
5313 Swap buffer text indirection counters in Fbuffer_swap_text.
5314 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5315 This avoids crash reported by Christoph Scholtes at
5316 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5317
5318 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5319
5320 * nsmenu.m (Popdown_data): New struct.
5321 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5322 free Popdown_data.
5323 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5324 (initWithContentRect): Make imgView and contentView non-static
5325 and autorelease them. Also autorelease img and matrix (Bug#12005).
5326 (dealloc): Remove (Bug#12005).
5327
5328 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5329
5330 Adjust consing_since_gc when objects are explicitly freed.
5331 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5332 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5333 (free_cons, free_misc): Subtract object size from consing_since_gc.
5334
5335 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5336
5337 Simplify and cleanup markers positioning code.
5338 * marker.c (attach_marker): More useful eassert.
5339 (live_buffer, set_marker_internal): New function.
5340 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5341 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5342
5343 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5346 as it's limited by the amount of memory, not by INT_MAX.
5347
5348 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5349
5350 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5351 in special-event-map. See the discussion at
5352 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5353 for the reasons.
5354
5355 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5356 info.dwItemData. Fixes crashes on 64-bit Windows.
5357 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5358
5359 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5360
5361 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5362 (conversationIdentifier): Return value is NSInteger.
5363 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5364
5365 2012-07-21 Chong Yidong <cyd@gnu.org>
5366
5367 * window.c (decode_any_window): Signal an error if the window is
5368 on a dead frame (Bug#11984).
5369
5370 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5371
5372 Add indirection counting to speed up Fkill_buffer.
5373 * buffer.h (struct buffer): New member.
5374 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5375 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5376 base buffer indirection counter.
5377 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5378 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5379 through buffer list if indirection counter is 0.
5380
5381 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5382
5383 Extend the value returned by Fgarbage_collect with heap statistics.
5384 * alloc.c (Qheap): New symbol.
5385 (syms_of_alloc): DEFSYM it.
5386 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5387 (Fmemory_free): Remove.
5388 (syms_of_alloc): Don't defsubr it.
5389 * buffer.c (Fcompact_buffer): Remove.
5390 (syms_of_buffer): Don't defsubr it.
5391
5392 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5393
5394 Make maybe_gc inline.
5395 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5396 * lisp.h (consing_since_gc, gc_relative_threshold)
5397 (memory_full_cons_threshold): Revert declaration.
5398 (maybe_gc): Remove prototype, define as inline.
5399 * alloc.c: Remove old commented-out code.
5400 (consing_since_gc, gc_relative_threshold)
5401 (memory_full_cons_threshold): Revert to global.
5402 (maybe_gc): Remove.
5403
5404 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5405
5406 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5407 * lisp.h (build_unibyte_string): New function.
5408 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5409 * sysdep.c, w32fns.c, xfns.c: Use it.
5410 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5411 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5412 Adjust users accordingly.
5413 * font.h (font_open_by_name): Adjust prototype.
5414
5415 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5416
5417 Cleanup calls to Fgarbage_collect.
5418 * lisp.h (maybe_gc): New prototype.
5419 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5420 Remove declarations.
5421 * alloc.c (maybe_gc): New function.
5422 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5423 Make them static.
5424 * bytecode.c (MAYBE_GC): Use maybe_gc.
5425 * eval.c (eval_sub, Ffuncall): Likewise.
5426 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5427 to avoid dependency from auto-save feature.
5428
5429 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5430
5431 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5432 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5433 'for_each_per_buffer_object_at'.
5434 All uses changed. It's better to use upper-case for macros that
5435 cannot be implemented as functions, to give the reader a clue
5436 that they're special.
5437
5438 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5439
5440 * alloc.c (Fgarbage_collect): Tweak docstring.
5441
5442 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5443
5444 Tweak the value returned from Fgarbage_collect again.
5445 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5446 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5447 Adjust documentation.
5448 (total_vector_bytes): Rename to total_vector_slots, adjust
5449 accounting.
5450 (total_free_vector_bytes): Rename to total_free_vector_slots,
5451 adjust accounting.
5452 (Qstring_bytes, Qvector_slots): New symbols.
5453 (syms_of_alloc): DEFSYM them.
5454
5455 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5456
5457 Buffer compaction primitive which may be used from Lisp.
5458 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5459 (syms_of_buffer): Register Fcompact_buffer.
5460 * alloc.c (Fgarbage_collect): Use compact_buffer.
5461 * buffer.h (compact_buffer): New prototype.
5462 (struct buffer_text): New member.
5463
5464 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5465
5466 New macro to iterate over all buffers, miscellaneous cleanups.
5467 * lisp.h (all_buffers): Remove declaration.
5468 * buffer.h (all_buffers): Add declaration, with comment.
5469 (for_each_buffer): New macro.
5470 * alloc.c (Fgarbage_collect, mark_object): Use it.
5471 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5472 (init_buffer): Likewise.
5473 * data.c (Fset_default): Likewise.
5474 * coding.c (code_conversion_restore): Remove redundant check
5475 for dead buffer.
5476 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5477
5478 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5479
5480 Fix bug that created negative-length intervals.
5481 * intervals.c (merge_interval_right, merge_interval_left):
5482 Do not zero out this interval if it is absorbed by its children,
5483 as this interval's total length doesn't change in that case. See
5484 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5485
5486 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5487
5488 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5489 when invoking (make-bool-vector N t) and N is a positive
5490 multiple of 8 -- the last 8 bits were mistakenly cleared.
5491
5492 Remove some struct layout assumptions in bool vectors.
5493 * alloc.c (bool_header_size): New constant.
5494 (header_size, word_size): Move earlier, as they're now used earlier.
5495 Use 'word_size' in a few more places, where it's appropriate.
5496 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5497 padding before the data member of a bool vector.
5498 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5499 than doing the check by hand with an abort ().
5500
5501 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5502
5503 * eval.c (Fdefvar): Don't check constants since we only set the var if
5504 it's not yet defined anyway (bug#11904).
5505
5506 * lisp.h (last_undo_boundary): Declare new var.
5507 * keyboard.c (command_loop_1): Set it.
5508 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5509 were auto-added by the command loop (bug#11774).
5510
5511 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5512
5513 * w32font.c (Qsymbol): Remove local definition.
5514 (syms_of_w32font): Don't DEFSYM it.
5515
5516 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5517
5518 Fix sweep_vectors to handle large bool vectors correctly.
5519 * alloc.c (sweep_vectors): Account total_vector_bytes for
5520 bool vectors larger than VBLOCK_BYTES_MAX.
5521
5522 2012-07-18 Chong Yidong <cyd@gnu.org>
5523
5524 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5525 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5526
5527 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5528
5529 Return more descriptive data from Fgarbage_collect.
5530 Suggested by Stefan Monnier in
5531 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5532 * alloc.c (bounded_number): New function.
5533 (total_buffers, total_vectors): New variable.
5534 (total_string_size): Rename to total_string_bytes, adjust users.
5535 (total_vector_size): Rename to total_vector_bytes, adjust users.
5536 (sweep_vectors): Account total_vectors and total_vector_bytes.
5537 (Fgarbage_collect): New return value. Adjust documentation.
5538 (gc_sweep): Account total_buffers.
5539 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5540 (VECTOR_SIZE): Remove.
5541 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5542 (Qinterval, Qmisc): New symbols.
5543 (syms_of_data): Initialize them.
5544 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5545 (Qcons, Qbuffer): New declarations.
5546
5547 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5548
5549 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5550 Round up, not down. Improve doc.
5551
5552 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5553
5554 Restore old code in allocate_string_data to avoid Faset breakage.
5555 Reported by Julien Danjou <julien@danjou.info> in
5556 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5557 * alloc.c (allocate_string_data): Restore old code with minor
5558 adjustments, fix comment to explain this subtle issue.
5559
5560 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5561
5562 Remove FILE_SYSTEM_CASE.
5563 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5564
5565 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5566 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5567 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5568 call-process-region passes it through expand-file-name.
5569
5570 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5571
5572 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5573
5574 Fix crash when creating indirect buffer (Bug#11917)
5575 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5576 Don't handle unbound variables specially if non-zero.
5577 (Fbuffer_local_variables): Pass zero.
5578 (clone_per_buffer_values): Pass non-zero.
5579
5580 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5581
5582 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5583 to make the loop interruptible.
5584
5585 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5586
5587 * gnutls.c (emacs_gnutls_handshake): Only retry if
5588 GNUTLS_E_INTERRUPTED.
5589
5590 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5591
5592 Cleanup and convert miscellaneous checks to eassert.
5593 * alloc.c (mark_interval): Fix comment, partially rephrase
5594 old comment from intervals.h (see below).
5595 * intervals.c (find_interval, adjust_intervals_for_insertion)
5596 (delete_interval, adjust_intervals_for_deletion)
5597 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5598 Convert to eassert.
5599 (adjust_intervals_for_insertion, make_new_interval):
5600 Remove obsolete and unused code.
5601 * intervals.h (struct interval): Remove obsolete comment.
5602 * textprotp.c (erase_properties): Remove unused code.
5603 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5604 (Fremove_list_of_text_properties): Convert to eassert.
5605
5606 2012-07-17 Chong Yidong <cyd@gnu.org>
5607
5608 * editfns.c (Finsert_char): Doc fix.
5609
5610 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5611
5612 Fix previous change to make Fmemory_free always accurate.
5613 * alloc.c (make_interval): Update total_free_intervals.
5614 (make_float): Likewise for total_free_floats.
5615 (free_cons, Fcons): Likewise for total_free_conses.
5616 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5617 Likewise for total_free_vector_bytes.
5618 (Fmake_symbol): Likewise for total_free_symbols.
5619 (bytes_free): Remove.
5620
5621 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5622
5623 Simple free memory accounting feature.
5624 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5625 (sweep_vectors): Accumulate size of free vectors.
5626 (Fgarbage_collect): Setup bytes_free.
5627 (Fmemory_free): New function.
5628 (syms_of_alloc): Register it.
5629
5630 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5631
5632 Cleanup overlays checking.
5633 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5634 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5635 eassert and OVERLAYP.
5636 (sort_overlays): Change to use OVERLAYP.
5637
5638 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5639
5640 * editfns.c (Finsert_char): Make it interactive, and make the
5641 second arg optional. Copy interactive spec and docstring from
5642 ucs-insert.
5643
5644 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5645
5646 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5647 Unlike the other wrapped functions, fabs has an unspecified
5648 effect on errno.
5649
5650 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5651
5652 * nsterm.m (keyDown): Interpret flags without left/right bits
5653 as the left key (Bug#11670).
5654
5655 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5656
5657 Remove empty and useless init functions.
5658 * lisp.h (init_character_once, init_fns, init_image)
5659 (init_filelock, init_sound): Remove prototype.
5660 * character.c (init_character_once): Remove.
5661 * filelock.c (init_filelock): Likewise.
5662 * fns.c (init_fns): Likewise.
5663 * image.c (init_image): Likewise.
5664 * sound.c (init_sound): Likewise.
5665 * emacs.c (main): Adjust accordingly.
5666
5667 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5668
5669 * gtkutil.h: Tiny cleanups.
5670 (use_old_gtk_file_dialog): Remove useless declaration.
5671 (xg_uses_old_file_dialog): Add suggested const attribute.
5672
5673 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5674
5675 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5676 (bidi_paragraph_init): Use it to limit search forward for a strong
5677 directional character in abnormally large paragraphs full of
5678 neutral or weak characters. (Bug#11943)
5679
5680 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5681
5682 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5683 the toolbar (Bug#9451).
5684 (xg_make_tool_item): Give the widget event box a transparent
5685 background.
5686
5687 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5688
5689 Cleanup basic allocation variables and functions.
5690 * alloc.c (ignore_warnings, init_intervals, init_float)
5691 (init_cons, init_symbol, init_marker): Remove.
5692 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5693 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5694 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5695 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5696 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5697 (staticidx, init_alloc_once, init_strings, free_ablock):
5698 Remove redundant initialization.
5699 * fns.c (init_weak_hash_tables): Remove.
5700 * lisp.h (init_weak_hash_tables): Remove prototype.
5701
5702 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5703
5704 Use zero_vector where appropriate.
5705 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5706 accordingly.
5707 * lisp.h (zero_vector): New declaration.
5708 * font.c (null_vector): Remove.
5709 (syms_of_font): Remove initialization and staticpro.
5710 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5711 * keymap.c (Faccessible_keymaps): Likewise.
5712
5713 2012-07-15 Leo Liu <sdl.web@gmail.com>
5714
5715 * fringe.c: Fix typo in comments.
5716
5717 2012-07-14 Leo Liu <sdl.web@gmail.com>
5718
5719 * fringe.c: Add a new bitmap exclamation-mark.
5720
5721 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5722
5723 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5724
5725 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5726 (HAVE_MENUS): Don't define, defined by editing config.in with
5727 msdos/sed2v2.inp.
5728 (GMALLOC_INHIBIT_VALLOC): Don't define.
5729 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5730
5731 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5732
5733 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5734
5735 2012-07-14 Glenn Morris <rgm@gnu.org>
5736
5737 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5738 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5739 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5740
5741 2012-07-13 Glenn Morris <rgm@gnu.org>
5742
5743 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5744
5745 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5746 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5747
5748 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5749
5750 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5751 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5752 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5753 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5754 where appropriate.
5755 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5756 as boolean expression.
5757 (x_set_window_size): Remove unused variable toolbar.
5758 (ns_get_color_default, ns_mod_to_lisp): Remove.
5759 (ns_mouse_position): Remove unused variables xchar and ychar.
5760 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5761 (ns_set_vertical_scroll_bar): Remove unused variable count.
5762 (ns_delete_terminal): Remove unused variable i.
5763 (ns_term_init): Remove unused variables r, g and b.
5764 (mouseDown): Remove unused variable window.
5765 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5766 (initFrameFromEmacs): Remove unused variable vbextra.
5767 (mouseEntered): Remove unused variables p and dpyinfo.
5768 (mouseExited): Remove unused variables p and r.
5769 (ns_define_frame_cursor, ns_clear_frame_area)
5770 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5771 (menuDown): Assign [sender tag] to variable and cast the variable.
5772
5773 * nsterm.h (menuDown): Add id as type to argument sender.
5774 (ns_display_info_for_name): Add Lisp_Object argument.
5775 (ns_term_init): Add Lisp_Object argument.
5776 (ns_map_event_to_object): Add void argument.
5777 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5778 prototype with arguments and only declare if __OBJC__.
5779 (nxatoms_of_nsselect): Add void argument.
5780 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5781 (ns_alloc_autorelease_pool): Add void argument.
5782 (ns_release_autorelease_pool): Add void* argument.
5783 (ns_get_defaults_value): Add const char* argument.
5784
5785 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5786 (initFromContents): Use SSDATA where appropriate.
5787 (ns_update_menubar): Add braces to ambigous if-else.
5788 (initWithTitle): Put () around assignment in if statement.
5789 (ns_menu_show): Remove unused variables window and keymap.
5790 (update_frame_tool_bar): Remove unused variable selected_p.
5791 (initWithContentRect): Remove unused variable this_cmd_name.
5792
5793 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5794 appropriate.
5795 (setXBMColor): Remove unused variable len.
5796 (setPixmapData): Put () around assignment in loop statement.
5797
5798 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5799 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5800 where appropriate.
5801 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5802 around assignment in loop statement.
5803 (nsfont_open): Remove unused variable i.
5804 (nsfont_open): Remove unused variable len.
5805 (nsfont_draw): Remove unused variable cs.
5806
5807 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5808 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5809 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5810 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5811 (Fns_font_name, Fns_perform_service)
5812 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5813 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5814 (ns_set_name): Remove unused variable view.
5815 (x_set_menu_bar_lines): Remove unused variable olines.
5816 (x_set_tool_bar_lines): Remove unused variable root_window.
5817 (Fns_list_colors): Put () around assignment in while statement.
5818 (Fns_perform_service): Remove unused variable len.
5819 (Fns_display_usable_bounds): Remove unused variable top.
5820 (syms_of_nsfns): Remove unused variable i.
5821
5822 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5823 memcpy (Bug#11907).
5824
5825 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5826
5827 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5828 and free it with DestroyExceptionInfo (Bug#11558).
5829
5830 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5831
5832 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5833 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5834 Set here, not in nt/config.nt.
5835
5836 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5837
5838 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5839 cursor overflow into the last glyph on display line when the right
5840 fringe is off. (Bug#11832)
5841
5842 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5843
5844 * xdisp.c (produce_special_glyphs): Now static.
5845 * dispextern.h (produce_special_glyphs): Remove decl.
5846
5847 2012-07-13 Glenn Morris <rgm@gnu.org>
5848
5849 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5850 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5851
5852 * s/usg5-4-common.h (USG, USG5):
5853 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5854 * s/sol2-6.h (SOLARIS2):
5855 * s/irix6-5.h (IRIX6_5):
5856 * s/hpux10-20.h (USG, USG5, HPUX):
5857 * s/gnu-linux.h (USG, GNU_LINUX):
5858 * s/freebsd.h (BSD_SYSTEM):
5859 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5860 * s/cygwin.h (CYGWIN):
5861 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5862 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5863
5864 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5865
5866 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5867
5868 2012-07-13 Glenn Morris <rgm@gnu.org>
5869
5870 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5871
5872 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5873
5874 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5875 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5876
5877 2012-07-12 Glenn Morris <rgm@gnu.org>
5878
5879 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5880
5881 * process.c (init_process_emacs): Rename from init_process.
5882 The old name is also the name of a Mach system call.
5883 * lisp.h, emacs.c: Update for this name change.
5884 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5885 longer needed.
5886
5887 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5888
5889 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5890 memmove call that removes glyphs covered by the left truncation
5891 glyph. Improve commentary.
5892 (display_line): Fix display of continuation glyphs on GUI frames
5893 when the right fringe is turned off and variable-size fonts are
5894 used in the window. Move the code that appends a stretch glyph to
5895 produce_special_glyphs, so that it could be used for truncation
5896 and continuation glyphs alike.
5897 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5898 glyph of a suitably computed width, to align the special glyphs at
5899 the window margin. Code moved from display_line. (Bug#11832)
5900
5901 2012-07-12 Glenn Morris <rgm@gnu.org>
5902
5903 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5904
5905 * s/gnu-linux.h, s/hpux10-20.h:
5906 Do not unconditionally define HAVE_XRMSETDATABASE.
5907
5908 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5909
5910 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5911
5912 Fix typos that broke OS X build.
5913 Reported by Randal L. Schwartz in
5914 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5915 * nsterm.m (ns_timeout): Add missing local decl.
5916 (ns_get_color): snprintf -> sprintf, to fix typo.
5917
5918 2012-07-12 Glenn Morris <rgm@gnu.org>
5919
5920 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5921 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5922 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5923 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5924
5925 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5926 Move PTY_OPEN to configure.
5927
5928 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5929 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5930 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5931
5932 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 Use empty_unibyte_string where applicable.
5935 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5936 * lread.c (read1): Likewise.
5937 * xsettings.c (syms_of_xsettings): Likewise.
5938
5939 2012-07-12 Glenn Morris <rgm@gnu.org>
5940
5941 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5942 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5943 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5944 * s/hpux10-20.h (RUN_TIME_REMAP):
5945 * s/bsd-common.h (TABDLY): Move to configure.
5946
5947 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5948
5949 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5950
5951 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5952 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5953
5954 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5955
5956 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5957 * s/template.h: Move NARROWPROTO to configure.
5958
5959 2012-07-11 Glenn Morris <rgm@gnu.org>
5960
5961 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5962 unused since 2011-01-17 change to systty.h.
5963
5964 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5965 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5966 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5967
5968 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5969
5970 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5971
5972 2012-07-11 Glenn Morris <rgm@gnu.org>
5973
5974 * s/darwin.h, s/gnu-linux.h, s/template.h:
5975 Move INTERRUPT_INPUT to configure.
5976
5977 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5978
5979 Minor adjustments to interning code.
5980 * lisp.h (intern, intern_c_string): Redefine as static inline
5981 wrappers for intern_1 and intern_c_string_1, respectively.
5982 (intern_1, intern_c_string_1): Rename prototypes.
5983 * lread.c (intern_1, intern_c_string_1, oblookup):
5984 Simplify Vobarray checking.
5985 * font.c (font_intern_prop): Likewise. Adjust comment.
5986 * w32font.c (intern_font_name): Likewise.
5987
5988 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5989
5990 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5991
5992 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5993 of Fcar/Fcdr if possible.
5994 * font.c (check_otf_features): Likewise.
5995 * fontset.c (Fnew_fontset): Likewise.
5996 * gnutls.c (Fgnutls_boot): Likewise.
5997 * minibuf.c (read_minibuf): Likewise.
5998 * msdos.c (IT_set_frame_parameters): Likewise.
5999 * xmenu.c (Fx_popup_dialog): Likewise.
6000 * w32menu.c (Fx_popup_dialog): Likewise.
6001
6002 2012-07-11 Glenn Morris <rgm@gnu.org>
6003
6004 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6005 since nothing has defined it on these platforms.
6006
6007 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6008 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6009
6010 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6011 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6012 Move CLASH_DETECTION to configure.
6013
6014 * s/gnu.h: Remove file, which is now empty.
6015
6016 * s/gnu.h, s/gnu-linux.h:
6017 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6018
6019 2012-07-11 John Wiegley <johnw@newartisans.com>
6020
6021 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6022 function attribute, so we only use it if it exists in the
6023 compiler.
6024
6025 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6026
6027 Avoid call to strlen in fast_c_string_match_ignore_case.
6028 * search.c (fast_c_string_match_ignore_case): Change to use
6029 length argument. Adjust users accordingly.
6030 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6031
6032 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6033
6034 Assume mkdir, rmdir.
6035 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6036 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6037
6038 Assume rename.
6039 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6040
6041 Assume perror.
6042 * s/hpux10-20.h (HAVE_PERROR): Remove.
6043 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6044 Remove dummy definition, as this problem was obsolete long ago.
6045
6046 Assume strerror.
6047 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6048
6049 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6050
6051 Avoid calls to strlen in font processing functions.
6052 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
6053 (font_open_by_name): Change to use length argument.
6054 Adjust users accordingly.
6055 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6056 Adjust prototypes.
6057 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6058 Change to return ptrdiff_t.
6059 (xfont_list_pattern, xfont_match): Use length returned by
6060 xfont_decode_coding_xlfd.
6061 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6062
6063 2012-07-11 Glenn Morris <rgm@gnu.org>
6064
6065 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6066 Move DONT_REOPEN_PTY to configure.
6067
6068 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6069 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6070
6071 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6072
6073 Remove "#define unix" that is no longer needed (Bug#11905).
6074 * s/aix4-2.h (unix): Remove; no longer needed.
6075
6076 EMACS_TIME simplification (Bug#11875).
6077 This replaces macros (which typically do not work in GDB)
6078 with functions, typedefs and enums, making the code easier to debug.
6079 The functional style also makes code easier to read and maintain.
6080 * systime.h: Include <sys/time.h> on all hosts, not just if
6081 WINDOWSNT, since 'struct timeval' is needed in general.
6082 (EMACS_TIME): Now a typedef, not a macro.
6083 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6084 not macros.
6085 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6086 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6087 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6088 (EMACS_TIME_LE): Now functions, not macros.
6089 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6090 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6091 which are not functions. All uses rewritten to use:
6092 (make_emacs_time): New function.
6093 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6094 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6095 not functions. All uses rewritten to use the following, respectively:
6096 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6097 (add_emacs_time, sub_emacs_time): New functions.
6098 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6099 * fileio.c (Fcopy_file):
6100 * xterm.c (XTflash): Get the current time closer to when it's used.
6101 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6102
6103 * bytecode.c (targets): Suppress -Woverride-init warnings.
6104
6105 Simplify by avoiding confusing use of strncpy etc.
6106 * doc.c (Fsnarf_documentation):
6107 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6108 * frame.c (Fmake_terminal_frame):
6109 * gtkutil.c (get_utf8_string):
6110 * lread.c (openp):
6111 * nsmenu.m (ns_update_menubar):
6112 * regex.c (regerror):
6113 Prefer memcpy to strncpy and strncat when either will do.
6114 * fileio.c (Fsubstitute_in_file_name):
6115 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6116 (menu_separator_name_p):
6117 * nsmenu.m (ns_update_menubar):
6118 Prefer memcmp to strncmp when either will do.
6119 * nsterm.m: Include <ftoastr.h>.
6120 (ns_get_color):
6121 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6122 Prefer snprintf to strncpy.
6123 * nsterm.m (ns_term_init):
6124 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6125 * nsterm.m (ns_term_init):
6126 Avoid the need for strncpy, by using build_string or
6127 make_unibyte_string directly. Use dtoastr, not snprintf.
6128 * process.c (Fmake_network_process): Diagnose service names that
6129 are too long, rather than silently truncating them or creating
6130 non-null-terminated names.
6131 (Fnetwork_interface_info): Likewise, for interface names.
6132 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6133 Prefer sprintf to strncat.
6134 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6135 Prefer vsnprintf to vsprintf + strncpy.
6136
6137 2012-07-10 Glenn Morris <rgm@gnu.org>
6138
6139 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6140 Clarify fallback case.
6141
6142 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6143
6144 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6145 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6146 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6147 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6148 where argument type is known to be a Lisp_Cons.
6149
6150 2012-07-10 Tom Tromey <tromey@redhat.com>
6151
6152 * bytecode.c (BYTE_CODE_THREADED): New macro.
6153 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6154 (enum byte_code_op): New type.
6155 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6156 (exec_byte_code): Use them. Use token threading when applicable.
6157
6158 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6159
6160 Optimize pure C strings initialization.
6161 * lisp.h (make_pure_string): Fix prototype.
6162 (build_pure_c_string): New function, defined as static inline. This
6163 provides a better opportunity to optimize away calls to strlen when
6164 the function is called with compile-time constant argument.
6165 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6166 argument, adjust users accordingly. Use build_pure_c_string where
6167 appropriate.
6168 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6169 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6170 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6171
6172 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6173
6174 Avoid calls to strlen in miscellaneous functions.
6175 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6176 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6177 * lread.c (openp): Likewise.
6178
6179 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6180
6181 Avoid calls to strlen in path processing functions.
6182 * fileio.c (file_name_as_directory): Add comment. Change to add
6183 srclen argument and return the length of result. Adjust users
6184 accordingly.
6185 (directory_file_name): Fix comment. Change to add srclen argument,
6186 swap 1st and 2nd arguments to obey the common convention.
6187 Adjust users accordingly.
6188 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6189
6190 2012-07-10 Glenn Morris <rgm@gnu.org>
6191
6192 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6193 Move PENDING_OUTPUT_COUNT definition to configure.
6194
6195 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6196 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6197 * s/gnu.h (DATA_START): Move definitions to configure.
6198
6199 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6200 We include usg5-4-common.h, which defines them both.
6201
6202 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6203 O_RDONLY already includes it).
6204
6205 Stop ns builds setting the EMACSLOADPATH environment variable.
6206 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6207 Now it does not set EMACSLOADPATH, just returns the load-path string.
6208 * nsterm.h: Update accordingly.
6209 * lread.c [HAVE_NS]: Include nsterm.h.
6210 (init_lread) [HAVE_NS]: Use ns_load_path.
6211 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6212
6213 2012-07-09 Glenn Morris <rgm@gnu.org>
6214
6215 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6216 since the included bsd-common.h does so.
6217
6218 Stop ns builds setting the EMACSPATH environment variable.
6219 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6220 (ns_init_paths): Do not set EMACSPATH.
6221 * nsterm.h (ns_exec_path): Add it.
6222 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6223 Use ns_exec_path.
6224
6225 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6226
6227 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6228
6229 * process.c (wait_reading_process_output): 'waitchannels' was unset
6230 when read_kbd || !NILP (wait_for_cell); fix this.
6231
6232 Add GCC-style 'const' attribute to functions that can use it.
6233 * character.h (char_resolve_modifier_mask):
6234 * keyboard.h (make_ctrl_char):
6235 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6236 (init_character_once, next_almost_prime, init_fns, init_image)
6237 (flush_pending_output, init_sound):
6238 * mem-limits.h (start_of_data):
6239 * menu.h (finish_menu_items):
6240 Add ATTRIBUTE_CONST.
6241 * emacs.c (DEFINE_DUMMY_FUNCTION):
6242 Declare the dummy function with ATTRIBUTE_CONST.
6243 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6244 Add decls with ATTRIBUTE_CONST.
6245
6246 Minor improvements to make_formatted_string.
6247 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6248 where int is good enough, as vsprintf returns an int.
6249 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6250
6251 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6252
6253 Use make_formatted_string to avoid double length calculation.
6254 * lisp.h (make_formatted_string): New prototype.
6255 * alloc.c (make_formatted_string): New function.
6256 * buffer.c (Fgenerate_new_buffer_name): Use it.
6257 * dbusbind.c (syms_of_dbusbind): Likewise.
6258 * editfns.c (Fcurrent_time_zone): Likewise.
6259 * filelock.c (get_boot_time): Likewise.
6260 * frame.c (make_terminal_frame, set_term_frame_name)
6261 (x_report_frame_params): Likewise.
6262 * image.c (gs_load): Likewise.
6263 * minibuf.c (get_minibuffer): Likewise.
6264 * msdos.c (dos_set_window_size): Likewise.
6265 * process.c (make_process): Likewise.
6266 * xdisp.c (ensure_echo_area_buffers): Likewise.
6267 * xsettings.c (apply_xft_settings): Likewise.
6268
6269 2012-07-09 Glenn Morris <rgm@gnu.org>
6270
6271 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6272 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6273 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6274 * nsterm.h (ns_etc_directory): Add it.
6275 * callproc.c [HAVE_NS]: Include nsterm.h.
6276 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6277
6278 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6279
6280 Move marker debugging code under MARKER_DEBUG.
6281 * marker.c (MARKER_DEBUG): Move marker debugging code under
6282 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6283 for bootstrap with --enable-checking (~3x slowdown reported
6284 by Juanma Barranquero <lekktu@gmail.com>).
6285 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6286
6287 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6288
6289 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6290 See <http://bugs.gnu.org/11825#29>.
6291
6292 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6293
6294 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6295 has no font, use the frame's font. (Bug#11813)
6296 (display_line): Add commentary about displaying truncation glyphs
6297 on GUI frames.
6298 (produce_special_glyphs): Move here from term.c.
6299
6300 * term.c (produce_special_glyphs): Move to xdisp.c.
6301
6302 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6303 section.
6304
6305 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6306
6307 * xdisp.c (display_line): Avoid warning about implicit declaration
6308 of FRAME_FONT.
6309
6310 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6311
6312 * lisp.h: Remove empty conditional.
6313
6314 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6315
6316 * lread.c (load_path_check): Now static.
6317
6318 Fix some minor --with-ns problems found by static checking.
6319 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6320 (x_set_font) [!HAVE_X_WINDOWS]:
6321 * image.c (xpm_load_image) [HAVE_NS]:
6322 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6323 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6324 Remove unused local.
6325 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6326 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6327 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6328 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6329 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6330 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6331 Fix pointer signedness problem.
6332 * xfaces.c (FRAME_X_FONT_TABLE):
6333 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6334
6335 2012-07-07 Glenn Morris <rgm@gnu.org>
6336
6337 * lread.c (load_path_check): New function, split from init_lread.
6338 (init_lread): Reorganize. Motivation:
6339 If EMACSLOADPATH is set, check/warn about that rather than the
6340 defaults, which we are not going to use. Hence we can remove
6341 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6342 Don't warn if site-lisp directories are missing.
6343 If not installed, start from a blank load-path, since
6344 PATH_LOADSEARCH refers to the eventual installation directories.
6345
6346 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6347
6348 Support truncation and continuation glyphs on GUI frames, when
6349 fringes are disabled. (Bug#11832)
6350 * xdisp.c (init_iterator): Get dimensions of truncation and
6351 continuation glyphs even if on GUI frames.
6352 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6353 or both, are absent.
6354 (start_display, move_it_in_display_line_to): Handle the case of a
6355 GUI frame without a fringe to display continuation or truncation
6356 glyphs.
6357 (insert_left_trunc_glyphs): Support GUI frames: make sure
6358 truncation glyphs overwrite enough glyphs from the current line to
6359 have sufficient space in pixels.
6360 (display_line): Support truncation and continuation glyphs on GUI
6361 frames. If some spare pixels are left on the line after inserting
6362 the truncation glyphs, fill that space with a stretch glyph of a
6363 suitably computed width.
6364
6365 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6366 produce_glyphs, to support GUI sessions.
6367
6368 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6369
6370 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6371
6372 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6373
6374 Do not require float-time's arg to fit in time_t (Bug#11825).
6375 This works better on hosts where time_t is unsigned, and where
6376 float-time is applied to the (negative) difference between two times.
6377 * editfns.c (decode_time_components): Last arg is now double *,
6378 not int *, and means to store all the result as a double, without
6379 worrying about whether the seconds part fits in time_t.
6380 All callers changed.
6381 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6382 All callers changed.
6383 (Ffloat_time): Do not fail merely because the specified time falls
6384 outside of time_t range.
6385
6386 2012-07-07 Glenn Morris <rgm@gnu.org>
6387
6388 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6389 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6390 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6391
6392 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6393
6394 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6395 Update dependencies.
6396
6397 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6398
6399 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6400
6401 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6402 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6403 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6404 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6405 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6406 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6407
6408 * xfont.c (compare_font_names): Redo to omit the need for casts.
6409
6410 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6411
6412 * xfns.c (Fx_change_window_property): Doc fix.
6413 * w32fns.c (Fx_change_window_property): Doc fix.
6414
6415 * w32fns.c (Fx_window_property): Accept the same arguments as the
6416 X Windows version. Doc fix.
6417 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6418
6419 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6420 Eli Zaretskii <eliz@gnu.org>
6421
6422 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6423 Windows-specific code from nt/config.nt moved here.
6424 Obsolete settings removed.
6425
6426 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6427
6428 * process.c: Avoid unnecessary calls to gettime.
6429 (wait_reading_process_output): Don't get the time of day
6430 when gobbling data immediately and not waiting, as there's no need
6431 for it in that case. This removes a FIXME.
6432
6433 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6434
6435 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6436 is defined (Bug#11768).
6437
6438 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6439
6440 Fix marker debugging code.
6441 * marker.c (byte_char_debug_check): Do not perform the check
6442 if buffer is not multibyte.
6443 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6444 Call byte_char_debug_check with correct arguments.
6445
6446 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6447
6448 Compile marker debugging code only if ENABLE_CHECKING is defined.
6449 * marker.c (byte_char_debug_check, count_markers):
6450 Use only if ENABLE_CHECKING is defined.
6451 (byte_debug_flag): Remove.
6452 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6453 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6454
6455 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6456
6457 Avoid code repetition in marker-related functions.
6458 * marker.c (attach_marker): New function.
6459 (Fset_marker, set_marker_restricted, set_marker_both)
6460 (set_marker_restricted_both): Use it.
6461 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6462 Consistently rename charno to charpos.
6463 (marker_position): Add eassert.
6464 (marker_byte_position): Convert to eassert.
6465
6466 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6467
6468 Simplify list operations in unchain_overlay and unchain_marker.
6469 * buffer.c (unchain_overlay): Simplify. Add comment.
6470 * marker.c (unchain_marker): Simplify. Fix comments.
6471
6472 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6473
6474 Introduce fast path for the widely used marker operation.
6475 * alloc.c (build_marker): New function.
6476 * lisp.h (build_marker): New prototype.
6477 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6478 * composite.c (autocmp_chars): Likewise.
6479 * editfns.c (buildmark): Remove.
6480 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6481 (save_restriction_save): Use build_marker.
6482 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6483 * window.c (save_window_save): Likewise.
6484
6485 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6486
6487 Do not use Fdelete_overlay in delete_all_overlays
6488 to avoid redundant calls to unchain_overlay.
6489 * buffer.c (drop_overlay): New function.
6490 (delete_all_overlays, Fdelete_overlay): Use it.
6491 * minibuf.c (get_minibuffer): Fix comment.
6492
6493 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6494
6495 Port to OpenBSD 5.1 amd64.
6496 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6497 This is needed for OpenBSD, and should be harmless on all BSD systems.
6498 Also, include <sys/sysctl.h>, as it should be available on all
6499 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6500 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6501 use p_pid member, not kp_proc.pid.
6502
6503 2012-07-06 Glenn Morris <rgm@gnu.org>
6504
6505 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6506
6507 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6508
6509 More xmalloc and related cleanup.
6510 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6511 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6512 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6513 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6514 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6515 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6516 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6517 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6518 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6519 * xterm.c:
6520 Omit needless casts involving void * pointers and allocation.
6521 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6522 as the former is more robust if P's type is changed.
6523 Prefer xzalloc to xmalloc + memset 0.
6524 Simplify malloc-or-realloc to realloc.
6525 Don't worry about xmalloc returning a null pointer.
6526 Prefer xstrdup to xmalloc + strcpy.
6527 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6528 growing it.
6529 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6530 alloca of a constant.
6531
6532 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6533
6534 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6535 hscroll is larger than the line width. Fixes long and futile
6536 looping inside extend_face_to_end_of_line (on a TTY) producing
6537 glyphs that are not needed and thrown away.
6538
6539 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6540
6541 * marker.c (set_marker_restricted_both): Simplify by using
6542 clip_to_bounds.
6543
6544 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6545
6546 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6547
6548 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6549
6550 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6551 not defined (Bug#11768).
6552 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6553 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6554 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6555 followed by gtk_box_set_homogeneous (Bug#11768).
6556 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6557 (update_theme_scrollbar_width, xg_create_scroll_bar):
6558 Use gtk_scrollbar_new (Bug#11768).
6559 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6560 (is_box_type): New function (Bug#11768).
6561 (xg_tool_item_stale_p): Call is_box_type.
6562 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6563 with default display (Bug#11768).
6564
6565 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6566
6567 * xdisp.c (window_hscroll_limited): New function.
6568 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6569 coordinates when window's hscroll is set to insanely large
6570 values. (Bug#11857)
6571
6572 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6573
6574 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6575 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6576
6577 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6578
6579 Cleanup xmalloc.
6580 * lisp.h (xzalloc): New prototype. Omit needless casts.
6581 * alloc.c (xzalloc): New function. Omit needless casts.
6582 * charset.c: Omit needless casts. Convert all calls to
6583 xmalloc with following memset to xzalloc.
6584 * dispnew.c: Likewise.
6585 * fringe.c: Likewise.
6586 * image.c: Likewise.
6587 * sound.c: Likewise.
6588 * term.c: Likewise.
6589 * w32fns.c: Likewise.
6590 * w32font.c: Likewise.
6591 * w32term.c: Likewise.
6592 * xfaces.c: Likewise.
6593 * xfns.c: Likewise.
6594 * xterm.c: Likewise.
6595 * atimer.c: Omit needless casts.
6596 * buffer.c: Likewise.
6597 * callproc.c: Likewise.
6598 * ccl.c: Likewise.
6599 * coding.c: Likewise.
6600 * composite.c: Likewise.
6601 * doc.c: Likewise.
6602 * doprnt.c: Likewise.
6603 * editfns.c: Likewise.
6604 * emacs.c: Likewise.
6605 * eval.c: Likewise.
6606 * filelock.c: Likewise.
6607 * fns.c: Likewise.
6608 * gtkutil.c: Likewise.
6609 * keyboard.c: Likewise.
6610 * lisp.h: Likewise.
6611 * lread.c: Likewise.
6612 * minibuf.c: Likewise.
6613 * msdos.c: Likewise.
6614 * print.c: Likewise.
6615 * process.c: Likewise.
6616 * region-cache.c: Likewise.
6617 * search.c: Likewise.
6618 * sysdep.c: Likewise.
6619 * termcap.c: Likewise.
6620 * terminal.c: Likewise.
6621 * tparam.c: Likewise.
6622 * w16select.c: Likewise.
6623 * w32.c: Likewise.
6624 * w32reg.c: Likewise.
6625 * w32select.c: Likewise.
6626 * w32uniscribe.c: Likewise.
6627 * widget.c: Likewise.
6628 * xdisp.c: Likewise.
6629 * xmenu.c: Likewise.
6630 * xrdb.c: Likewise.
6631 * xselect.c: Likewise.
6632
6633 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6634
6635 * fileio.c (time_error_value): Check the right error number.
6636 Problem reported by Troels Nielsen in
6637 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6638
6639 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6640
6641 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6642 This should be fixed in a better way; see Eli Zaretskii in
6643 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6644 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6645
6646 * fileio.c (time_error_value): Rename from special_mtime.
6647 The old name's problems were noted by Eli Zaretskii in
6648 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6649
6650 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6651 This variable's comment says Emacs needs at least one GDB-visible
6652 symbol of type enum pvec_type, to work around GDB problems.
6653 The symbol's value doesn't matter.
6654
6655 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6656 that causes compilation to fail on pre-C99 compilers.
6657
6658 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6659
6660 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6661 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6662
6663 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6664
6665 * buffer.c (init_buffer_once): Fix initialization of
6666 headers for buffer_defaults and buffer_local_symbols.
6667 Reported by Juanma Barranquero <lekktu@gmail.com>.
6668
6669 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6670
6671 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6672 * lisp.h (enum pvec_type): Use fewer bits.
6673 (PSEUDOVECTOR_SIZE_BITS): New constant.
6674 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6675 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6676 change in pvec_type.
6677 (PSEUDOVECTOR_TYPEP): New macro.
6678 (TYPED_PSEUDOVECTORP): Use it.
6679 * fns.c (internal_equal): Adapt code to extract pvectype.
6680 * emacs.c (gdb_pvec_type): Update type.
6681 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6682 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6683 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6684 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6685 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6686 abusing vector->header.next.nbytes.
6687 (live_vector_p): Use PVEC_TYPE.
6688 (mark_object): Adapt code to extract pvectype. Use switch.
6689
6690 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6691
6692 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6693 Tighten new eassert a bit.
6694
6695 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6696
6697 Fix compilation with --enable-gcc-warnings and -O1
6698 optimization level.
6699 * doprnt.c (doprnt): Change type of tem to int, initialize
6700 to avoid compiler warning. Add eassert.
6701 * search.c (simple_search): Initialize match_byte to avoid
6702 compiler warning. Add eassert.
6703
6704 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 Avoid weird behavior with large horizontal scrolls.
6707 Without this change, for example, large hscroll values would
6708 mess up Emacs's display on Fedora 15 x86, presumably due to
6709 overflows in int calculations in the display code.
6710 Also, if buffers had long lines, Emacs would freeze.
6711 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6712 (set_window_hscroll): New function, containing the old guts of
6713 Fset_window_hscroll. Return the clipped value.
6714 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6715 This avoids the need to check against PTRDIFF_MAX.
6716
6717 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6718
6719 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6720
6721 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6722
6723 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6724
6725 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6726 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6727 since GCC 4.4.6 issues a bogus warning for them.
6728
6729 Fix bugs in file timestamp newness comparisons.
6730 * fileio.c (Ffile_newer_than_file_p):
6731 * lread.c (Fload): Use full timestamp resolution of files,
6732 not just the 1-second resolution, so that files that are only
6733 slightly newer still count as newer.
6734 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6735 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6736
6737 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6738
6739 * fileio.c: Improve handling of file time marker. (Bug#11852)
6740 (special_mtime): New function.
6741 (Finsert_file_contents, Fverify_visited_file_modtime):
6742 Use it to set special mtime values consistently.
6743
6744 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6745
6746 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6747 marker for non-existing file. (Bug#11852)
6748
6749 2012-07-03 Glenn Morris <rgm@gnu.org>
6750
6751 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6752 and did not make it into globals.h).
6753
6754 2012-07-03 Tom Tromey <tromey@redhat.com>
6755
6756 * window.c (Fset_window_margins, Fset_window_fringes)
6757 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6758 * textprop.c (Fprevious_property_change): No longer static.
6759 * syntax.c (Fsyntax_table_p): No longer static.
6760 * process.c (Fget_process, Fprocess_datagram_address): No longer
6761 static.
6762 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6763 * keyboard.c (Fcommand_execute): No longer static.
6764 Remove EXFUN.
6765 * insdel.c (Fcombine_after_change_execute): No longer static.
6766 * image.c (Finit_image_library): No longer static.
6767 * fileio.c (Fmake_symbolic_link): No longer static.
6768 * eval.c (Ffetch_bytecode): No longer static.
6769 * editfns.c (Fuser_full_name): No longer static.
6770 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6771 No longer static.
6772 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6773 static.
6774 * dired.c (Ffile_attributes): No longer static.
6775 * composite.c (Fcomposition_get_gstring): No longer static.
6776 * callproc.c (Fgetenv_internal): No longer static.
6777
6778 * ccl.h: Remove EXFUNs.
6779 * buffer.h: Remove EXFUNs.
6780 * dispextern.h: Remove EXFUNs.
6781 * intervals.h: Remove EXFUNs.
6782 * fontset.h: Remove EXFUN.
6783 * font.h: Remove EXFUNs.
6784 * dosfns.c (system_process_attributes): Remove EXFUN.
6785 * keymap.h: Remove EXFUNs.
6786 * lisp.h: Remove EXFUNs.
6787 * w32term.h: Remove EXFUNs.
6788 * window.h: Remove EXFUNs.
6789 * xsettings.h: Remove EXFUN.
6790 * xterm.h: Remove EXFUN.
6791
6792 2012-07-03 Glenn Morris <rgm@gnu.org>
6793
6794 * lisp.h (Frandom): Make it visible to C.
6795 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6796 buffer for invisible buffers. (Bug#1229)
6797
6798 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6799
6800 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6801 values which aren't power of 2.
6802 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6803 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6804 accordingly.
6805
6806 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6807
6808 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6809
6810 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6811
6812 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6813
6814 * alloc.c (allocate_vector_block): Remove redundant
6815 calls to mallopt if DOUG_LEA_MALLOC is defined.
6816 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6817 avoid calls to mallopt if zero_vector is returned.
6818
6819 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6820
6821 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6822 is enabled, avoid dereferencing NULL current_sblock if
6823 running undumped.
6824
6825 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6826
6827 Cleanup basic buffer management.
6828 * buffer.h (struct buffer): Change layout to use generic vector
6829 marking code. Fix some comments. Change type of 'clip_changed'
6830 to bitfield. Remove unused #ifndef old.
6831 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6832 (GET_OVERLAYS_AT): Fix indentation.
6833 (for_each_per_buffer_object_at): New macro.
6834 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6835 (Fbuffer_local_variables): Use it.
6836 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6837 * alloc.c (allocate_buffer): Adjust to match new layout of
6838 struct buffer. Fix comment.
6839 (mark_overlay): New function.
6840 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6841 Lisp area of struct buffer.
6842 (mark_object): Use it. Adjust marking of misc objects
6843 and related comments.
6844
6845 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6846
6847 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6848 wrapper that is not needed because the wrapped code is a no-op (zero
6849 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6850 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6851
6852 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6853
6854 * alloc.c (mark_buffer): Simplify. Remove prototype.
6855 (mark_object): Add comment. Reorganize marking of vector-like
6856 objects. Use CHECK_LIVE for all vector-like objects except buffers
6857 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6858 Avoid redundant calls to mark_vectorlike for bool vectors.
6859
6860 2012-06-30 Glenn Morris <rgm@gnu.org>
6861
6862 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6863
6864 * epaths.in (PATH_SITELOADSEARCH): New.
6865 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6866 This is rather than relying on --enable-locallisppath elements
6867 having "site-lisp" in their names. (Bug#10208#25, 11658)
6868
6869 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6870
6871 * w32proc.c (sys_select): Accept and ignore one more argument.
6872
6873 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6874
6875 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6876 (pselect) [!MS_DOS]: Redirect to sys_select.
6877
6878 * sysdep.c: Don't include dos.h and dosfns.h.
6879
6880 * process.c (sys_select):
6881 * msdos.c (sys_select): Accept one more argument and ignore it.
6882
6883 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6884 adapt data types and code to that.
6885
6886 * dosfns.c:
6887 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6888 which clashes with the gnulib function of the same name.
6889
6890 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6891
6892 * font.c (font_style_to_value, font_style_symbolic)
6893 (font_prop_validate_style): Add type checks for values in
6894 font_style_table.
6895
6896 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6897 argument.
6898 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6899 uses.
6900
6901 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6902
6903 * xdisp.c (try_window_id): Undo last change.
6904
6905 * w32.c (getwd): Adjust commentary about startup_dir.
6906 (init_environment): Always call sys_access, even in non-MSVC
6907 builds. Don't chdir to the directory of the Emacs executable.
6908 This undoes code from 1997 which was justified by the need to
6909 "avoid conflicts when removing and renaming directories". But its
6910 downside was that every relative file name was being interpreted
6911 relative to the directory of the Emacs executable, which can never
6912 be TRT. In particular, it broke sys_access when called with
6913 relative file names.
6914 (sys_access): Map GetLastError to errno.
6915
6916 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6917
6918 * window.h (struct window): Change type of 'fringes_outside_margins'
6919 to bitfield. Fix comment. Adjust users accordingly.
6920 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6921 Adjust comment.
6922 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6923 to ptrdiff_t.
6924
6925 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6926
6927 * gnutls.c (emacs_gnutls_handshake):
6928 Add QUIT to make the loop interruptible.
6929
6930 2012-06-29 Glenn Morris <rgm@gnu.org>
6931
6932 * charset.c (init_charset): Make lack of etc/charsets fatal.
6933
6934 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6935
6936 * editfns.c (region_limit): Fix type mismatch.
6937
6938 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6939
6940 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6941 undefined. Convert from xassert to eassert.
6942 * nsmenu.m: Convert from xassert to eassert.
6943 * nsterm.m: Likewise.
6944
6945 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6946
6947 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6948
6949 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6950
6951 Avoid integer overflow on scroll-left and scroll-right.
6952 * window.c (HSCROLL_MAX): New macro.
6953 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6954 overflow when requested scroll falls outside ptrdiff_t range.
6955
6956 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6957
6958 * window.h (struct window): Change type of 'hscroll',
6959 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6960 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6961 Adjust users accordingly.
6962 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6963 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6964 from EMACS_INT to ptrdiff_t.
6965 (make_window): Omit redundant initialization.
6966
6967 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6968
6969 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6970
6971 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6972
6973 * window.h (struct window): Change type of 'use_time' and
6974 'sequence_number' from Lisp_Object to int.
6975 * frame.c (make_frame): Adjust users accordingly.
6976 * print.c (print_object): Likewise.
6977 * window.c (select_window, Fwindow_use_time, make_parent_window)
6978 (make_window): Likewise.
6979
6980 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6981
6982 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6983 enabled with --enable-checking=[all,glyphs] configure option.
6984 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6985 adjust comments accordingly.
6986 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6987 undefined, adjust comments accordingly.
6988 * image.c: Likewise.
6989 * scroll.c: Likewise.
6990 * w32fns.c: Likewise.
6991 * w32term.c: Likewise.
6992 * xdisp.c: Likewise.
6993 * xfaces.c: Likewise.
6994 * xfns.c: Likewise.
6995 * xterm.c: Likewise.
6996
6997 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6998
6999 Generalize run-time debugging checks.
7000 * dispextern.h (XASSERTS): Remove.
7001 * fontset.c (xassert): Remove.
7002 Convert from xassert to eassert.
7003 * alloc.c: Convert from xassert to eassert.
7004 * bidi.c: Likewise.
7005 * dispnew.c: Likewise.
7006 * fns.c: Likewise.
7007 * fringe.c: Likewise.
7008 * ftfont.c: Likewise.
7009 * gtkutil.c: Likewise.
7010 * image.c: Likewise.
7011 * keyboard.c: Likewise.
7012 * menu.c: Likewise.
7013 * process.c: Likewise.
7014 * scroll.c: Likewise.
7015 * sound.c: Likewise.
7016 * term.c: Likewise.
7017 * w32console.c: Likewise.
7018 * w32fns.c: Likewise.
7019 * w32term.c: Likewise.
7020 * window.c: Likewise.
7021 * xdisp.c: Likewise.
7022 * xfaces.c: Likewise.
7023 * xfns.c: Likewise.
7024 * xselect.c: Likewise.
7025 * xterm.c: Likewise.
7026
7027 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7028
7029 * fns.c (maybe_resize_hash_table): Output message when growing the
7030 purify-hashtable.
7031
7032 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7033
7034 * alloc.c (allocate_string_data): Remove dead code.
7035 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7036 avoid GCC warning about unused macro.
7037
7038 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7039
7040 * alloc.c (allocate_string): Omit intervals initialization.
7041 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7042 as in make_pure_string and make_pure_c_string.
7043
7044 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7045
7046 * alloc.c (allocate_string): Fix last change.
7047
7048 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7049
7050 * alloc.c (allocate_string): Remove two redundant calls
7051 to memset, add explicit initialization where appropriate.
7052
7053 2012-06-27 Glenn Morris <rgm@gnu.org>
7054
7055 * lisp.mk (lisp): Remove paths.elc.
7056
7057 2012-06-27 Chong Yidong <cyd@gnu.org>
7058
7059 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7060
7061 2012-06-26 John Wiegley <johnw@newartisans.com>
7062
7063 * unexmacosx.c (copy_data_segment): Add two section names used
7064 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7065
7066 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7067 when building with Clang.
7068
7069 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7070
7071 * eval.c (Fapply): Allow calling it with a single argument.
7072
7073 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7074
7075 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7076 _stricmp and _strnicmp.
7077 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7078
7079 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7080
7081 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7082 allocated window.
7083 (allocate_process): Likewise for new process.
7084 (allocate_terminal): Change to use offsetof.
7085 (allocate_frame): Likewise.
7086 * frame.c (make_frame): Omit redundant initialization.
7087 * window.c (make_parent_window): Use memset.
7088 (make_window): Omit redundant initialization.
7089 * process.c (make_process): Omit redundant initialization.
7090 * terminal.c (create_terminal): Likewise.
7091
7092 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7093
7094 * term.c (delete_tty): Remove redundant call to memset.
7095
7096 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7097
7098 * alloc.c: Remove build_string.
7099 * lisp.h: Define build_string as static inline. This provides
7100 a better opportunity to optimize away calls to strlen when the
7101 function is called with compile-time constant argument.
7102 * image.c (imagemagick_error): Convert to build_string.
7103 * w32proc.c (sys_spawnve): Likewise.
7104 * xterm.c (x_term_init): Likewise.
7105
7106 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7107
7108 Use sprintf return value instead of invoking strlen on result.
7109 In the old days this wasn't portable, since some sprintf
7110 implementations returned char *. But they died out years ago and
7111 Emacs already assumes sprintf returns int.
7112 Similarly for float_to_string.
7113 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7114 * ccl.c (ccl_driver):
7115 * character.c (string_escape_byte8):
7116 * data.c (Fnumber_to_string):
7117 * doprnt.c (doprnt):
7118 * print.c (print_object):
7119 * xdisp.c (message_dolog):
7120 * xfns.c (syms_of_xfns):
7121 Use sprintf or float_to_string result to avoid need to call strlen.
7122 * data.c (Fnumber_to_string):
7123 Use make_unibyte_string, since the string must be ASCII.
7124 * lisp.h, print.c (float_to_string): Now returns int length.
7125 * term.c (produce_glyphless_glyph):
7126 Use sprintf result rather than recomputing it.
7127
7128 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7129 * Makefile.in (ALL_CFLAGS):
7130 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7131 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7132
7133 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7134
7135 * dispextern.h (xstrcasecmp): Define to library function
7136 strcasecmp if available.
7137 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7138
7139 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7140
7141 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7142 Avoid comma operator.
7143 * menu.c (push_submenu_start, push_submenu_end)
7144 (push_left_right_boundary, push_menu_pane): Likewise.
7145 * msdos.c (dos_rawgetc): Likewise.
7146
7147 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7148
7149 * xfns.c (xic_create_fontsetname): Remove redundant calls
7150 to memset.
7151
7152 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7153
7154 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7155 sprintf already null-terminates its output.
7156
7157 * xfns.c (x_window): Remove redundant cast.
7158
7159 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7160
7161 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7162 `const char *' to `char *' to avoid compiler warning.
7163
7164 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7165
7166 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7167 instead of truncating it to 63 (admittedly a generous limit).
7168
7169 * process.c: Fix spelling and caps in comments.
7170
7171 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7172
7173 * emacs.c (setpgrp): Remove definition, unused.
7174 * sysdep.c (setpgrp): Remove definition, not used in this file.
7175
7176 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7177
7178 * makefile.w32-in: Update dependencies.
7179
7180 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7181
7182 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7183 (SYSTIME_H): Add nt/inc/sys/time.h.
7184
7185 * systime.h [WINDOWSNT]: Include sys/time.h.
7186
7187 * s/ms-w32.h (struct timespec): Definition moved from
7188 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7189
7190 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7191
7192 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7193 * buffer.h (buffer_slot_type_mismatch):
7194 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7195 * eval.c (unwind_to_catch):
7196 * image.c (my_png_error, my_error_exit):
7197 * keyboard.c (quit_throw_to_read_char, user_error)
7198 (Fexit_recursive_edit, Fabort_recursive_edit):
7199 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7200 (wrong_type_argument, buffer_overflow, __executable_start)
7201 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7202 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7203 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7204 (fatal):
7205 (child_setup) [!DOS_NT]:
7206 * lread.c (end_of_file_error, invalid_syntax):
7207 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7208 * puresize.h (pure_write_error):
7209 * search.c (matcher_overflow):
7210 * sound.c (sound_perror, alsa_sound_perror):
7211 * sysdep.c, syssignal.h (croak):
7212 * term.c (maybe_fatal, vfatal):
7213 * textprop.c (text_read_only):
7214 * undo.c (user_error):
7215 * unexmacosx.c (unexec_error):
7216 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7217 Use _Noreturn rather than NO_RETURN.
7218 No need for separate decl merely because of _Noreturn.
7219 * sound.c (sound_warning, parse_sound):
7220 Remove unnecessary forward decls.
7221
7222 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7223
7224 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7225 * lisp.h (WAIT_READING_MAX): New macro.
7226 * dispnew.c (Fsleep_for, sit_for):
7227 * keyboard.c (kbd_buffer_get_event):
7228 * process.c (Faccept_process_output):
7229 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7230 This improves on the previous patch, which introduced a bug
7231 when time_t is unsigned and as wide as intmax_t.
7232 See <http://bugs.gnu.org/9000#51>.
7233
7234 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7235
7236 * dispnew.c (sit_for, Fsleep_for):
7237 * keyboard.c (kbd_buffer_get_event):
7238 * process.c (Faccept_process_output): Avoid compiler warnings when
7239 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7240
7241 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7242
7243 * makefile.w32-in: Update dependencies.
7244
7245 * w32.c (ltime): Add return type and declare static.
7246 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7247
7248 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7249
7250 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7251 Privately reported by Herbert J. Skuhra.
7252 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7253 All uses changed.
7254 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7255 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7256
7257 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7258
7259 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7260 last argument of make_unibyte_string.
7261
7262 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7263 language ID in the event parameters.
7264
7265 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7266 event.code, not the obscure "character set ID".
7267
7268 2012-06-23 Chong Yidong <cyd@gnu.org>
7269
7270 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7271
7272 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7273
7274 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7275 * w32.c (fdutimens): New function.
7276
7277 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7278
7279 * s/ms-w32.h (pselect): Redirect to sys_select.
7280
7281 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7282
7283 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7284 in the logic of incrementing and decrementing the value of
7285 use_relocatable_buffers.
7286
7287 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7288
7289 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7290 Privately reported by Herbert J. Skuhra.
7291 [__FreeBSD__]: Remove "*/" typo after "#include".
7292 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7293 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7294 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7295 Don't assume EMACS_TIME and struct timeval are the same type.
7296
7297 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7298
7299 Support higher-resolution time stamps (Bug#9000).
7300 The time stamps are only nanosecond-resolution at the C level,
7301 since that's the best that any real-world system supports now.
7302 But they are picosecond-resolution at the Lisp level, as that's
7303 easy, and leaves room for future OS improvements.
7304
7305 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7306 (LIBES): Use it.
7307
7308 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7309 Don't get current time unless it's needed.
7310
7311 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7312 now provides it if it's absent.
7313 (start_atimer): Port to higher-res time stamps.
7314 Check for time stamp overflow. Don't get current time more
7315 often than is needed.
7316
7317 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7318 Include systime.h, not time.h.
7319 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7320
7321 * dired.c: Include stat-time.h.
7322 (Ffile-attributes): File times now have higher resolution.
7323
7324 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7325 (struct image): Timestamp now has higher resolution.
7326
7327 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7328 has at least microseconds now. All uses removed.
7329 (update_frame, update_single_window, update_window, update_frame_1)
7330 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7331 (duration_to_sec_usec): Remove; no longer needed.
7332
7333 * editfns.c (time_overflow): Now extern.
7334 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7335 (float-time, Fformat_time_string, Fcurrent_time_string)
7336 (Fcurrent_time_zone): Accept and generate higher-resolution
7337 time stamps.
7338 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7339 (decode_time_components, lisp_seconds_argument): New functions.
7340 (make_time): Now static.
7341 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7342 Report an error if the time is invalid, rather than having the caller
7343 do that.
7344
7345 * fileio.c: Include <stat-time.h>
7346 (Fcopy_file): Copy higher-resolution time stamps.
7347 Prefer to set the time stamp via a file descriptor if that works.
7348 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7349 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7350 (Fvisited_file_modtime, Fset_visited_file_modtime):
7351 Support higher-resolution time stamps.
7352
7353 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7354
7355 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7356
7357 * image.c (prepare_image_for_display, clear_image_cache)
7358 (lookup_image): Port to higer-resolution time stamps.
7359
7360 * keyboard.c (start_polling, bind_polling_period):
7361 Check for time stamp overflow.
7362 (read_char, kbd_buffer_get_event, timer_start_idle)
7363 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7364 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7365 Port to higher-resolution time stamps. Do not assume time_t is signed.
7366 (decode_timer): New function. Timers are now vectors of length 9,
7367 not 8, to accommodate the picosecond component.
7368 (timer_check_2): Use it.
7369
7370 * nsterm.m (select_timeout, timeval_subtract): Remove.
7371 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7372 as they're a bit more accurate and handle overflow better.
7373 (ns_select): Change prototype to be compatible with pselect.
7374 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7375 * nsterm.h (ns_select): Adjust prototype.
7376
7377 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7378 us-resolution time stamps.
7379 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7380
7381 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7382
7383 * lisp.h (time_overflow): New decl.
7384 (wait_reading_process_output): First arg is now intmax_t, not int,
7385 to accommodate larger waits.
7386
7387 * process.h (struct Lisp_Process.read_output_delay):
7388 Now counts nanoseconds, not microseconds.
7389 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7390 EMACS_HAS_USECS.
7391 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7392 (wait_reading_process_output):
7393 Port to ns-resolution time stamps.
7394 (Faccept_process_output, wait_reading_process_output):
7395 Check for time stamp overflow. Do not assume time_t is signed.
7396 (select_wrapper): Remove; we now use pselect.
7397 (Fprocess_attributes): Now generates ns-resolution time stamps.
7398
7399 * sysdep.c: Include utimens.h. Don't include utime.h
7400 or worry about struct utimbuf; gnulib does that for us now.
7401 (gettimeofday): Remove; gnulib provides a substitute.
7402 (make_timeval): New function.
7403 (set_file_times): Now sets ns-resolution time stamps.
7404 New arg FD; all uses changed.
7405 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7406 (system_process_attributes):
7407 Now returns ns-resolution time stamp. All uses changed.
7408 Check for time stamp overflow.
7409
7410 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7411 provides a substitute now.
7412
7413 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7414 since it guarantees struct timespec.
7415 (EMACS_TIME): Now struct timespec, so that we can support
7416 ns-resolution time stamps.
7417 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7418 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7419 (EMACS_USECS): Remove.
7420 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7421 so multiply the arg by 1000 before storing it.
7422 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7423 New macros.
7424 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7425 Port to ns-resolution time stamps.
7426 (EMACS_TIME_NEG_P): Remove; replaced by....
7427 (EMACS_TIME_SIGN): New macro.
7428 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7429 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7430 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7431 (make_timeval, make_lisp_time, decode_time_components): New decls.
7432 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7433 that it mishandled time_t overflow. You can't compare by subtracting!
7434 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7435 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7436
7437 * term.c: Include <sys/time.h>.
7438 (timeval_to_Time): New function, for proper overflow wraparound.
7439 (term_mouse_position, term_mouse_click): Use it.
7440
7441 * undo.c (record_first_change): Support higher-resolution time stamps
7442 in the undo buffer.
7443 (Fprimitive_undo): Use them when restoring time stamps.
7444
7445 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7446 (w32_get_internal_run_time):
7447 Port to higher-resolution Emacs time stamps.
7448 (ltime): Now accepts single 64-bit integer, as that's more convenient
7449 for callers.
7450
7451 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7452
7453 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7454 for compatibility with pselect. Support ns-resolution time stamps.
7455
7456 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7457
7458 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7459 Check for time stamp overflow, and support ns-resolution time stamps.
7460
7461 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7462 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7463 (timeval_subtract): Remove; no longer needed.
7464 (XTflash, XTring_bell, x_wait_for_event):
7465 Port to ns-resolution time stamps. Don't assume time_t is signed.
7466
7467 2012-06-22 Chong Yidong <cyd@gnu.org>
7468
7469 * xdisp.c (x_consider_frame_title): Revert last change.
7470
7471 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7472
7473 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7474 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7475 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7476 staticidx goes up to 1597 out of 1600 = 0x640.)
7477
7478 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7481 Otherwise, the umask might be mistakenly 0 while handling input signals.
7482
7483 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7484
7485 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7486
7487 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7488
7489 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7490 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7491 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7492 access to `contents' member of Lisp_Vector objects with AREF and ASET
7493 where appropriate.
7494
7495 2012-06-19 Chong Yidong <cyd@gnu.org>
7496
7497 * frame.c (delete_frame): When selecting a frame on a different
7498 text terminal, do not alter the terminal's top-frame.
7499
7500 * xdisp.c (format_mode_line_unwind_data): Record the target
7501 frame's selected window and its terminal's top-frame.
7502 (unwind_format_mode_line): Restore them.
7503 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7504 Callers changed.
7505 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7506 since tty frames can be explicitly named.
7507 (prepare_menu_bars): Likewise.
7508
7509 * term.c (Ftty_top_frame): New function.
7510
7511 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7512
7513 Port byte-code-meter to modern targets.
7514 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7515 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7516 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7517 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7518 (METER_1, METER_2): Simplify.
7519
7520 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7521
7522 * data.c (Fdefalias): Return `symbol' (bug#11686).
7523
7524 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7525
7526 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7527 gets killed during executing of this function (Bug#11665).
7528 Try to always return Qt when the buffer has been actually killed.
7529 (Vkill_buffer_query_functions): In doc-string say that functions
7530 run by this hook should not change the current buffer.
7531
7532 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7533
7534 Fix recently-introduced process.c problems found by static checking.
7535 * process.c (write_queue_push, write_queue_pop, send_process):
7536 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7537 (write_queue_pop): Fix pointer signedness problem.
7538 (send_process): Remove unused local.
7539
7540 2012-06-17 Chong Yidong <cyd@gnu.org>
7541
7542 * xdisp.c (redisplay_internal): No need to redisplay terminal
7543 frames that are not on top.
7544
7545 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7546
7547 * process.c (make_process): Initialize write_queue.
7548 (write_queue_push, write_queue_pop): New functions.
7549 (send_process): Use them to maintain correct ordering of process
7550 writes (Bug#10815).
7551
7552 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7553
7554 * lisp.h (eassert): Assume C89 or later.
7555 This removes the need for CHECK.
7556 (CHECK): Remove. Its comments about always evaluating its
7557 argument were confusing, as 'eassert' typically does not evaluate
7558 its argument.
7559
7560 * coding.c (produce_chars): Use ptrdiff_t, not int.
7561
7562 * xterm.c (x_draw_underwave): Check for integer overflow.
7563 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7564
7565 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7566
7567 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7568 referenced (Bug#11583).
7569
7570 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7571
7572 Implement wave-style variant of underlining.
7573 * dispextern.h (face_underline_type): New enum.
7574 (face): Add field for underline type.
7575 * nsterm.m (ns_draw_underwave): New function.
7576 (ns_draw_text_decoration): Use it.
7577 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7578 New functions.
7579 (x_draw_glyph_string): Use them.
7580 * xfaces.c (Qline, Qwave): New Lisp objects.
7581 (check_lface_attrs, merge_face_ref)
7582 (Finternal_set_lisp_face_attribute, realize_x_face):
7583 Handle wave-style underline face attributes.
7584 * xterm.c (x_draw_underwave): New function.
7585 (x_draw_glyph_string): Use it.
7586
7587 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7588
7589 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7590 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7591 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7592 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7593 ($(BLD)/w32select.$(O)): Update dependencies.
7594
7595 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7596
7597 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7598 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7599 * character.c (_fetch_multibyte_char_p): Remove.
7600 * alloc.c: Include "character.h" before "buffer.h".
7601 * bidi.c: Likewise.
7602 * buffer.c: Likewise.
7603 * bytecode.c: Likewise.
7604 * callint.c: Likewise.
7605 * callproc.c: Likewise.
7606 * casefiddle.c: Likewise.
7607 * casetab.c: Likewise.
7608 * category.c: Likewise.
7609 * cmds.c: Likewise.
7610 * coding.c: Likewise.
7611 * composite.c: Likewise.
7612 * dired.c: Likewise.
7613 * dispnew.c: Likewise.
7614 * doc.c: Likewise.
7615 * dosfns.c: Likewise.
7616 * editfns.c: Likewise.
7617 * emacs.c: Likewise.
7618 * fileio.c: Likewise.
7619 * filelock.c: Likewise.
7620 * font.c: Likewise.
7621 * fontset.c: Likewise.
7622 * fringe.c: Likewise.
7623 * indent.c: Likewise.
7624 * insdel.c: Likewise.
7625 * intervals.c: Likewise.
7626 * keyboard.c: Likewise.
7627 * keymap.c: Likewise.
7628 * lread.c: Likewise.
7629 * macros.c: Likewise.
7630 * marker.c: Likewise.
7631 * minibuf.c: Likewise.
7632 * nsfns.m: Likewise.
7633 * nsmenu.m: Likewise.
7634 * print.c: Likewise.
7635 * process.c: Likewise.
7636 * regex.c: Likewise.
7637 * region-cache.c: Likewise.
7638 * search.c: Likewise.
7639 * syntax.c: Likewise.
7640 * term.c: Likewise.
7641 * textprop.c: Likewise.
7642 * undo.c: Likewise.
7643 * unexsol.c: Likewise.
7644 * w16select.c: Likewise.
7645 * w32fns.c: Likewise.
7646 * w32menu.c: Likewise.
7647 * window.c: Likewise.
7648 * xdisp.c: Likewise.
7649 * xfns.c: Likewise.
7650 * xmenu.c: Likewise.
7651 * xml.c: Likewise.
7652 * xselect.c: Likewise.
7653
7654 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7655
7656 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7657 If all the glyphs of the glyph row came from strings, and we have no
7658 cursor positioning clues, put the cursor on the first glyph of the
7659 row.
7660 (handle_face_prop): Use chunk-relative overlay string index when
7661 indexing into it->string_overlays array. (Bug#11653)
7662 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7663 the rightmost. (Bug#11720)
7664
7665 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7666
7667 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7668 (CATEGORY_MEMBER): Enforce 1/0 value.
7669 * category.c (_temp_category_set): Remove.
7670
7671 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7672
7673 * window.c (Fdelete_other_windows_internal)
7674 (Fdelete_window_internal): Don't access frame's mouse highlight
7675 info of the initial frame. (Bug#11677)
7676
7677 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7678
7679 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7680 Assume USE_2_TAGS_FOR_INTS.
7681 (xreload): Adjust $tagmask width to match recent lisp.h change.
7682
7683 Simplify lisp.h in minor ways that should not affect code.
7684 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7685 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7686 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7687 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7688 (INTTYPEBITS): New macro, for clarity.
7689 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7690 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7691 Simplify now that USE_LSB_TAG is always defined.
7692 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7693 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7694
7695 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7696
7697 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7698
7699 2012-06-13 Glenn Morris <rgm@gnu.org>
7700
7701 * s/bsd-common.h (BSD4_3):
7702 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7703
7704 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7705
7706 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7707 instead of union.
7708 (XLI, XIL): Define.
7709 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7710 Use them.
7711 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7712 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7713 * alloc.c (widen_to_Lisp_Object): Remove.
7714 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7715 * frame.c (delete_frame): Remove outdated comment.
7716 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7717 USE_LISP_UNION_TYPE.
7718 (Fw32_unregister_hot_key): Likewise.
7719 (Fw32_toggle_lock_key): Likewise.
7720 * w32menu.c (add_menu_item): Likewise.
7721 (w32_menu_display_help): Use XIL instead of checking
7722 USE_LISP_UNION_TYPE.
7723 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7724 (init_heap): Likewise.
7725 * w32term.c (w32_read_socket): Update comment.
7726
7727 2012-06-13 Glenn Morris <rgm@gnu.org>
7728
7729 * s/usg5-4-common.h, src/s/unixware.h:
7730 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7731
7732 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7733
7734 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7735
7736 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7737 * alloc.c (make_number) [!defined make_number]:
7738 Remove, as lisp.h always defines this now.
7739 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7740 (roundup_size): Verify that it is a power of 2.
7741 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7742 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7743 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7744 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7745 USE_LSB_TAG now is always defined to be either 0 or 1.
7746 All uses changed.
7747 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7748 code works fine either way, and efficiency is not a concern here,
7749 as the union type is for debugging, not for production.
7750 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7751 Use an inline function on all platforms when using the union type,
7752 since this is simpler and 'static inline' can be used portably
7753 within Emacs now.
7754 (LISP_INITIALLY_ZERO): New macro.
7755 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7756 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7757
7758 2012-06-12 Glenn Morris <rgm@gnu.org>
7759
7760 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7761
7762 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7763
7764 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7765 Move BROKEN_SIGIO to configure.
7766
7767 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7768 Move NO_TERMIO to configure.
7769
7770 2012-06-12 Chong Yidong <cyd@gnu.org>
7771
7772 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7773 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7774 MagickExportImagePixels is undefined.
7775
7776 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7777
7778 * image.c (imagemagick_load_image): Remove unused label.
7779
7780 2012-06-11 Glenn Morris <rgm@gnu.org>
7781
7782 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7783 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7784 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7785 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7786
7787 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7788
7789 * alloc.c (make_byte_code): New function.
7790 (Fmake_byte_code): Use it. Don't purify here.
7791 * lread.c (read1): Use it as well to avoid extra allocation.
7792
7793 2012-06-11 Chong Yidong <cyd@gnu.org>
7794
7795 * image.c (imagemagick_load_image): Implement transparency.
7796
7797 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7798
7799 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7800 account for preceding backslashes. (Bug#11663)
7801
7802 2012-06-09 Chong Yidong <cyd@gnu.org>
7803
7804 * term.c: Support italics in capable terminals (Bug#9652).
7805 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7806 (turn_on_face): Output using TS_enter_italic_mode if available.
7807 Don't handle unused blinking and alt-charset cases.
7808 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7809 and tty_alt_charset_p cases.
7810 (tty_capable_p, init_tty): Support italics.
7811
7812 * termchar.h (struct tty_display_info): Add field for italics.
7813 Remove unused blink field.
7814
7815 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7816 Handle slant.
7817
7818 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7819 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7820 tty_alt_charset_p. Add tty_italic_p.
7821
7822 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7823
7824 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7825 dbus_type_is_basic if available.
7826 (xd_extract_signed, xd_extract_unsigned): Rename from
7827 extract_signed and extract_unsigned, respectively. Adapt callers.
7828
7829 2012-06-09 Chong Yidong <cyd@gnu.org>
7830
7831 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7832
7833 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7834 case (Bug#9752).
7835
7836 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7837
7838 * xdisp.c (vmessage): Treat frame message as multibyte.
7839 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7840 would generate the diagnostic "Making \302\247 buffer-local while
7841 let-bound!".
7842
7843 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7844
7845 * dispnew.c (showing_window_margins_p): Undo last change, which
7846 was done due to an inadvertent commit.
7847 (adjust_frame_glyphs_for_frame_redisplay): Do call
7848 showing_window_margins_p.
7849
7850 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7851
7852 * eval.c (Fmake_var_non_special): New primitive.
7853 (syms_of_eval): Defsubr it.
7854 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7855
7856 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7857
7858 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7859 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7860
7861 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7862
7863 * alloc.c (allocate_vectorlike): Fix last change.
7864
7865 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7866
7867 Block-based vector allocation of small vectors.
7868 * lisp.h (struct vectorlike_header): New field `nbytes',
7869 adjust comment accordingly.
7870 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7871 to denote vector blocks. Adjust users (live_vector_p,
7872 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7873 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7874 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7875 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7876 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7877 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7878 (roundup_size): New constant.
7879 (struct vector_block): New data type.
7880 (vector_blocks, vector_free_lists, zero_vector): New variables.
7881 (all_vectors): Rename to `large_vectors'.
7882 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7883 (sweep_vectors): New functions.
7884 (allocate_vectorlike): Return `zero_vector' as the only vector of
7885 0 items. Allocate new vector from block if vector size is less than
7886 or equal to VBLOCK_BYTES_MAX.
7887 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7888 (init_alloc_once): Add call to init_vectors.
7889
7890 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7891
7892 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7893
7894 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7895
7896 * doprnt.c (doprnt): Truncate multibyte char correctly.
7897 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7898 would mishandle a string argument "Xc" if X was a multibyte
7899 character of length 2: it would truncate after X's first byte
7900 rather than including all of X.
7901
7902 2012-06-06 Chong Yidong <cyd@gnu.org>
7903
7904 * buffer.c (word_wrap): Doc fix.
7905
7906 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7907
7908 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7909
7910 2012-06-03 Glenn Morris <rgm@gnu.org>
7911
7912 * xdisp.c (tool-bar-style): Doc fix.
7913
7914 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7915
7916 * Makefile.in (PAXCTL): Define.
7917 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7918 binary via PaX flags if the paxctl utility is available.
7919 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7920 Restore PaX flags to their default. (Bug#11398)
7921
7922 2012-06-03 Chong Yidong <cyd@gnu.org>
7923
7924 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7925 buffer (Bug#11226).
7926
7927 2012-06-03 Chong Yidong <cyd@gnu.org>
7928
7929 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7930 (note_mode_line_or_margin_highlight): If there is no help echo,
7931 use mode-line-default-help-echo. Handle the case where the mouse
7932 position is past the end of the mode line string.
7933
7934 * buffer.c (buffer_local_value_1): New function, split from
7935 Fbuffer_local_value; can return Qunbound.
7936 (Fbuffer_local_value): Use it.
7937 (Vmode_line_format): Docstring tweaks.
7938
7939 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7940
7941 * sysdep.c (system_process_attributes): Improve comment.
7942
7943 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7944
7945 * keyboard.c: Export real-this-command to Elisp.
7946 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7947 and DEFVAR it. Update all users.
7948
7949 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7950
7951 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7952
7953 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7954 Convert pctcpu and pctmem to Lisp float properly.
7955 Let the compiler fold better, as 100.0/0x8000 is exact.
7956
7957 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7958
7959 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7960 cons_block.
7961
7962 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7963
7964 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7965
7966 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7967
7968 For a 'struct window', replace some Lisp_Object fields to
7969 bitfields where appropriate, remove unused fields.
7970 * window.h (struct window): Remove unused 'last_mark_x' and
7971 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7972 change its type from Lisp_Object to bitfield.
7973 Change type of 'force_start', 'optional_new_start',
7974 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7975 fields from Lisp_Object to bitfield. Adjust users accordingly.
7976
7977 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 Pacify gcc -Wdouble-precision when using Xaw.
7980 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7981 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7982 Use 'float' consistently, rather than 'float' in most places
7983 and 'double' in a couple of places.
7984
7985 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7986
7987 * xdisp.c (handle_stop): Detect whether we have overlay strings
7988 loaded by testing it->current.overlay_string_index to be
7989 non-negative, instead of checking whether n_overlay_strings is
7990 positive. (Bug#11587)
7991
7992 2012-05-31 Chong Yidong <cyd@gnu.org>
7993
7994 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7995
7996 * doc.c (Fsubstitute_command_keys): Doc fix.
7997
7998 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7999
8000 * search.c (search_buffer): Remove calls to
8001 r_alloc_inhibit_buffer_relocation, as it is now called by
8002 maybe_unify_char, which was the cause of relocation of buffer text
8003 in bug#11519.
8004
8005 2012-05-31 Eli Zaretskii <eliz@gnu.org>
8006
8007 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8008 for the duration of call to load_charset, to avoid problems with
8009 callers of maybe_unify_char that access buffer text through C
8010 pointers.
8011
8012 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8013 decrement the inhibition flag, instead of just setting or
8014 resetting it.
8015
8016 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8017
8018 Remove obsolete '#define static' cruft.
8019 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8020 This #undef was "temporary" in 2000; it is no longer needed
8021 now that '#define static' has gone away.
8022 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8023 (gray_bitmap_bits): Remove; no longer needed.
8024 All uses replaced with definiens.
8025 * xterm.c: Include "bitmaps/gray.xbm".
8026
8027 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8028
8029 Clean up __executable_start, monstartup when --enable-profiling.
8030 The following changes affect the code only when profiling.
8031 * dispnew.c (__executable_start): Rename from safe_bcopy.
8032 Define only on platforms that need it.
8033 * emacs.c: Include <sys/gmon.h> when profiling.
8034 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8035 (__executable_start): Remove decl, since lisp.h does it now.
8036 (safe_bcopy): Remove decl; no longer has that name.
8037 (main): Coalesce #if into single bit of code, for simplicity.
8038 Cast pointers to uintptr_t, since standard libraries want integers
8039 and not pointers.
8040 * lisp.h (__executable_start): New decl.
8041
8042 2012-05-31 Glenn Morris <rgm@gnu.org>
8043
8044 * image.c (Fimagemagick_types): Doc fix.
8045
8046 2012-05-30 Jim Meyering <meyering@redhat.com>
8047
8048 * callproc.c (Fcall_process_region): Include directory component
8049 in mkstemp error message (Bug#11586).
8050
8051 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8052
8053 * alloc.c, lisp.h (make_pure_vector): Now static.
8054
8055 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8056
8057 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8058 Move to byte-run.el.
8059 (Fautoload): Do the hash-doc more carefully.
8060 * data.c (Fdefalias): Purify definition, except for keymaps.
8061 (Qdefun): Move from eval.c.
8062 * lisp.h (Qdefun): Remove.
8063 * lread.c (read1): Tiny simplification.
8064
8065 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8066
8067 Do not create empty overlays with the evaporate property (Bug#9642).
8068 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8069 Bug#9642, but explicitly check that the buffer the overlay would
8070 be moved to is live and rearrange lines to make sure that errors
8071 will not put the overlay in an inconsistent state.
8072 (Fdelete_overlay): Cosmetics.
8073
8074 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8075
8076 * w32term.c (my_bring_window_to_top): New function.
8077 (x_raise_frame): Use handle returned by DeferWindowPos, which
8078 could be different from the original one.
8079 Call my_bring_window_to_top instead of my_set_foreground_window.
8080 (Bug#11513)
8081
8082 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8083 by calling BringWindowToTop.
8084
8085 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8086 (WM_EMACS_END): Increase by one.
8087
8088 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8089
8090 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8091 This avoids undefined behavior that might cause the eassert
8092 to not catch an out-of-range value.
8093
8094 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8095
8096 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8097 Update dependencies.
8098
8099 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8100
8101 * bidi.c (bidi_mirror_char): Fix last change.
8102
8103 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8104
8105 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8106 when referring to sectname field in printf format.
8107
8108 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8109
8110 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8111 Only r_alloc_inhibit_buffer_relocation needed to be added;
8112 the others were already declared.
8113
8114 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8115 before checking whether it's out of range. Put the check inside
8116 eassert. See
8117 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8118
8119 2012-05-27 Ken Brown <kbrown@cornell.edu>
8120
8121 * callproc.c (Fcall_process): Restore a line that was accidentally
8122 commented out in the 2011-02-13 change (bug#11547).
8123
8124 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8125
8126 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8127 defined on ralloc.c.
8128
8129 * buffer.c [REL_ALLOC]: Remove prototypes of
8130 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8131 they are now on lisp.h.
8132
8133 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8134
8135 * search.c (search_buffer): Use it to inhibit relocation of buffer
8136 text while re_search_2 is doing its job, because re_search_2 is
8137 passed C pointers to buffer text. (Bug#11519)
8138
8139 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8140 Update value to 24.
8141
8142 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8143 state after an additional call to move_it_in_display_line_to, keep
8144 the values of it->max_ascent and it->max_descent found for the
8145 entire line.
8146 (pos_visible_p): Revert the comparison against bottom_y to what it
8147 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8148 (Bug#11464)
8149
8150 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8151
8152 Fix coding-related core dumps with gcc -ftrapv.
8153 The code was computing A - B, where A and B are pointers, and B is
8154 random garbage. This can lead to core dumps on platforms that
8155 have special pointer registers, and it also leads to core dumps on
8156 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8157 A - B only when B is initialized properly.
8158 * coding.c (coding_set_source, coding_set_destination): Return void.
8159 (coding_change_source, coding_change_destinations): New functions,
8160 with the old behaviors of coding_set_source and coding_set_destination.
8161 All callers that need an offset changed to use these new functions.
8162
8163 2012-05-26 Glenn Morris <rgm@gnu.org>
8164
8165 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8166
8167 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8168
8169 Extend mouse support on W32 text-mode console.
8170 * xdisp.c (draw_row_with_mouse_face):
8171 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8172
8173 * w32console.c: Include window.h.
8174 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8175 New functions.
8176 (initialize_w32_display): Initialize mouse-highlight data.
8177
8178 * w32inevt.c: Include termchar.h and window.h.
8179 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8180 moves, call note_mouse_highlight. If help_echo changed, call
8181 gen_help_event to produce help-echo message in the echo area.
8182 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8183 highlight info.
8184
8185 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8186
8187 * lread.c (read1): Simplify slightly to avoid an overflow warning
8188 with GCC 4.7.0 on x86-64.
8189
8190 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8191
8192 * bidi.c (bidi_mirror_char): Revert last change: an int is
8193 definitely wide enough here.
8194
8195 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8196
8197 Fix integer width and related bugs (Bug#9874).
8198 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8199 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8200 (string_bytes, check_sblock, allocate_string_data):
8201 (compact_small_strings, Fmake_bool_vector, make_string)
8202 (make_unibyte_string, make_multibyte_string)
8203 (make_string_from_bytes, make_specified_string)
8204 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8205 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8206 (mark_vectorlike):
8207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8208 (allocate_pseudovector):
8209 Use int, not EMACS_INT, where int is wide enough.
8210 (inhibit_garbage_collection, Fgarbage_collect):
8211 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8212 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8213 int might not be wide enough.
8214 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8215 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8216 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8217 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8218 (bidi_level_of_next_char, bidi_move_to_visually_next):
8219 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8220 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8221 (Fkill_buffer, Fset_buffer_major_mode)
8222 (advance_to_char_boundary, Fbuffer_swap_text)
8223 (Fset_buffer_multibyte, overlays_at, overlays_in)
8224 (overlay_touches_p, struct sortvec, record_overlay_string)
8225 (overlay_strings, recenter_overlay_lists)
8226 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8227 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8228 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8229 (Foverlay_recenter, last_overlay_modification_hooks_used)
8230 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8231 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8232 (validate_region): Omit unnecessary test for b <= e,
8233 since that's guaranteed by the previous test.
8234 (adjust_overlays_for_delete): Avoid pos + length overflow.
8235 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8236 (report_overlay_modification):
8237 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8238 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8239 Omit pointer cast, which isn't needed anyway, and doesn't work
8240 after the EMACS_INT -> ptrdiff_t change.
8241 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8242 * buffer.h: Adjust decls to match defn changes elsewhere.
8243 (struct buffer_text, struct buffer):
8244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8245 Use EMACS_INT, not int, where int might not be wide enough.
8246 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8247 not int, to avoid needless 32-bit limit on 64-bit hosts.
8248 (exec_byte_code): Use tighter memory-full test, one that checks
8249 for alloca overflow. Don't compute the address of the object just
8250 before an array, as that's not portable. Use EMACS_INT, not
8251 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8252 * callint.c (Fcall_interactively):
8253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8254 * callproc.c (call_process_kill, Fcall_process):
8255 Don't assume pid_t fits into an Emacs fixnum.
8256 (call_process_cleanup, Fcall_process, child_setup):
8257 Don't assume pid_t fits into int.
8258 (call_process_cleanup, Fcall_process, delete_temp_file)
8259 (Fcall_process_region):
8260 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8261 (Fcall_process): Simplify handling of volatile integers.
8262 Use int, not EMACS_INT, where int will do.
8263 * casefiddle.c (casify_object, casify_region, operate_on_word)
8264 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8265 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8266 (casify_object): Avoid integer overflow when overallocating buffer.
8267 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8268 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8269 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8270 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8271 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8272 integers are now checked earlier. All uses replaced with XINT.
8273 (ccl_driver):
8274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8275 For CCL_MapSingle, check that content and value are in int range.
8276 (ccl_driver, Fregister_code_conversion_map):
8277 Check that Vcode_version_map_vector is a vector.
8278 (resolve_symbol_ccl_program): Check that vector header is in range.
8279 Always copy the vector, so that we can check its contents reliably
8280 now rather than having to recheck each instruction as it's being
8281 executed. Check that vector words fit in 'int'.
8282 (ccl_get_compiled_code, Fregister_ccl_program)
8283 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8284 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8285 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8286 contents are in range.
8287 (Fccl_execute_on_string): Check that status is in range.
8288 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8289 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8290 Accept and return EMACS_INT, not int, because callers can pass values
8291 out of 'int' range.
8292 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8293 (multibyte_chars_in_text, parse_str_as_multibyte)
8294 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8295 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8296 (string_escape_byte8, Fget_byte):
8297 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8298 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8299 avoid mishandling large integers.
8300 * character.h: Adjust decls to match defn changes elsewhere.
8301 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8302 (Ffind_charset_region):
8303 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8304 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8305 (load_charset_map_from_vector, Fdefine_charset_internal):
8306 Don't assume fixnum fits in int.
8307 (load_charset_map_from_vector, Fmap_charset_chars):
8308 Remove now-unnecessary CHECK_NATNUMs.
8309 (Fdefine_charset_internal): Check ranges here, more carefully.
8310 Don't rely on undefined behavior with signed left shift overflow.
8311 Don't assume unsigned int fits into fixnum, or that fixnum fits
8312 into unsigned int. Don't require max_code to be a valid fixnum;
8313 that's not true for gb10830 4-byte on a 32-bit host. Allow
8314 invalid_code to be a cons, for the same reason. Require code_offset
8315 to be a character. Avoid int overflow if max_char is close
8316 to INT_MAX.
8317 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8318 this is intended anyway and avoids some undefined behavior.
8319 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8320 INDEX_TO_CODE_POINT, as that's what it expects.
8321 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8322 * charset.h (DECODE_CHAR): Return int, not unsigned;
8323 this is what was intended anyway, and it avoids undefined behavior.
8324 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8325 integer-overflow issues.
8326 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8327 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8328 where the argument is EMACS_INT, and this behavior is not intended.
8329 * chartab.c (Fmake_char_table, Fset_char_table_range)
8330 (uniprop_get_decoder, uniprop_get_encoder):
8331 Don't assume fixnum fits in int.
8332 * cmds.c (move_point): New function, that does the gist of
8333 Fforward_char and Fbackward_char, but does so while checking
8334 for integer overflow more accurately.
8335 (Fforward_char, Fbackward_char): Use it.
8336 (Fforward_line, Fend_of_line, internal_self_insert)
8337 (internal_self_insert):
8338 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8339 Fix a FIXME, by checking for integer overflow when calculating
8340 target_clm and actual_clm.
8341 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8342 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8343 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8344 (coding_alloc_by_making_gap, alloc_destination)
8345 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8346 (encode_coding_utf_16, detect_coding_emacs_mule)
8347 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8348 (detect_coding_iso_2022, decode_coding_iso_2022)
8349 (encode_invocation_designation, encode_designation_at_bol)
8350 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8351 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8352 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8353 (encode_coding_ccl, encode_coding_raw_text)
8354 (detect_coding_charset, decode_coding_charset)
8355 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8356 (produce_composition, produce_charset, produce_annotation)
8357 (decode_coding, handle_composition_annotation)
8358 (handle_charset_annotation, consume_chars, decode_coding_gap)
8359 (decode_coding_object, encode_coding_object, detect_coding_system)
8360 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8361 (code_convert_region, code_convert_string)
8362 (Fdefine_coding_system_internal)
8363 (coding_set_source, coding_set_destination):
8364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8365 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8366 (Fdefine_coding_system_internal):
8367 Don't assume fixnums fit in int.
8368 (decode_coding_gap, decode_coding_object, encode_coding_object)
8369 (Fread_coding_system, Fdetect_coding_region)
8370 (Funencodable_char_position, Fcheck_coding_systems_region)
8371 (get_translation, handle_composition_annotation, consume_chars):
8372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8373 (consume_chars): Rewrite to not calculate an address outside buffer.
8374 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8375 Don't access memory outside of the args array.
8376 (Fdefine_coding_system_internal): Check for charset-id overflow.
8377 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8378 result of ENCODE_CHAR.
8379 * coding.h: Adjust decls to match defn changes elsewhere.
8380 (struct coding_system):
8381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8382 * composite.c (get_composition_id, find_composition)
8383 (run_composition_function, update_compositions)
8384 (compose_text, composition_gstring_put_cache)
8385 (composition_gstring_p, composition_gstring_width)
8386 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8387 (composition_compute_stop_pos, composition_reseat_it)
8388 (composition_update_it, struct position_record)
8389 (find_automatic_composition, composition_adjust_point)
8390 (Fcomposition_get_gstring, Ffind_composition_internal):
8391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8392 (update_compositions):
8393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8394 * composite.h: Adjust decls to match defn changes elsewhere.
8395 (struct composition):
8396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8397 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8398 Do not attempt to compute the address of the object just before a
8399 buffer; this is not portable.
8400 (Faref, Faset):
8401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8402 (Faset): Use int, not EMACS_INT, where int is wide enough.
8403 (Fstring_to_number): Don't assume fixnums fit in int.
8404 (Frem): Don't assume arg is nonnegative.
8405 * dbusbind.c (xd_append_arg): Check for integers out of range.
8406 (Fdbus_call_method): Don't overflow the timeout int.
8407 (extract_signed, extract_unsigned): New functions.
8408 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8409 (xd_get_connection_references): Return ptrdiff_t, not int.
8410 All uses changed.
8411 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8412 (xd_read_message_1):
8413 Use int, not unsigned, where the dbus API uses int.
8414 (Fdbus_message_internal): Don't overflow mtype.
8415 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8416 * dired.c (directory_files_internal, file_name_completion, scmp)
8417 (file_name_completion_stat):
8418 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8419 (file_name_completion): Don't overflow matchcount.
8420 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8421 * dispextern.h: Adjust decls to match defn changes elsewhere.
8422 (struct text_pos, struct glyph, struct bidi_saved_info)
8423 (struct bidi_string_data, struct bidi_it, struct composition_it)
8424 (struct it):
8425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8426 (struct display_pos, struct composition_it, struct it):
8427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8428 * dispnew.c (increment_matrix_positions)
8429 (increment_row_positions, mode_line_string)
8430 (marginal_area_string):
8431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8432 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8434 (duration_to_sec_usec): New function, to check for overflow better.
8435 (Fsleep_for, sit_for): Use it.
8436 * doc.c (get_doc_string, store_function_docstring):
8437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8438 (get_doc_string, Fsnarf_documentation):
8439 Use int, not EMACS_INT, where int is wide enough.
8440 (get_doc_string):
8441 Use SAFE_ALLOCA, not alloca.
8442 Check for overflow when converting EMACS_INT to off_t.
8443 * doprnt.c (doprnt):
8444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8445 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8446 Don't assume uid_t fits into fixnum.
8447 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8448 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8449 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8450 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8451 (general_insert_function)
8452 (Finsert_char, make_buffer_string, make_buffer_string_both)
8453 (update_buffer_properties, Fbuffer_substring)
8454 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8455 (Fsubst_char_in_region, check_translation)
8456 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8457 (transpose_markers, Ftranspose_regions):
8458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8459 (clip_to_bounds): Move to lisp.h as an inline function).
8460 (Fconstrain_to_field): Don't assume integers are nonnegative.
8461 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8462 (Fsubst_char_in_region, Fsave_restriction):
8463 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8464 (Femacs_pid): Don't assume pid_t fits into fixnum.
8465 (lo_time): Use int, not EMACS_INT, when int suffices.
8466 (lisp_time_argument): Check for usec out of range.
8467 (Fencode_time): Don't assume fixnum fits in int.
8468 (Fuser_login_name, Fuser_full_name): Signal an error
8469 if a uid argument is out of range, rather than relying on
8470 undefined behavior.
8471 (Fformat_time_string): Remove now-unnecessary check.
8472 lisp_time_argument checks for out-of-range usec now.
8473 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8474 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8475 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8476 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8477 (init_cmdargs, Fdump_emacs):
8478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8479 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8480 the bottom (typically) 32 bits of the fixnum.
8481 * eval.c (specpdl_size, call_debugger):
8482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8483 (when_entered_debugger, Fbacktrace_debug):
8484 Don't assume fixnum can fit in int.
8485 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8486 the object just before a buffer; this is not portable.
8487 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8488 (grow_specpdl, unbind_to):
8489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8490 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8491 (grow_specpdl): Simplify allocation by using xpalloc.
8492 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8493 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8494 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8495 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8496 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8497 (a_write, e_write):
8498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8499 (Fcopy_file, non_regular_nbytes, read_non_regular)
8500 (Finsert_file_contents):
8501 Use int, not EMACS_INT, where int is wide enough.
8502 (READ_BUF_SIZE): Verify that it fits in int.
8503 (Finsert_file_contents): Check that counts are in proper range,
8504 rather than assuming fixnums fit into ptrdiff_t etc.
8505 Don't assume fixnums fit into int.
8506 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8507 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8508 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8509 (string_char_to_byte, string_byte_to_char)
8510 (string_make_multibyte, string_to_multibyte)
8511 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8512 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8513 (substring_both, Fdelete, internal_equal, Ffillarray)
8514 (Fclear_string, mapcar1)
8515 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8516 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8517 (larger_vector, make_hash_table, maybe_resize_hash_table)
8518 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8519 (Fmaphash, secure_hash):
8520 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8521 (concat): Check for string index and length overflow.
8522 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8523 (Frequire):
8524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8525 (larger_vector): New API (vec, incr_min, size_max) replaces old
8526 one (vec, new_size, init). This catches size overflow.
8527 INIT was removed because it was always Qnil.
8528 All callers changed.
8529 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8530 the upper bound on a hash table index size.
8531 (make_hash_table, maybe_resize_hash_table): Use it.
8532 (secure_hash): Computer start_byte and end_byte only after
8533 they're known to be in ptrdiff_t range.
8534 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8535 (Ffont_get_glyphs, Ffont_at):
8536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8537 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8538 (Flist_fonts, Fopen_font):
8539 Don't assume fixnum can fit in int.
8540 (check_gstring): Don't assume index can fit in int.
8541 (font_match_p): Check that fixnum is a character, not a nonnegative
8542 fixnum, since the later code needs to stuff it into an int.
8543 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8544 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8545 conversion overflow issues.
8546 (Fopen_font): Check for integer out of range.
8547 (Ffont_get_glyphs): Don't assume index can fit in int.
8548 * font.h: Adjust decls to match defn changes elsewhere.
8549 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8550 integer overflow.
8551 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8552 printmax_t, where ptrdiff_t is wide enough.
8553 (Finternal_char_font):
8554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8555 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8556 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8557 (Fset_frame_position, x_set_frame_parameters)
8558 (x_set_line_spacing, x_set_border_width)
8559 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8560 Check that fixnums are in proper range for system types.
8561 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8562 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8563 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8564 Use SAFE_ALLOCA_LISP, not alloca.
8565 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8566 intptr_t is wide enough.
8567 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8568 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8569 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8570 Check for fixnum out of range.
8571 * ftfont.c (ftfont_list): Don't assume index fits in int.
8572 Check that fixnums are in proper range for system types.
8573 (ftfont_shape_by_flt):
8574 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8575 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8577 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8578 Check that fixnums are in proper range for system types.
8579 * gnutls.h: Adjust decls to match defn changes elsewhere.
8580 * gtkutil.c (xg_dialog_run):
8581 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8582 (update_frame_tool_bar):
8583 Check that fixnums are in proper range for system types.
8584 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8585 (lookup_image): Check that fixnums are in range for system types.
8586 * indent.c (last_known_column, last_known_column_point):
8587 (current_column_bol_cache):
8588 (skip_invisible, current_column, check_display_width):
8589 (check_display_width, scan_for_column, current_column_1)
8590 (Findent_to, Fcurrent_indentation, position_indentation)
8591 (indented_beyond_p, Fmove_to_column, compute_motion):
8592 (Fcompute_motion, Fvertical_motion):
8593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8594 (last_known_column_modified): Use EMACS_INT, not int.
8595 (check_display_width):
8596 (Fcompute_motion):
8597 Check that fixnums and floats are in proper range for system types.
8598 (compute_motion): Don't assume index or fixnum fits in int.
8599 (compute_motion, Fcompute_motion):
8600 Use int, not EMACS_INT, when it is wide enough.
8601 (vmotion): Omit local var start_hpos that is always 0; that way
8602 we don't need to worry about overflow in expressions involving it.
8603 * indent.h: Adjust decls to match defn changes elsewhere.
8604 (struct position):
8605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8606 Use int, not EMACS_INT, where int is wide enough.
8607 Remove unused members ovstring_chars_done and tab_offset;
8608 all uses removed.
8609 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8610 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8611 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8612 (make_gap, copy_text, insert, insert_and_inherit)
8613 (insert_before_markers, insert_before_markers_and_inherit)
8614 (insert_1, count_combining_before, count_combining_after)
8615 (insert_1_both, insert_from_string)
8616 (insert_from_string_before_markers, insert_from_string_1)
8617 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8618 (adjust_after_replace, adjust_after_insert, replace_range)
8619 (replace_range_2, del_range, del_range_1, del_range_byte)
8620 (del_range_both, del_range_2, modify_region)
8621 (prepare_to_modify_buffer, signal_before_change)
8622 (signal_after_change, Fcombine_after_change_execute):
8623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8624 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8625 (balance_an_interval, split_interval_right, split_interval_left)
8626 (find_interval, next_interval, update_interval)
8627 (adjust_intervals_for_insertion, delete_node, delete_interval)
8628 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8629 (static_offset_intervals, offset_intervals)
8630 (merge_interval_right, merge_interval_left, make_new_interval)
8631 (graft_intervals_into_buffer, temp_set_point_both)
8632 (temp_set_point, set_point, adjust_for_invis_intang)
8633 (set_point_both, move_if_not_intangible, get_property_and_range)
8634 (get_local_map, copy_intervals, copy_intervals_to_string)
8635 (compare_string_intervals, set_intervals_multibyte_1):
8636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8637 * intervals.h: Adjust decls to match defn changes elsewhere.
8638 (struct interval):
8639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8640 * keyboard.c (this_command_key_count, this_single_command_key_start)
8641 (before_command_key_count, before_command_echo_length, echo_now)
8642 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8643 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8644 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8645 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8646 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8647 (last_non_minibuf_size, last_point_position, echo_truncate)
8648 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8649 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8650 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8651 (stuff_buffered_input):
8652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8653 (last_auto_save, command_loop_1, read_char):
8654 Use EMACS_INT, not int, to avoid integer overflow.
8655 (record_char): Avoid overflow in total_keys computation.
8656 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8657 * keyboard.h: Adjust decls to match defn changes elsewhere.
8658 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8659 (Fkey_description, Fdescribe_vector, Flookup_key):
8660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8661 (click_position): New function, to check that positions are in range.
8662 (Fcurrent_active_maps):
8663 (describe_command):
8664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8665 (Faccessible_keymaps, Fkey_description):
8666 (preferred_sequence_p):
8667 Don't assume fixnum can fit into int.
8668 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8669 Check for integer overflow in size calculations.
8670 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8671 avoid mishandling large integers.
8672 * lisp.h: Adjust decls to match defn changes elsewhere.
8673 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8674 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8675 (struct Lisp_Marker):
8676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8677 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8678 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8679 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8680 All callers changed.
8681 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8682 Assume the arg has valid form, since it always does.
8683 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8684 unsigned integer system type.
8685 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8686 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8688 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8689 (duration_to_sec_usec): New decl.
8690 * lread.c (read_from_string_index, read_from_string_index_byte)
8691 (read_from_string_limit, readchar, unreadchar, openp)
8692 (read_internal_start, read1, oblookup):
8693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8694 (Fload, readevalloop, Feval_buffer, Feval_region):
8695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8696 (openp): Check for out-of-range argument to 'access'.
8697 (read1): Use int, not EMACS_INT, where int is wide enough.
8698 Don't assume fixnum fits into int.
8699 Fix off-by-one error that can read outside a buffer.
8700 (read_filtered_event): Use duration_to_sec_usec
8701 to do proper overflow checking on durations.
8702 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8703 in size calculation.
8704 (Fexecute_kbd_macro):
8705 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8706 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8707 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8708 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8709 (set_marker_both, set_marker_restricted_both, marker_position)
8710 (marker_byte_position, Fbuffer_has_markers_at):
8711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8712 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8713 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8714 It now merely ensures that the menu is large enough, without
8715 necessarily growing it, as this avoids some integer overflow issues.
8716 All callers changed.
8717 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8719 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8720 Use SAFE_ALLOCA_LISP, not alloca.
8721 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8722 to EMACS_INT. Check that fixnums are in proper range for system types.
8723 * minibuf.c (minibuf_prompt_width, string_to_object)
8724 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8725 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8727 (get_minibuffer, read_minibuf_unwind):
8728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8729 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8730 this simplifies overflow checking. All callers changed.
8731 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8732 (Ftest_completion):
8733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8734 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8735 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8736 Check that fixnums are in proper range for system types.
8737 (Fx_create_frame, Fx_show_tip):
8738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8739 * nsfont.m (ns_findfonts, nsfont_list_family):
8740 Don't assume fixnum fits in long.
8741 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8742 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8743 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8744 wide enough.
8745 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8747 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8748 (PRINTDECLARE, PRINTPREPARE):
8749 (strout, print_string):
8750 (print, print_preprocess, print_check_string_charset_prop)
8751 (print_object):
8752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8753 (PRINTDECLARE):
8754 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8755 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8756 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8757 (printchar, strout): Use xpalloc to catch size calculation overflow.
8758 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8759 (print_error_message): Use SAFE_ALLOCA, not alloca.
8760 (print_object): Use int, not EMACS_INT, where int is wide enough.
8761 (print_depth, new_backquote_output, print_number_index):
8762 Use ptrdiff_t, not int, where int might not be wide enough.
8763 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8764 (Fset_process_window_size, Fformat_network_address)
8765 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8766 (sigchld_handler):
8767 Check that fixnums are in proper range for system types.
8768 (Fsignal_process): Simplify by avoiding a goto.
8769 Check for process-ids out of pid_t range rather than relying on
8770 undefined behavior.
8771 (process_tick, update_tick): Use EMACS_INT, not int.
8772 (Fformat_network_address, read_process_output, send_process)
8773 (Fprocess_send_region, status_notify):
8774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8775 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8776 (wait_reading_process_output, read_process_output, exec_sentinel):
8777 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8778 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8779 (Faccept_process_output): Use duration_to_sec_usec to do proper
8780 overflow checking on durations.
8781 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8782 Don't assume pid_t fits in int.
8783 * process.h (struct Lisp_Process): Members tick and update_tick
8784 are now of type EMACS_INT, not int.
8785 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8786 configured --with-wide-int.
8787 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8788 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8789 * search.c (looking_at_1, string_match_1):
8790 (fast_string_match, fast_c_string_match_ignore_case)
8791 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8792 (scan_newline, find_before_next_newline, search_command)
8793 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8794 (set_search_regs, wordify):
8795 (Freplace_match):
8796 (Fmatch_data):
8797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8798 (string_match_1, search_buffer, set_search_regs):
8799 (Fmatch_data):
8800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8801 (wordify): Check for overflow in size calculation.
8802 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8803 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8804 Check that fixnums are in proper range for system types.
8805 * sound.c (struct sound_device)
8806 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8808 (Fplay_sound_internal):
8809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8810 * syntax.c (struct lisp_parse_state, find_start_modiff)
8811 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8812 (Fparse_partial_sexp):
8813 Don't assume fixnums can fit in int.
8814 (struct lisp_parse_state, find_start_pos, find_start_value)
8815 (find_start_value_byte, find_start_begv)
8816 (update_syntax_table, char_quoted, dec_bytepos)
8817 (find_defun_start, prev_char_comend_first, back_comment):
8818 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8819 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8820 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8821 (Finternal_describe_syntax_value): Check that match_lisp is a
8822 character, not an integer, since the code stuffs it into int.
8823 (scan_words, scan_sexps_forward):
8824 Check that fixnums are in proper range for system types.
8825 (Fforward_word):
8826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8827 (scan_sexps_forward):
8828 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8829 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8830 * syntax.h: Adjust decls to match defn changes elsewhere.
8831 (struct gl_state_s):
8832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8833 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8834 MOST_POSITIVE_FIXNUM.
8835 * sysdep.c (wait_for_termination_1, wait_for_termination)
8836 (interruptible_wait_for_termination, mkdir):
8837 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8838 (emacs_read, emacs_write):
8839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8840 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8841 and double all fit in int.
8842 * term.c (set_tty_color_mode):
8843 Check that fixnums are in proper range for system types.
8844 * termhooks.h (struct input_event):
8845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8846 * textprop.c (validate_interval_range, interval_of)
8847 (Fadd_text_properties, set_text_properties_1)
8848 (Fremove_text_properties, Fremove_list_of_text_properties)
8849 (Ftext_property_any, Ftext_property_not_all)
8850 (copy_text_properties, text_property_list, extend_property_ranges)
8851 (verify_interval_modification):
8852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8853 (Fnext_single_char_property_change)
8854 (Fprevious_single_char_property_change):
8855 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8856 (copy_text_properties):
8857 Check for integer overflow in index calculation.
8858 * undo.c (last_boundary_position, record_point, record_insert)
8859 (record_delete, record_marker_adjustment, record_change)
8860 (record_property_change):
8861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8862 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8863 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8864 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8865 (Fx_hide_tip, Fx_file_dialog):
8866 * w32menu.c (set_frame_menubar):
8867 Use ptrdiff_t, not int, for consistency with rest of code.
8868 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8869 (select_window, Fdelete_other_windows_internal)
8870 (window_scroll_pixel_based, window_scroll_line_based)
8871 (Frecenter, Fset_window_configuration):
8872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8873 (Fset_window_hscroll, run_window_configuration_change_hook)
8874 (set_window_buffer, temp_output_buffer_show, scroll_command)
8875 (Fscroll_other_window, Frecenter):
8876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8877 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8878 Don't assume fixnum fits in int.
8879 (Fset_window_scroll_bars):
8880 Check that fixnums are in proper range for system types.
8881 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8882 (string_pos, c_string_pos, number_of_chars, init_iterator)
8883 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8884 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8885 (compute_display_string_end, handle_face_prop)
8886 (face_before_or_after_it_pos, handle_invisible_prop)
8887 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8888 (display_prop_intangible_p, string_buffer_position_lim)
8889 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8890 (get_overlay_strings_1, get_overlay_strings)
8891 (iterate_out_of_display_property, forward_to_next_line_start)
8892 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8893 (get_next_display_element, set_iterator_to_next)
8894 (get_visually_first_element, compute_stop_pos_backwards)
8895 (handle_stop_backwards, next_element_from_buffer)
8896 (move_it_in_display_line_to, move_it_in_display_line)
8897 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8898 (add_to_log, message_dolog, message_log_check_duplicate)
8899 (message2, message2_nolog, message3, message3_nolog
8900 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8901 (current_message_1, truncate_echo_area, truncate_message_1)
8902 (set_message, set_message_1, store_mode_line_noprop)
8903 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8904 (text_outside_line_unchanged_p, check_point_in_composition)
8905 (reconsider_clip_changes)
8906 (redisplay_internal, set_cursor_from_row, try_scrolling)
8907 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8908 (redisplay_window, find_last_unchanged_at_beg_row)
8909 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8910 (trailing_whitespace_p, find_row_edges, display_line)
8911 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8912 (display_mode_element, store_mode_line_string)
8913 (pint2str, pint2hrstr, decode_mode_spec)
8914 (display_count_lines, display_string, draw_glyphs)
8915 (x_produce_glyphs, x_insert_glyphs)
8916 (rows_from_pos_range, mouse_face_from_buffer_pos)
8917 (fast_find_string_pos, mouse_face_from_string_pos)
8918 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8920 (safe_call, init_from_display_pos, handle_fontified_prop)
8921 (handle_single_display_spec, load_overlay_strings)
8922 (with_echo_area_buffer, setup_echo_area_for_printing)
8923 (display_echo_area, echo_area_display)
8924 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8925 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8926 (redisplay_window, dump_glyph_row, display_mode_line)
8927 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8928 (handle_display_spec, display_prop_string_p):
8929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8930 (handle_single_display_spec, build_desired_tool_bar_string)
8931 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8932 (get_specified_cursor_type):
8933 Check that fixnums are in proper range for system types.
8934 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8935 (Flookup_image_map):
8936 Don't assume fixnums fit in int.
8937 (compare_overlay_entries):
8938 Avoid mishandling comparisons due to subtraction overflow.
8939 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8940 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8941 (handle_tool_bar_click):
8942 Use int, not unsigned, since we prefer signed and the signedness
8943 doesn't matter here.
8944 (get_next_display_element, next_element_from_display_vector):
8945 Use int, not EMACS_INT, when int is wide enough.
8946 (start_hourglass): Use duration_to_sec_usec to do proper
8947 overflow checking on durations.
8948 * xfaces.c (Fbitmap_spec_p):
8949 Check that fixnums are in proper range for system types.
8950 (compare_fonts_by_sort_order):
8951 Avoid mishandling comparisons due to subtraction overflow.
8952 (Fx_family_fonts, realize_basic_faces):
8953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8954 (Fx_family_fonts):
8955 Don't assume fixnum fits in int.
8956 Use SAFE_ALLOCA_LISP, not alloca.
8957 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8958 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8959 (face_at_buffer_position, face_for_overlay_string)
8960 (face_at_string_position):
8961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8962 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8963 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8964 (Fx_show_tip):
8965 Check that fixnums are in proper range for system types.
8966 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8967 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8969 (Fx_change_window_property): Don't assume fixnums fit in int.
8970 * xfont.c (xfont_chars_supported):
8971 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8972 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8973 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8974 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8975 * xml.c (parse_region):
8976 * xrdb.c (magic_file_p):
8977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8978 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8979 (x_get_local_selection, x_reply_selection_request)
8980 (x_handle_selection_request, wait_for_property_change):
8981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8982 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8983 short is wide enough.
8984 (x_send_client_event): Don't assume fixnum fits in int.
8985 * xterm.c (x_x_to_emacs_modifiers):
8986 Don't assume EMACS_INT overflows nicely into int.
8987 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8988 may come from Lisp.
8989 (handle_one_xevent): NATNUMP can eval its arg twice.
8990 (x_connection_closed):
8991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8992 * xterm.h: Adjust decls to match defn changes elsewhere.
8993 (struct scroll_bar): Use struct vectorlike_header
8994 rather than rolling our own approximation.
8995 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8996
8997 2012-05-25 Glenn Morris <rgm@gnu.org>
8998
8999 * lisp.mk (lisp): Update for more files being compiled now.
9000
9001 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9002
9003 * lread.c: Remove `read_pure' which makes no difference.
9004 (read_pure): Remove var.
9005 (unreadpure): Remove function.
9006 (readevalloop): Don't call read_list with -1 flag.
9007 (read1, read_vector): Don't test read_pure any more.
9008 (read_list): Simplify.
9009
9010 * fileio.c, character.h: Minor style tweaks.
9011
9012 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9013
9014 * window.h (clip_changed): Remove useless declaration.
9015
9016 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
9017
9018 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9019 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9020
9021 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 Remove src/m/*.
9024 This directory predates autoconf and is no longer needed nowadays.
9025 Move its few remaining bits of functionality to where they're needed.
9026 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9027 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9028 * m/template.h: Remove.
9029 * Makefile.in (M_FILE): Remove. All uses removed.
9030 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9031 * lisp.h (USE_LSB_TAG):
9032 * mem-limits.h (EXCEEDS_LISP_PTR):
9033 Use VAL_MAX, not VALBITS, in #if.
9034 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9035 (EMACS_UINT): Define unconditionally now.
9036 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9037 (BITS_PER_EMACS_INT): New constants, replacing
9038 what used to be in config.h, but not useful in #if.
9039 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9040 define them any more.
9041 (VAL_MAX): New macro.
9042 (VALMASK): Use it.
9043 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9044 BITS_PER_EMACS_INT, in #if.
9045 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9046 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9047 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9048 * s/ms-w32.h (DATA_START):
9049 Move here from removed file m/intel386.h.
9050 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9051 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9052
9053 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9054
9055 Assume C89 or later.
9056 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9057 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9058 (xrealloc):
9059 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9060 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9061 * textprop.c, tparam.c (NULL): Remove.
9062 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9063 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9064 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9065 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9066 * xterm.c (input_signal_count): Assume volatile works.
9067
9068 2012-05-21 Ken Brown <kbrown@cornell.edu>
9069
9070 * xgselect.c (xg_select): Fix first argument in call to 'select'
9071 (bug#11508).
9072
9073 2012-05-20 Ken Brown <kbrown@cornell.edu>
9074
9075 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9076 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9077
9078 2012-05-19 Ken Brown <kbrown@cornell.edu>
9079
9080 * xfns.c (x_in_use): Remove `static' qualifier.
9081 * xterm.h (x_in_use): Declare.
9082 * xgselect.c: Include xterm.h.
9083 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9084 and `display_arg' (bug#9754).
9085
9086 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9087
9088 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9089
9090 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9091 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9092
9093 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9094
9095 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9096
9097 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9098 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9099
9100 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9101 reference to image_cache->refcount.
9102 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9103
9104 2012-05-17 Juri Linkov <juri@jurta.org>
9105
9106 * search.c (Fword_search_regexp, Fword_search_backward)
9107 (Fword_search_forward, Fword_search_backward_lax)
9108 (Fword_search_forward_lax): Move functions to isearch.el
9109 (bug#10145, bug#11381).
9110
9111 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9112
9113 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9114
9115 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9116
9117 * lread.c (init_obarray): Declare Qt and Qnil as special.
9118
9119 2012-05-14 Glenn Morris <rgm@gnu.org>
9120
9121 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9122 Put "libexec" before "bin", for the sake of init_callproc_1.
9123
9124 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9125
9126 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9127
9128 * unexaix.c: Port to more-recent AIX compilers.
9129 (report_error, report_error_1, make_hdr, copy_sym)
9130 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9131 Make arguments const char *, not char *, to avoid violations of C
9132 standard and to fix some AIX warnings reported by Gilles Pion.
9133
9134 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9135
9136 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9137 already have overlays loaded.
9138 (handle_single_display_spec): Before returning without displaying
9139 fringe bitmap, synchronize the bidi iterator with the main display
9140 iterator, by calling iterate_out_of_display_property.
9141 (iterate_out_of_display_property): Detect buffer iteration by
9142 testing that it->string is a Lisp string.
9143 (get_next_display_element): When the current object is exhausted,
9144 and there's something on it->stack, call set_iterator_to_next to
9145 proceed with what's on the stack, instead of returning zero.
9146 (set_iterator_to_next): If called at the end of a Lisp string,
9147 proceed to consider_string_end without incrementing string
9148 position. Don't increment display vector index past the end of
9149 the display vector. (Bug#11417)
9150 (pos_visible_p): Don't report a position visible when move_it_to
9151 stopped at the last line of window, which happens to be scanned
9152 backwards by the bidi iteration. (Bug#11464)
9153
9154 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9155
9156 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9157 and right-margin display specs even if the spec is invalid or we
9158 are on a TTY, and thus unable to display on the fringes.
9159 That's because the text with the property will not be displayed anyway,
9160 so we need to signal to the caller that this is a "replacing"
9161 display spec. This fixes display when the spec is invalid or we
9162 are on a TTY.
9163
9164 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9165
9166 * unexaix.c (make_hdr): Fix typo in prototype.
9167 This bug broke the build on AIX. Problem reported by Gilles Pion.
9168
9169 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9170
9171 * keyboard.c (kbd_buffer_get_event): Read special events also in
9172 batch mode. (Bug#11415)
9173
9174 2012-05-12 Glenn Morris <rgm@gnu.org>
9175
9176 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9177
9178 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9179
9180 * lisp.mk (lisp): Add newcomment.elc.
9181
9182 2012-05-12 Glenn Morris <rgm@gnu.org>
9183
9184 * Makefile.in (MKDIR_P): New, set by configure.
9185 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9186
9187 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9188
9189 Remove unused function hourglass_started.
9190 * dispextern.h (hourglass_started):
9191 * w32fns.c (hourglass_started):
9192 * xdisp.c (hourglass_started): Remove.
9193
9194 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9195
9196 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9197 Update dependencies.
9198
9199 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9200
9201 * xgselect.c (xg_select): Put maxfds+1 into a var.
9202 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9203
9204 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9205
9206 2012-05-10 Dave Abrahams <dave@boostpro.com>
9207
9208 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9209 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9210
9211 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9212
9213 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9214 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9215 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9216 Initialize xd_registered_buses.
9217
9218 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9219
9220 Untag more efficiently if USE_LSB_TAG.
9221 This is based on a proposal by YAMAMOTO Mitsuharu in
9222 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9223 For an admittedly artificial (nth 8000 longlist) benchmark on
9224 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9225 Emacs's overall text size by 1%.
9226 * lisp.h (XUNTAG): New macro.
9227 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9228 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9229 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9230 * eval.c (Fautoload):
9231 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9232 * frame.h (XFRAME): Use XUNTAG.
9233
9234 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9235 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9236 Remove unportable assumptions about print widths of types like
9237 dbus_uint32_t.
9238 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9239 intptr_t when converting between pointer and integer, to avoid GCC
9240 warnings about wrong width.
9241
9242 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9243
9244 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9245 stack for each reader_thread, instead of defaulting to 8MB
9246 determined by the linker. This avoids failures in creating
9247 subprocesses on Windows 7, see the discussion in this thread:
9248 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9249
9250 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9251
9252 Fix up display of the *Minibuf-0* buffer in the mini window.
9253 * keyboard.c (read_char): Don't clear the echo area if there's no
9254 message to clear.
9255 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9256 contents of *Minibuf-0*) if there's no message displayed in its stead.
9257
9258 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9259
9260 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9261 batch mode.
9262
9263 2012-05-06 Chong Yidong <cyd@gnu.org>
9264
9265 * lisp.mk (lisp): Update.
9266
9267 2012-05-05 Jim Meyering <meyering@redhat.com>
9268
9269 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9270
9271 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9272
9273 * data.c (PUT_ERROR): New macro.
9274 (syms_of_data): Use it. Add new error type `user-error'.
9275 * undo.c (user_error): New function.
9276 (Fprimitive_undo): Use it.
9277 * print.c (print_error_message): Adjust print style for `user-error'.
9278 * keyboard.c (user_error): New function.
9279 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9280
9281 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9282
9283 Do not limit current-time-string to years 1000..9999.
9284 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9285 (Fcurrent_time_string): Support any year that is supported by the
9286 underlying localtime representation. Don't use asctime, as it
9287 has undefined behavior for years outside the range -999..9999.
9288
9289 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9290
9291 Fix race conditions involving setenv, gmtime, localtime, asctime.
9292 Without this fix, interrupts could mess up code that uses these
9293 nonreentrant functions, since setting TZ invalidates existing
9294 tm_zone or tzname values, and since most of these functions return
9295 pointers to static storage.
9296 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9297 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9298 Grow the critical sections to include not just invoking
9299 localtime/gmtime, but also accessing these functions' results
9300 including their tm_zone values if any, and any related TZ setting.
9301 (format_time_string): Last arg is now struct tm *, not struct tm **,
9302 so that the struct tm is saved in the critical section.
9303 All callers changed. Simplify allocation of initial buffer, partly
9304 motivated by the fact that memory allocation needs to be outside
9305 the critical section.
9306
9307 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9308
9309 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9310 with RESET_INTERVAL.
9311
9312 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9313 Remove duplicated buffer name initialization.
9314
9315 2012-05-02 Jim Meyering <jim@meyering.net>
9316
9317 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9318
9319 * xfns.c (x_window): Use xstrdup (Bug#11375).
9320
9321 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9322
9323 * xdisp.c (pos_visible_p): If already at a newline from the
9324 display string before the 'while' loop, don't walk back the glyphs
9325 from it3.glyph_row. Solves assertion violation when the display
9326 string begins with a newline (egg.el). (Bug#11367)
9327
9328 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9329
9330 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9331 Move to simple.el.
9332
9333 2012-05-01 Glenn Morris <rgm@gnu.org>
9334
9335 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9336 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9337 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9338 All were removed before 23.1.
9339
9340 * dispnew.c: Remove HAVE_LIBNCURSES test;
9341 it is always true on relevant platforms.
9342
9343 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9344 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9345
9346 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9347
9348 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9349
9350 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9351 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9352 Remove.
9353
9354 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9355
9356 Do not avoid creating empty evaporating overlays (Bug#9642).
9357 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9358 That is, do not delete an evaporating overlay if it becomes
9359 empty after its bounds are adjusted to fit within its buffer.
9360 This fix caused other problems, and I'm reverting it until we get
9361 to the bottom of them.
9362
9363 2012-04-27 Chong Yidong <cyd@gnu.org>
9364
9365 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9366
9367 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9368
9369 * xdisp.c (pos_visible_p): If the window start position is beyond
9370 ZV, start the display from buffer beginning. Prevents assertion
9371 violation in init_iterator when the minibuffer window is scrolled
9372 via the scroll bar.
9373
9374 * window.c (window_scroll_pixel_based): Likewise.
9375
9376 2012-04-27 Chong Yidong <cyd@gnu.org>
9377
9378 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9379
9380 2012-04-27 Glenn Morris <rgm@gnu.org>
9381
9382 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9383 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9384
9385 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9386
9387 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9388 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9389
9390 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9391
9392 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9393 display element, check also the underlying string or buffer
9394 character. (Bug#11341)
9395
9396 * w32menu.c: Include w32heap.h.
9397 (add_menu_item): If the call to AppendMenuW (via
9398 unicode_append_menu) fails, disable Unicode menus only if we are
9399 running on Windows 9X/Me.
9400
9401 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9402
9403 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9404 (xgetint): Add missing shift for LSB tags.
9405
9406 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9407
9408 * keyboard.c (read_char): Don't wipe echo area for select window
9409 events: These might get delayed via `mouse-autoselect-window'
9410 (Bug#11304).
9411
9412 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9413
9414 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9415 manipulation of :loaded-from data.
9416
9417 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9418
9419 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9420 now a cons (bug#11311).
9421
9422 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9423
9424 Do not create empty overlays with the evaporate property (Bug#9642).
9425 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9426 if it becomes empty after its bounds are adjusted to fit within
9427 its buffer. Without this fix, in a nonempty buffer (let ((o
9428 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9429 yields an empty overlay that has the evaporate property, which is
9430 not supposed to happen.
9431
9432 Fix minor GTK3 problems found by static checking.
9433 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9434 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9435 (struct _EmacsFixedClass, emacs_fixed_get_type):
9436 Move decls here from emacsgtkfixed.h, since they needn't be public.
9437 (emacs_fixed_get_type): Now static.
9438 (emacs_fixed_class_init): Omit unused local.
9439 (emacs_fixed_child_type): Remove; unused.
9440 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9441 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9442 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9443 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9444 (EMACS_FIXED_GET_CLASS): Remove; unused.
9445 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9446
9447 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9448 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9449
9450 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9451
9452 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9453 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9454 (__malloc_size_t, __malloc_ptrdiff_t):
9455 Remove. All uses removed, replaced by the definiens if needed,
9456 since we can assume C89 or better now.
9457 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9458 (protect_malloc_state, align, get_contiguous_space)
9459 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9460 (malloc_atfork_handler_child, malloc_enable_thread)
9461 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9462 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9463 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9464 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9465 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9466 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9467 Define using prototypes, not old style.
9468 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9469 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9470 (align): Don't assume that signed integer overflow wraps around.
9471 Omit unused local var.
9472 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9473 (_free_internal_nolock, memalign, mallochook, reallochook):
9474 Omit no-longer-needed casts.
9475 (valloc): Use getpagesize, not __getpagesize.
9476 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9477 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9478
9479 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9480
9481 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9482
9483 Move functions from C to Lisp. Make non-blocking method calls
9484 the default. Implement further D-Bus standard interfaces.
9485
9486 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9487 (QCdbus_request_name_allow_replacement)
9488 (QCdbus_request_name_replace_existing)
9489 (QCdbus_request_name_do_not_queue)
9490 (QCdbus_request_name_reply_primary_owner)
9491 (QCdbus_request_name_reply_in_queue)
9492 (QCdbus_request_name_reply_exists)
9493 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9494 (QCdbus_registered_serial, QCdbus_registered_method)
9495 (QCdbus_registered_signal): New Lisp objects.
9496 (XD_DEBUG_MESSAGE): Use sizeof.
9497 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9498 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9499 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9500 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9501 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9502 (xd_signature, xd_append_arg): Allow float for integer types.
9503 (xd_get_connection_references): New function.
9504 (xd_get_connection_address): Rename from xd_initialize.
9505 Return cached address.
9506 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9507 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9508 level.
9509 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9510 Return number of refcounts.
9511 (Fdbus_get_unique_name): Make stronger parameter check.
9512 (Fdbus_message_internal): New defun.
9513 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9514 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9515 (Fdbus_send_signal, Fdbus_register_service)
9516 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9517 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9518 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9519 (Vdbus_compiled_version, Vdbus_runtime_version)
9520 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9521 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9522 (Vdbus_message_type_signal): New defvars.
9523 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9524 Adapt docstring.
9525
9526 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9529 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9530 Do not assume ptrdiff_t is the same width as 'int'.
9531
9532 * alloc.c: Handle unusual debugging option combinations.
9533 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9534 since the two debugging options are incompatible.
9535 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9536 is defined.
9537 (mem_init, mem_insert, mem_insert_fixup):
9538 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9539 (NEED_MEM_INSERT): Remove; no longer needed.
9540
9541 2012-04-22 Leo Liu <sdl.web@gmail.com>
9542
9543 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9544
9545 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9546
9547 * sysdep.c [__FreeBSD__]: Minor cleanups.
9548 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9549 Use Emacs indenting style more consistently. Avoid some casts.
9550 Use 'double' consistently rather than mixing 'float' and 'double'.
9551
9552 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9553
9554 * sysdep.c (list_system_processes, system_process_attributes):
9555 Add implementation for FreeBSD (Bug#5243).
9556
9557 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9558
9559 * lisp.mk (lisp): Update.
9560
9561 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9562
9563 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9564 It is never used otherwise.
9565
9566 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9567
9568 * print.c (print_preprocess): Only check print_depth if print-circle
9569 is nil.
9570 (print_object): Check for cycles even when print-circle is nil and
9571 print-gensym is t, but only check print_depth if print-circle is nil.
9572
9573 2012-04-20 Chong Yidong <cyd@gnu.org>
9574
9575 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9576 set the status to "failed" and ensure that sentinel is run.
9577
9578 2012-04-20 Glenn Morris <rgm@gnu.org>
9579
9580 * process.c (Fset_process_inherit_coding_system_flag)
9581 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9582 (Fmake_network_process, Fmake_serial_process): Doc fix.
9583
9584 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9585
9586 * xdisp.c (string_buffer_position_lim): Limit starting position to
9587 BEGV.
9588 (set_cursor_from_row): If called for a mode-line or header-line
9589 row, return zero immediately.
9590 (try_cursor_movement): If inside continuation line, don't back up
9591 farther than the first row after the header line, if any.
9592 Don't consider the header-line row as "partially visible", even if
9593 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9594
9595 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9596
9597 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9598 (bug#11238).
9599
9600 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9601 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9602
9603 configure: new option --enable-gcc-warnings (Bug#11207)
9604 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9605 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9606 (ALL_CFLAGS): Use new macros rather than old.
9607 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9608 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9609 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9610 -Wunused-result, -Wunused-variable. This should go away once
9611 the Emacs and Gnulib regex code is merged.
9612 (xmalloc, xrealloc): Now static.
9613
9614 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9615
9616 * dired.c (Fsystem_groups): Remove unused local.
9617
9618 2012-04-17 Glenn Morris <rgm@gnu.org>
9619
9620 * dired.c (Fsystem_users): Doc fix.
9621
9622 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9623
9624 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9625 (syms_of_dired): Add them.
9626
9627 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9628
9629 Fix minor alloc.c problems found by static checking.
9630 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9631 New extern decls, to avoid calling undeclared functions.
9632 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9633 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9634 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9635 (NEED_MEM_INSERT): New macro.
9636 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9637 Remove one incorrect comment and fix another.
9638
9639 Fix minor ralloc.c problems found by static checking.
9640 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9641 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9642 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9643 (r_alloc_sbrk): Now static.
9644
9645 Improve ralloc.c interface checking.
9646 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9647 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9648 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9649 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9650 [REL_ALLOC]: ... to here, to check interface.
9651 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9652 Remove decls. This fixes an "It stinks!".
9653
9654 * alloc.c (which_symbols): Fix alignment issue / type clash.
9655
9656 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9657
9658 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9659 (struct Lisp_Misc_Any): Likewise.
9660 (struct Lisp_Free): Likewise.
9661 * alloc.c (union aligned_Lisp_Symbol): Define.
9662 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9663 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9664 (union aligned_Lisp_Misc): Define.
9665 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9666 aligned_Lisp_Misc instead of union Lisp_Misc.
9667 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9668
9669 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9670
9671 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9672 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9673 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9674 * s/netbsd.h, s/sol2-6.h:
9675 Remove definition of GC_MARK_STACK, since the default now works.
9676 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9677 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9678 no longer the default.
9679 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9680
9681 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9682
9683 * lread.c (lisp_file_lexically_bound_p):
9684 Fix hang at ";-*-\n" (bug#11238).
9685
9686 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9687
9688 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9689 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9690
9691 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9692
9693 * nsterm.m (constrainFrameRect): Always constrain when there is only
9694 one screen (Bug#10962).
9695
9696 2012-04-13 Ken Brown <kbrown@cornell.edu>
9697
9698 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9699
9700 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9701
9702 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9703
9704 2012-04-11 Daniel Colascione <dancol@dancol.org>
9705
9706 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9707 against is gone. It's better to use vfork now so that when Cygwin
9708 gains a new, working vfork, we use it automatically (bug#10398).
9709
9710 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9711
9712 * window.c (save_window_save): Obey window-point-insertion-type.
9713
9714 2012-04-11 Glenn Morris <rgm@gnu.org>
9715
9716 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9717
9718 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9719
9720 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9721
9722 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9723
9724 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9725 (force_quit_count): New var.
9726 (handle_interrupt): Use it.
9727
9728 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9729
9730 * w32.c (w32_delayed_load): Record the full path of the library
9731 being loaded (bug#10424).
9732
9733 2012-04-09 Glenn Morris <rgm@gnu.org>
9734
9735 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9736 not just in the obarray, before snarfing them. (Bug#11036)
9737
9738 * Makefile.in ($(leimdir)/leim-list.el):
9739 Pass EMACS rather than BUILT_EMACS.
9740
9741 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9742
9743 * process.c (make_process):
9744 * process.h: Add integer `gnutls_handshakes_tried' member to
9745 process struct.
9746
9747 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9748 Add convenience `GNUTLS_LOG2i' macro.
9749
9750 * gnutls.c (gnutls_log_function2i): Convenience log function.
9751 (emacs_gnutls_read): Use new log functions,
9752 `gnutls_handshakes_tried' process member, and
9753 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9754 attempts per process (connection).
9755
9756 2012-04-09 Chong Yidong <cyd@gnu.org>
9757
9758 * eval.c (Fuser_variable_p, user_variable_p_eh)
9759 (lisp_indirect_variable): Functions deleted.
9760 (Fdefvar): Caller changed.
9761
9762 * callint.c (Finteractive, Fcall_interactively):
9763 * minibuf.c (Fread_variable): Callers changed.
9764
9765 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9766
9767 * xdisp.c (set_cursor_from_row): If the display string appears in
9768 the buffer at position that is closer to point than the position
9769 after the display string, display the cursor on the first glyph of
9770 the display string. Fixes cursor display when a 'display' text
9771 property immediately follows invisible text. (Bug#11094)
9772
9773 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9774
9775 composite.c: use 'double' consistently
9776 * composite.c (get_composition_id): Use 'double' consistently
9777 instead of converting 'float' to 'double' and vice versa; this is
9778 easier to understand and avoids a GCC warning.
9779
9780 2012-04-09 Glenn Morris <rgm@gnu.org>
9781
9782 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9783 preparation for dumping it with emacs. (Bug#4789)
9784 (leimdir): New variable.
9785 ($(leimdir)/leim-list.el): New rule.
9786 (emacs$(EXEEXT)): Depend on leim-list.el.
9787
9788 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9789 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9790 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9791
9792 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9793
9794 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9795 proper alignment.
9796
9797 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9798
9799 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9800 Remove unused local variable.
9801
9802 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9803
9804 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9805 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9806 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9807 objects, as mark_maybe_pointer will catch them otherwise.
9808 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9809 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9810
9811 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9812
9813 Fix typo that broke non-Windows builds.
9814 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9815
9816 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9817
9818 Support building on MS-Windows with libxml2.
9819
9820 * makefile.w32-in (OBJ2): Add xml.$(O).
9821 (GLOBAL_SOURCES): Add xml.c.
9822 ($(BLD)/xml.$(O)): New dependency list.
9823
9824 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9825 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9826 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9827 [!WINDOWSNT]: New macros.
9828 (init_libxml2_functions, libxml2_loaded_p): New functions.
9829 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9830 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9831 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9832 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9833 linked in).
9834 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9835 Call init_libxml2_functions before calling libxml2 functions.
9836 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9837
9838 * emacs.c: Don't include libxml/parser.h.
9839 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9840 xmlCleanupParser directly.
9841
9842 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9843
9844 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9845
9846 * indent.c (Fvertical_motion): If there is a display string at
9847 point, use it.vpos to compute how many lines to backtrack after
9848 move_it_to point. (Bug#11133)
9849
9850 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9851
9852 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9853 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9854 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9855 macros related to unification of CJK characters. For the details,
9856 see the discussion following the message here:
9857 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9858
9859 2012-04-04 Chong Yidong <cyd@gnu.org>
9860
9861 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9862
9863 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9864
9865 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9866 instead of alloca. (Bug#11138)
9867
9868 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9869
9870 * w32menu.c (is_simple_dialog): Properly check lisp types.
9871 (Bug#11141)
9872
9873 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9874
9875 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9876 position we get to after a call to move_it_to fails the
9877 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9878 only if we wind up in a string from display property. (Bug#11063)
9879
9880 * window.c (Fdelete_other_windows_internal): Invalidate the row
9881 and column information about mouse highlight, so that redisplay
9882 restores it after reallocating the glyph matrices. (Bug#7464)
9883
9884 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9885 string comes from a `display' text property, use the buffer
9886 position of that property as if we actually saw that position in
9887 the row's glyphs.
9888 (move_it_by_lines): Remove the assertion that
9889 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9890 violated when there's a before-string at the beginning of a line.
9891 (Bug#11063)
9892
9893 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9894
9895 * xdisp.c (append_space_for_newline): If the default face was
9896 remapped, use the remapped face for the appended newline.
9897 (extend_face_to_end_of_line): Use the remapped default face for
9898 extending the face to the end of the line.
9899 (display_line): Call extend_face_to_end_of_line when the default
9900 face was remapped. (Bug#11068)
9901
9902 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9903
9904 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9905
9906 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9907
9908 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9909
9910 2012-03-27 Glenn Morris <rgm@gnu.org>
9911
9912 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9913 Doc fixes.
9914
9915 2012-03-26 Kenichi Handa <handa@m17n.org>
9916
9917 * dispextern.h (struct glyph): Fix previous change. Change the
9918 bit length of glyphless.ch to 25 (Bug#11082).
9919
9920 2012-03-26 Chong Yidong <cyd@gnu.org>
9921
9922 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9923 (command_loop_1): Use it; inhibit selection update for
9924 handle-select-window too (Bug#8996).
9925
9926 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9927
9928 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9929
9930 2012-03-25 Kenichi Handa <handa@m17n.org>
9931
9932 * dispextern.h (struct glyph): Change the bit length of
9933 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9934
9935 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9936
9937 * s/ms-w32.h (tzname): Include time.h before redirecting to
9938 _tzname. Fixes the MSVC build. (Bug#9960)
9939
9940 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9941
9942 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9943 characters.
9944
9945 * xterm.c (XTread_socket): Only modify handling_signal if
9946 !SYNC_INPUT. (Bug#11080)
9947
9948 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9949
9950 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9951 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9952 when fetching a multibyte character consumes more bytes than
9953 CHAR_BYTES returns, due to unification of CJK characters in
9954 string_char. (Bug#11073)
9955
9956 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9957
9958 * process.c (wait_reading_process_output): Handle pty disconnect
9959 by refraining from sending oneself a SIGCHLD (bug#10933).
9960
9961 2012-03-22 Chong Yidong <cyd@gnu.org>
9962
9963 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9964
9965 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9966 Mark string as coming from a prefix property.
9967 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9968 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9969
9970 2012-03-21 Chong Yidong <cyd@gnu.org>
9971
9972 * xfaces.c (Vface_remapping_alist): Doc fix.
9973
9974 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9975
9976 * w32proc.c (Fw32_set_console_codepage)
9977 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9978 Doc fixes.
9979
9980 2012-03-20 Chong Yidong <cyd@gnu.org>
9981
9982 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9983 to reflect default non-nil value of redisplay-dont-pause.
9984
9985 2012-03-19 Kenichi Handa <handa@m17n.org>
9986
9987 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9988 it fit in a valid range (Bug#11003).
9989
9990 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9991
9992 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9993 that is not from display property, accept the row as a "cursor
9994 row" if one of the string's character has a non-nil `cursor'
9995 property. Fixes cursor positioning when there are newlines in
9996 overlay strings, e.g. in icomplete.el. (Bug#11035)
9997
9998 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9999
10000 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10001
10002 2012-03-12 Chong Yidong <cyd@gnu.org>
10003
10004 * eval.c (inhibit_lisp_code): Rename from
10005 inhibit_window_configuration_change_hook; move from window.c.
10006
10007 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10008 * window.c (run_window_configuration_change_hook)
10009 (syms_of_window): Callers changed.
10010
10011 2012-03-11 Chong Yidong <cyd@gnu.org>
10012
10013 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10014
10015 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10016
10017 2012-03-10 Chong Yidong <cyd@gnu.org>
10018
10019 * frame.c (other_visible_frames): Don't assume the selected frame
10020 is visible (Bug#10955).
10021
10022 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10023
10024 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10025
10026 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10027
10028 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10029 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10030 zero (Bug#10954).
10031
10032 2012-03-03 Glenn Morris <rgm@gnu.org>
10033
10034 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
10035
10036 2012-03-02 Eli Zaretskii <eliz@gnu.org>
10037
10038 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10039 position past the first glyph_row that ends at ZV. (Bug#10902)
10040 (redisplay_window, next_element_from_string): Fix typos in
10041 comments.
10042 (redisplay_window): Pass to move_it_vertically the margin in
10043 pixels, not in screen lines.
10044
10045 2012-03-02 Glenn Morris <rgm@gnu.org>
10046
10047 * buffer.c (buffer-list-update-hook): Doc fix.
10048
10049 2012-02-29 Eli Zaretskii <eliz@gnu.org>
10050
10051 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10052 push_it before setting up the iterator for the first overlay
10053 string, even if we have an empty string loaded.
10054 (next_overlay_string): If there's an empty string on the iterator
10055 stack, pop the stack. (Bug#10903)
10056
10057 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10060 Suggested by Stefan Monnier in
10061 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10062 * alloc.c (widen_to_Lisp_Object): New static function.
10063 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10064 and widening them to Lisp_Objects. This would work even if
10065 USE_LSB_TAG is defined and wide integers are used, which might
10066 happen in a future version of Emacs.
10067
10068 2012-02-25 Chong Yidong <cyd@gnu.org>
10069
10070 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10071 Doc fix.
10072
10073 * xselect.c (Fx_selection_exists_p): Doc fix.
10074 (x_clipboard_manager_save_all): Print an informative message
10075 before saving to clipboard manager.
10076
10077 2012-02-24 Chong Yidong <cyd@gnu.org>
10078
10079 * keyboard.c (process_special_events): Handle all X selection
10080 requests in kbd_buffer, not just the next one (Bug#8869).
10081
10082 2012-02-23 Chong Yidong <cyd@gnu.org>
10083
10084 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10085 call when setting menu-bar-lines and tool-bar-lines parameters.
10086 (unwind_create_frame_1): New helper function.
10087
10088 * window.c (inhibit_window_configuration_change_hook): New var.
10089 (run_window_configuration_change_hook): Obey it.
10090 (syms_of_window): Initialize it.
10091
10092 2012-02-22 Chong Yidong <cyd@gnu.org>
10093
10094 * xterm.c (x_draw_image_relief): Add missing type check for
10095 Vtool_bar_button_margin (Bug#10743).
10096
10097 2012-02-21 Chong Yidong <cyd@gnu.org>
10098
10099 * fileio.c (Vfile_name_handler_alist): Doc fix.
10100
10101 * buffer.c (Fget_file_buffer): Protect against invalid file
10102 handler return value.
10103
10104 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10105
10106 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10107 when computing $valmask.
10108
10109 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10110 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10111 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10112 It's useless in that case, and it can cause problems on hosts
10113 that allocate halves of EMACS_INT values separately.
10114 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10115 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10116 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10117 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10118 it avoids undefined behavior on hosts where shifting right by more
10119 than the word width has undefined behavior.
10120
10121 2012-02-19 Chong Yidong <cyd@gnu.org>
10122
10123 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10124 (Funhandled_file_name_directory, Ffile_name_as_directory)
10125 (Fdirectory_file_name, Fexpand_file_name)
10126 (Fsubstitute_in_file_name): Protect against invalid file handler
10127 return values (Bug#10845).
10128
10129 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10130
10131 * .gdbinit (pitx): Fix incorrect references to fields of the
10132 iterator stack.
10133
10134 2012-02-17 Chong Yidong <cyd@gnu.org>
10135
10136 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10137
10138 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10139
10140 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10141 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10142
10143 2012-02-15 Chong Yidong <cyd@gnu.org>
10144
10145 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10146 marked as special. Also, starting docstrings with * is obsolete.
10147
10148 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10149
10150 * gnutls.c (emacs_gnutls_write): Fix last change.
10151
10152 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10153
10154 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10155 send_process.
10156
10157 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10158
10159 * keymap.c (Fsingle_key_description): Handle char ranges.
10160
10161 2012-02-12 Chong Yidong <cyd@gnu.org>
10162
10163 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10164 as that creates a dangerous corner case.
10165
10166 * window.c (Fdelete_window_internal): Invalidate the mouse
10167 highlight (Bug#9904).
10168
10169 2012-02-12 Glenn Morris <rgm@gnu.org>
10170
10171 * xselect.c (Fx_own_selection_internal)
10172 (Fx_get_selection_internal, Fx_disown_selection_internal)
10173 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10174 * nsselect.m (Fx_own_selection_internal)
10175 (Fx_disown_selection_internal, Fx_selection_exists_p)
10176 (Fx_selection_owner_p, Fx_get_selection_internal):
10177 Sync docs and argument specs with the xselect.c versions.
10178
10179 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10180
10181 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10182
10183 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10184
10185 * w32select.c (Fx_selection_exists_p): Sync doc string and
10186 argument list with xselect.c. (Bug#10783)
10187
10188 * w16select.c (Fx_selection_exists_p): Sync doc string and
10189 argument list with xselect.c. (Bug#10783)
10190
10191 2012-02-10 Glenn Morris <rgm@gnu.org>
10192
10193 * fns.c (Fsecure_hash): Doc fix.
10194
10195 2012-02-09 Kenichi Handa <handa@m17n.org>
10196
10197 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10198
10199 2012-02-07 Chong Yidong <cyd@gnu.org>
10200
10201 * buffer.c (Fbuffer_local_variables)
10202 (buffer_lisp_local_variables): Handle unbound vars correctly;
10203 don't let Qunbound leak into Lisp.
10204
10205 2012-02-07 Glenn Morris <rgm@gnu.org>
10206
10207 * image.c (Fimagemagick_types): Doc fix.
10208
10209 * image.c (imagemagick-render-type): Change it from a lisp object
10210 to an integer. Move the doc here from the lisp manual.
10211 Treat all values not equal to 0 the same.
10212
10213 2012-02-06 Chong Yidong <cyd@gnu.org>
10214
10215 * doc.c (store_function_docstring): Avoid applying docstring of
10216 alias to base function (Bug#2603).
10217
10218 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10219
10220 * .gdbinit (pp1, pv1): Remove redundant defines.
10221 (pr): Use pp.
10222
10223 2012-02-04 Chong Yidong <cyd@gnu.org>
10224
10225 * nsterm.m: Declare a global (Bug#10694).
10226
10227 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10228
10229 * w32.c (get_emacs_configuration_options):
10230 Include --enable-checking, if specified, in the return value.
10231
10232 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10233
10234 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10235 after rounding frame sizes. (Bug#9723)
10236
10237 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10238
10239 * keyboard.c (adjust_point_for_property): Don't position point
10240 before BEGV. (Bug#10696)
10241
10242 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10243
10244 Handle overflow when computing char display width (Bug#9496).
10245 * character.c (char_width): Return EMACS_INT, not int.
10246 (char_width, c_string_width): Check for overflow when
10247 computing the width; this is possible now that individual
10248 characters can have unbounded width. Problem introduced
10249 by merge from Emacs 23 on 2012-01-19.
10250
10251 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10252
10253 * dbusbind.c (Fdbus_register_method): Mention the return value
10254 :ignore in the docstring.
10255
10256 2012-02-02 Glenn Morris <rgm@gnu.org>
10257
10258 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10259
10260 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10261 Unconditionally set to t. (Bug#10673)
10262 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10263 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10264 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10265
10266 2012-02-02 Kenichi Handa <handa@m17n.org>
10267
10268 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10269 0, do not call append_composite_glyph.
10270
10271 2012-02-02 Kenichi Handa <handa@m17n.org>
10272
10273 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10274 NULL (Bug#6988).
10275 (x_produce_glyphs): If the component of a composition is a null
10276 string, set it->pixel_width to 1 to avoid zero-width glyph.
10277
10278 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10279
10280 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10281 first 2 arguments are identical. This makes inserting large
10282 output from a subprocess an order of magnitude faster on
10283 MS-Windows, where all sbrk'ed memory is always contiguous.
10284
10285 2012-01-31 Glenn Morris <rgm@gnu.org>
10286
10287 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10288 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10289 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10290
10291 2012-01-29 Glenn Morris <rgm@gnu.org>
10292
10293 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10294
10295 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10296
10297 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10298
10299 2012-01-28 Chong Yidong <cyd@gnu.org>
10300
10301 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10302
10303 2012-01-26 Chong Yidong <cyd@gnu.org>
10304
10305 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10306
10307 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10308 repeat counts (Bug#10507).
10309
10310 2012-01-26 Glenn Morris <rgm@gnu.org>
10311
10312 * lread.c (syms_of_lread): Doc fix.
10313
10314 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10315
10316 * coding.c (encode_designation_at_bol): Change return value to
10317 EMACS_INT.
10318
10319 2012-01-25 Chong Yidong <cyd@gnu.org>
10320
10321 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10322
10323 2012-01-21 Chong Yidong <cyd@gnu.org>
10324
10325 * floatfns.c (Fcopysign): Make the second argument non-optional,
10326 since nil is not allowed anyway.
10327
10328 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10329
10330 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10331 (send_process): Likewise.
10332
10333 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10334
10335 * window.c (save_window_save, Fcurrent_window_configuration)
10336 (Vwindow_persistent_parameters): Do not use Qstate.
10337 Rewrite doc-strings.
10338
10339 2012-01-19 Kenichi Handa <handa@m17n.org>
10340
10341 * character.c (char_width): New function.
10342 (Fchar_width, c_string_width, lisp_string_width):
10343 Use char_width (Bug#9496).
10344
10345 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10346
10347 * window.c (Vwindow_persistent_parameters): New variable.
10348 (Fset_window_configuration, save_window_save): Handle persistent
10349 window parameters.
10350
10351 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10352
10353 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10354 thrashing the stack of the thread. (Bug#9087)
10355
10356 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10357
10358 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10359
10360 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10361
10362 * xdisp.c (rows_from_pos_range): Handle the case where the
10363 highlight ends on a newline. (Bug#10464)
10364 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10365 he end column for display of highlight that ends on a newline
10366 before a R2L line.
10367
10368 2012-01-11 Glenn Morris <rgm@gnu.org>
10369
10370 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10371 from load-path also when installation-directory is nil. (Bug#10208)
10372
10373 2012-01-10 Glenn Morris <rgm@gnu.org>
10374
10375 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10376
10377 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10378 Update template values to be closer to their typical values these days.
10379
10380 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10381
10382 * xdisp.c (rows_from_pos_range): Accept additional argument
10383 DISP_STRING, and accept any glyph in a row whose object is that
10384 string as eligible for mouse highlight. Fixes mouse highlight of
10385 display strings from overlays. (Bug#10464)
10386
10387 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10388
10389 emacs: fix an auto-save permissions race condition (Bug#10400)
10390 * fileio.c (auto_saving_dir_umask): New static var.
10391 (Fmake_directory_internal): Use it.
10392 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10393 creating the directory. The old code temporarily assigns
10394 too-generous permissions to the directory.
10395 (do_auto_save_eh): Clear it.
10396 (Fdo_auto_save): Catch all errors, not just file errors, so
10397 that the var is always cleared.
10398
10399 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10400
10401 * search.c (scan_buffer): Pass character positions to
10402 know_region_cache, not byte positions. (Bug#6540)
10403
10404 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10405
10406 * w32.c (sys_rename): Report EXDEV when rename of a directory
10407 fails because the target is on another logical disk. (Bug#10284)
10408
10409 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10410
10411 * xterm.c (x_embed_request_focus): New function.
10412
10413 * xterm.h: Add prototype.
10414
10415 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10416
10417 2012-01-05 Glenn Morris <rgm@gnu.org>
10418
10419 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10420
10421 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10422
10423 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10424 Load gnutls_transport_set_lowat only if GnuTLS version is below
10425 2.11.1.
10426 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10427 GnuTLS versions below 2.11.1.
10428
10429 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10430
10431 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10432 to the doc string advising against its use for altering the way
10433 windows are scrolled.
10434
10435 2011-12-28 Kenichi Handa <handa@m17n.org>
10436
10437 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10438 coding-system ASCII compatible only when it does not produce BOM
10439 on encoding (Bug#10383).
10440
10441 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10442
10443 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10444 can scroll.
10445 (create_and_show_popup_menu): Always use menu_position_func for
10446 Gtk3 (Bug#10361).
10447
10448 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10449
10450 * callint.c (Fcall_interactively): Don't truncate prompt string.
10451
10452 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10453
10454 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10455 property that ends at ZV, so that the bidi iteration could be
10456 resumed from there (after widening). (Bug#10360)
10457
10458 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10459
10460 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10461
10462 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10463
10464 * nsterm.m (x_free_frame_resources):
10465 Release f->output_data.ns->miniimage.
10466 (ns_index_color): Fix indentation. Do not retain
10467 color_table->colors[i].
10468
10469 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10470 before returning.
10471
10472 * nsfns.m (x_set_background_color): Assign return value from
10473 ns_index_color to face-background instead of NSColor*.
10474 (ns_implicitly_set_icon_type): Fix indentation.
10475 Change assignment in for loop to comparison.
10476
10477 * emacs.c (ns_pool): New variable.
10478 (main): Assign ns_pool.
10479 (Fkill_emacs): Call ns_release_autorelease_pool.
10480
10481 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10482 autorelease fdesc, release fdAttrs and tdict.
10483 (ns_get_covering_families): Release charset.
10484 (ns_findfonts): Release NSFontDescriptor created with new.
10485 (ns_uni_to_glyphs): Fix indentation.
10486 (setString): Release attrStr before assigning new value.
10487
10488 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10489
10490 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10491 and NS_IMPL_COCOA.
10492 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10493 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10494
10495 2011-12-18 David Reitter <reitter@cmu.edu>
10496
10497 * nsterm.m (ns_term_init): Subscribe for notifications
10498 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10499 to method trackingNotification in EmacsMenu.
10500
10501 * nsmenu.m (trackingMenu): New variable.
10502 (trackingNotification): New method (from Aquamacs).
10503 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10504 from Aquamacs (Bug#7030).
10505
10506 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10507
10508 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10509 (symbol_to_nsstring): Fix indentation.
10510 (ns_symbol_to_pb): New function.
10511 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10512 (Fns_rotate_cut_buffers_internal): Remove.
10513 (Fns_store_selection_internal): Rename from
10514 Fns_store_cut_buffer_internal.
10515 (ns_get_foreign_selection, Fx_own_selection_internal)
10516 (Fx_disown_selection_internal, Fx_selection_exists_p)
10517 (Fns_get_selection_internal, Fns_store_selection_internal):
10518 Use ns_symbol_to_pb and check if return value is nil.
10519 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10520 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10521 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10522 renamed to Sns_store_selection_internal.
10523 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10524 and remove this function.
10525 (ns_handle_selection_clear): Remove, never used.
10526 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10527 here.
10528
10529 2011-12-17 Ken Brown <kbrown@cornell.edu>
10530
10531 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10532 GID is unknown (Bug#10257).
10533
10534 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10535
10536 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10537 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10538 which caused a build failure on GNU/Linux IA-64. This problem was
10539 introduced by my 2011-10-07 patch.
10540
10541 2011-12-15 Juri Linkov <juri@jurta.org>
10542
10543 * image.c (imagemagick_error): New function. (Bug#10112)
10544 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10545 Use `imagemagick_error' where ImageMagick functions return
10546 `MagickFalse'.
10547 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10548 proper order.
10549
10550 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10551
10552 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10553 fill background (Bug#8992).
10554
10555 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10556
10557 * window.c (Vwindow_combination_resize)
10558 (Vwindow_combination_limit): Use t instead of non-nil in
10559 doc-strings.
10560 (Vrecenter_redisplay): Add first sentence of doc-string on
10561 separate line.
10562 (Frecenter): Fix doc-string typo.
10563
10564 2011-12-11 Kenichi Handa <handa@m17n.org>
10565
10566 * coding.c (Funencodable_char_position): Pay attention to the
10567 buffer text relocation (Bug#9389).
10568
10569 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10570
10571 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10572 gtk_init (Bug#10100).
10573
10574 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10575
10576 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10577 IT->string is nil. (Bug#10263)
10578
10579 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10580
10581 * nsterm.h (x_free_frame_resources): Declare.
10582
10583 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10584 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10585
10586 * nsterm.h (ns_get_defaults_value): Declare.
10587
10588 * nsterm.m (ns_default): Call ns_get_defaults_value.
10589
10590 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10591
10592 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10593 (Bug#10170)
10594
10595 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10596
10597 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10598 that where the value of an _OBJC_* symbol points to is in the .bss
10599 section (Bug#10240).
10600
10601 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10602
10603 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10604 after the loop to call ccl_driver at least once (Bug#8619).
10605
10606 2011-12-08 Kenichi Handa <handa@m17n.org>
10607
10608 * ftfont.c (get_adstyle_property): Fix previous change
10609 (Bug#10233).
10610
10611 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10612
10613 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10614 dirs from the default value of EMACSLOADPATH (bug#10208).
10615
10616 2011-12-07 Glenn Morris <rgm@gnu.org>
10617
10618 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10619 installation and source directories as well. (Bug#10208)
10620
10621 2011-12-06 Chong Yidong <cyd@gnu.org>
10622
10623 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10624
10625 2011-12-06 Glenn Morris <rgm@gnu.org>
10626
10627 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10628 as an error, not just -1. (Bug#10217)
10629
10630 2011-12-05 Chong Yidong <cyd@gnu.org>
10631
10632 * keyboard.c (process_special_events): New function.
10633 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10634
10635 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10636
10637 * coding.c (encode_designation_at_bol): Don't use uninitialized
10638 local variable (Bug#9318).
10639
10640 2011-12-05 Kenichi Handa <handa@m17n.org>
10641
10642 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10643 return Qnil (Bug#8046, Bug#10193).
10644
10645 2011-12-05 Kenichi Handa <handa@m17n.org>
10646
10647 * coding.c (encode_designation_at_bol): New args charbuf_end and
10648 dst. Return the number of produced bytes. Callers changed.
10649 (coding_set_source): Return how many bytes coding->source was
10650 relocated.
10651 (coding_set_destination): Return how many bytes
10652 coding->destination was relocated.
10653 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10654 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10655
10656 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10657
10658 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10659 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10660 macro (Bug#9318).
10661
10662 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10663
10664 The following changes are to fix Bug#9318.
10665
10666 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10667 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10668 (encode_coding_iso_2022, encode_coding_sjis)
10669 (encode_coding_big5, encode_coding_charset): Use the above macros.
10670
10671 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10672
10673 * lisp.h (process_quit_flag): Fix external declaration.
10674
10675 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10676
10677 Don't macro-inline non-performance-critical code.
10678 * eval.c (process_quit_flag): New function.
10679 * lisp.h (QUIT): Use it.
10680
10681 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10682
10683 * nsfns.m (get_geometry_from_preferences): New function.
10684 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10685
10686 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10687
10688 * emacs.c (Qkill_emacs): Define.
10689 (syms_of_emacs): Initialize it.
10690 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10691 Qquit_flag to `kill-emacs' instead.
10692 (quit_throw_to_read_char): Add parameter `from_signal'.
10693 All callers changed. Call Fkill_emacs if requested and safe.
10694 * lisp.h (QUIT): Call Fkill_emacs if requested.
10695
10696 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10697
10698 * widget.c (update_wm_hints): Return if wmshell is null.
10699 (widget_update_wm_size_hints): New function.
10700
10701 * widget.h (widget_update_wm_size_hints): Declare.
10702
10703 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10704 widget_update_wm_size_hints (Bug#10104).
10705
10706 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10707
10708 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10709 before a newline, prepare the bidi iterator for consuming the
10710 newline, and keep the current paragraph direction. (Bug#10183)
10711 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10712
10713 2011-12-02 Juri Linkov <juri@jurta.org>
10714
10715 * search.c (Fword_search_regexp): New Lisp function created from
10716 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10717 (Fword_search_backward, Fword_search_forward)
10718 (Fword_search_backward_lax, Fword_search_forward_lax):
10719 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10720 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10721
10722 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10723
10724 * fileio.c (Finsert_file_contents): Move after-change-function call
10725 to before the "handled:" label, since all "goto handled" appear in
10726 cases where the *-change-functions have already been properly called
10727 (bug#10117).
10728
10729 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10730
10731 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10732 waiting for input. (Bug#10169)
10733
10734 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10735
10736 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10737 verifies glyph row's hash code--we have just reallocated the
10738 glyphs, so their contents can be complete garbage. (Bug#10164)
10739
10740 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10741
10742 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10743
10744 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10745
10746 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10747 attributes are tested _before_ calling verify_row_hash, to protect
10748 against GCC re-ordering of the tests. (Bug#10164)
10749
10750 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10751
10752 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10753
10754 * xterm.c (handle_one_xevent): Only set async_visible and friends
10755 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10756 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10757 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10758
10759 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10760
10761 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10762 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10763 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10764 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10765 All uses changed to use GCPRO1 etc.
10766 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10767 Revert to old implementation (i.e., before 2011-03-11).
10768
10769 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10770
10771 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10772 of scroll runs so as to avoid assigning disabled bogus rows and
10773 unnecessary graphics copy operations.
10774
10775 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10776
10777 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10778 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10779 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10780 (malloc, free, realloc, calloc): Redirect to e_* only when
10781 compiling Emacs.
10782
10783 * lisp.h (GCTYPEBITS): Move before first use.
10784 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10785 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10786 this macro definition.
10787
10788 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10789 _MSC_VER.
10790
10791 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10792
10793 * gtkutil.c (xg_create_frame_widgets):
10794 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10795 present with Gtk+ 2.0.
10796
10797 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10798
10799 * fileio.c (Finsert_file_contents): Undo previous change; see
10800 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10801
10802 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10803
10804 Rename locals to avoid shadowing.
10805 * fileio.c (Finsert_file_contents):
10806 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10807 * process.c (wait_reading_process_output):
10808 Rename inner 'proc' to 'p' to avoid shadowing.
10809 Indent for consistency with usual Emacs style.
10810
10811 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10812
10813 * xdisp.c (redisplay_window): If cursor row is not fully visible
10814 after recentering, and scroll-conservatively is set to a large
10815 number, scroll window by a few more lines to make the cursor fully
10816 visible and out of scroll-margin. (Bug#10105)
10817 (start_display): Don't move to the next line if the display should
10818 start at a newline that is part of a display vector or an overlay
10819 string. (Bug#10119)
10820
10821 2011-11-24 Juri Linkov <juri@jurta.org>
10822
10823 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10824 after the `MagickPingImage' call. (Bug#10112)
10825
10826 2011-11-23 Chong Yidong <cyd@gnu.org>
10827
10828 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10829
10830 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10831
10832 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10833 making another buffer current. (Bug#10114)
10834
10835 2011-11-23 Glenn Morris <rgm@gnu.org>
10836
10837 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10838
10839 2011-11-23 Chong Yidong <cyd@gnu.org>
10840
10841 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10842 using it (Bug#5984).
10843
10844 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10845
10846 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10847 and header-lines, as they don't have one computed for them.
10848 (Bug#10098)
10849
10850 * .gdbinit (prow): Make displayed values more self-explaining.
10851 Add row's hash code.
10852
10853 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10854
10855 * process.c (wait_reading_process_output): Fix asynchrounous
10856 GnuTLS socket handling on some versions of the GnuTLS library.
10857 (wait_reading_process_output): Add comment and URL.
10858
10859 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10860
10861 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10862
10863 2011-11-21 Chong Yidong <cyd@gnu.org>
10864
10865 * window.c (Fnext_window, Fprevious_window): Doc fix.
10866
10867 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10868
10869 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10870
10871 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10872
10873 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10874
10875 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10876
10877 * window.c (Fset_window_combination_limit): Rename argument
10878 STATUS to LIMIT.
10879 (Vwindow_combination_limit): Remove "status" from doc-string.
10880
10881 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10882
10883 * m/ibms390.h: Remove.
10884 * m/ibms390x.h: Don't include "ibms390.h".
10885
10886 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10887
10888 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10889 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10890
10891 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10892
10893 * casetab.c (Fset_case_table):
10894 * charset.c (Fcharset_after): Fix typos.
10895
10896 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10897
10898 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10899 Otherwise, valgrind does not work on some platforms.
10900 Problem reported by Andreas Schwab in
10901 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10902 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10903 is set, removing the need for VIRT_ADDRESS_VARIES.
10904 (PURE_P): Use a more-efficient implementation that needs just one
10905 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10906 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10907 to 4 (xorl, subq, cmpq, setbe).
10908 * alloc.c (pure): Always extern now, since that's the
10909 VIRT_ADDR_VARIES behavior.
10910 (PURE_POINTER_P): Use a single comparison, not two, for
10911 consistency with the new puresize.h.
10912 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10913 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10914 Remove VIRT_ADDR_VARIES no longer needed.
10915
10916 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10917
10918 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10919 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10920 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10921 behave as if the cursor position were at the window margin.
10922
10923 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10924 and the cursor position is out of bounds, behave as if the cursor
10925 position were at the window margin. (Bug#10075)
10926
10927 2011-11-18 Chong Yidong <cyd@gnu.org>
10928
10929 * window.c (Fwindow_combination_limit): Make first argument
10930 non-optional, since it is meaningless for live windows like the
10931 selected window.
10932
10933 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10934
10935 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10936
10937 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10938
10939 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10940 (graft_intervals_into_buffer): Simplify.
10941
10942 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10943
10944 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10945 hash values of the two rows.
10946 (copy_row_except_pointers): Preserve the used[] arrays and the
10947 hash values of the two rows. (Bug#10035)
10948 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10949
10950 * xdisp.c (row_hash): New function, body extracted from
10951 compute_line_metrics.
10952 (compute_line_metrics): Call row_hash, instead of computing the
10953 hash code inline.
10954
10955 * dispnew.c (verify_row_hash): Call row_hash for computing the
10956 hash code of a row, instead of duplicating code from xdisp.c.
10957
10958 * dispextern.h (row_hash): Add prototype.
10959
10960 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10961
10962 * frame.c (delete_frame): Don't delete the terminal when the last
10963 X frame is closed if emacs is built with GTK toolkit.
10964
10965 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10966
10967 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10968
10969 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10970
10971 * window.c (Vwindow_splits): Rename to
10972 Vwindow_combination_resize. Suggested by Juri Linkov.
10973 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10974 of Vwindow_splits.
10975
10976 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10977
10978 * nsfns.m (Fns_font_name):
10979 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10980
10981 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10982
10983 * window.h (window): Rename slot "nest" to "combination_limit".
10984 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10985 (Fset_window_nest): Rename to Fset_window_combination_limit.
10986 (Vwindow_nest): Rename to Vwindow_combination_limit.
10987 (recombine_windows, make_parent_window, make_window)
10988 (Fsplit_window_internal, saved_window)
10989 (Fset_window_configuration, save_window_save): Rename all
10990 occurrences of window_nest to window_combination_limit.
10991
10992 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10993
10994 * image.c (imagemagick_load_image): Fix typo.
10995
10996 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10997
10998 * xdisp.c (display_line): Move the call to
10999 highlight_trailing_whitespace before the call to
11000 compute_line_metrics, since the latter needs to see the final
11001 faces of all the glyphs to compute ROW's hash value.
11002 Fixes assertion violations in row_equal_p. (Bug#10035)
11003
11004 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
11005
11006 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11007 just return (bug#10044).
11008
11009 2011-11-12 Eli Zaretskii <eliz@gnu.org>
11010
11011 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11012 with user-defined heap size. Bump the default size of the temacs
11013 heap to 27MB, to avoid memory warning when running temacs.
11014 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11015
11016 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11017 current_matrix and desired_matrix. (Bug#9990)
11018 (verify_row_hash) [XASSERTS]: New function.
11019 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11020 that the hash value of glyph rows is correct.
11021
11022 2011-11-12 Martin Rudalics <rudalics@gmx.at>
11023
11024 * window.h (window): Remove splits slot.
11025 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11026 (Fdelete_other_windows_internal, make_parent_window)
11027 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11028 (Fset_window_configuration, save_window_save): Don't deal with
11029 split status of windows.
11030 (saved_window): Remove splits slot.
11031 (Vwindow_splits): Rewrite doc-string.
11032
11033 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11034
11035 * xfns.c (unwind_create_frame):
11036 * nsfns.m (unwind_create_frame):
11037 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11038 Vframe_list (Bug#9999).
11039
11040 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11041
11042 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
11043
11044 2011-11-11 Kenichi Handa <handa@m17n.org>
11045
11046 * callproc.c (Fcall_process): Set the member dst_multibyte of
11047 process_coding.
11048
11049 2011-11-11 Johan Bockgård <bojohan@gnu.org>
11050
11051 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11052 avoid a crash (bug#9496).
11053
11054 2011-11-09 Chong Yidong <cyd@gnu.org>
11055
11056 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11057 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11058
11059 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11060
11061 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11062
11063 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11064
11065 Avoid some portability problems by eschewing 'extern inline' functions.
11066 The trivial performance wins aren't worth the portability hassles; see
11067 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11068 et seq.
11069 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11070 (window_box_width, window_box_left, window_box_left_offset)
11071 (window_box_right, window_box_right_offset): Undo previous change,
11072 by removing the "extern"s.
11073 * intervals.c (adjust_intervals_for_insertion)
11074 (adjust_intervals_for_deletion): Undo previous change,
11075 making these static again.
11076 (offset_intervals, temp_set_point_both, temp_set_point)
11077 (copy_intervals_to_string): No longer inline.
11078 * xdisp.c (window_text_bottom_y, window_box_width)
11079 (window_box_height, window_box_left_offset)
11080 (window_box_right_offset, window_box_left, window_box_right)
11081 (window_box): No longer inline.
11082
11083 2011-11-08 Chong Yidong <cyd@gnu.org>
11084
11085 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11086 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11087 Signal an error if not a live window.
11088 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11089 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11090
11091 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11092
11093 * lisp.h (syms_of_abbrev): Remove declaration.
11094 Reported by CHENG Gao <chenggao@royau.me>.
11095
11096 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11097
11098 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11099 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11100 of temacs in GUI mode.
11101
11102 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11103
11104 * window.h: Declare delete_all_child_windows instead of
11105 delete_all_subwindows.
11106 * window.c (Fwindow_nest, Fset_window_nest)
11107 (Fset_window_new_total, Fset_window_new_normal)
11108 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11109 (delete_all_subwindows): Rename to delete_all_child_windows.
11110 (Fdelete_other_windows_internal, Fset_window_configuration):
11111 Call delete_all_child_windows instead of delete_all_subwindows.
11112 * frame.c (delete_frame): Call delete_all_child_windows instead
11113 of delete_all_subwindows.
11114
11115 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11116
11117 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11118 This is also needed for porting to any host where GC_MARK_STACK is
11119 not GC_MAKE_GCPROS_NOOPS.
11120 (which_symbols): Use it.
11121
11122 2011-11-07 Kenichi Handa <handa@m17n.org>
11123
11124 * coding.c (coding_set_destination): Check coding->src_pos only
11125 when coding->src_object is a buffer (bug#9910).
11126
11127 * process.c (send_process): Set the member src_multibyte of coding
11128 to 0 (bug#9911) when sending a unibyte text.
11129
11130 * callproc.c (Fcall_process): Set the member src_multibyte of
11131 process_coding to 0 (bug#9912).
11132
11133 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11134
11135 * xmenu.c (cleanup_widget_value_tree): New function.
11136 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11137 calling free_menubar_widget_value_tree directly (Bug#9830).
11138
11139 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11140
11141 Fix some portability problems with 'inline'.
11142 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11143 (window_box_width, window_box_left, window_box_left_offset)
11144 (window_box_right, window_box_right_offset): Declare extern.
11145 Otherwise, these inline functions do not conform to C99 and
11146 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11147 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11148 * intervals.c (adjust_intervals_for_insertion)
11149 (adjust_intervals_for_deletion): Now extern, because otherwise the
11150 extern inline functions 'offset_intervals' couldn't refer to it.
11151 (static_offset_intervals): Remove.
11152 (offset_intervals): Rewrite using the old contents of
11153 static_offset_intervals. The old version didn't conform to C99
11154 because an extern inline function contained a reference to an
11155 identifier with static linkage.
11156
11157 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11158
11159 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11160 GC.
11161
11162 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11163
11164 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11165 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11166 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11167 return Qleft_to_right.
11168
11169 2011-11-06 Chong Yidong <cyd@gnu.org>
11170
11171 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11172 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11173 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11174 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11175 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11176 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11177 (Fwindow_vscroll): Doc fix.
11178 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11179 argument, since it makes no sense to pass a live window and for
11180 consistency with window-child.
11181
11182 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11183
11184 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11185 support MSVC.
11186
11187 2011-11-05 Jason Rumney <jasonr@gnu.org>
11188
11189 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11190 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11191 fonts (Bug#6029).
11192 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11193 bitwise arithmetic preventing use of unicode-sip and non-truetype
11194 opentype fonts.
11195
11196 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11197
11198 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11199 "emacs"-only part.
11200
11201 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11202 initialization code to keep similarity to xfns.c after changes
11203 from 2011-11-05.
11204
11205 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11206
11207 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11208 (unwind_create_frame): New function (Bug#9943).
11209 (Fx_create_frame): Restructure code to be more similar to the one in
11210 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11211 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11212 Move terminal->reference_count++ just before making the frame official
11213 (Bug#9943).
11214
11215 * nsterm.m (x_free_frame_resources): New function.
11216 (x_destroy_window): Move code to x_free_frame_resources.
11217
11218 * xfns.c (unwind_create_frame): Fix comment.
11219 (Fx_create_frame, x_create_tip_frame):
11220 Move terminal->reference_count++ just before making the frame
11221 official. Move initialization of image_cache_refcount and
11222 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11223
11224 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11225
11226 Support MSVC build with newer versions of Visual Studio.
11227 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11228 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11229 nt/gmake.defs.
11230
11231 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11232 which are not supported by MSVC.
11233 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11234 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11235 bitfields.
11236 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11237 types in bitfields.
11238 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11239
11240 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11241
11242 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11243
11244 Support MSVC build with newer versions of Visual Studio.
11245 * w32.c: Don't include w32api.h for MSVC.
11246 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11247
11248 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11249 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11250 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11251 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11252 e_* cousins.
11253 (alloca) [_MSC_VER]: Define to _alloca.
11254
11255 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11256
11257 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11258
11259 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11260
11261 * xdisp.c (note_mouse_highlight): If either of
11262 previous/next-single-property-change returns nil, treat that as
11263 the beginning or the end of the buffer. (Bug#9955)
11264
11265 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11266
11267 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11268 label is not null (Bug#9951).
11269 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11270 may be NULL.
11271
11272 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11273
11274 * window.c (Fwindow_body_size): Mention in the doc string that the
11275 return value is in frame's canonical units. (Bug#9949)
11276
11277 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11278
11279 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11280
11281 * w32fns.c (unwind_create_frame): If needed, free the glyph
11282 matrices of the partially constructed frame. (Bug#9943)
11283 * xfns.c (unwind_create_frame): Likewise.
11284
11285 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11286
11287 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11288 Don't stop backward scan on the continuation glyph, even though
11289 its CHARPOS is positive.
11290 (mouse_face_from_buffer_pos, note_mouse_highlight):
11291 Rename cover_string to disp_string.
11292
11293 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11294
11295 * window.c (temp_output_buffer_show): Don't use
11296 Vtemp_buffer_show_specifiers.
11297 (Vtemp_buffer_show_specifiers): Remove unused variable.
11298
11299 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11300
11301 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11302 past the beginning of the current glyph matrix.
11303
11304 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11305
11306 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11307 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11308 HAVE_GTK3 (Bug#9869).
11309
11310 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11311 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11312
11313 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11314
11315 * xterm.c: Declare x_handle_net_wm_state to return int.
11316 (handle_one_xevent): Check if we are iconified but don't have
11317 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11318 (get_current_wm_state): Return non-zero if not hidden,
11319 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11320 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11321 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11322 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11323
11324 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11325
11326 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11327 so that this new function doesn't get optimized away by a
11328 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11329
11330 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11331
11332 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11333
11334 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11335
11336 Fix the `xbytecode' command.
11337 * .gdbinit (xprintbytestr): New command.
11338 (xwhichsymbols): Rename from `which'; all callers changed.
11339 (xbytecode): Print the byte-code string as well.
11340
11341 2011-10-29 Kim Storm <storm@cua.dk>
11342
11343 * alloc.c (which_symbols): New function.
11344
11345 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11346
11347 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11348 line. (Bug#9903)
11349
11350 2011-10-29 Glenn Morris <rgm@gnu.org>
11351
11352 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11353 Not clear what it was for, and it causes various bugs. (Bug#9839)
11354
11355 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11356
11357 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11358 possible random value that matches one of those tested as
11359 condition to clear the mouse face.
11360
11361 2011-10-28 Chong Yidong <cyd@gnu.org>
11362
11363 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11364
11365 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11366
11367 * window.c (make_window): Initialize phys_cursor_on_p.
11368
11369 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11370
11371 * lisp.h (struct Lisp_Symbol): Update comments.
11372
11373 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11374
11375 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11376
11377 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11378
11379 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11380 <oslsachem@gmail.com> for helping to debug this.
11381
11382 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11383 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11384 (g_b_init_get_glyph_outline_w): New static variables.
11385 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11386 (GetGlyphOutlineW_Proc): New typedefs.
11387 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11388 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11389 New functions.
11390 (w32font_open_internal, compute_metrics):
11391 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11392 instead of calling the "wide" APIs directly.
11393
11394 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11395
11396 * w32.h (syms_of_w32font): Add prototype.
11397
11398 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11399
11400 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11401 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11402 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11403 (Fmove_to_window_line): Doc fix.
11404
11405 2011-10-27 Chong Yidong <cyd@gnu.org>
11406
11407 * process.c (make_process): Set gnutls_state to NULL.
11408
11409 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11410 non-NULL, regardless of GNUTLS_INITSTAGE.
11411 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11412 an error. Set process slots as soon as we allocate them.
11413
11414 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11415
11416 2011-10-27 Chong Yidong <cyd@gnu.org>
11417
11418 * gnutls.c (emacs_gnutls_deinit): New function.
11419 Deallocate credentials structures as well as calling gnutls_deinit.
11420 (Fgnutls_deinit, Fgnutls_boot): Use it.
11421
11422 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11423 (deactivate_process): Call emacs_gnutls_deinit.
11424
11425 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11426
11427 * image.c (x_create_x_image_and_pixmap):
11428 * w32.c (sys_rename, w32_delayed_load):
11429 * w32font.c (fill_in_logfont):
11430 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11431
11432 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11433
11434 * w32fns.c (w32_default_color_map): New function,
11435 extracted from Fw32_default_color_map.
11436 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11437
11438 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11439
11440 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11441
11442 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11443
11444 * keyboard.c (test_undefined): New function (bug#9751).
11445 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11446
11447 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11448
11449 * sysdep.c (init_sys_modes): Fix the check for the controlling
11450 terminal (Bug#6649).
11451
11452 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11453
11454 * dispextern.h (struct bidi_it): New member next_en_type.
11455
11456 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11457 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11458 current character, check also for next_en_type being WEAK_EN.
11459 (bidi_resolve_weak): Don't enter the expensive loop if the current
11460 position is before next_en_pos. Record the bidi type of the first
11461 non-ET, non-BN character we find, in addition to its position.
11462 (bidi_level_of_next_char): Invalidate next_en_type when
11463 next_en_pos is over-stepped.
11464
11465 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11466
11467 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11468 * editfns.c: Rewrite current-time-zone so that it invokes
11469 the equivalent of (format-time-string "%Z") to get the time zone name.
11470 This fixes a bug when the time zone name contains characters that
11471 need converting from the system time locale to Emacs internal format.
11472 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11473 that patch fixed format-time-string to do the conversion, but
11474 I forgot to fix current-time-zone.
11475 (format_time_string): New function, containing most of
11476 what Fformat_time_string used to contain.
11477 (Fformat_time_string): Rewrite in terms of format_time_string.
11478 This doesn't change this function's behavior.
11479 (current-time-zone): Rewrite to use format_time_string.
11480 This fixes the bug reported by Michael Schierl in
11481 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11482 Jason Rumney's 2007-06-07 change worked around this bug, but
11483 didn't fix it.
11484 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11485
11486 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11487
11488 * xdisp.c (start_display): If the character at POS is displayed
11489 via a display vector, reset IT->current.dpvec_index to zero.
11490 (try_window_reusing_current_matrix): If a line ends in a display
11491 vector or the next line starts in a display vector, continue
11492 redrawing the window even though the character position of
11493 start_row was reached.
11494 (Bug#9771, part 2)
11495
11496 2011-10-18 Chong Yidong <cyd@gnu.org>
11497
11498 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11499 with nobreak-char-display too.
11500
11501 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11502
11503 Fix part 3 of bug#9771.
11504 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11505 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11506 non-neutral characters if the current character is a paragraph
11507 separator (a.k.a. Newline). This avoids running the same
11508 expensive loop twice, once when we consume the preceding newline
11509 and the other time when the line actually needs to be displayed.
11510 Avoid the loop when we see neutrals on the base embedding level
11511 following a character whose directionality is the same as the
11512 paragraph's. This avoids running the expensive loop when a line
11513 ends in a long sequence of neutrals, like control characters.
11514 Add assertion against STRONG_AL type. Slightly rearrange code
11515 that determines the type of a neutral given the first non-neutral
11516 that follows it.
11517 (bidi_level_of_next_char): Set next_en_pos to zero when
11518 invalidating its info.
11519
11520 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11521
11522 * xdisp.c (push_display_prop): Determine whether to record string
11523 or buffer position by IT->string, not by IT->method. Allow
11524 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11525 (move_it_vertically_backward): Don't look for character position
11526 immediately after the newline when in a continuation line.
11527 (Bug#9771, part 1)
11528
11529 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11530
11531 * window.c (coordinates_in_window): Rewrite and delabelize
11532 vertical border check. (Bug#5357) (Bug#9618)
11533
11534 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11535
11536 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11537 errors in XSetWindowBorder (bug#9310).
11538
11539 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11540
11541 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11542 avoid crash when xmalloc overrun checking is enabled.
11543
11544 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11545
11546 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11547 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11548 cursor motion with <left> and <right> arrow keys.
11549
11550 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11551 some callers set that themselves.
11552
11553 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11554
11555 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11556 display string and the previous row comes from the same string and
11557 is empty. (Bug#9739) (Bug#9738)
11558
11559 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11560
11561 * doc.c (get_doc_string): Encode file name (bug#9735).
11562
11563 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11564
11565 * bidi.c (bidi_level_of_next_char):
11566 * xdisp.c (get_visually_first_element): Remove old incorrect
11567 comments regarding the Unicode Line Separator character.
11568
11569 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11570
11571 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11572
11573 * alloc.c (Fgc_status): Do not access beyond zombies array
11574 boundary if nzombies > MAX_ZOMBIES.
11575 * alloc.c (dump_zombies): Add missing format specifier.
11576
11577 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11578
11579 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11580 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11581
11582 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11583 Some packages use them to denote characters with modifiers.
11584
11585 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11586
11587 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11588 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11589 matching a pp-number. Rename parameter var to var1.
11590
11591 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11592
11593 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11594
11595 2011-10-08 Glenn Morris <rgm@gnu.org>
11596
11597 * callint.c (Fcall_interactively): Give a more explicit error for the
11598 'c' case with a non-character input. (Bug#8479)
11599
11600 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11601
11602 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11603 lines.
11604 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11605 lines that are hscrolled on the left.
11606
11607 * dispnew.c (buffer_posn_from_coords): Account for a possible
11608 presence of header-line. (Bug#4426)
11609
11610 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11611
11612 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11613 Don't advertise functionality which we discourage or doesn't work.
11614
11615 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11616
11617 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11618 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11619 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11620 this makes Emacs dump core during garbage collection on rare
11621 occasions. sizeof is obviously inferior to offsetof here, so
11622 stick with offsetof.
11623 (GC_POINTER_ALIGNMENT): New macro.
11624 (mark_memory): Omit 3rd (offset) arg; caller changed.
11625 Don't assume EMACS_INT alignment is the same as pointer alignment.
11626
11627 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11628
11629 * keyboard.c (read_key_sequence_remapped): New var.
11630 (read_key_sequence): Compute remapping in the right buffer.
11631 (command_loop_1): Use read_key_sequence's remapping directly.
11632
11633 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11634
11635 * dired.c (file_name_completion): Don't expand file name.
11636 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11637 before checking file name handler.
11638
11639 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11640 they've been requested explicitly (bug#9591).
11641
11642 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11643
11644 * keymap.c (Fsingle_key_description): Use make_specified_string
11645 instead of build_string to build string from push_key_description.
11646 (Bug#5193)
11647
11648 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11649
11650 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11651 This fixes a Y2038 bug on 64-bit hosts.
11652 * buffer.c (reset_buffer):
11653 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11654 (Fclear_buffer_auto_save_failure):
11655 Use 0, not -1, to represent an unset failure time, since time_t
11656 might not be signed.
11657
11658 Remove dependency on glibc malloc internals.
11659 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11660 Move back here from lisp.h, but with their new implementations.
11661 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11662 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11663 * charset.c (charset_table_init): New static var.
11664 (syms_of_charset): Use it instead of xmalloc. This removes a
11665 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11666 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11667 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11668 Move back to alloc.c.
11669 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11670 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11671
11672 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11673
11674 * nsterm.m (windowDidResize): Call x_set_window_size only when
11675 ns_in_resize is true. Otherwise set pixelwidth/height and
11676 call change_frame_size (Bug#9628).
11677
11678 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11679
11680 Port --enable-checking=all to Fedora 14 x86-64.
11681 * charset.c (syms_of_charset): Also account for glibc malloc's
11682 internal overhead when calculating the initial malloc maximum.
11683
11684 Port --enable-checking=all to Fedora 14 x86.
11685 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11686 Move to lisp.h.
11687 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11688 (overrun_check_realloc, overrun_check_free):
11689 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11690 That way, xmalloc returns a properly-aligned pointer even if
11691 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11692 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11693 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11694 into account when calculating the initial malloc maximum.
11695 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11696 Move here from alloc.c, so that charset.c can use it too.
11697 Properly align; the old code wasn't right for common 32-bit hosts
11698 when configured with --enable-checking=all.
11699 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11700 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11701
11702 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11703
11704 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11705 use EDOM.
11706
11707 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11708
11709 * xdisp.c (compute_display_string_end): If there's no display
11710 string at CHARPOS, return -1.
11711
11712 * bidi.c (bidi_fetch_char): When compute_display_string_end
11713 returns a negative value, treat the character as a normal
11714 character not covered by a display string. (Bug#9624)
11715
11716 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11717
11718 * lread.c (Fread_from_string): Fix typo in docstring.
11719
11720 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11721
11722 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11723 newline, reseat the iterator instead of bidi-iterating there one
11724 character at a time. (Bug#9610)
11725 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11726 TO_CHARPOS if the bidi iterator is at base embedding level.
11727
11728 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11729
11730 * lread.c (readevalloop): Use correct code for NBSP.
11731 (read1): Likewise. (Bug#9608)
11732
11733 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11734
11735 * dbusbind.c (Fdbus_register_signal): When service is not
11736 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11737
11738 2011-09-25 Glenn Morris <rgm@gnu.org>
11739
11740 * buffer.c (truncate-lines): Doc fix.
11741
11742 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11743
11744 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11745 (Fset_window_next_buffers): Doc fix.
11746
11747 2011-09-24 Glenn Morris <rgm@gnu.org>
11748
11749 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11750
11751 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11752
11753 Fix minor problems found by static checking.
11754 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11755 * indent.c (Fvertical_motion): Fix == vs = typo.
11756
11757 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11758
11759 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11760 Default value is now t. Doc fix.
11761
11762 * indent.c (Fvertical_motion): Compute and apply the overshoot
11763 logic when moving up, not only when moving down. Fix the
11764 confusing name and values of the it_overshoot_expected variable;
11765 logic changes accordingly. (Bug#9254) (Bug#9549)
11766
11767 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11768 CHARPOS is covered by a display string which includes newlines.
11769 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11770 is covered by a display string with embedded newlines.
11771
11772 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11773
11774 * dbusbind.c (Fdbus_register_signal): Add match rule to
11775 Vdbus_registered_objects_table. (Bug#9581)
11776 (Fdbus_register_method, Vdbus_registered_objects_table):
11777 Fix docstring.
11778
11779 2011-09-24 Jim Meyering <meyering@redhat.com>
11780
11781 do not ignore write error for any output size
11782 The previous change was incomplete.
11783 While it makes emacs --batch detect the vast majority of stdout
11784 write failures, errors were still ignored whenever the output size is
11785 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11786 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11787 && echo FAIL: ignored write error
11788 FAIL: ignored write error
11789 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11790 && echo FAIL: ignored write error
11791 FAIL: ignored write error
11792 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11793
11794 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11795
11796 * emacs.c (Fkill_emacs): In noninteractive mode exit
11797 non-successfully if a write error occurred on stdout. (Bug#9574)
11798
11799 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11800
11801 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11802 the xassert test.
11803
11804 * dispextern.h (struct it): Update the comment documenting what
11805 can it->OBJECT be.
11806
11807 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11808
11809 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11810 a display string, extend search for cursor position to end of row.
11811 (find_row_edges): If the row ends in a newline from a display
11812 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11813 Handle the case of a display string with multiple newlines.
11814 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11815 non-empty line. Fixes confusing cursor motion with arrow keys at
11816 the beginning of a line that starts with whitespace.
11817
11818 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11819
11820 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11821 (bug#9493).
11822
11823 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11824
11825 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11826 boolean (Bug#9154).
11827
11828 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11829
11830 * xdisp.c (display_line): Record maximum and minimum buffer
11831 positions even if no glyphs were produced (e.g., by a zero-width
11832 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11833 buffer positions that will be removed from the glyph row because
11834 they don't fit.
11835 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11836 column is beyond frame width: don't subtract 1 "pixel" when
11837 computing width of the stretch.
11838 (reseat_at_next_visible_line_start): Undo the change made on
11839 2011-09-17 that saved paragraph information and restored it after
11840 the call to `reseat'. (Bug#9545)
11841
11842 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11843
11844 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11845 and turn window cursor on if cleared (Bug#9415).
11846
11847 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11848
11849 * search.c (boyer_moore): Take unibyte characters from pattern
11850 literally. (Bug#9458)
11851
11852 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11853
11854 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11855
11856 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11857
11858 Fix minor problem found by static checking.
11859 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11860 initialized, to pacify gcc -Wuninitialized.
11861
11862 * fileio.c: Report proper errno when syscall falls.
11863 (Finsert_file_contents): Save and restore errno,
11864 so that report_file_error outputs the correct diagnostic.
11865 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11866
11867 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11868
11869 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11870
11871 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11872
11873 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11874 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11875
11876 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11877
11878 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11879 about the current paragraph and restore it after the call to reseat.
11880
11881 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11882 (bidi_find_paragraph_start): Search back for paragraph beginning
11883 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11884 (bidi_move_to_visually_next): Only trigger paragraph-related
11885 computations when the last character is a newline or at EOB, not
11886 just any NEUTRAL_B. (Bug#9470)
11887
11888 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11889 truncated lines if point is covered by a display string. (Bug#9524)
11890
11891 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11892
11893 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11894 (cons_to_x_long): New function.
11895 (lisp_data_to_selection_data): Use it. Correct the test for
11896 short-versus-long data; it was negated. Break out of vector
11897 loop, for efficiency, when a long datum is discovered.
11898
11899 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11900
11901 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11902
11903 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11904
11905 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11906 GCC PR/17406) by declaring this function with external scope.
11907
11908 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11911 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11912
11913 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11914
11915 * editfns.c (Fformat): Correctly handle text properties on "%%".
11916
11917 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11918
11919 * xterm.c (x_draw_composite_glyph_string_foreground):
11920 * w32term.c (x_draw_composite_glyph_string_foreground):
11921 * term.c (encode_terminal_code):
11922 * composite.c (composition_update_it, get_composition_id):
11923 * xdisp.c (get_next_display_element)
11924 (fill_composite_glyph_string): Add comments about special meaning
11925 of TAB characters in a composition.
11926
11927 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11928
11929 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11930 This occurs when processing a multibyte format.
11931 Problem reported by Wolfgang Jenker.
11932
11933 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11934
11935 * xdisp.c (try_cursor_movement): Only check for exact match if
11936 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11937
11938 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11939
11940 Remove unused external symbols.
11941 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11942 * xdisp.c (calc_pixel_width_or_height): Now static.
11943 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11944 * indent.c (check_display_width):
11945 * w32term.c: Fix comment to match code.
11946 * xterm.c, xterm.h (x_catching_errors): Remove.
11947
11948 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11949
11950 * xselect.c: Use signed conversions more consistently (Bug#9498).
11951 (selection_data_to_lisp_data): Assume incoming selection data are
11952 signed integers, not unsigned. This is to be consistent with
11953 outgoing selection data, which was modified to use signed integers
11954 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11955 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11956 expects long, not unsigned long.
11957
11958 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11959
11960 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11961 computation of loop end. Reported by Johan Bockgård
11962 <bojohan@gnu.org>.
11963
11964 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11965
11966 * frame.c (Fother_visible_frames_p): Function deleted.
11967
11968 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11969
11970 * indent.c (compute_motion): Process display vector front to back
11971 rather than the other way around. (Bug#2496)
11972
11973 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11974
11975 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11976
11977 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11978
11979 * minibuf.c (Fread_from_minibuffer): Doc fix.
11980
11981 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11982
11983 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11984 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11985
11986 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11987
11988 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11989 value for non-existent files.
11990
11991 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11992
11993 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11994 set its "size" to -1. This will set the modtime_size field of
11995 the corresponding buffer to -1, which is what
11996 verify-visited-file-modtime expects for files that do not exist.
11997 (Bug#9139)
11998
11999 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12000
12001 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12002 here ...
12003 * lisp.h: ... from here. push_key_description is no longer
12004 defined in keyboard.c, so its declaration should not be in
12005 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12006 logically belongs with push_key_description.
12007
12008 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12009
12010 * buffer.h: Include <sys/types.h> instead of <time.h>.
12011 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12012 Problem reported by Herbert J. Skuhra.
12013
12014 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12015
12016 * xml.c (parse_region): Make the parsing work for
12017 non-comment-starting XML files again (bug#9144).
12018
12019 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12020
12021 * image.c (gif_load): Fix calculation of bottom and right corner.
12022 (Bug#9468)
12023
12024 2011-09-10 Eli Zaretskii <eliz@gnu.org>
12025
12026 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12027 redisplay in small windows.
12028
12029 2011-09-09 Eli Zaretskii <eliz@gnu.org>
12030
12031 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12032
12033 2011-09-08 Martin Rudalics <rudalics@gmx.at>
12034
12035 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12036 Operate on live windows only.
12037
12038 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
12039
12040 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12041
12042 2011-09-07 Eli Zaretskii <eliz@gnu.org>
12043
12044 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12045 only under bidi iteration.
12046
12047 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12048
12049 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12050
12051 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12052
12053 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12054 Without this fix, the command to link temacs failed due to an
12055 undefined symbol __builtin_isnan. This is because
12056 /usr/include/iso/math_c99.h #defines isnan(x) to
12057 __builtin_isnan(x), but the bundled gcc, which identifies itself
12058 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12059 a __builtin_isnan.
12060 * floatfns.c (isnan): #undef, and then #define to a clone of
12061 what's in data.c.
12062 (Fisnan): Always define, since it's always available now.
12063 (syms_of_floatfns): Always define isnan at the Lisp level.
12064
12065 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12066
12067 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12068
12069 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12070
12071 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12072 The previous code assumed that file offsets (off_t values) fit in
12073 EMACS_INT variables, which is not true on typical 32-bit hosts.
12074 The code messed up by falsely reporting buffer overflow in cases
12075 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12076 when "big" contains more than 2**29 bytes, even though this
12077 inserts just one byte and does not overflow the buffer.
12078 (Finsert_file_contents): Store file offsets as off_t
12079 values, not as EMACS_INT values. Check for overflow when
12080 converting between EMACS_INT and off_t. When checking for
12081 buffer overflow or for overlap, take the offsets into account.
12082 Don't use EMACS_INT for small values where int suffices.
12083 When checking for overlap, fix a typo: ZV was used where
12084 ZV_BYTE was intended.
12085 (Fwrite_region): Don't assume off_t fits into 'long'.
12086 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12087
12088 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12089
12090 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12091
12092 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12093
12094 sprintf-related integer and memory overflow issues (Bug#9412).
12095
12096 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12097 (esprintf, exprintf, evxprintf): New functions.
12098 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12099 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12100 (modify_event_symbol): Do not assume that the length of
12101 name_alist_or_stem is safe to alloca and fits in int.
12102 (Fexecute_extended_command): Likewise for function name and binding.
12103 (Frecursion_depth): Wrap around reliably on integer overflow.
12104 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12105 since some callers pass EMACS_INT values.
12106 (Fsingle_key_description): Don't crash if symbol name contains more
12107 than MAX_ALLOCA bytes.
12108 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12109 (get_minibuffer): Arg is now EMACS_INT, not int.
12110 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12111 (esprintf, exprintf, evxprintf): New decls.
12112 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12113
12114 * dbusbind.c (signature_cat): New function.
12115 (xd_signature, Fdbus_register_signal):
12116 Do not overrun buffer; instead, report string overflow.
12117
12118 * dispnew.c (add_window_display_history): Don't overrun buffer.
12119 Truncate instead; this is OK since it's just a log.
12120
12121 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12122 even if the time zone offset is outlandishly large.
12123 Don't mishandle offset == INT_MIN.
12124
12125 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12126 when creating daemon; the previous buffer-overflow check was incorrect.
12127
12128 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12129 which has the guts of the old verror function.
12130
12131 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12132 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12133
12134 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12135 (font_unparse_xlfd): Don't blindly alloca long strings.
12136 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12137 fits in int, when using sprintf. Use single snprintf to count
12138 length of string rather than counting it via multiple sprintfs;
12139 that's simpler and more reliable.
12140 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12141 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12142 sprintf, in case result does not fit in int.
12143
12144 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12145 (fontset_from_font): Print it.
12146
12147 * frame.c (tty_frame_count): Now printmax_t, not int.
12148 (make_terminal_frame, set_term_frame_name): Print it.
12149 (x_report_frame_params): In X, window IDs are unsigned long,
12150 not signed long, so print them as unsigned.
12151 (validate_x_resource_name): Check for implausibly long names,
12152 and don't assume name length fits in 'int'.
12153 (x_get_resource_string): Don't blindly alloca invocation name;
12154 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12155 not fit in int.
12156
12157 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12158 (xg_check_special_colors, xg_set_geometry):
12159 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12160
12161 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12162 Use esprintf, not sprintf, in case result does not fit in int.
12163
12164 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12165 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12166 it as a large positive number.
12167 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12168 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12169
12170 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12171 in case result does not fit in int.
12172
12173 * print.c (float_to_string): Detect width overflow more reliably.
12174 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12175 buffer overrun. Don't assume list length fits in 'int'. Treat
12176 print length of 0 as 0, not as infinity; to be consistent with other
12177 uses of print length in this function. Don't overflow print length
12178 index. Don't assume hash table size fits in 'long', or that
12179 vectorlike size fits in 'unsigned long'.
12180
12181 * process.c (make_process): Use printmax_t, not int, to format
12182 process-name gensyms.
12183
12184 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12185
12186 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12187 to avoid potential buffer overrun.
12188
12189 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12190 if X resource line is longer than 512 bytes.
12191
12192 * xfns.c (x_window): Make sprintf buffer a bit bigger
12193 to avoid potential buffer overrun.
12194
12195 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12196
12197 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12198
12199 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12200
12201 Integer overflow fixes for scrolling, etc.
12202 Without these, Emacs silently mishandles large integers sometimes.
12203 For example, "C-u 4294967297 M-x recenter" was treated as if
12204 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12205
12206 * xdisp.c (try_window_id): Check Emacs fixnum range before
12207 converting to 'int'.
12208
12209 * window.c (window_scroll_line_based, Frecenter):
12210 Check that an Emacs fixnum is in range before assigning it to 'int'.
12211 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12212 values converted from Emacs fixnums.
12213 (Frecenter): Don't wrap around a line count if it is out of 'int'
12214 range; instead, treat it as an extreme value.
12215 (Fset_window_configuration, compare_window_configurations):
12216 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12217
12218 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12219 that can exceed INT_MAX. Check that EMACS_INT value is in range
12220 before assigning it to the (possibly-narrower) index.
12221 (match_limit): Don't assume that a fixnum can fit in 'int'.
12222
12223 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12224 exceed INT_MAX.
12225
12226 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12227 (Fvertical_motion): Don't wrap around LINES values that don't fit
12228 in 'int'. Instead, treat them as extreme values. This is good
12229 enough for windows, which can't have more than INT_MAX lines anyway.
12230
12231 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12232
12233 * Require libxml/parser.h to avoid compilation warning.
12234
12235 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12236
12237 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12238 since this reportedly can destroy thread storage.
12239
12240 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12241
12242 * syntax.c (find_defun_start): Update all cache variables if
12243 exiting early (Bug#9401).
12244
12245 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12246
12247 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12248
12249 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12250 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12251 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12252
12253 * term.c (tty_append_glyph): New function.
12254 (produce_stretch_glyph): Static function and its prototype deleted.
12255
12256 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12257 Add prototypes.
12258
12259 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12260
12261 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12262 when checking :margin (Bug#9390).
12263 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12264 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12265 so that the name doesn't mislead. All uses changed.
12266
12267 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12268
12269 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12270 set_tty_hooks.
12271
12272 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12273
12274 * xdisp.c (move_it_to): Don't bail out early when reaching
12275 position beyond to_charpos, if we are scanning backwards.
12276 (move_it_vertically_backward): When DY == 0, make sure we get to
12277 the first character in the line after the newline.
12278
12279 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12280
12281 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12282 (ccl_driver): Do not generate an out-of-range pointer.
12283 (Fccl_execute_on_string): Remove unnecessary check for
12284 integer overflow, noted by Stefan Monnier in
12285 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12286 Remove a FIXME that didn't need fixing.
12287 Simplify the newly-introduced buffer reallocation code.
12288
12289 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12290
12291 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12292
12293 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12294
12295 Integer and memory overflow issues (Bug#9196).
12296
12297 * doc.c (get_doc_string): Rework so that
12298 get_doc_string_buffer_size is the actual buffer size, rather than
12299 being 1 less than the actual buffer size; this makes xpalloc more
12300 convenient.
12301
12302 * image.c (x_allocate_bitmap_record, cache_image):
12303 * xselect.c (Fx_register_dnd_atom):
12304 Simplify previous changes by using xpalloc.
12305
12306 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12307 since either will do and ptrdiff_t is convenient with xpalloc.
12308
12309 * charset.c (charset_table_size)
12310 (struct charset_sort_data.priority): Now ptrdiff_t.
12311 (charset_compare): Don't overflow if priorities differ greatly.
12312 (Fsort_charsets): Don't assume list length fits in int.
12313 Check for size-calculation overflow when allocating sort data.
12314 (syms_of_charset): Allocate an initial charset table that is
12315 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12316
12317 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12318
12319 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12320 The actual value is always <= INT_MAX, and leaving it unsigned made
12321 overflow checking harder.
12322
12323 * dispextern.h (struct glyph_matrix.rows_allocated)
12324 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12325 with xpalloc. The values are still always <= INT_MAX.
12326
12327 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12328
12329 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12330 (SAFE_NALLOCA): New macro.
12331
12332 * region-cache.c (struct boundary.pos, find_cache_boundary)
12333 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12334 (set_cache_region, invalidate_region_cache)
12335 (revalidate_region_cache, know_region_cache, region_cache_forward)
12336 (region_cache_backward, pp_cache):
12337 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12338 so that ptrdiff_t * can be passed to xpalloc.
12339 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12340 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12341 (pp_cache): Don't assume cache_len fits in int.
12342 * region-cache.h: Adjust extern decls to match.
12343
12344 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12345 EMACS_INT, since either will do, for xpalloc.
12346
12347 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12348 (xnmalloc, xnrealloc, xpalloc): New functions.
12349
12350 * bidi.c (bidi_shelve_header_size): New constant.
12351 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12352 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12353
12354 * bidi.c (bidi_cache_shrink):
12355 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12356 (overlay_strings):
12357 Don't update size of array until after memory allocation succeeds,
12358 because xmalloc/xrealloc may not return.
12359 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12360 now that we have proper integer overflow checking.
12361 (record_overlay_string, overlay_strings): Catch overflows when
12362 calculating size of overlay_str_buf.
12363
12364 * callproc.c (Fcall_process): Check for size overflow when
12365 calculating size of args2.
12366 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12367 Normally we prefer signed values, but sticking with ptrdiff_t would
12368 require adding more-complicated checks.
12369
12370 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12371 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12372 Redo buffer-overflow calculations to avoid integer overflow.
12373 Add a FIXME comment where memory seems to be over-allocated.
12374
12375 * character.c (Fstring): Check for size-calculation overflow.
12376
12377 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12378 unnecessary integer overflow. Check for size overflow.
12379 (encode_coding_object): Don't update size until xmalloc succeeds.
12380
12381 * composite.c (get_composition_id): Check for overflow in glyph
12382 length calculations.
12383
12384 Integer and memory overflow fixes for display code.
12385 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12386 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12387 (scrolling_window): Check for overflow in size calculations.
12388 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12389 Don't assume glyph table len fits in int.
12390 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12391 (row_table_size): Now ptrdiff_t, not int.
12392 (scrolling_window): Avoid overflow in size calculations.
12393 Don't update size until allocation succeeds.
12394 * fns.c (concat): Check for overflow in size calculations.
12395 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12396 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12397 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12398
12399 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12400 (get_doc_string): Check for size calculation overflow.
12401 Don't update size until allocation succeeds.
12402 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12403 EMACS_INT, where ptrdiff_t will do.
12404 (Fsubstitute_command_keys): Check for string overflow.
12405
12406 * editfns.c (set_time_zone_rule): Don't assume environment length
12407 fits in int.
12408 (message_length): Now ptrdiff_t, not int.
12409 (Fmessage_box): Don't update size until allocation succeeds.
12410 Don't assume message length fits in int.
12411 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12412
12413 * emacs.c (main): Do not reallocate argv, since there is a null at
12414 the end that can be overwritten, and this way there's no need to
12415 worry about size-calculation overflow.
12416 (sort_args): Check for size-calculation overflow.
12417
12418 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12419 alloc succeeds.
12420 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12421
12422 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12423 (x_set_scroll_bar_width, x_figure_window_size):
12424 Check for integer overflow.
12425 (x_set_alpha): Do not assume XINT fits in int.
12426
12427 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12428 This is for the members text_lines, text_cols, total_lines, total_cols,
12429 where the system imposes an 'int' limit.
12430
12431 * fringe.c (Fdefine_fringe_bitmap):
12432 Don't update size until alloc works.
12433
12434 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12435 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12436
12437 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12438 Check for size-calculation overflow.
12439 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12440 do, as we prefer signed integers.
12441 (id_to_widget.max_size, id_to_widget.used)
12442 (xg_store_widget_in_map, xg_remove_widget_from_map)
12443 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12444 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12445 Use and return ptrdiff_t, not int.
12446 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12447 * gtkutil.h: Change prototypes to match the above.
12448
12449 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12450 are duplicate now that they've been promoted to lisp.h.
12451 (x_allocate_bitmap_record, x_alloc_image_color)
12452 (make_image_cache, cache_image, xpm_load):
12453 Don't update size until alloc is done.
12454 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12455 (x_detect_edges):
12456 Check for size calculation overflow.
12457 (ct_colors_allocated_max): New constant.
12458 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12459 overflow.
12460
12461 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12462 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12463 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12464 Use ptrdiff_t, not int, to count maps.
12465 (read_char_minibuf_menu_prompt): Check for overflow in size
12466 calculations. Don't update size until allocation succeeds.
12467 Redo calculations to avoid overflow.
12468 * keyboard.h: Change prototypes to match the above.
12469
12470 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12471 to count maps.
12472 (current_minor_maps): Check for size calculation overflow.
12473 * keymap.h: Change prototypes to match the above.
12474
12475 * lread.c (read1, init_obarray): Don't update size until alloc done.
12476
12477 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12478 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12479
12480 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12481 Now ptrdiff_t, not int.
12482 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12483 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12484
12485 * process.c (Fnetwork_interface_list): Check for overflow
12486 in size calculation.
12487
12488 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12489
12490 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12491 overflow. Don't bother calling xmalloc when xrealloc will do.
12492
12493 * search.c (Freplace_match): Check for size calculation overflow.
12494 (Fset_match_data): Don't assume list lengths fit in 'int'.
12495
12496 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12497 for command line length. Do not attempt to address one before the
12498 beginning of an array, as that's not portable.
12499
12500 * term.c (max_frame_lines): Remove; unused.
12501 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12502 not int.
12503 (encode_terminal_code, calculate_costs): Check for size
12504 calculation overflow.
12505 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12506 table lengths and related sizes. Don't update size until alloc
12507 done. Redo calculations to avoid overflow.
12508 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12509
12510 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12511 subtracting pointers.
12512 (gobble_line): Check for overflow more carefully. Don't update size
12513 until alloc done.
12514
12515 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12516 Don't update size until alloc done.
12517 Redo size calculations to avoid overflow.
12518 Check for size calculation overflow.
12519 (main) [DEBUG]: Fix typo in invoking tparam1.
12520
12521 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12522 Use ptrdiff_t, not int, for sizes.
12523 (store_mode_line_noprop_char): Don't update size until alloc done.
12524
12525 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12526 Use ptrdiff_t, not int, for sizes.
12527 (Finternal_make_lisp_face, cache_face):
12528 Check for size calculation overflow.
12529 (cache_face): Treat size calculation overflows as if they were
12530 memory exhaustion (the usual treatment), rather than aborting.
12531
12532 * xfns.c (x_encode_text, x_set_name_internal)
12533 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12534 sizes, since they can exceed INT_MAX in size. Check for size
12535 calculation overflow.
12536
12537 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12538 (xg_select): Check for size calculation overflow.
12539 Don't update size until alloc done.
12540
12541 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12542 as sprintf is limited to int lengths.
12543
12544 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12545 (X_LONG_MIN): New macros.
12546 Use them to make the following changes clearer.
12547 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12548 This change doesn't affect the value now, but it may help remind
12549 future maintainers not to raise the value too much later.
12550 (SELECTION_QUANTUM): Remove, replacing with ...
12551 (selection_quantum): ... new function, which avoids overflow.
12552 All uses changed.
12553 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12554 assumption that selection length fits in 'int'.
12555 (x_reply_selection_request, x_handle_selection_request)
12556 (x_get_window_property, receive_incremental_selection)
12557 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12558 (lisp_data_to_selection_data, clean_local_selection_data):
12559 Use ptrdiff_t, not int, to record length of selection.
12560 (x_reply_selection_request, x_get_window_property)
12561 (receive_incremental_selection, x_property_data_to_lisp):
12562 Redo calculations to avoid overflow.
12563 (x_reply_selection_request): When sending hint, ceiling it at
12564 X_LONG_MAX rather than relying on wraparound overflow to send
12565 something.
12566 (x_get_window_property, receive_incremental_selection)
12567 (lisp_data_to_selection_data, x_property_data_to_lisp):
12568 Check for size-calculation overflow.
12569 (x_get_window_property, receive_incremental_selection)
12570 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12571 Don't store size until memory allocation succeeds.
12572 (x_get_window_property): Plug memory leak on memory exhaustion.
12573 Don't double-block input; malloc is safe here. Don't assume 2**34
12574 - 4 fits in unsigned long. Add an xassert to check
12575 XGetWindowProperty overflow. Be more careful about overflow
12576 calculations, and distinguish size from memory overflow better.
12577 (receive_incremental_selection): When tracing, don't assume
12578 unsigned int is less than INT_MAX.
12579 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12580 harmful) conversions of unsigned short to int.
12581 (lisp_data_to_selection_data): Don't assume that integers
12582 in the range -65535 through -1 fit in an X unsigned short.
12583 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12584 result parameters unless successful. Rely on cons_to_unsigned
12585 to report problems with elements; the old code wasn't right anyway.
12586 (x_check_property_data): Check for int overflow; we cannot use
12587 a wider type due to X limits.
12588 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12589
12590 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12591
12592 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12593 (x_term_init): Check for size calculation overflow.
12594 (x_color_cells): Don't store size until memory allocation succeeds.
12595 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12596 Don't assume alloca size is less than MAX_ALLOCA.
12597 (x_term_init): Don't assume length fits in int (sprintf is limited
12598 to int size).
12599
12600 Use ptrdiff_t for composition IDs.
12601 * character.c (lisp_string_width):
12602 * composite.c (composition_table_size, n_compositions)
12603 (get_composition_id, composition_gstring_from_id):
12604 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12605 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12606 * window.c (Frecenter):
12607 Use ptrdiff_t, not int, for composition IDs.
12608 * composite.c (get_composition_id): Check for integer overflow.
12609 * composite.h: Adjust prototypes to match the above changes.
12610
12611 Use ptrdiff_t for hash table indexes.
12612 * category.c (hash_get_category_set):
12613 * ccl.c (ccl_driver):
12614 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12615 * coding.c (coding_system_charset_list, detect_coding_system):
12616 * coding.h (struct coding_system.id):
12617 * composite.c (get_composition_id, gstring_lookup_cache):
12618 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12619 * image.c (xpm_get_color_table_h):
12620 * lisp.h (hash_lookup, hash_put):
12621 * minibuf.c (Ftest_completion):
12622 Use ptrdiff_t for hash table indexes, not int (which is too
12623 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12624 32-bit --with-wide-int hosts).
12625
12626 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12627 Add a FIXME comment about memory leaks.
12628 (syms_of_charset): Don't assume xmalloc returns.
12629
12630 Don't assume that stated character widths fit in int.
12631 * character.c (Fchar_width, c_string_width, lisp_string_width):
12632 * character.h (CHAR_WIDTH):
12633 * indent.c (MULTIBYTE_BYTES_WIDTH):
12634 Use sanitize_char_width to avoid undefined and/or bad behavior
12635 with outlandish widths.
12636 * character.h (sanitize_tab_width): Rename from sanitize_width,
12637 now that we have two such functions. All uses changed.
12638 (sanitize_char_width): New inline function.
12639
12640 Don't assume that tab-width fits in int.
12641 * character.h (sanitize_width): New inline function.
12642 (SANE_TAB_WIDTH): New macro.
12643 (ASCII_CHAR_WIDTH): Use it.
12644 * indent.c (sane_tab_width): Remove. All uses replaced by
12645 SANE_TAB_WIDTH (current_buffer).
12646 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12647
12648 * fileio.c: Integer overflow issues with file modes.
12649 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12650
12651 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12652 Remove unreachable code.
12653 (read_hex, load_charset_map_from_file): Check for integer overflow.
12654
12655 * xterm.c: Don't go over XClientMessageEvent limit.
12656 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12657 (x_send_scroll_bar_event): Likewise. Check that the size does not
12658 exceed limits imposed by XClientMessageEvent, as well as the usual
12659 ptrdiff_t and size_t limits.
12660
12661 * keyboard.c: Overflow, signedness and related fixes.
12662 (make_lispy_movement): Use same integer type in forward decl
12663 that is used in the definition.
12664 (read_key_sequence, keyremap_step):
12665 Change bufsize argument back to int, undoing my 2011-03-30 change.
12666 We prefer signed types, and int is wide enough here.
12667 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12668 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12669 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12670 length, not size_t. Use ptrdiff_t for index, not int.
12671 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12672 possibility of integer overflow.
12673
12674 Overflow, signedness and related fixes for images.
12675
12676 * dispextern.h (struct it.stack[0].u.image.image_id)
12677 (struct_it.image_id, struct image.id, struct image_cache.size)
12678 (struct image_cache.used, struct image_cache.ref_count):
12679 * gtkutil.c (update_frame_tool_bar):
12680 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12681 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12682 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12683 * nsmenu.m (update_frame_tool_bar):
12684 * xdisp.c (calc_pixel_width_or_height):
12685 * xfns.c (image_cache_refcount):
12686 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12687 on typical 64-bit hosts.
12688
12689 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12690 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12691 Omit unnecessary casts to int.
12692 (parse_image_spec): Check that integers fall into 'int' range
12693 when the callers expect that.
12694 (image_ascent): Redo ascent calculation to avoid int overflow.
12695 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12696 (lookup_image): Remove unnecessary tests.
12697 (xbm_image_p): Locals are now of int, not EMACS_INT,
12698 since parse_image_check makes sure they fit into int.
12699 (png_load, gif_load, svg_load_image):
12700 Prefer int to unsigned where either will do.
12701 (tiff_handler): New function, combining the cores of the
12702 old tiff_error_handler and tiff_warning_handler.
12703 This function is rewritten to use vsnprintf and thereby avoid
12704 stack buffer overflows. It uses only the features of vsnprintf
12705 that are common to both POSIX and native Microsoft.
12706 (tiff_error_handler, tiff_warning_handler): Use it.
12707 (tiff_load, gif_load, imagemagick_load_image):
12708 Don't assume :index value fits in 'int'.
12709 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12710 (imagemagick_load_image): Check that crop parameters fit into
12711 the integer types that MagickCropImage accepts. Don't assume
12712 Vimagemagick_render_type has a nonnegative value. Don't assume
12713 size_t fits in 'long'.
12714 (gs_load): Use printmax_t to print the widest integers possible.
12715 Check for integer overflow when computing image height and width.
12716
12717 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12718
12719 * xdisp.c (redisplay_window): Don't force window start if point
12720 will be invisible in the resulting window. (Bug#9324)
12721
12722 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12723
12724 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12725 the display spec is of the form `(space ...)'.
12726 (handle_display_spec): Return the value returned by
12727 handle_single_display_spec, not just 1 or zero.
12728 (handle_single_display_spec): If the display spec is of the form
12729 `(space ...)', and specifies display in the text area, return 2
12730 rather than 1.
12731 (try_cursor_movement): Check for the need to scroll more
12732 accurately, and prefer exact match for point under bidi.
12733 Don't advance `row' beyond the last row of the window.
12734
12735 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12736 into disp_prop; all users changed.
12737
12738 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12739 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12740 for the text covered by the display property.
12741
12742 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12743
12744 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12745 Change return value to nil.
12746 (Frecord_buffer): Delete unused function.
12747
12748 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12749
12750 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12751 buffers, return left-to-right.
12752 (set_cursor_from_row): Consider candidate row a win if its glyph
12753 represents a newline and point is on that newline. Fixes cursor
12754 positioning on the newline at EOL of R2L text within L2R
12755 paragraph, and vice versa.
12756 (try_cursor_movement): Check continued rows, in addition to
12757 continuation rows. Fixes unwarranted scroll when point enters a
12758 continued line of R2L text within an L2R paragraph, or vice versa.
12759 (cursor_row_p): Consider the case of point being equal to
12760 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12761 from the end of a short line to the beginning of a continued line
12762 of R2L text within L2R paragraph.
12763 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12764 composed characters.
12765
12766 * bidi.c (bidi_check_type): Use xassert.
12767 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12768 members.
12769
12770 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12771
12772 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12773 a character.
12774
12775 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12776
12777 * nsfont.m (ns_otf_to_script): Fix typo.
12778
12779 2011-08-22 Kenichi Handa <handa@m17n.org>
12780
12781 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12782 extra slot even if the purpose is char-code-property-table.
12783
12784 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12785
12786 * xdisp.c (redisplay_window): When computing centering_position,
12787 account for the height of the header line. (Bug#8874)
12788
12789 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12790 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12791 candidate is selected by the mouse, and that candidate has a
12792 composed character under the mouse.
12793
12794 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12795 coordinates reported by pos-visible-in-window-p for a composed
12796 character in column zero.
12797
12798 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12799
12800 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12801
12802 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12803
12804 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12805 consider it a hit if to_charpos is anywhere in the range of the
12806 composed buffer positions.
12807
12808 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12809
12810 * image.c (gif_load): Don't assume that each subimage has the same
12811 dimensions as the base image. Handle disposal method that is
12812 "undefined" by the gif spec (Bug#9335).
12813
12814 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12815
12816 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12817 (Fcondition_case): Document `debug' symbol in error handler.
12818
12819 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12820
12821 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12822 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12823 from an Org mode buffer to a Speedbar frame.
12824
12825 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12826 a composition, take its buffer position from IT->cmp_it.charpos.
12827 Fixes cursor positioning at the beginning of a line that begins
12828 with a composed character.
12829
12830 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12831
12832 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12833 character bidirectional type, use STRONG_L instead. Fixes crashes
12834 in a buffer produced by `describe-categories'.
12835
12836 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12837 members before the level stack, so they would be saved and
12838 restored when copying iterator state. Fixes incorrect reordering
12839 around TABs covered by display properties.
12840
12841 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12842
12843 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12844
12845 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12846
12847 * eval.c (internal_condition_case, internal_condition_case_1)
12848 (internal_condition_case_2, internal_condition_case_n):
12849 Remove unnecessary aborts (Bug#9081).
12850
12851 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12852
12853 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12854 has no `load' handler, try opening the file locally. (Bug#9311)
12855
12856 2011-08-16 Ken Brown <kbrown@cornell.edu>
12857
12858 * gmalloc.c: Expand comment.
12859
12860 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12861
12862 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12863 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12864
12865 2011-08-16 Ken Brown <kbrown@cornell.edu>
12866
12867 Fix memory allocation problems in Cygwin build (Bug#9273).
12868
12869 * unexcw.c ( __malloc_initialized): Declare external variable.
12870 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12871
12872 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12873 New variables.
12874 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12875 dumped emacs.
12876 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12877 in the static heap.
12878 [CYGWIN] (special_realloc): New function.
12879 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12880 requests to realloc storage in the static heap.
12881
12882 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12883
12884 * bidi.c (bidi_initialize): Remove unused local.
12885
12886 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12887
12888 * bidimirror.h:
12889 * biditype.h: Remove file.
12890 * makefile.w32-in ($(BLD)/bidi.$(O)):
12891 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12892
12893 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12894
12895 * chartab.c: Improve commentary for the uniprop_table API.
12896
12897 * bidi.c (bidi_paragraph_init): Support zero value of
12898 bidi_ignore_explicit_marks_for_paragraph_level.
12899 (bidi_initialize): Use uniprop_table instead of including
12900 biditype.h and bidimirror.h.
12901
12902 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12903 coordinates of the iterator when restoring from ppos_it.
12904 (Bug#9296)
12905
12906 2011-08-14 Kenichi Handa <handa@m17n.org>
12907
12908 * process.c (create_process): Call setup_process_coding_systems
12909 after the pid of the process is set to -1 (Bug#8162).
12910
12911 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12912
12913 * xdisp.c (move_it_in_display_line_to): Don't invoke
12914 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12915 ppos_it. Fixes vertical cursor motion when line beginning is
12916 covered by an image. (Bug#9296)
12917
12918 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12919
12920 * nsterm.h (ns_run_ascript): Declare.
12921 (NSAPP_DATA2_RUNASSCRIPT): Define.
12922
12923 * nsfns.m (as_script, as_result, as_status): New static variables.
12924 (ns_run_ascript): New function.
12925 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12926 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12927 the event loop. Get status from as_status (Bug#7276).
12928
12929 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12930 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12931 the event loop (Bug#7276).
12932
12933 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12934
12935 * gnutls.c (QCgnutls_bootprop_priority)
12936 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12937 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12938 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12939 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12940 (QCgnutls_bootprop_verify_hostname_error)
12941 (QCgnutls_bootprop_callbacks_verify): Rename from
12942 Qgnutls_bootprop_..., all uses changed.
12943
12944 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12945 uses changed.
12946
12947 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12948
12949 * xfaces.c (Qframe_set_background_mode): Now static.
12950 * dispextern.h (Qframe_set_background_mode): Remove decl.
12951
12952 * process.c (Fnetwork_interface_info): Declare local only if needed.
12953
12954 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12955
12956 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12957 (Fnetwork_interface_list): Allocate in increments of bytes instead
12958 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12959 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12960 sockaddr.
12961 (struct ifflag_def): notrailers is smart on OSX.
12962 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12963 Get hardware address with getifaddrs if available.
12964
12965 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12966
12967 * xdisp.c (iterate_out_of_display_property): xassert that
12968 IT->position is set to within IT->object's boundaries. Break from
12969 the loop as soon as EOB is reached; avoids infloops in redisplay
12970 when IT->position is set up wrongly due to some bug.
12971 Set IT->current to match the bidi iterator unconditionally.
12972 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12973 entry. Force push_it to save on the stack the current
12974 buffer/string position, to be restored by pop_it. Fix flags in
12975 the iterator structure wrt the object coming from a display
12976 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12977 properties. (Bug#9284)
12978
12979 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12980
12981 * fontset.c (fontset_get_font_group): Add proper type checks.
12982 (Bug#9172)
12983
12984 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12985
12986 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12987 and LC_VERSION_MIN_MACOSX.
12988 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12989 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12990
12991 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12992
12993 * xdisp.c (forward_to_next_line_start): Allow to use the
12994 no-display-properties-and-no-overlays under bidi display.
12995 Set disp_pos in the bidi iterator to avoid searches for display
12996 properties and overlays.
12997
12998 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12999
13000 * editfns.c (Fset_time_zone_rule): Document relationship with the
13001 setenv function.
13002
13003 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13004 the font entity extracted from the cache (Bug#8109).
13005
13006 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
13007
13008 * composite.c (autocmp_chars): Don't reset point. That is done by
13009 restore_point_unwind (Bug#5984).
13010
13011 2011-08-07 Juri Linkov <juri@jurta.org>
13012
13013 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13014 to show the arg `TIME' instead of `TIMEVAL'.
13015
13016 2011-08-06 Eli Zaretskii <eliz@gnu.org>
13017
13018 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13019 display property strides EOL and includes a newline, as in
13020 longlines-mode. (Bug#9254)
13021 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13022 word-wrap under bidirectional display. (Bug#9224)
13023
13024 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13025 is non-zero, even if the data buffer is NULL. Fixes a crash in
13026 vertical-motion with longlines-mode. (Bug#9254)
13027
13028 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13029
13030 * bidi.c <bidi_cache_total_alloc>: Now static.
13031 (bidi_initialize): Initialize bidi_cache_total_alloc.
13032
13033 * xdisp.c (display_line): Release buffer allocated for shelved bidi
13034 cache. (Bug#9221)
13035
13036 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13037 amount allocated this far in `bidi_cache_total_alloc'.
13038 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13039 non-zero, only free the data buffer without restoring the cache
13040 contents. All callers changed.
13041
13042 * dispextern.h (bidi_unshelve_cache): Update prototype.
13043
13044 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13045 (move_it_in_display_line, move_it_to)
13046 (move_it_vertically_backward, move_it_by_lines): Replace the call
13047 to xfree to an equivalent call to bidi_unshelve_cache.
13048 (move_it_in_display_line_to): Fix logic of returning
13049 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
13050
13051 2011-08-05 Eli Zaretskii <eliz@gnu.org>
13052
13053 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13054 came from a string character with a `cursor' property. (Bug#9229)
13055
13056 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13057
13058 * Makefile.in (LIB_PTHREAD): New variable.
13059 (LIBES): Add LIB_PTHREAD (Bug#9216).
13060
13061 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13062 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13063
13064 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13065
13066 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13067
13068 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13069
13070 * xterm.c (x_find_topmost_parent): New function.
13071 (x_set_frame_alpha): Find topmost parent window with
13072 x_find_topmost_parent and set the property there also (bug#9181).
13073 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13074
13075 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13076
13077 * callproc.c (Fcall_process): Avoid vfork clobbering
13078 the local vars buffer, coding_systems, current_dir.
13079
13080 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13081
13082 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13083
13084 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13085
13086 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13087 so that it is not optimized away.
13088
13089 * xdisp.c (compute_display_string_pos): Remove unused local.
13090
13091 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13092
13093 Fix slow cursor motion and scrolling in large buffers with
13094 selective display, like Org Mode buffers. (Bug#9218)
13095
13096 * dispextern.h (struct bidi_it): New member disp_prop_p.
13097
13098 * xdisp.c: Remove one-slot cache of display string positions.
13099 (compute_display_string_pos): Accept an additional argument
13100 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13101 for a display string or property. If found, set DISP_PROP_P
13102 non-zero.
13103
13104 * bidi.c (bidi_fetch_char): Accept an additional argument
13105 DISP_PROP_P, and pass it to compute_display_string_pos.
13106 Only handle text covered by a display string if DISP_PROP_P is returned
13107 non-zero. All callers of bidi_fetch_char changed.
13108
13109 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13110
13111 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13112
13113 2010-12-03 Don March <don@ohspite.net>
13114
13115 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13116 last character M-[char] is translated to ESC [char] (bug#7541).
13117
13118 2011-08-02 Kenichi Handa <handa@m17n.org>
13119
13120 * lisp.h (uniprop_table): Extern it.
13121
13122 * chartab.c (uniprop_table): Make it non-static.
13123
13124 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13125
13126 * xdisp.c (forward_to_next_line_start): Accept additional argument
13127 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13128 on the newline.
13129 (reseat_at_next_visible_line_start): Use the bidi iterator state
13130 returned by forward_to_next_line_start to restore the state of
13131 it->bidi_it after backing up to previous newline. (Bug#9212)
13132
13133 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13134
13135 * regex.c (re_comp): Protoize.
13136 (re_exec): Fix return type.
13137 (regexec): Fix type of `ret'. (Bug#9203)
13138
13139 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13140
13141 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13142 This is needed if max-image-size is a floating-point number.
13143
13144 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13145
13146 * print.c (print_object): Print empty symbol as ##.
13147
13148 * lread.c (read1): Read ## as empty symbol.
13149
13150 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13151
13152 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13153 setting frame foreground color (Bug#9175).
13154 (x_set_background_color): Likewise.
13155
13156 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13157 contents (Bug#9176).
13158 (EmacsTooltip -init): Remove bezels and add shadows to
13159 tooltip windows.
13160
13161 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13162 or scroll bar (Bug#8470).
13163
13164 * nsfont.m (nsfont_open): Remove assignment to voffset and
13165 unnecessary vars hshink, expand, hd, full_height, min_height.
13166 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13167
13168 * nsterm.h (nsfont_info): Remove voffset field.
13169
13170 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13171
13172 Implement strike-through and overline on NextStep (Bug#8863).
13173
13174 * nsfont.m (nsfont_open): Use underline position provided by font,
13175 instead of hard-coded value of 2.
13176 (nsfont_draw): Call ns_draw_text_decoration instead.
13177
13178 * nsterm.h: Add declaration for ns_draw_text_decoration.
13179
13180 * nsterm.m (ns_draw_text_decoration): New function for drawing
13181 underline, overline, and strike-through.
13182 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13183 ns_draw_text_decoration. Change treatment of cursor drawing to
13184 accommodate underlining, etc.
13185
13186 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13187
13188 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13189 default.
13190
13191 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13192
13193 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13194 Without this fix, if a signal arrives just after memory fills up,
13195 'malloc' might be invoked reentrantly.
13196
13197 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13198 In other words, assume that every image size is allowed, on non-X
13199 hosts. This assumption is probably wrong, but it lets Emacs compile.
13200
13201 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13202
13203 * regex.c (re_iswctype): Convert return values to boolean.
13204
13205 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13206
13207 * xdisp.c (compute_display_string_pos): Don't use cached display
13208 string position if the buffer had its restriction changed.
13209 (Bug#9184)
13210
13211 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13212
13213 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13214
13215 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13216
13217 Integer signedness and overflow and related fixes. (Bug#9079)
13218
13219 * bidi.c: Integer size and overflow fixes.
13220 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13221 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13222 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13223 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13224 (bidi_find_other_level_edge):
13225 Use ptrdiff_t instead of EMACS_INT where either will do.
13226 This works better on 32-bit hosts configured --with-wide-int.
13227 (bidi_cache_ensure_space): Check for size-calculation overflow.
13228 Use % rather than repeated addition, for better worst-case speed.
13229 Don't set bidi_cache_size until after xrealloc returns, because it
13230 might not return.
13231 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13232 (bidi_cache_ensure_space): Also check that the bidi cache size
13233 does not exceed that of the largest Lisp string or buffer. See Eli
13234 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13235
13236 * alloc.c (__malloc_size_t): Remove.
13237 All uses replaced by size_t. See Andreas Schwab's note
13238 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13239
13240 * image.c: Improve checking for integer overflow.
13241 (check_image_size): Assume that f is nonnull, since
13242 it is always nonnull in practice. This is one less thing to
13243 worry about when checking for integer overflow later.
13244 (x_check_image_size): New function, which checks for integer
13245 overflow issues inside X.
13246 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13247 This removes the need for a memory_full check.
13248 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13249 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13250 (xbm_read_bitmap_data): Change locals back to 'int', since
13251 their values must fit in 'int'.
13252 (xpm_load_image, png_load, tiff_load):
13253 Invoke x_create_x_image_and_pixmap earlier,
13254 to avoid much needless work if the image is too large.
13255 (tiff_load): Treat overly large images as if
13256 x_create_x_image_and_pixmap failed, not as malloc failures.
13257 (gs_load): Use x_check_image_size.
13258
13259 * gtkutil.c: Omit integer casts.
13260 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13261 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13262
13263 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13264
13265 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13266 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13267 would wrongly return t on a 64-bit host.
13268
13269 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13270 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13271 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13272 and therefore cause GCC to emit a bogus diagnostic in some cases.
13273
13274 * image.c: Integer signedness and overflow and related fixes.
13275 This is not an exhaustive set of fixes, but it's time to
13276 record what I've got.
13277 (lookup_pixel_color, check_image_size): Remove redundant decls.
13278 (check_image_size): Don't assume that arbitrary EMACS_INT values
13279 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13280 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13281 (tiff_load, imagemagick_load_image):
13282 Check for overflow in size calculations.
13283 (x_create_x_image_and_pixmap): Remove unnecessary test for
13284 xmalloc returning NULL; that can't happen.
13285 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13286 (xpm_color_bucket): Use better integer hashing function.
13287 (xpm_cache_color): Don't possibly over-allocate memory.
13288 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13289 (gif_memory_source):
13290 Use ptrdiff_t, not int or size_t, to record sizes.
13291 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13292 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13293 either works, as we prefer signed integers.
13294 (tiff_read_from_memory, tiff_write_from_memory):
13295 Return tsize_t, not size_t, since that's what the TIFF API wants.
13296 (tiff_read_from_memory): Don't fail simply because the read would
13297 go past EOF; instead, return a short read.
13298 (tiff_load): Omit no-longer-needed casts.
13299 (Fimagemagick_types): Don't assume size fits into 'int'.
13300
13301 Improve hashing quality when configured --with-wide-int.
13302 * fns.c (hash_string): New function, taken from sxhash_string.
13303 Do not discard information about ASCII character case; this
13304 discarding is no longer needed.
13305 (sxhash-string): Use it. Change sig to match it. Caller changed.
13306 * lisp.h: Declare it.
13307 * lread.c (hash_string): Remove, since we now use fns.c's version.
13308 The fns.c version returns a wider integer if --with-wide-int is
13309 specified, so this should help the quality of the hashing a bit.
13310
13311 * emacs.c: Integer overflow minor fix.
13312 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13313 Define only if GNU_LINUX.
13314 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13315
13316 * dispnew.c: Integer signedness and overflow fixes.
13317 Remove unnecessary forward decls, that were a maintenance hassle.
13318 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13319 All uses changed.
13320 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13321 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13322 (prepare_desired_row, line_draw_cost):
13323 Use int, not unsigned, where either works.
13324 (save_current_matrix, restore_current_matrix):
13325 Use ptrdiff_t, not size_t, where either works.
13326 (init_display): Check for overflow more accurately, and without
13327 relying on undefined behavior.
13328
13329 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13330 Remove, replacing with the new symbols in lisp.h. All uses changed.
13331 * fileio.c (make_temp_name):
13332 * filelock.c (lock_file_1, lock_file):
13333 * xdisp.c (message_dolog):
13334 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13335 Use pMd etc. instead.
13336 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13337 replacing the pWIDE etc. symbols removed from editfns.c.
13338
13339 * keyboard.h (num_input_events): Now uintmax_t.
13340 This is (very slightly) less likely to mess up due to wraparound.
13341 All uses changed.
13342
13343 * buffer.c: Integer signedness fixes.
13344 (alloc_buffer_text, enlarge_buffer_text):
13345 Use ptrdiff_t rather than size_t when either will do, as we prefer
13346 signed integers.
13347
13348 * alloc.c: Integer signedness and overflow fixes.
13349 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13350 (__malloc_size_t): Default to size_t, not to int.
13351 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13352 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13353 Prefer ptrdiff_t to size_t when either would do, as we prefer
13354 signed integers.
13355 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13356 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13357 Now const. Initialize with values that are in range even if char
13358 is signed.
13359 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13360 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13361 These functions do the right thing with sizes > 2**32.
13362 (check_depth): Now ptrdiff_t, not int.
13363 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13364 Adjust to new way of storing sizes. Check for size overflow bugs
13365 in rest of code.
13366 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13367 slightly wrong anyway, as it missed one instance of
13368 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13369 (refill_memory_reserve): Omit needless cast to size_t.
13370 (mark_object_loop_halt): Mark as externally visible.
13371
13372 * xselect.c: Integer signedness and overflow fixes.
13373 (Fx_register_dnd_atom, x_handle_dnd_message):
13374 Use ptrdiff_t, not size_t, since we prefer signed.
13375 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13376 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13377 x_dnd_atoms_size and x_dnd_atoms_length.
13378
13379 * doprnt.c: Prefer signed to unsigned when either works.
13380 * eval.c (verror):
13381 * doprnt.c (doprnt):
13382 * lisp.h (doprnt):
13383 * xdisp.c (vmessage):
13384 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13385 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13386 prefer signed arithmetic to avoid comparison confusion.
13387 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13388 but is a bit tricky.
13389
13390 Assume freestanding C89 headers, string.h, stdlib.h.
13391 * data.c, doprnt.c, floatfns.c, print.c:
13392 Include float.h unconditionally.
13393 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13394 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13395 * regex.c: Likewise for stddef.h, string.h.
13396 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13397 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13398 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13399 (STDC_HEADERS): Remove obsolete defines.
13400 * sysdep.c: Include limits.h unconditionally.
13401
13402 Assume support for memcmp, memcpy, memmove, memset.
13403 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13404 * regex.c (memcmp, memcpy):
13405 Remove; we assume C89 now.
13406
13407 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13408 (__malloc_safe_bcopy): Remove; no longer needed.
13409
13410 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13411 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13412 well either way, and we prefer signed to unsigned.
13413
13414 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13415
13416 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13417 closes the connection while we're reading (bug#9182).
13418
13419 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13420
13421 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13422 are specified (Bug#9168).
13423
13424 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13425
13426 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13427 Found by GCC static checking and --with-wide-int on a 32-bit host.
13428
13429 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13430
13431 * xdisp.c (compute_display_string_pos): Fix logic of caching
13432 previous display string position. Initialize cached_prev_pos to
13433 -1. Fixes slow-down at the beginning of a buffer.
13434
13435 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13436
13437 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13438 for attrs[LFACE_FONTSET_INDEX].
13439
13440 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13441
13442 * xml.c (parse_region): Remove unused local
13443 that was recently introduced.
13444
13445 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13446
13447 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13448 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13449
13450 * xdisp.c (move_it_in_display_line_to): Record the best matching
13451 position for TO_CHARPOS while scanning the line, and restore it on
13452 exit if none of the characters scanned was an exact match.
13453 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13454 when exact match is impossible due to invisible text, and the
13455 lines are truncated.
13456
13457 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13458
13459 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13460 for OSX >= 10.7.
13461
13462 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13463
13464 Fix a significant slow-down of cursor motion with C-n, C-p,
13465 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13466 auto-repeat under bidi redisplay in fontified buffers.
13467 * xdisp.c (compute_stop_pos_backwards): New function.
13468 (next_element_from_buffer): Call compute_stop_pos_backwards to
13469 find a suitable prev_stop when we find ourselves before
13470 base_level_stop.
13471 (reseat): Don't look for prev_stop, as that could mean a very long
13472 run.
13473 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13474 <cached_disp_overlay_modiff>: Cache for last found display string
13475 position.
13476 (compute_display_string_pos): Return the cached position if asked
13477 about the same buffer in the same area of character positions, and
13478 the buffer wasn't changed since the time the display string
13479 position was cached.
13480
13481 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13482
13483 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13484 is an integer, which is important for empty lines. (Bug#9149)
13485
13486 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13487
13488 * frame.c (Fmodify_frame_parameters): In tty case, update the
13489 default face if necessary (Bug#4238).
13490
13491 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13492
13493 * editfns.c (Fstring_to_char): No need to explain what a character
13494 is in the docstring (Bug#6576).
13495
13496 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13497
13498 * xml.c (parse_region): Make sure we always return a tree.
13499
13500 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13501
13502 * xml.c (parse_region): If a document contains only comments,
13503 return that, too.
13504
13505 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13506
13507 * xml.c (make_dom): Return comments, too.
13508
13509 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13510
13511 Port to OpenBSD.
13512 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13513 and the surrounding thread.
13514 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13515 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13516 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13517 timer goes off.
13518 * s/openbsd.h (BROKEN_SIGIO): Define.
13519 * unexelf.c (unexec) [__OpenBSD__]:
13520 Don't update the .mdebug section of the Alpha COFF symbol table.
13521
13522 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13523
13524 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13525 (bug#8460).
13526
13527 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13528
13529 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13530 This fixes some race conditions on the permissions of any newly
13531 created file.
13532
13533 * alloc.c (valid_pointer_p): Use pipe, not open.
13534 This fixes some permissions issues when debugging.
13535
13536 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13537 If fchown fails to set both uid and gid, try to set just gid,
13538 as that is sometimes allowed. Adjust the file's mode to eliminate
13539 setuid or setgid bits that are inappropriate if fchown fails.
13540
13541 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13542
13543 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13544 to compare Lisp_Objects.
13545 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13546 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13547 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13548
13549 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13550
13551 * lread.c (read_integer): Unread even EOF character.
13552 (read1): Likewise. Properly record start position of symbol.
13553
13554 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13555 symbol character follows.
13556
13557 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13558
13559 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13560 This works around a problem with the previous change to Fcopy_file.
13561 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13562 and without this change, GCC might complain about discarding
13563 fchown's return value.
13564
13565 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13566
13567 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13568
13569 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13570
13571 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13572
13573 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13574
13575 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13576 it's used from the C level.
13577
13578 * process.c: Use the same condition for POLL_FOR_INPUT in both
13579 keyboard.c and process.c (bug#1858).
13580
13581 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13582
13583 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13584 (Fgnutls_boot): Use it.
13585
13586 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13587
13588 * doc.c (Fsubstitute_command_keys): Revert last change.
13589
13590 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13591
13592 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13593 quotes the next character, and doesn't affect other longer
13594 sequences (bug#8935).
13595
13596 * lread.c (syms_of_lread): Clarify that is isn't only
13597 `eval-buffer' and `eval-defun' that's affected by
13598 `lexical-binding' (bug#8460).
13599
13600 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13601
13602 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13603 bidi redisplay when a line includes both an image and is truncated.
13604
13605 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13606
13607 Fix minor problems found by static checking.
13608 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13609 (elsz): Now a signed constant, not a size_t var. We prefer signed
13610 types to unsigned, to avoid integer comparison confusion. Without
13611 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13612 "cannot optimize loop, the loop counter may overflow", a symptom
13613 of the confusion.
13614 * indent.c (Fvertical_motion): Mark locals as initialized.
13615 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13616
13617 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13618
13619 * search.c (Fre_search_backward): Mention `case-fold-search' in
13620 all the re_search_* functions (bug#8138).
13621
13622 * keyboard.c (Fopen_dribble_file): Document when the file is
13623 closed (bug#8056).
13624
13625 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13626
13627 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13628 bidi_cache_idx.
13629
13630 Support bidi reordering of display and overlay strings.
13631 * xdisp.c (compute_display_string_pos)
13632 (compute_display_string_end): Accept additional argument STRING.
13633 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13634 (reseat_to_string): Initialize bidi_it->string.s and
13635 bidi_it->string.schars.
13636 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13637 NULL (avoids a crash in bidi_paragraph_init).
13638 Initialize itb.string.lstring.
13639 (init_iterator): Call bidi_init_it only of a valid
13640 buffer position was specified. Initialize paragraph_embedding to
13641 L2R.
13642 (reseat_to_string): Initialize the bidi iterator.
13643 (display_string): If we need to ignore text properties of
13644 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13645 original value of -1 will not work with bidi.)
13646 (compute_display_string_pos): First arg is now struct
13647 `text_pos *'; all callers changed. Support display properties on
13648 Lisp strings.
13649 (compute_display_string_end): Support display properties on Lisp
13650 strings.
13651 (init_iterator, reseat_1, reseat_to_string): Initialize the
13652 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13653 when iterating on a string not from display properties).
13654 (compute_display_string_pos, compute_display_string_end):
13655 Fix calculation of the object to scan. Fixes an error when using
13656 arrow keys.
13657 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13658 base_level_stop; instead, set base_level_stop to BEGV.
13659 Fixes crashes in vertical-motion.
13660 (next_element_from_buffer): Improve commentary for when
13661 the iterator is before prev_stop.
13662 (init_iterator): Initialize bidi_p from the default value of
13663 bidi-display-reordering, not from buffer-local value. Use the
13664 buffer-local value only if initializing for buffer iteration.
13665 (handle_invisible_prop): Support invisible properties on strings
13666 that are being bidi-reordered.
13667 (set_iterator_to_next): Support bidi reordering of C strings and
13668 Lisp strings.
13669 (next_element_from_string): Support bidi reordering of Lisp
13670 strings.
13671 (handle_stop_backwards): Support Lisp strings as well.
13672 (display_string): Support display of R2L glyph rows.
13673 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13674 (init_iterator): Don't initialize it->bidi_p for strings
13675 here.
13676 (reseat_to_string): Initialize it->bidi_p for strings here.
13677 (next_element_from_string, next_element_from_c_string)
13678 (next_element_from_buffer): Add xassert's for correspondence
13679 between IT's object being iterated and it->bidi_it.string
13680 structure.
13681 (face_before_or_after_it_pos): Support bidi iteration.
13682 (next_element_from_c_string): Handle the case of the first string
13683 character that is not the first one in the visual order.
13684 (get_visually_first_element): New function, refactored from common
13685 parts of next_element_from_buffer, next_element_from_string, and
13686 next_element_from_c_string.
13687 (tool_bar_lines_needed, redisplay_tool_bar)
13688 (display_menu_bar): Force left-to-right direction. Add a FIXME
13689 comment for making that be controlled by a user option.
13690 (push_it, pop_it): Save and restore the state of the
13691 bidi iterator. Save and restore the bidi_p flag.
13692 (pop_it): Iterate out of display property for string iteration as
13693 well.
13694 (iterate_out_of_display_property): Support iteration over strings.
13695 (handle_single_display_spec): Set up it->bidi_it for iteration
13696 over a display string, and call bidi_init_it.
13697 (handle_single_display_spec, next_overlay_string)
13698 (get_overlay_strings_1, push_display_prop): Set up the bidi
13699 iterator for displaying display or overlay strings.
13700 (forward_to_next_line_start): Don't use the shortcut if
13701 bidi-iterating.
13702 (back_to_previous_visible_line_start): If handle_display_prop
13703 pushed the iterator stack, restore the internal state of the bidi
13704 iterator by calling bidi_pop_it same number of times.
13705 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13706 and we are bidi-iterating, don't decrement the iterator position;
13707 instead, set the first_elt flag in the bidi iterator, to produce
13708 the same effect.
13709 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13710 (push_display_prop): xassert that we are iterating a buffer.
13711 (push_it, pop_it): Save and restore paragraph_embedding member.
13712 (handle_single_display_spec, next_overlay_string)
13713 (get_overlay_strings_1, reseat_1, reseat_to_string)
13714 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13715 correctly. Don't assume unibyte strings are not bidi-reordered.
13716 (compute_display_string_pos)
13717 (compute_display_string_end): Fix handling the case of C string.
13718 (push_it, pop_it): Save and restore from_disp_prop_p.
13719 (handle_single_display_spec, push_display_prop): Set the
13720 from_disp_prop_p flag.
13721 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13722 (pop_it): Call iterate_out_of_display_property only if we are
13723 popping after iteration over a string that came from a display
13724 property. Fix a typo in popping stretch info. Add an assertion
13725 for verifying that the iterator position is in sync with the bidi
13726 iterator.
13727 (handle_single_display_spec, get_overlay_strings_1)
13728 (push_display_prop): Fix initialization of paragraph direction for
13729 string when that of the parent object is not yet determined.
13730 (reseat_1): Call bidi_init_it to resync the bidi
13731 iterator with IT's position. (Bug#7616)
13732 (find_row_edges): If ROW->start.pos gives position
13733 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13734 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13735 Reset the from_disp_prop_p flag.
13736 (SAVE_IT, RESTORE_IT): New macros.
13737 (pos_visible_p, face_before_or_after_it_pos)
13738 (back_to_previous_visible_line_start)
13739 (move_it_in_display_line_to, move_it_in_display_line)
13740 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13741 (try_scrolling, redisplay_window, display_line): Use them when
13742 saving a temporary copy of the iterator and restoring it back.
13743 (back_to_previous_visible_line_start, reseat_1)
13744 (init_iterator): Empty the bidi cache "stack".
13745 (move_it_in_display_line_to): If iterator ended up at
13746 EOL, but we never saw any buffer positions smaller than
13747 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13748 motion in bidi-reordered lines.
13749 (move_it_in_display_line_to): Record prev_method and prev_pos
13750 immediately before the call to set_iterator_to_next. Fixes cursor
13751 motion in bidi-reordered lines with stretch glyphs and strings
13752 displayed in margins. (Bug#8133) (Bug#8867)
13753 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13754 TO_CHARPOS.
13755 (pos_visible_p): Support positions in bidi-reordered lines.
13756 Save and restore bidi cache.
13757
13758 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13759 (bidi_paragraph_info): Delete unused struct.
13760 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13761 (bidi_cache_start): New variable.
13762 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13763 to zero.
13764 (bidi_cache_fetch_state, bidi_cache_search)
13765 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13766 (bidi_cache_find, bidi_peek_at_next_level)
13767 (bidi_level_of_next_char, bidi_find_other_level_edge)
13768 (bidi_move_to_visually_next): Compare cache index with
13769 bidi_cache_start rather than with zero.
13770 (bidi_fetch_char): Accept new argument STRING; all callers
13771 changed. Support iteration over a string. Support strings with
13772 display properties. Support unibyte strings. Fix the type of
13773 `len' according to what STRING_CHAR_AND_LENGTH expects.
13774 (bidi_paragraph_init, bidi_resolve_explicit_1)
13775 (bidi_resolve_explicit, bidi_resolve_weak)
13776 (bidi_level_of_next_char, bidi_move_to_visually_next):
13777 Support iteration over a string.
13778 (bidi_set_sor_type, bidi_resolve_explicit_1)
13779 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13780 can now be zero (for strings); special values 0 and -1 were
13781 changed to -1 and -2, respectively.
13782 (bidi_char_at_pos): New function.
13783 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13784 Call it instead of FETCH_MULTIBYTE_CHAR.
13785 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13786 initialized to valid values.
13787 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13788 values.
13789 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13790 the test for valid cached positions. Fix the logic for looking up
13791 the sentinel state in the cache. GCPRO the Lisp string we are
13792 iterating.
13793 (bidi_push_it, bidi_pop_it): New functions.
13794 (bidi_initialize): Initialize the bidi cache start stack pointer.
13795 (bidi_cache_ensure_space): New function, refactored from part of
13796 bidi_cache_iterator_state. Don't assume the required size is just
13797 one BIDI_CACHE_CHUNK away.
13798 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13799 (bidi_count_bytes, bidi_char_at_pos): New functions.
13800 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13801 always valid if bidi_cache_idx is valid.
13802 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13803 is valid if it's going to be used.
13804 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13805 (bidi_cache_fetch_state, bidi_cache_search)
13806 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13807 (bidi_cache_iterator_state, bidi_cache_find)
13808 (bidi_find_other_level_edge, bidi_cache_start_stack):
13809 All variables related to cache indices are now EMACS_INT.
13810
13811 * dispextern.h (struct bidi_string_data): New structure.
13812 (struct bidi_it): New member `string'. Make flag members be 1-bit
13813 fields, and put them last in the struct.
13814 (compute_display_string_pos, compute_display_string_end):
13815 Update prototypes.
13816 (bidi_push_it, bidi_pop_it): Add prototypes.
13817 (struct iterator_stack_entry): New members bidi_p,
13818 paragraph_embedding, and from_disp_prop_p.
13819 (struct it): Member bidi_p is now a bit field 1 bit wide.
13820 (bidi_shelve_cache, bidi_unshelve_cache):
13821 Declare prototypes.
13822
13823 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13824 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13825 and vector-like objects.
13826
13827 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13828 cache around display iteration.
13829
13830 * window.c (Fwindow_end, window_scroll_pixel_based)
13831 (displayed_window_lines, Frecenter): Save and restore the bidi
13832 cache around display iteration.
13833
13834 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13835
13836 * editfns.c (Fdelete_region): Clarify the use of the named
13837 parameters (bug#6788).
13838
13839 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13840
13841 * indent.c (Fvertical_motion): Set and restore w->pointm when
13842 saving and restoring the window's buffer (Bug#9006).
13843
13844 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13845
13846 * editfns.c (Fstring_to_char): Clarify just what is returned
13847 (bug#6576). Text by Eli Zaretskii.
13848
13849 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13850
13851 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13852
13853 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13854
13855 * buffer.c (mmap_find): Fix a typo.
13856
13857 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13858
13859 Fix execution of x selection hooks.
13860 * xselect.c (Qx_lost_selection_functions)
13861 (Qx_sent_selection_functions): New vars.
13862 (syms_of_xselect): DEFSYM them.
13863 (x_handle_selection_request): Pass Qx_sent_selection_functions
13864 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13865 (x_handle_selection_clear,x_clear_frame_selections):
13866 Pass Qx_lost_selection_functions rather than
13867 Vx_lost_selection_functions to Frun_hook_with_args.
13868
13869 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13870
13871 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13872 The old code sometimes used this field without initializing it.
13873
13874 * alloc.c (gc_sweep): Don't read past end of array.
13875 In theory, the old code could also have corrupted Emacs internals,
13876 though it'd be very unlikely.
13877
13878 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13879
13880 * character.c (Fcharacterp): Don't advertise optional ignored
13881 argument. (Bug#4026)
13882
13883 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13884
13885 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13886 key" (bug#4257).
13887
13888 * window.c (Fset_window_start): Doc fix (bug#4199).
13889 (Fset_window_hscroll): Ditto.
13890
13891 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13892
13893 Fix minor new problems caught by GCC 4.6.1.
13894 * term.c (init_tty): Remove unused local.
13895 * xsettings.c (store_monospaced_changed): Define this function only
13896 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13897 not used otherwise.
13898
13899 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13900
13901 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13902
13903 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13904
13905 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13906 are the mini-buffer and the echo area (bug#3320).
13907
13908 * term.c (init_tty): Remove support for supdup, c10 and perq
13909 terminals, which are no longer supported (bug#1482).
13910
13911 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13912
13913 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13914
13915 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13916
13917 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13918 for non-popups (Bug#3642).
13919
13920 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13921
13922 * alloc.c (reset_malloc_hooks): Protoize.
13923 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13924 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13925 * cm.c (losecursor): Likewise.
13926 * data.c (fmod): Likewise.
13927 * dispnew.c (swap_glyphs_in_rows): Likewise.
13928 * emacs.c (memory_warning_signal): Likewise.
13929 * floatfns.c (float_error): Likewise.
13930 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13931 (otf_open, font_otf_capability, generate_otf_features)
13932 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13933 Likewise.
13934 * image.c (pbm_read_file): Likewise.
13935 * indent.c (string_display_width): Likewise.
13936 * intervals.c (check_for_interval, search_for_interval)
13937 (inc_interval_count, count_intervals, root_interval)
13938 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13939 * lread.c (defalias): Likewise.
13940 * ralloc.c (r_alloc_check): Likewise.
13941 * regex.c (set_image_of_range_1, set_image_of_range)
13942 (regex_grow_registers): Likewise.
13943 * sysdep.c (strerror): Likewise.
13944 * termcap.c (valid_filename_p, tprint, main): Likewise.
13945 * tparam.c (main): Likewise.
13946 * unexhp9k800.c (run_time_remap, save_data_space)
13947 (update_file_ptrs, read_header, write_header, calculate_checksum)
13948 (copy_file, copy_rest, display_header): Likewise.
13949 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13950 Likewise.
13951 * xdisp.c (check_it): Likewise.
13952 * xfaces.c (register_color, unregister_color, unregister_colors):
13953 Likewise.
13954 * xfns.c (print_fontset_result): Likewise.
13955 * xrdb.c (member, fatal, main): Likewise.
13956
13957 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13958
13959 Fix minor problems found by static checking (Bug#9031).
13960 * chartab.c (char_table_set_range, map_sub_char_table):
13961 Remove unused locals.
13962 (uniprop_table): Now static.
13963 * composite.c (_work_char): Remove unused static var.
13964
13965 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13966
13967 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13968
13969 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13970
13971 * gtkutil.c (qttip_cb): Remove code without function.
13972
13973 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13974
13975 * w32.c (pthread_sigmask): New stub.
13976
13977 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13978
13979 Use pthread_sigmask, not sigprocmask (Bug#9010).
13980 sigprocmask is portable only for single-threaded applications, and
13981 Emacs can be multi-threaded when it uses GTK.
13982 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13983 (LIBES): Use it.
13984 * callproc.c (Fcall_process):
13985 * process.c (create_process):
13986 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13987 Use pthread_sigmask, not sigprocmask.
13988
13989 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13990
13991 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13992 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13993 wrong (Bug#8591).
13994
13995 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13996
13997 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13998 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13999 (xg_hide_tooltip): Fix comment.
14000
14001 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14002 in registerServicesMenuSendTypes.
14003 (validRequestorForSendType): Don't check ns_return_types.
14004
14005 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14006 ns_return_type.
14007
14008 2011-07-08 Jason Rumney <jasonr@gnu.org>
14009
14010 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14011 SH_SHOW for hidden windows (Bug#5482).
14012
14013 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14014 frame struct members of non-existent frames (Bug#6284).
14015
14016 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14017
14018 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14019 variable firstTime not needed on OSX >= 10.6.
14020 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14021 >= 10.5. Use setKnobProportion, setDoubleValue.
14022
14023 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14024 (MAC_OS_X_VERSION_10_5): Define if not defined.
14025 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14026 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14027 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14028
14029 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
14030 cString and lossyCString on OSX >= 10.4.
14031
14032 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
14033 sizeToFit on OSX >= 10.2.
14034
14035 * nsimage.m (allocInitFromFile): Don't use deprecated method
14036 bestRepresentationForDevice on OSX >= 10.6.
14037
14038 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14039 to avoid warning.
14040
14041 * emacs.c: Declare unexec_init_emacs_zone.
14042
14043 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14044
14045 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14046
14047 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14048 on svcsMenu (Bug#8842).
14049
14050 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14051 ns_return_types.
14052 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14053
14054 * nsterm.m (QUTF8_STRING): Declare.
14055 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14056 (validRequestorForSendType): Return type is (id).
14057 Change indexOfObjectIdenticalTo to indexOfObject.
14058 Check if we have local selection before returning self (Bug#8842).
14059 (writeSelectionToPasteboard): Put local selection into paste board
14060 if we have a local selection (Bug#8842).
14061 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14062
14063 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14064 (ns_get_local_selection): Declare.
14065
14066 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14067
14068 * keymap.c (describe_map_tree): Don't insert a double newline at
14069 the end of the buffer (bug#1169) and return whether we inserted
14070 something.
14071
14072 * callint.c (Fcall_interactively): Change "reading args" to
14073 "providing args" to try to clarify what it does (bug#1010).
14074
14075 2011-07-07 Kenichi Handa <handa@m17n.org>
14076
14077 * composite.c (composition_compute_stop_pos): Ignore a static
14078 composition starting before CHARPOS (Bug#8915).
14079
14080 * xdisp.c (handle_composition_prop): Likewise.
14081
14082 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14083
14084 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14085 (Bug#9015)
14086
14087 2011-07-07 Kenichi Handa <handa@m17n.org>
14088
14089 * character.h (unicode_category_t): New enum type.
14090
14091 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14092 (Qchar_code_property_table): New variable.
14093 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14094 (UNIPROP_COMPRESSED_FORM_P): New macros.
14095 (char_table_ascii): Uncompress the compressed values.
14096 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14097 Uncompress the compressed values.
14098 (sub_char_table_ref_and_range): Likewise.
14099 (char_table_ref_and_range): Uncompress the compressed values.
14100 (sub_char_table_set): New arg is_uniprop. Callers changed.
14101 Uncompress the compressed values.
14102 (sub_char_table_set_range): Args changed. Callers changed.
14103 (char_table_set_range): Adjuted for the above change.
14104 (map_sub_char_table): Delete args default_val and parent. Add arg
14105 top. Give decoded values to a Lisp function.
14106 (map_char_table): Adjust for the above change. Give decoded
14107 values to a Lisp function. Gcpro more variables.
14108 (uniprop_table_uncompress)
14109 (uniprop_decode_value_run_length): New functions.
14110 (uniprop_decoder, uniprop_decoder_count): New variables.
14111 (uniprop_get_decoder, uniprop_encode_value_character)
14112 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14113 New functions.
14114 (uniprop_encoder, uniprop_encoder_count): New variables.
14115 (uniprop_get_encoder, uniprop_table)
14116 (Funicode_property_table_internal, Fget_unicode_property_internal)
14117 (Fput_unicode_property_internal): New functions.
14118 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14119 Sunicode_property_table_internal, Sget_unicode_property_internal,
14120 and Sput_unicode_property_internal. Defvar_lisp
14121 char-code-property-alist.
14122
14123 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14124 Vunicode_category_table.
14125
14126 * font.c (font_range): Adjust for the change of
14127 Vunicode_category_table.
14128
14129 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14130
14131 * m/iris4d.h: Remove file, move contents ...
14132 * s/irix6-5.h: ... here.
14133
14134 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14135
14136 Remove unportable assumption about struct layout (Bug#8884).
14137 * alloc.c (mark_buffer):
14138 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14139 (clone_per_buffer_values): Don't assume that
14140 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14141 This isn't true in general, and it's particularly not true
14142 if Emacs is configured with --with-wide-int.
14143 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14144 New macros, used in the buffer.c change.
14145
14146 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14147
14148 * xsettings.c: Use both GConf and GSettings if both are available.
14149 (store_config_changed_event): Add comment.
14150 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14151 (store_tool_bar_style_changed): New functions.
14152 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14153 (struct xsettings): Move font inside HAVE_XFT.
14154 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14155 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14156 Move inside HAVE_XFT.
14157 (something_changed_gsettingsCB): Rename from something_changedCB.
14158 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14159 also.
14160 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14161 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14162 (something_changed_gconfCB): Rename from something_changedCB.
14163 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14164 (parse_settings): Move check for font inside HAVE_XFT.
14165 (read_settings, apply_xft_settings): Add comment.
14166 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14167 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14168 call store_font_name_changed.
14169 (xft_settings_event): Add comment.
14170 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14171 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14172 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14173 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14174 (xsettings_initialize): Call init_gsettings last.
14175 (xsettings_get_system_font, xsettings_get_system_normal_font):
14176 Add comment.
14177
14178 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14179
14180 Random fixes. E.g., (random) never returned negative values.
14181 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14182 subseconds part to the entropy, as that's a bit more random.
14183 Prefer signed to unsigned, since the signedness doesn't matter and
14184 in general we prefer signed. When given a limit, use a
14185 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14186 latter isn't right if USE_2_TAGS_FOR_INTS.
14187 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14188 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14189
14190 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14191
14192 * textprop.c (text_property_stickiness):
14193 Obey Vtext_property_default_nonsticky.
14194 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14195 * w32fns.c (syms_of_w32fns):
14196 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14197
14198 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14199
14200 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14201 This is more efficient than Ffile_directory_p and avoids a minor race.
14202
14203 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14204
14205 * buffer.c (Foverlay_put): Say what the return value is
14206 (bug#7835).
14207
14208 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14209 is a directory before asking whether to use the file name
14210 (bug#7564).
14211 (barf_or_query_if_file_exists): Make the "File is a directory"
14212 error be more correct.
14213
14214 * fns.c (Frequire): Remove the mention of the .gz files, since
14215 that's installation-specific, but keep the mention of
14216 `get-load-suffixes'.
14217
14218 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14219
14220 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14221 Report string overflow if the output is too long.
14222
14223 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14224
14225 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14226 (syms_of_gnutls): Remove duplicate DEFSYM for
14227 Qgnutls_bootprop_verify_hostname_error, an error for
14228 Qgnutls_bootprop_verify_error (which is no longer used).
14229
14230 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14231 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14232 Also (re)move comments that are misplaced or no longer relevant.
14233
14234 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14235
14236 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14237
14238 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14239
14240 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14241 and background color parameters if they have been changed.
14242
14243 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14244
14245 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14246
14247 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14248
14249 * xsettings.c (SYSTEM_FONT): Define only when used.
14250 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14251
14252 * keymap.c (access_keymap_1): Now static.
14253
14254 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14255
14256 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14257 leave any prefix arg for the up event (Bug#1586).
14258
14259 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14260
14261 * lread.c (syms_of_lread): Mention single symbols defined by
14262 `defvar' or `defconst' (bug#7154).
14263
14264 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14265 (Frequire): Mention get-load-suffixes.
14266
14267 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14268
14269 * window.h (window): Remove clone_number slot.
14270 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14271 Remove.
14272 (make_parent_window, make_window, saved_window)
14273 (Fset_window_configuration, save_window_save): Don't deal with
14274 clone numbers.
14275 * buffer.c (Qclone_number): Remove declaration.
14276 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14277
14278 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14279
14280 Add multiple inheritance to keymaps.
14281 * keymap.c (Fmake_composed_keymap): New function.
14282 (Fset_keymap_parent): Simplify.
14283 (fix_submap_inheritance): Remove.
14284 (access_keymap_1): New function extracted from access_keymap to handle
14285 embedded parents and handle lists of maps.
14286 (access_keymap): Use it.
14287 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14288 (Fcopy_keymap): Handle embedded parents.
14289 (Fcommand_remapping, define_as_prefix): Simplify.
14290 (Fkey_binding): Simplify.
14291 (syms_of_keymap): Move minibuffer-local-completion-map,
14292 minibuffer-local-filename-completion-map,
14293 minibuffer-local-must-match-map, and
14294 minibuffer-local-filename-must-match-map to Elisp.
14295 (syms_of_keymap): Defsubr make-composed-keymap.
14296 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14297 (parse_menu_item): Trivial simplification.
14298
14299 2011-07-01 Glenn Morris <rgm@gnu.org>
14300
14301 * Makefile.in (SETTINGS_LIBS): Fix typo.
14302
14303 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14304
14305 * coding.c (Fencode_coding_string): Record the last coding system
14306 used, as the function doc string says (bug#8738).
14307
14308 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14309
14310 * xsettings.c (store_monospaced_changed): Take new font as arg and
14311 check for change against current_mono_font.
14312 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14313 (emacs_settings_constructor, emacs_settings_get_property)
14314 (emacs_settings_set_property, emacs_settings_class_init)
14315 (emacs_settings_init, gsettings_obj): Remove.
14316 (something_changedCB): New function for HAVE_GSETTINGS.
14317 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14318 with value as argument.
14319 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14320 g_settings_new (Bug#8967). Do not create gsettings_obj.
14321 Remove calls to g_settings_bind. Connect something_changedCB to
14322 "changed".
14323
14324 * xgselect.c: Add defined (HAVE_GSETTINGS).
14325 (xgselect_initialize): Ditto.
14326
14327 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14328 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14329 xg_select.
14330
14331 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14332
14333 * eval.c (struct backtrace): Simplify and port the data structure.
14334 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14335 signed bit field, as this assumption is not portable and it makes
14336 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14337 "char debug_on_exit : 1" as this is not portable either; instead,
14338 use the portable "unsigned int debug_on_exit : 1". Remove unused
14339 member evalargs. Remove obsolete comments about cc bombing out.
14340
14341 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14342
14343 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14344 Let HAVE_GSETTINGS override HAVE_GCONF.
14345 (store_monospaced_changed): New function.
14346 (EMACS_SETTINGS): A new type derived from GObject to handle
14347 GSettings notifications.
14348 (emacs_settings_constructor, emacs_settings_get_property)
14349 (emacs_settings_set_property, emacs_settings_class_init):
14350 New functions.
14351 (gsettings_client, gsettings_obj): New variables.
14352 (GSETTINGS_SCHEMA): New define.
14353 (something_changedCB): Call store_monospaced_changed.
14354 (init_gsettings): New function.
14355 (xsettings_initialize): Call init_gsettings.
14356 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14357 to NULL.
14358
14359 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14360 GCONF_CFLAGS/LIBS.
14361
14362 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14363
14364 * window.c (resize_root_window, grow_mini_window)
14365 (shrink_mini_window): Rename Qresize_root_window to
14366 Qwindow_resize_root_window and Qresize_root_window_vertically to
14367 Qwindow_resize_root_window_vertically.
14368
14369 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14370
14371 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14372
14373 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14374
14375 * makefile.w32-in: Redesign dependencies so they reflect more
14376 clearly which files are directly included by each source file,
14377 and not through other includes.
14378
14379 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14380
14381 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14382 (sort_overlays, overlay_strings): When an overlay's clone number
14383 matches the window's clone number process the overlay even if
14384 the overlay's window property doesn't match the current window.
14385
14386 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14387 (Fwindow_hchild): Rename to Fwindow_left_child.
14388 (Fwindow_next): Rename to Fwindow_next_sibling.
14389 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14390 (resize_window_check): Rename to window_resize_check.
14391 (resize_window_apply): Rename to window_resize_apply.
14392 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14393 (Fdelete_other_windows_internal, resize_frame_windows)
14394 (Fsplit_window_internal, Fdelete_window_internal)
14395 (grow_mini_window, shrink_mini_window)
14396 (Fresize_mini_window_internal): Fix callers accordingly.
14397
14398 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14399
14400 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14401 (emacs_fixed_set_min_size): Remove.
14402 (emacs_fixed_new): Take frame as argument.
14403
14404 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14405 (_EmacsFixedPrivate): Remove minwidth/height.
14406 Add struct frame *f.
14407 (emacs_fixed_init): Initialize priv->f.
14408 (get_parent_class, emacs_fixed_set_min_size): Remove.
14409 (emacs_fixed_new): Set priv->f to argument.
14410 (emacs_fixed_get_preferred_width)
14411 (emacs_fixed_get_preferred_height): Use min_width/height from
14412 frames size_hint to set minimum and natural (Bug#8919).
14413 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14414 and use min_width/height from frames size_hint to set
14415 min_width/height (Bug#8919).
14416
14417 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14418 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14419 Fix indentation.
14420
14421 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14422
14423 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14424 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14425 called at ZV.
14426
14427 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14428
14429 * process.c (wait_reading_process_output): Bypass select if
14430 waiting for a cell while ignoring keyboard input, and input is
14431 pending. Suggested by Jan Djärv (Bug#8869).
14432
14433 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14434
14435 Use gnulib's dup2 module instead of rolling our own.
14436 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14437
14438 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14439
14440 * dispnew.c (scrolling_window): Before scrolling, turn off a
14441 mouse-highlight in the window being scrolled.
14442
14443 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14444
14445 Move DEFSYM to lisp.h and use everywhere.
14446
14447 * character.h (DEFSYM): Move declaration...
14448 * lisp.h (DEFSYM): ...here.
14449
14450 * gnutls.c:
14451 * minibuf.c:
14452 * w32menu.c:
14453 * w32proc.c:
14454 * w32select.c: Don't include character.h.
14455
14456 * alloc.c (syms_of_alloc):
14457 * buffer.c (syms_of_buffer):
14458 * bytecode.c (syms_of_bytecode):
14459 * callint.c (syms_of_callint):
14460 * casefiddle.c (syms_of_casefiddle):
14461 * casetab.c (init_casetab_once):
14462 * category.c (init_category_once, syms_of_category):
14463 * ccl.c (syms_of_ccl):
14464 * cmds.c (syms_of_cmds):
14465 * composite.c (syms_of_composite):
14466 * dbusbind.c (syms_of_dbusbind):
14467 * dired.c (syms_of_dired):
14468 * dispnew.c (syms_of_display):
14469 * doc.c (syms_of_doc):
14470 * editfns.c (syms_of_editfns):
14471 * emacs.c (syms_of_emacs):
14472 * eval.c (syms_of_eval):
14473 * fileio.c (syms_of_fileio):
14474 * fns.c (syms_of_fns):
14475 * frame.c (syms_of_frame):
14476 * fringe.c (syms_of_fringe):
14477 * insdel.c (syms_of_insdel):
14478 * keymap.c (syms_of_keymap):
14479 * lread.c (init_obarray, syms_of_lread):
14480 * macros.c (syms_of_macros):
14481 * msdos.c (syms_of_msdos):
14482 * print.c (syms_of_print):
14483 * process.c (syms_of_process):
14484 * search.c (syms_of_search):
14485 * sound.c (syms_of_sound):
14486 * syntax.c (init_syntax_once, syms_of_syntax):
14487 * terminal.c (syms_of_terminal):
14488 * textprop.c (syms_of_textprop):
14489 * undo.c (syms_of_undo):
14490 * w32.c (globals_of_w32):
14491 * window.c (syms_of_window):
14492 * xdisp.c (syms_of_xdisp):
14493 * xfaces.c (syms_of_xfaces):
14494 * xfns.c (syms_of_xfns):
14495 * xmenu.c (syms_of_xmenu):
14496 * xsettings.c (syms_of_xsettings):
14497 * xterm.c (syms_of_xterm): Use DEFSYM.
14498
14499 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14500
14501 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14502
14503 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14504
14505 Integer and buffer overflow fixes (Bug#8873).
14506
14507 * print.c (printchar, strout): Check for string overflow.
14508 (PRINTPREPARE, printchar, strout):
14509 Don't set size unless allocation succeeds.
14510
14511 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14512 for sizes. Check for string overflow more accurately.
14513 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14514
14515 * macros.c: Integer and buffer overflow fixes.
14516 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14517 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14518 Use ptrdiff_t, not int, for sizes.
14519 Don't increment bufsize until after realloc succeeds.
14520 Check for size-calculation overflow.
14521 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14522
14523 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14524
14525 * lread.c: Integer overflow fixes.
14526 (read_integer): Radix is now EMACS_INT, not int,
14527 to improve quality of diagnostics for out-of-range radices.
14528 Calculate buffer size correctly for out-of-range radices.
14529 (read1): Check for integer overflow in radices, and in
14530 read-circle numbers.
14531 (read_escape): Avoid int overflow.
14532 (Fload, openp, read_buffer_size, read1)
14533 (substitute_object_recurse, read_vector, read_list, map_obarray):
14534 Use ptrdiff_t, not int, for sizes.
14535 (read1): Use EMACS_INT, not int, for sizes.
14536 Check for size overflow.
14537
14538 * image.c (cache_image): Check for size arithmetic overflow.
14539
14540 * lread.c: Integer overflow issues.
14541 (saved_doc_string_size, saved_doc_string_length)
14542 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14543 Now ptrdiff_t, not int.
14544 (read1): Don't assume doc string length fits in int. Check for
14545 out-of-range doc string lengths.
14546 (read_list): Don't assume file position fits in int.
14547 (read_escape): Check for hex character overflow.
14548
14549 2011-06-22 Leo Liu <sdl.web@gmail.com>
14550
14551 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14552 Move to minibuffer.el.
14553
14554 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14555
14556 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14557 The following patches are for when GLYPH_DEBUG && !XASSERT.
14558 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14559 * dispnew.c (flush_stdout):
14560 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14561 Mark as externally visible.
14562 * dispnew.c (check_window_matrix_pointers): Now static.
14563 * dispnew.c (window_to_frame_vpos):
14564 * xfns.c (unwind_create_frame):
14565 * xterm.c (x_check_font): Remove unused local.
14566 * scroll.c (CHECK_BOUNDS):
14567 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14568 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14569 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14570 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14571 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14572 Now static.
14573 (debug_method_add): Use va_list and vsprintf rather than relying
14574 on undefined behavior with wrong number of arguments.
14575 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14576 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14577 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14578 since we're not interested in debugging glyphs with old libraries.
14579 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14580 GCC 4.6.0's static checking.
14581
14582 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14583
14584 Integer overflow and signedness fixes (Bug#8873).
14585 A few related buffer overrun fixes, too.
14586
14587 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14588
14589 * dispextern.h (struct face.stipple):
14590 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14591 (x_bitmap_mask, x_allocate_bitmap_record)
14592 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14593 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14594 (x_create_bitmap_from_xpm_data):
14595 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14596 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14597 (.bitmaps_last):
14598 * xfaces.c (load_pixmap):
14599 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14600 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14601 (.bitmaps_last, struct x_output.icon_bitmap):
14602 Use ptrdiff_t, not int, for bitmap indexes.
14603 (x_allocate_bitmap_record): Check for size overflow.
14604 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14605
14606 Use ptrdiff_t, not int, for overlay counts.
14607 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14608 * editfns.c (overlays_around, get_pos_property):
14609 * textprop.c (get_char_property_and_overlay):
14610 * xdisp.c (next_overlay_change, note_mouse_highlight):
14611 * xfaces.c (face_at_buffer_position):
14612 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14613 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14614 (Fnext_overlay_change, Fprevious_overlay_change)
14615 (mouse_face_overlay_overlaps, Foverlays_in):
14616 Use ptrdiff_t, not int, for sizes.
14617 (overlays_at, overlays_in): Check for size-calculation overflow.
14618
14619 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14620
14621 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14622 (x_session_initialize): Do not assume string length fits in int.
14623
14624 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14625 This is unlikely, but can occur if DPI is outlandish.
14626
14627 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14628 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14629
14630 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14631 * xrdb.c (magic_file_p, search_magic_path):
14632 Omit last arg SUFFIX; it was always 0. All callers changed.
14633 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14634
14635 * xfont.c (xfont_match): Avoid need for strlen.
14636
14637 * xfns.c: Don't assume strlen fits in int.
14638 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14639
14640 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14641 not unsigned long, as we prefer signed integers. All callers changed.
14642 Detect integer overflow in repeat count.
14643 (message_dolog): Don't assume print length fits in 39 bytes.
14644 (display_mode_element): Don't assume strlen fits in int.
14645
14646 * termcap.c: Don't assume sizes fit in int and never overflow.
14647 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14648 (gobble_line): Check for size-calculation overflow.
14649
14650 * minibuf.c (Fread_buffer):
14651 * lread.c (intern, intern_c_string):
14652 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14653 Don't assume string length fits in int.
14654
14655 * keyboard.c (parse_tool_bar_item):
14656 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14657
14658 * font.c: Don't assume string length fits in int.
14659 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14660 Use ptrdiff_t, not int.
14661 (font_intern_prop): Don't assume string length fits in int.
14662 Don't assume integer property fits in fixnum.
14663 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14664
14665 * filelock.c: Fix some buffer overrun and integer overflow issues.
14666 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14667 Reformulate so as not to need the command string.
14668 Invoke gzip -cd rather than gunzip, as it's more portable.
14669 (lock_info_type, lock_file_1, lock_file):
14670 Don't assume pid_t and time_t fit in unsigned long.
14671 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14672 (current_lock_owner): Prefer signed type for sizes.
14673 Use memcpy, not strncpy, where memcpy is what is really wanted.
14674 Don't assume (via atoi) that time_t and pid_t fit in int.
14675 Check for time_t and/or pid_t out of range, e.g., via a network share.
14676 Don't alloca where an auto var works fine.
14677
14678 * fileio.c: Fix some integer overflow issues.
14679 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14680 Don't assume string length fits in int.
14681 (directory_file_name): Don't assume string length fits in long.
14682 (make_temp_name): Don't assume pid fits in int, or that its print
14683 length is less than 20.
14684
14685 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14686
14687 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14688
14689 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14690
14691 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14692 We prefer signed integers, even for size calculations.
14693
14694 * emacs.c: Don't assume string length fits in 'int'.
14695 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14696 (main): Don't invoke strlen when not needed.
14697
14698 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14699 (XD_DEBUG_MESSAGE): Don't waste a byte.
14700
14701 * callproc.c (getenv_internal_1, getenv_internal)
14702 (Fgetenv_internal):
14703 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14704
14705 * lread.c (invalid_syntax): Omit length argument.
14706 All uses changed. This doesn't fix a bug, but it simplifies the
14707 code away from its former Hollerith-constant appearance, and it's
14708 one less 'int' to worry about when looking at integer-overflow issues.
14709 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14710
14711 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14712 This didn't break anything, but it didn't help either.
14713 It's confusing to put a bogus integer in a place where the actual
14714 value does not matter.
14715 (LIST_END_P): Remove unused macro and its bogus comment.
14716 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14717
14718 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14719 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14720 implementation.
14721 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14722 We prefer signed types, and the value cannot exceed the EMACS_INT
14723 range anyway (because otherwise the length would not be representable).
14724 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14725 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14726 This avoids a GCC warning when WIDE_EMACS_INT.
14727
14728 * indent.c (sane_tab_width): New function.
14729 (current_column, scan_for_column, Findent_to, position_indentation)
14730 (compute_motion): Use it. This is just for clarity.
14731 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14732
14733 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14734
14735 * lisp.h (lint_assume): New macro.
14736 * composite.c (composition_gstring_put_cache):
14737 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14738
14739 * editfns.c, insdel.c:
14740 Omit unnecessary forward decls, to simplify future changes.
14741
14742 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14743
14744 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14745
14746 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14747 Use much-faster test for byte-length change.
14748 Don't assume string byte-length fits in 'int'.
14749 Check that character arg fits in 'int'.
14750 (mapcar1): Declare byte as byte, for clarity.
14751
14752 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14753
14754 * fns.c (concat): Catch string overflow earlier.
14755 Do not rely on integer wraparound.
14756
14757 * dispextern.h (struct it.overlay_strings_charpos)
14758 (struct it.selective): Now EMACS_INT, not int.
14759 * xdisp.c (forward_to_next_line_start)
14760 (back_to_previous_visible_line_start)
14761 (reseat_at_next_visible_line_start, next_element_from_buffer):
14762 Don't arbitrarily truncate the value of 'selective' to int.
14763
14764 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14765
14766 * composite.c: Don't truncate sizes to 'int'.
14767 (composition_gstring_p, composition_reseat_it)
14768 (composition_adjust_point): Use EMACS_INT, not int.
14769 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14770 not EMACS_UINT, for indexes.
14771
14772 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14773
14774 * buffer.c: Include <verify.h>.
14775 (struct sortvec.priority, struct sortstr.priority):
14776 Now EMACS_INT, not int.
14777 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14778 (struct sortstr.size, record_overlay_string)
14779 (struct sortstrlist.size, struct sortlist.used):
14780 Don't truncate size to int.
14781 (record_overlay_string): Check for size-calculation overflow.
14782 (init_buffer_once): Check at compile-time, not run-time.
14783
14784 2011-06-22 Jim Meyering <meyering@redhat.com>
14785
14786 Don't leak an XBM-image-sized buffer
14787 * image.c (xbm_load): Free the image buffer after using it.
14788
14789 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14790
14791 Port to Sun C.
14792 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14793 that Sun C diagnosed.
14794 * fns.c (secure_hash): Fix pointer signedness issue.
14795 * intervals.c (static_offset_intervals): New function.
14796 (offset_intervals): Use it.
14797
14798 2011-06-21 Leo Liu <sdl.web@gmail.com>
14799
14800 * deps.mk (fns.o):
14801 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14802 sha512.h.
14803
14804 * fns.c (secure_hash): Rename from crypto_hash_function and change
14805 the first arg to accept symbols.
14806 (Fsecure_hash): New primitive.
14807 (syms_of_fns): New symbols.
14808
14809 2011-06-20 Deniz Dogan <deniz@dogan.se>
14810
14811 * process.c (Fset_process_buffer): Clarify return value in
14812 docstring.
14813
14814 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14815
14816 * dispnew.c (add_window_display_history): Use BVAR.
14817
14818 * xdisp.c (debug_method_add): Use BVAR.
14819 (check_window_end, dump_glyph_matrix, dump_glyph)
14820 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14821
14822 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14823 Likewise.
14824
14825 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14826 check till after the cache is created in init_frame_faces.
14827
14828 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14829
14830 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14831
14832 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14833
14834 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14835 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14836 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14837
14838 Improve buffer-overflow checking (Bug#8873).
14839 * fileio.c (Finsert_file_contents):
14840 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14841 Remove the old (too-loose) buffer overflow checks.
14842 They weren't needed, since make_gap checks for buffer overflow.
14843 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14844 The old code merely checked for Emacs fixnum overflow, and relied
14845 on undefined (wraparound) behavior. The new code avoids undefined
14846 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14847
14848 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14849 Tune. Don't use wider integers than needed. Don't use alloca.
14850 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14851
14852 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14853
14854 * insdel.c, lisp.h (buffer_overflow): New function.
14855 (insert_from_buffer_1, replace_range, replace_range_2):
14856 * insdel.c (make_gap_larger):
14857 * editfns.c (Finsert_char):
14858 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14859
14860 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14861
14862 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14863
14864 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14865
14866 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14867 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14868
14869 * fileio.c: Don't assume EMACS_INT fits in off_t.
14870 (emacs_lseek): New static function.
14871 (Finsert_file_contents, Fwrite_region): Use it.
14872 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14873
14874 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14875
14876 * fns.c: Don't overflow int when computing a list length.
14877 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14878 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14879 truncation on 64-bit hosts. Check for QUIT every
14880 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14881 faster and is responsive enough.
14882 (Flength): Report an error instead of overflowing an integer.
14883 (Fsafe_length): Return a float if the value is not representable
14884 as a fixnum. This shouldn't happen except in contrived situations.
14885 (Fnthcdr, Fsort): Don't assume list length fits in int.
14886 (Fcopy_sequence): Don't assume vector length fits in int.
14887
14888 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14889 (header_size, word_size): New constants.
14890 (allocate_vectorlike): Don't check size overflow here.
14891 (allocate_vector): Check it here instead, since this is the only
14892 caller of allocate_vectorlike that could cause overflow.
14893 Check that the new vector's length is representable as a fixnum.
14894
14895 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14896 The previous code was bogus. For example, next_almost_prime (32)
14897 returned 39, which is undesirable as it is a multiple of 3; and
14898 next_almost_prime (24) returned 25, which is a multiple of 5 so
14899 why was the code bothering to check for multiples of 7?
14900
14901 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14902
14903 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14904
14905 Variadic C functions now count arguments with ptrdiff_t.
14906 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14907 Back then I didn't know that the Emacs coding style prefers signed int.
14908 Also, in the meantime I found a few more instances where arguments
14909 were being counted with int, which may truncate counts on 64-bit
14910 machines, or EMACS_INT, which may be unnecessarily wide.
14911 * lisp.h (struct Lisp_Subr.function.aMANY)
14912 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14913 Arg counts are now ptrdiff_t, not size_t.
14914 All variadic functions and their callers changed accordingly.
14915 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14916 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14917 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14918 * callint.c (Fcall_interactively): Check arg count for overflow,
14919 to avoid potential buffer overrun. Use signed char, not 'int',
14920 for 'varies' array, so that we needn't bother to check its size
14921 calculation for overflow.
14922 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14923 * eval.c (apply_lambda):
14924 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14925 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14926 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14927
14928 * callint.c (Fcall_interactively): Don't use index var as event count.
14929
14930 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14931 * mem-limits.h (SIZE): Remove; no longer used.
14932
14933 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14934
14935 Remove unnecessary casts.
14936 * xterm.c (x_term_init):
14937 * xfns.c (x_set_border_pixel):
14938 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14939 These aren't needed now that we assume ANSI C.
14940
14941 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14942 It's more likely to cause problems (due to unsigned overflow)
14943 than to cure them.
14944
14945 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14946
14947 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14948
14949 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14950
14951 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14952
14953 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14954
14955 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14956
14957 GLYPH_CODE_FACE returns EMACS_INT, not int.
14958 * dispextern.h (merge_faces):
14959 * xfaces.c (merge_faces):
14960 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14961 Don't assume EMACS_INT fits in int.
14962
14963 * character.h (CHAR_VALID_P): Remove unused parameter.
14964 * fontset.c, lisp.h, xdisp.c: All uses changed.
14965
14966 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14967
14968 * fns.c (concat): Minor tuning based on overflow analysis.
14969 This doesn't fix any bugs. Use int to hold character, instead
14970 of constantly refetching from Emacs object. Use XFASTINT, not
14971 XINT, for value known to be a character. Don't bother comparing
14972 a single byte to 0400, as it's always less.
14973
14974 * floatfns.c (Fexpt):
14975 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14976
14977 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14978 for characters.
14979
14980 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14981
14982 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14983 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14984 incorrectly succeed when S was a string, because 4294967386 was
14985 truncated before it was used.
14986
14987 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14988 Otherwise, an out-of-range integer could cause undefined behavior
14989 on a 64-bit host.
14990
14991 * composite.c: Use int, not EMACS_INT, for characters.
14992 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14993 EMACS_INT, for values that are known to be in character range.
14994 This doesn't fix any bugs but is the usual style inside Emacs and
14995 may generate better code on 32-bit machines.
14996
14997 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14998 This is for reasons similar to the recent CHAR_STRING fix.
14999 * charset.c (Fencode_char): Check that character arg is actually
15000 a character. Pass an int to ENCODE_CHAR.
15001 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15002 wider than 'int', as a compile-time check to prevent future regressions
15003 in this area.
15004
15005 * character.c (char_string): Remove unnecessary casts.
15006
15007 Make sure a 64-bit char is never passed to CHAR_STRING.
15008 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15009 by silently ignoring the top 32 bits, allowing some values
15010 that were far too large to be valid characters.
15011 * character.h: Include <verify.h>.
15012 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15013 arguments are no wider than unsigned, as a compile-time check
15014 to prevent future regressions in this area.
15015 * data.c (Faset):
15016 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
15017 (Fsubst_char_in_region):
15018 * fns.c (concat):
15019 * xdisp.c (decode_mode_spec_coding):
15020 Adjust to CHAR_STRING's new requirement.
15021 * editfns.c (Finsert_char, Fsubst_char_in_region):
15022 * fns.c (concat): Check that character args are actually
15023 characters. Without this test, these functions did the wrong
15024 thing with wildly out-of-range values on 64-bit hosts.
15025
15026 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15027 These casts should not be needed on 32-bit hosts, either.
15028 * keyboard.c (read_char):
15029 * lread.c (Fload): Remove casts to unsigned.
15030
15031 * lisp.h (UNSIGNED_CMP): New macro.
15032 This fixes comparison bugs on 64-bit hosts.
15033 (ASCII_CHAR_P): Use it.
15034 * casefiddle.c (casify_object):
15035 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
15036 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15037 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15038 * dispextern.h (FACE_FROM_ID):
15039 * keyboard.c (read_char): Use UNSIGNED_CMP.
15040
15041 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15042 not to EMACS_INT, to avoid GCC warning.
15043
15044 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15045
15046 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15047 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15048 isn't needed on 32-bit machines.
15049
15050 * buffer.c (Fgenerate_new_buffer_name):
15051 Use EMACS_INT for count, not int.
15052 (advance_to_char_boundary): Return EMACS_INT, not int.
15053
15054 * data.c (Qcompiled_function): Now static.
15055
15056 * window.c (window_body_lines): Now static.
15057
15058 * image.c (gif_load): Rename local to avoid shadowing.
15059
15060 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15061 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15062 * alloc.c (make_save_value): Integer argument is now of type
15063 ptrdiff_t, not int.
15064 (mark_object): Use ptrdiff_t, not int.
15065 * lisp.h (pD): New macro.
15066 * print.c (print_object): Use it.
15067
15068 * alloc.c: Use EMACS_INT, not int, to count objects.
15069 (total_conses, total_markers, total_symbols, total_vector_size)
15070 (total_free_conses, total_free_markers, total_free_symbols)
15071 (total_free_floats, total_floats, total_free_intervals)
15072 (total_intervals, total_strings, total_free_strings):
15073 Now EMACS_INT, not int. All uses changed.
15074 (Fgarbage_collect): Compute overall total using a double, so that
15075 integer overflow is less likely to be a problem. Check for overflow
15076 when converting back to an integer.
15077 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15078 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15079 These were 'int' variables that could overflow on 64-bit hosts;
15080 they were never used, so remove them instead of repairing them.
15081 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15082 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15083 Previously, this ceilinged at INT_MAX, but that doesn't work on
15084 64-bit machines.
15085 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15086
15087 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15088 (allocate_vectorlike): Check for ptrdiff_t overflow.
15089 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15090 when a (possibly-narrower) signed value would do just as well.
15091 We prefer using signed arithmetic, to avoid comparison confusion.
15092
15093 * alloc.c: Catch some string size overflows that we were missing.
15094 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15095 for convenience in STRING_BYTES_MAX.
15096 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15097 The definition here is exact; the one in lisp.h was approximate.
15098 (allocate_string_data): Check for string overflow. This catches
15099 some instances we weren't catching before. Also, it catches
15100 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15101 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15102 and ptrdiff_t and EMACS_INT are both 64 bits.
15103
15104 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15105 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15106 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15107
15108 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15109
15110 * alloc.c (Fmake_string): Check for out-of-range init.
15111
15112 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15113
15114 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15115
15116 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15117
15118 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15119 xg_get_default_scrollbar_width.
15120
15121 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15122 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15123 (style_changed_cb): Call update_theme_scrollbar_width and call
15124 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15125 all frames (Bug#8505).
15126 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15127 Call gtk_window_set_resizable if HAVE_GTK3.
15128 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15129 and height if HAVE_GTK3 (Bug#8505).
15130 (scroll_bar_width_for_theme): New variable.
15131 (update_theme_scrollbar_width): New function.
15132 (xg_get_default_scrollbar_width): Move code to
15133 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15134 (xg_initialize): Call update_theme_scrollbar_width.
15135
15136 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15137
15138 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15139
15140 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15141
15142 * frame.c (make_frame): Call other_buffer_safely instead of
15143 other_buffer.
15144
15145 * window.c (temp_output_buffer_show): Call display_buffer with
15146 second argument Vtemp_buffer_show_specifiers and reset latter
15147 immediately after the call.
15148 (Vtemp_buffer_show_specifiers): New variable.
15149 (auto_window_vscroll_p, next_screen_context_lines)
15150 (Vscroll_preserve_screen_position): Remove leading asterisks from
15151 doc-strings.
15152
15153 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15154
15155 Fix minor problems found by GCC 4.6.0 static checking.
15156 * buffer.c (Qclone_number): Remove for now, as it's unused.
15157 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15158 (record_buffer): Remove unused local.
15159 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15160 (set_frame_buffer_list): Remove; unused.
15161 * frame.h (other_visible_frames): Remove decl.
15162 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15163 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15164 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15165 if HAVE_GPM.
15166 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15167 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15168 Define only if HAVE_GPM.
15169 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15170 (update_hints_inhibit): Remove; never set. All uses removed.
15171 * widgetprv.h (emacsFrameClassRec): Remove decl.
15172 * window.c (delete_deletable_window): Now returns void, since it
15173 wasn't returning anything.
15174 (compare_window_configurations): Remove unused locals.
15175 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15176 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15177 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15178 the same widths as pointers. This follows up on the 2011-05-06 patch.
15179 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15180 * xterm.h: Likewise.
15181 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15182
15183 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15184
15185 * makefile.w32-in: Update dependencies.
15186 (LISP_H): Add lib/intprops.h.
15187
15188 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15189
15190 * image.c (gif_load): Add animation frame delay to the metadata.
15191 (syms_of_image): Use DEFSYM. New symbol `delay'.
15192
15193 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15194
15195 * window.c (delete_deletable_window): Re-add.
15196 (Fset_window_configuration): Rewrite to handle dead buffers and
15197 consequently deletable windows.
15198 (window_tree, Fwindow_tree): Remove. Supply functionality in
15199 window.el.
15200 (compare_window_configurations): Simplify code.
15201
15202 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15203
15204 * image.c (imagemagick_load_image): Fix type mismatch.
15205 (Fimagemagick_types): Likewise.
15206
15207 * window.h (replace_buffer_in_windows): Declare.
15208
15209 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15210
15211 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15212 Qclone_number. Remove external declaration of Qdelete_window.
15213 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15214 code.
15215 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15216 Run Qbuffer_list_update_hook if allowed.
15217 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15218 buffer list implementation.
15219 (other_buffer_safely): New function.
15220 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15221 calls to replace_buffer_in_windows and
15222 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15223 if allowed.
15224 (record_buffer): Inhibit quitting and rewrite using quittable
15225 functions. Run Qbuffer_list_update_hook if allowed.
15226 (Frecord_buffer, Funrecord_buffer): New functions.
15227 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15228 Move switch-to-buffer to window.el.
15229 (bury-buffer): Move to window.el.
15230 (Vbuffer_list_update_hook): New variable.
15231
15232 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15233 section.
15234
15235 * window.h (resize_frame_windows): Move up in code.
15236 (Fwindow_frame): Remove EXFUN.
15237 (replace_buffer_in_all_windows): Remove prototype.
15238 (replace_buffer_in_windows_safely): Add prototype.
15239
15240 * window.c: Declare Qdelete_window static again. Move down
15241 declaration of select_count.
15242 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15243 (Fother_window): Move to window.el.
15244 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15245 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15246 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15247 window.el.
15248 (replace_buffer_in_windows): Implement by calling
15249 Qreplace_buffer_in_windows.
15250 (replace_buffer_in_all_windows): Remove with some functionality
15251 moved into replace_buffer_in_windows_safely.
15252 (replace_buffer_in_windows_safely): New function.
15253 (select_window_norecord, select_frame_norecord): Move in front
15254 of run_window_configuration_change_hook. Remove now obsolete
15255 declarations.
15256 (Fset_window_buffer): Rewrite doc-string.
15257 Call Qrecord_window_buffer.
15258 (keys_of_window): Move binding for other-window to window.el.
15259
15260 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15261
15262 * dispextern.h (struct image): Replace data member, whose int_val
15263 and ptr_val fields were not used by anything, with a single
15264 lisp_val object.
15265
15266 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15267 (gif_clear_image, gif_load, imagemagick_load_image)
15268 (gs_clear_image, gs_load): Callers changed.
15269
15270 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15271
15272 * buffer.h: Include <time.h>, for time_t.
15273 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15274
15275 Fix minor problems found by static checking.
15276
15277 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15278
15279 Make identifiers static if they are not used in other modules.
15280 * data.c (Qcompiled_function, Qframe, Qvector):
15281 * image.c (QimageMagick, Qsvg):
15282 * minibuf.c (Qmetadata):
15283 * window.c (resize_window_check, resize_root_window): Now static.
15284 * window.h (resize_window_check, resize_root_window): Remove decls.
15285
15286 * window.c (window_deletion_count, delete_deletable_window):
15287 Remove; unused.
15288 (window_body_lines): Now static.
15289 (Fdelete_other_windows_internal): Mark vars as initialized.
15290 Make sure 'resize_failed' is initialized.
15291 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15292 (resize_window_apply): Remove unused local.
15293 * window.h (delete_deletable_window): Remove decl.
15294
15295 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15296 (imagemagick_load_image): Fix pointer signedness problem by changing
15297 last arg from unsigned char * to char *. All uses changed.
15298 Also, fix a local for similar reasons.
15299 Remove unused locals. Remove locals to avoid shadowing.
15300 (fn_rsvg_handle_free): Remove; unused.
15301 (svg_load, svg_load_image): Fix pointer signedness problem.
15302 (imagemagick_load_image): Don't use garbage pointer image_wand.
15303
15304 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15305
15306 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15307
15308 * image.c (gif_load): Fix omitted cast error introduced by
15309 2011-06-06 change.
15310
15311 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15312
15313 * window.h (resize_proportionally, orig_total_lines)
15314 (orig_top_line): Remove from window structure.
15315 (set_window_height, set_window_width, change_window_heights)
15316 (Fdelete_window): Remove prototypes.
15317 (resize_frame_windows): Remove duplicate declaration.
15318
15319 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15320
15321 * window.h (resize_frame_windows, resize_window_check)
15322 (delete_deletable_window, resize_root_window)
15323 (resize_frame_windows): Declare prototypes.
15324
15325 * window.c (resize_window_apply): Make definition be "static" to
15326 match the prototype.
15327
15328 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15329
15330 * window.c: Remove declarations of Qwindow_size_fixed,
15331 window_min_size_1, window_min_size_2, window_min_size,
15332 size_window, window_fixed_size_p, enlarge_window, delete_window.
15333 Remove static from declaration of Qdelete_window, it's
15334 temporarily needed by Fbury_buffer.
15335 (replace_window): Don't assign orig_top_line and
15336 orig_total_lines.
15337 (Fdelete_window, delete_window): Remove. Window deletion is
15338 handled by window.el.
15339 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15340 Replace Fdelete_window calls with calls to Qdelete_window.
15341 (Fdelete_other_windows): Remove. Deleting other windows is
15342 handled by window.el.
15343 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15344 handled in window.el.
15345 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15346 Window minimum sizes are handled in window.el.
15347 (shrink_windows, size_window, set_window_height)
15348 (set_window_width, change_window_heights, window_height)
15349 (window_width, CURBEG, CURSIZE, enlarge_window)
15350 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15351 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15352 handled in window.el.
15353 (make_dummy_parent): Rename to make_parent_window and give it a
15354 second argument horflag.
15355 (make_window): Don't set resize_proportionally any more.
15356 (Fsplit_window): Remove. Windows are split in window.el.
15357 (save_restore_action, save_restore_orig_size)
15358 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15359 Resize mini windows in window.el.
15360 (grow_mini_window, shrink_mini_window): Implement by calling
15361 Qresize_root_window_vertically, resize_window_check and
15362 resize_window_apply.
15363 (saved_window, Fset_window_configuration, save_window_save):
15364 Do not handle orig_top_line, orig_total_lines, and
15365 resize_proportionally.
15366 (window_min_height, window_min_width): Move to window.el.
15367 (keys_of_window): Move bindings for delete-other-windows,
15368 split-window, delete-window and enlarge-window to window.el.
15369
15370 * buffer.c: Temporarily extern Qdelete_window.
15371 (Fbury_buffer): Temporarily call Qdelete_window instead of
15372 Fdelete_window (Fbury_buffer will move to window.el soon).
15373
15374 * frame.c (set_menu_bar_lines_1): Remove code handling
15375 orig_top_line and orig_total_lines.
15376
15377 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15378 set_window_height but set heights directly.
15379 (change_frame_size_1): Use resize_frame_windows.
15380
15381 * xdisp.c (init_xdisp): Don't use set_window_height but set
15382 heights directly.
15383
15384 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15385 Use resize_frame_windows instead of change_window_heights and run
15386 run_window_configuration_change_hook.
15387
15388 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15389 instead of change_window_heights and run
15390 run_window_configuration_change_hook.
15391
15392 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15393
15394 * window.c (replace_window): Rename second argument REPLACEMENT to
15395 NEW. New third argument SETFLAG. Rewrite.
15396 (delete_window, make_dummy_parent): Call replace_window with
15397 third argument 1.
15398 (window_list_1): Move down in code.
15399 (run_window_configuration_change_hook): Move set_buffer part
15400 before select_frame_norecord part in order to unwind correctly.
15401 Rename count1 to count.
15402 (recombine_windows, delete_deletable_window, resize_root_window)
15403 (Fdelete_other_windows_internal)
15404 (Frun_window_configuration_change_hook, make_parent_window)
15405 (resize_window_check, resize_window_apply, Fresize_window_apply)
15406 (resize_frame_windows, Fsplit_window_internal)
15407 (Fdelete_window_internal, Fresize_mini_window_internal):
15408 New functions.
15409 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15410
15411 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15412
15413 * window.h (window): Add some new members to window structure -
15414 normal_lines, normal_cols, new_total, new_normal, clone_number,
15415 splits, nest, prev_buffers, next_buffers.
15416 (WINDOW_TOTAL_SIZE): Move here from window.c.
15417 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15418
15419 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15420 Remove.
15421 (make_dummy_parent): Set new members of windows structure.
15422 (make_window): Move down in code. Handle new members of window
15423 structure.
15424 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15425 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15426 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15427 (Fset_window_prev_buffers, Fwindow_next_buffers)
15428 (Fset_window_next_buffers, Fset_window_clone_number):
15429 New functions.
15430 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15431 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15432 Doc-string fixes.
15433 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15434 Argument WINDOW can be now internal window too.
15435 (Fwindow_use_time): Move up in code.
15436 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15437 Rewrite doc-string.
15438 (Fset_window_configuration, saved_window)
15439 (Fcurrent_window_configuration, save_window_save): Handle new
15440 members of window structure.
15441 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15442 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15443 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15444 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15445 Qget_mru_window, Qresize_root_window,
15446 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15447 Qauto_buffer_name; staticpro them.
15448
15449 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15450
15451 * window.c (Fwindow_total_size, Fwindow_left_column)
15452 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15453 (Fwindow_list_1): New functions.
15454 (window_box_text_cols): Replace with window_body_cols.
15455 (Fwindow_width, Fscroll_left, Fscroll_right):
15456 Use window_body_cols instead of window_box_text_cols.
15457 (delete_window, Fset_window_configuration):
15458 Call delete_all_subwindows with window as argument.
15459 (delete_all_subwindows): Take a window as argument and not a
15460 structure. Rewrite.
15461 (window_loop): Remove handling of GET_LRU_WINDOW and
15462 GET_LARGEST_WINDOW.
15463 (Fget_lru_window, Fget_largest_window): Move to window.el.
15464
15465 * window.h: Extern window_body_cols instead of
15466 window_box_text_cols. delete_all_subwindows now takes a
15467 Lisp_Object as argument.
15468
15469 * indent.c (compute_motion, Fcompute_motion):
15470 Use window_body_cols instead of window_box_text_cols.
15471
15472 * frame.c (delete_frame): Call delete_all_subwindows with root
15473 window as argument.
15474
15475 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15476
15477 * fns.c (Fputhash): Document return value.
15478
15479 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15480
15481 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15482
15483 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15484
15485 Cons<->int and similar integer overflow fixes (Bug#8794).
15486
15487 Check for overflow when converting integer to cons and back.
15488 * charset.c (Fdefine_charset_internal, Fdecode_char):
15489 Use cons_to_unsigned to catch overflow.
15490 (Fencode_char): Use INTEGER_TO_CONS.
15491 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15492 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15493 * data.c (long_to_cons, cons_to_long): Remove.
15494 (cons_to_unsigned, cons_to_signed): New functions.
15495 These signal an error for invalid or out-of-range values.
15496 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15497 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15498 * font.c (Ffont_variation_glyphs):
15499 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15500 * lisp.h: Include <intprops.h>.
15501 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15502 (cons_to_signed, cons_to_unsigned): New decls.
15503 (long_to_cons, cons_to_long): Remove decls.
15504 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15505 (Fprimitive_undo): Use CONS_TO_INTEGER.
15506 * xfns.c (Fx_window_property): Likewise.
15507 * xselect.c: Include <limits.h>.
15508 (x_own_selection, selection_data_to_lisp_data):
15509 Use INTEGER_TO_CONS.
15510 (x_handle_selection_request, x_handle_selection_clear)
15511 (x_get_foreign_selection, Fx_disown_selection_internal)
15512 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15513 (lisp_data_to_selection_data): Use cons_to_unsigned.
15514 (x_fill_property_data): Use cons_to_signed.
15515 Report values out of range.
15516
15517 Check for buffer and string overflow more precisely.
15518 * buffer.h (BUF_BYTES_MAX): New macro.
15519 * lisp.h (STRING_BYTES_MAX): New macro.
15520 * alloc.c (Fmake_string):
15521 * character.c (string_escape_byte8):
15522 * coding.c (coding_alloc_by_realloc):
15523 * doprnt.c (doprnt):
15524 * editfns.c (Fformat):
15525 * eval.c (verror):
15526 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15527 since they may not be the same number.
15528 * editfns.c (Finsert_char):
15529 * fileio.c (Finsert_file_contents):
15530 Likewise for BUF_BYTES_MAX.
15531
15532 * image.c: Use ptrdiff_t, not int, for sizes.
15533 (slurp_file): Switch from int to ptrdiff_t.
15534 All uses changed.
15535 (slurp_file): Check that file size fits in both size_t (for
15536 malloc) and ptrdiff_t (for sanity and safety).
15537
15538 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15539 if b->modtime has its maximal value.
15540
15541 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15542
15543 Don't assume time_t can fit into int.
15544 * buffer.h (struct buffer.modtime): Now time_t, not int.
15545 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15546 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15547
15548 Minor fixes for signed vs unsigned integers.
15549 * character.h (MAYBE_UNIFY_CHAR):
15550 * charset.c (maybe_unify_char):
15551 * keyboard.c (read_char, reorder_modifiers):
15552 XINT -> XFASTINT, since the integer must be nonnegative.
15553 * ftfont.c (ftfont_spec_pattern):
15554 * keymap.c (access_keymap, silly_event_symbol_error):
15555 XUINT -> XFASTINT, since the integer must be nonnegative.
15556 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15557 since it makes no difference and we prefer signed.
15558 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15559 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15560 nonnegative.
15561
15562 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15563
15564 * window.h (Fwindow_frame): Declare.
15565
15566 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15567
15568 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15569 (SPARE_MEMORY): Always define.
15570 (LARGE_REQUEST): Remove.
15571 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15572
15573 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15574
15575 * lisp.h: Move EXFUNS for Fframe_root_window,
15576 Fframe_first_window and Fset_frame_selected_window to window.h.
15577
15578 * window.h: Move EXFUNS for Fframe_root_window,
15579 Fframe_first_window and Fset_frame_selected_window here from
15580 lisp.h.
15581
15582 * frame.c (Fwindow_frame, Fframe_first_window)
15583 (Fframe_root_window, Fframe_selected_window)
15584 (Fset_frame_selected_window): Move to window.c.
15585 (Factive_minibuffer_window): Move to minibuf.c.
15586 (Fother_visible_frames_p): New function.
15587
15588 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15589
15590 * window.c (decode_window, decode_any_window): Move up in code.
15591 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15592 (inhibit_frame_unsplittable): Remove unused variable.
15593 (Fwindow_buffer): Move up and rewrite doc-string.
15594 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15595 (Fwindow_prev): New functions.
15596 (Fwindow_frame): Move here from frame.c. Accept any window as
15597 argument.
15598 (Fframe_root_window, Fframe_first_window)
15599 (Fframe_selected_window): Move here from frame.c. Accept frame
15600 or arbitrary window as argument. Update doc-strings.
15601 (Fminibuffer_window): Move up in code.
15602 (Fwindow_minibuffer_p): Move up in code and simplify.
15603 (Fset_frame_selected_window): Move here from frame.c.
15604 Marginal rewrite.
15605 (Fselected_window, select_window, Fselect_window): Move up in
15606 code. Minor doc-string fixes.
15607
15608 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15609
15610 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15611 Do not assume that spare memory exists; that assumption is valid
15612 only if SYSTEM_MALLOC.
15613 (LARGE_REQUEST): New macro, so that the issue of large requests
15614 is separated from the issue of spare memory.
15615
15616 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15617
15618 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15619 format. (Bug#8806)
15620
15621 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15622
15623 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15624 before statements.
15625
15626 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15627
15628 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15629
15630 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15631
15632 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15633 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15634
15635 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15636
15637 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15638
15639 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15640
15641 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15642 (x_clipboard_manager_save): Add return value.
15643 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15644 New error handlers.
15645 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15646 Obey Vx_select_enable_clipboard_manager. Catch errors in
15647 x_clipboard_manager_save (Bug#8779).
15648 (Vx_select_enable_clipboard_manager): New variable.
15649 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15650
15651 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15652
15653 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15654
15655 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15656
15657 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15658 in the current matrix if keep_current_p is non-zero.
15659
15660 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15661
15662 * bidi.c (bidi_level_of_next_char): Fix last change.
15663
15664 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15665
15666 Support bidi reordering of text covered by display properties.
15667
15668 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15669 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15670 (bidi_cache_search, bidi_cache_iterator_state)
15671 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15672 (bidi_level_of_next_char, bidi_move_to_visually_next):
15673 Support character positions inside a run of characters covered by a
15674 display string.
15675 (bidi_paragraph_init, bidi_resolve_explicit_1)
15676 (bidi_level_of_next_char): Call bidi_fetch_char and
15677 bidi_fetch_char_advance instead of FETCH_CHAR and
15678 FETCH_CHAR_ADVANCE.
15679 (bidi_init_it): Initialize new members.
15680 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15681 definitions.
15682 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15683 instead of using explicit *_CHAR codes.
15684 (bidi_resolve_explicit, bidi_resolve_weak):
15685 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15686 bidirectional text is supported only in multibyte buffers.
15687 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15688 it to initialize the frame_window_p member of struct bidi_it.
15689 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15690 (bidi_resolve_explicit, bidi_resolve_weak)
15691 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15692 bidi_it->nchars is non-positive.
15693 (bidi_level_of_next_char): Don't try to lookup the cache for the
15694 next/previous character if nothing is cached there yet, or if we
15695 were just reseat()'ed to a new position.
15696
15697 * xdisp.c (set_cursor_from_row): Set start and stop points
15698 according to the row's direction when priming the loop that looks
15699 for the glyph on which to display cursor.
15700 (single_display_spec_intangible_p): Function deleted.
15701 (display_prop_intangible_p): Reimplement to call
15702 handle_display_spec instead of single_display_spec_intangible_p.
15703 Accept 3 additional arguments needed by handle_display_spec.
15704 This fixes incorrect cursor motion across display property with complex
15705 values: lists, `(when COND...)' forms, etc.
15706 (single_display_spec_string_p): Support property values that are
15707 lists with the argument STRING its top-level element.
15708 (display_prop_string_p): Fix the condition for processing a
15709 property that is a list to be consistent with handle_display_spec.
15710 (handle_display_spec): New function, refactored from the
15711 last portion of handle_display_prop.
15712 (compute_display_string_pos): Accept additional argument
15713 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15714 value of a `display' property is a "replacing spec".
15715 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15716 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15717 the display property, but just return a value indicating whether
15718 the display property will replace the characters it covers.
15719 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15720 frame_window_p members of struct bidi_it.
15721 (compute_display_string_pos, compute_display_string_end):
15722 New functions.
15723 (push_it): Accept second argument POSITION, where pop_it should
15724 jump to continue iteration.
15725 (reseat_1): Initialize bidi_it.disp_pos.
15726
15727 * keyboard.c (adjust_point_for_property): Adjust the call to
15728 display_prop_intangible_p to its new signature.
15729
15730 * dispextern.h (struct bidi_it): New member frame_window_p.
15731 (bidi_init_it): Update prototypes.
15732 (display_prop_intangible_p): Update prototype.
15733 (compute_display_string_pos, compute_display_string_end):
15734 Declare prototypes.
15735 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15736 EMACS_INT.
15737
15738 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15739
15740 Malloc failure behavior now depends on size of allocation.
15741 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15742 * lisp.h: Change signatures accordingly.
15743 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15744 All callers changed. (Bug#8762)
15745
15746 * gnutls.c: Use Emacs's memory allocators.
15747 Without this change, the gnutls library would invoke malloc etc.
15748 directly, which causes problems on non-SYNC_INPUT hosts, and which
15749 runs afoul of improving memory_full behavior. (Bug#8761)
15750 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15751 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15752 xfree instead of the default malloc, realloc, free.
15753 (Fgnutls_boot): No need to check for memory allocation failure,
15754 since xmalloc does that for us.
15755
15756 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15757 * category.c (hash_get_category_set):
15758 * ccl.c (ccl_driver):
15759 * charset.c (Fdefine_charset_internal):
15760 * charset.h (struct charset.hash_index):
15761 * composite.c (get_composition_id, gstring_lookup_cache)
15762 (composition_gstring_put_cache):
15763 * composite.h (struct composition.hash_index):
15764 * dispextern.h (struct image.hash):
15765 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15766 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15767 (hashfn_equal, hashfn_user_defined, make_hash_table)
15768 (maybe_resize_hash_table, hash_lookup, hash_put)
15769 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15770 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15771 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15772 * image.c (make_image, search_image_cache, lookup_image)
15773 (xpm_put_color_table_h):
15774 * lisp.h (struct Lisp_Hash_Table):
15775 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15776 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15777 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15778 * alloc.c (allocate_vectorlike):
15779 Check for overflow in vector size calculations.
15780 * ccl.c (ccl_driver):
15781 Check for overflow when converting EMACS_INT to int.
15782 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15783 need to be updated by these changes.
15784 * fns.c (make_hash_table, maybe_resize_hash_table):
15785 Check for integer overflow with large hash tables.
15786 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15787 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15788 (SXHASH_REDUCE): New macro.
15789 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15790 Use it instead of discarding useful hash info with large hash values.
15791 (sxhash_float): New function.
15792 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15793 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15794 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15795 Rewrite to use FIXNUM_BITS, as this simplifies things.
15796 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15797 Adjust signatures to match updated version of code.
15798 (consing_since_gc): Now EMACS_INT, since a single hash table can
15799 use more than INT_MAX bytes.
15800
15801 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15802
15803 Make it possible to build with GCC-4.6+ -O2 -flto.
15804
15805 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15806
15807 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15808
15809 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15810 Call minibuffer-inactive-mode.
15811
15812 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15813
15814 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15815 Update dependencies.
15816
15817 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15818
15819 * data.c (init_data): Remove code for UTS, this system is not
15820 supported anymore.
15821
15822 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15823
15824 Don't force ./temacs to start in terminal mode.
15825
15826 * frame.c (make_initial_frame): Initialize faces in all cases, not
15827 only when CANNOT_DUMP is defined.
15828 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15829
15830 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15831
15832 * dispnew.c (add_window_display_history): Use const for the string
15833 pointer. Remove declaration, not needed.
15834
15835 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15836
15837 Use 'inline', not 'INLINE'.
15838 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15839 * alloc.c, fontset.c (INLINE): Remove.
15840 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15841 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15842 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15843 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15844 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15845
15846 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15847
15848 Make it possible to run ./temacs.
15849
15850 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15851 syms_of_callproc does the same thing. Remove test for
15852 "initialized", do it in the caller.
15853 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15854
15855 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15856
15857 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15858 (read_minibuf): Use get_minibuffer.
15859 (syms_of_minibuf): Use DEFSYM.
15860 (Qmetadata): New var.
15861 * data.c (Qbuffer): Don't make it static.
15862 (syms_of_data): Use DEFSYM.
15863
15864 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15865
15866 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15867 (CCL_CODE_MIN): New macro.
15868
15869 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15870
15871 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15872
15873 * eval.c (Qdebug): Now static.
15874 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15875 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15876 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15877
15878 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15879
15880 * image.c: Various fixes to ImageMagick code comments.
15881 (Fimagemagick_types): Doc fix.
15882
15883 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15884
15885 Minor fixes prompted by GCC 4.6.0 warnings.
15886
15887 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15888
15889 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15890 (x_clipboard_manager_save_all): Move extern decl to ...
15891 * xterm.h: ... here, so that it can be checked for consistency.
15892
15893 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15894
15895 * xselect.c (x_clipboard_manager_save_frame)
15896 (x_clipboard_manager_save_all): New functions.
15897 (Fx_clipboard_manager_save): Lisp function deleted.
15898
15899 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15900 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15901
15902 * xterm.h: Update prototype.
15903
15904 2011-05-28 William Xu <william.xwl@gmail.com>
15905
15906 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15907 exiting (Bug#8239).
15908
15909 2011-05-28 Jim Meyering <meyering@redhat.com>
15910
15911 Avoid a sign-extension bug in crypto_hash_function.
15912 * fns.c (to_uchar): Define.
15913 (crypto_hash_function): Use it to convert some newly-signed
15914 variables to unsigned, to avoid sign-extension bugs. For example,
15915 without this change, (md5 "truc") would evaluate to
15916 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15917 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15918 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15919
15920 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15921
15922 Integer overflow fixes.
15923
15924 * dbusbind.c: Serial number integer overflow fixes.
15925 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15926 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15927 to hold a serial number that is too large for a fixnum.
15928 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15929 Check for serial numbers out of range. Decode any serial number
15930 that was so large that it became a float. (Bug#8722)
15931
15932 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15933 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15934 Use XFASTINT rather than XUINT when numbers are nonnegative.
15935 (xd_append_arg, Fdbus_method_return_internal):
15936 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15937 arguments, check that Lisp number is nonnegative, rather than
15938 silently wrapping negative numbers around. (Bug#8722)
15939 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15940 (Bug#8722)
15941
15942 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15943
15944 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15945
15946 ccl: Add integer overflow checks.
15947 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15948 (IN_INT_RANGE): New macros.
15949 (ccl_driver): Use them to check for integer overflow when
15950 decoding a CCL program. Many of the new checks are whether XINT (x)
15951 fits in int; it doesn't always, on 64-bit hosts. The new version
15952 doesn't catch all possible integer overflows, but it's an
15953 improvement. (Bug#8719)
15954
15955 * alloc.c (make_event_array): Use XINT, not XUINT.
15956 There's no need for unsigned here.
15957
15958 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15959 This follows up to the 2011-05-06 change that substituted uintptr_t
15960 for EMACS_INT. This case wasn't caught back then.
15961
15962 Rework Fformat to avoid integer overflow issues.
15963 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15964 now (part of C89). Include <verify.h>.
15965 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15966 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15967 (Fformat): Avoid the prepass trying to compute sizes; it was only
15968 approximate and thus did not catch overflow reliably. Instead, walk
15969 through the format just once, formatting and computing sizes as we go,
15970 checking for integer overflow at every step, and allocating a larger
15971 buffer as needed. Keep track separately whether the format is
15972 multibyte. Keep only the most-recently calculated precision, rather
15973 than them all. Record whether each argument has been converted to
15974 string. Use EMACS_INT, not int, for byte and char and arg counts.
15975 Support field widths and precisions larger than INT_MAX. Avoid
15976 sprintf's undefined behavior with conversion specifications such as %#d
15977 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15978 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15979 formatting out-of-range floating point numbers with int
15980 formats. (Bug#8668)
15981
15982 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15983
15984 * data.c: Avoid integer truncation in expressions involving floats.
15985 * data.c: Include <intprops.h>.
15986 (arith_driver): When there's an integer overflow in an expression
15987 involving floating point, convert the integers to floating point
15988 so that the resulting value does not suffer from catastrophic
15989 integer truncation. For example, on a 64-bit host (* 4
15990 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15991 Do not rely on undefined behavior after integer overflow.
15992
15993 merge count_size_as_multibyte, parse_str_to_multibyte
15994 * character.c, character.h (count_size_as_multibyte):
15995 Rename from parse_str_to_multibyte; all uses changed.
15996 Check for integer overflow.
15997 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15998 since it's now a duplicate of the other. This is more of
15999 a character than a buffer op, so better that it's in character.c.
16000 * fns.c, print.c: Adjust to above changes.
16001
16002 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16003
16004 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16005
16006 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16007
16008 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16009 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16010 (x_clipboard_manager_save): Now static.
16011 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16012
16013 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16014 (crypto_hash_function): Now static.
16015 Fix pointer signedness problems. Avoid unnecessary initializations.
16016
16017 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
16018
16019 * termhooks.h (Vselection_alist): Make it terminal-local.
16020
16021 * terminal.c (create_terminal): Initialize it.
16022
16023 * xselect.c: Support for clipboard managers.
16024 (Vselection_alist): Move to termhooks.h as terminal-local var.
16025 (LOCAL_SELECTION): New macro.
16026 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16027 (symbol_to_x_atom): Remove gratuitous arg.
16028 (x_handle_selection_request, lisp_data_to_selection_data)
16029 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
16030 (x_own_selection, x_get_local_selection, x_convert_selection):
16031 New arg, specifying work frame. Use terminal-local Vselection_alist.
16032 (some_frame_on_display): Delete unused function.
16033 (Fx_own_selection_internal, Fx_get_selection_internal)
16034 (Fx_disown_selection_internal, Fx_selection_owner_p)
16035 (Fx_selection_exists_p): New optional frame arg.
16036 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16037 (x_handle_selection_clear): Don't treat other terminals with the
16038 same keyboard specially. Use the terminal-local Vselection_alist.
16039 (x_clear_frame_selections): Use Frun_hook_with_args.
16040
16041 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16042
16043 * xterm.h: Add support for those atoms.
16044
16045 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
16046
16047 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16048 (converted_selections, conversion_fail_tag): New global variables.
16049 (x_selection_request_lisp_error): Free the above.
16050 (x_get_local_selection): Remove unnecessary code.
16051 (x_reply_selection_request): Args changed; handle arbitrary array
16052 of converted selections stored in converted_selections.
16053 Separate the XChangeProperty and SelectionNotify steps.
16054 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16055 (x_convert_selection): New function.
16056 (x_handle_selection_event): Simplify.
16057 (x_get_foreign_selection): Don't ignore incoming requests while
16058 waiting for an answer; this will fail when we implement
16059 SAVE_TARGETS, and seems unnecessary anyway.
16060 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16061 (Vx_sent_selection_functions): Doc fix.
16062
16063 2011-05-26 Leo Liu <sdl.web@gmail.com>
16064
16065 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16066
16067 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16068
16069 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16070
16071 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16072 for fringe update if it has periodic bitmap.
16073 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16074 and fringe_bitmap_periodic_p.
16075
16076 * fringe.c (get_fringe_bitmap_data): New function.
16077 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16078 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16079 row. Mark glyph row for fringe update if periodicity changed.
16080
16081 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16082 for fringe update unless it has periodic bitmap.
16083
16084 2011-05-25 Kenichi Handa <handa@m17n.org>
16085
16086 * xdisp.c (get_next_display_element): Set correct it->face_id for
16087 a static composition.
16088
16089 2011-05-24 Leo Liu <sdl.web@gmail.com>
16090
16091 * deps.mk (fns.o):
16092 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16093
16094 * fns.c (crypto_hash_function, Fsha1): New function.
16095 (Fmd5): Use crypto_hash_function.
16096 (syms_of_fns): Add Ssha1.
16097
16098 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16099
16100 * gnutls.c: Remove unused macros.
16101 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16102 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16103 Remove macros that are defined and never used.
16104 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16105
16106 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16107
16108 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16109 (Fx_get_selection_internal): Minor cleanup.
16110 (Fx_own_selection_internal): Rename arguments for consistency with
16111 select.el.
16112
16113 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16114
16115 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16116
16117 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16118
16119 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16120
16121 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16122
16123 * dispnew.c (scrolling_window): Don't exclude the case that the
16124 last enabled row in the desired matrix touches the bottom boundary.
16125
16126 2011-05-21 Glenn Morris <rgm@gnu.org>
16127
16128 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16129 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16130 and add some more files.
16131
16132 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16133
16134 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16135 report_file_error introduced by the change from 2011-05-07.
16136
16137 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16138
16139 * systime.h (Time): Define only if emacs is defined.
16140 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16141 where the include path doesn't have X11/X.h by default. See
16142 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16143
16144 2011-05-20 Kenichi Handa <handa@m17n.org>
16145
16146 * composite.c (find_automatic_composition): Fix previous change.
16147
16148 2011-05-20 Glenn Morris <rgm@gnu.org>
16149
16150 * lisp.mk: New file, split from Makefile.in.
16151 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16152 (shortlisp): Remove.
16153 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16154
16155 2011-05-19 Glenn Morris <rgm@gnu.org>
16156
16157 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16158 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16159 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16160 (lisp): Set the order to that of loadup.el.
16161 (shortlisp): Make it a copy of $lisp.
16162 (SOME_MACHINE_LISP): Remove.
16163 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16164 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16165
16166 2011-05-18 Kenichi Handa <handa@m17n.org>
16167
16168 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16169 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16170 (find_automatic_composition): Mostly rewrite for efficiency.
16171
16172 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16173
16174 * makefile.w32-in: Update dependencies.
16175
16176 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16177
16178 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16179 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16180
16181 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16182
16183 Fix some integer overflow issues, such as string length overflow.
16184
16185 * insdel.c (count_size_as_multibyte): Check for string overflow.
16186
16187 * character.c (lisp_string_width): Check for string overflow.
16188 Use EMACS_INT, not int, for string indexes and lengths; in
16189 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16190 the resulting string length overflows an EMACS_INT; instead,
16191 report a string overflow if no precision given. When checking for
16192 precision exhaustion, use a check that cannot possibly have
16193 integer overflow. (Bug#8675)
16194 * character.h (lisp_string_width): Adjust to new signature.
16195
16196 * alloc.c (string_overflow): New function.
16197 (Fmake_string): Use it. This doesn't change behavior, but saves
16198 a few bytes and will simplify future changes.
16199 * character.c (string_escape_byte8): Likewise.
16200 * lisp.h (string_overflow): New decl.
16201
16202 Fixups, following up to the user-interface timestamp change.
16203 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16204 for UI timestamps, instead of unsigned long.
16205 * msdos.c (mouse_get_pos): Likewise.
16206 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16207 * w32gui.h (Time): Define by including "systime.h" rather than by
16208 declaring it ourselves. (Bug#8664)
16209
16210 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16211 * image.c (clear_image_cache): Likewise.
16212
16213 * term.c (term_mouse_position): Don't assume time_t wraparound.
16214
16215 Be more systematic about user-interface timestamps.
16216 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16217 and sometimes 'EMACS_UINT', to represent these timestamps.
16218 This change causes it to use 'Time' uniformly, as that's what X uses.
16219 This makes the code easier to follow, and makes it easier to catch
16220 integer overflow bugs such as Bug#8664.
16221 * frame.c (Fmouse_position, Fmouse_pixel_position):
16222 Use Time, not unsigned long, for user-interface timestamps.
16223 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16224 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16225 * keyboard.h (last_event_timestamp): Likewise.
16226 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16227 * menu.h (xmenu_show): Likewise.
16228 * term.c (term_mouse_position): Likewise.
16229 * termhooks.h (struct input_event.timestamp): Likewise.
16230 (struct terminal.mouse_position_hook): Likewise.
16231 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16232 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16233 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16234 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16235 what it was before.
16236 * menu.h, termhooks.h: Include "systime.h", for Time.
16237
16238 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16239 Don't assume that the difference between two unsigned long values
16240 can fit into an integer. At this point, we know button_down_time
16241 <= event->timestamp, so the difference must be nonnegative, so
16242 there's no need to cast the result if double-click-time is
16243 nonnegative, as it should be; check that it's nonnegative, just in
16244 case. This bug is triggered when events are more than 2**31 ms
16245 apart (about 25 days). (Bug#8664)
16246
16247 * xselect.c (last_event_timestamp): Remove duplicate decl.
16248 (x_own_selection): Remove needless cast to unsigned long.
16249
16250 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16251 that always fit in int. Use a sentinel instead of a counter, to
16252 avoid a temp and to allay GCC's concerns about possible int overflow.
16253 * frame.h (struct frame): Use int for menu_bar_items_used
16254 instead of EMACS_INT, since it always fits in int.
16255
16256 * menu.c (grow_menu_items): Check for int overflow.
16257
16258 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16259
16260 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16261 Before, the code was not consistent. These values cannot exceed
16262 2**31 - 1 so there's no need to make them unsigned.
16263 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16264 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16265 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16266 as modifiers.
16267 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16268
16269 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16270 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16271 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16272 presumably because the widths might not match.
16273
16274 * window.c (size_window): Avoid needless test at loop start.
16275
16276 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16277
16278 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16279
16280 2011-05-12 Drew Adams <drew.adams@oracle.com>
16281
16282 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16283
16284 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16285
16286 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16287 `width' to `bar_area_x' and `bar_area_width', respectively.
16288 (x_scroll_run): Take account of fringe background extension.
16289
16290 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16291 Rename local vars `left' and `width' to `bar_area_x' and
16292 `bar_area_width', respectively.
16293 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16294 background extension.
16295
16296 2011-05-10 Jim Meyering <meyering@redhat.com>
16297
16298 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16299
16300 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16301
16302 * image.c (Finit_image_library): Return t for built-in image types,
16303 like pbm and xbm. (Bug#8640)
16304
16305 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16306
16307 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16308
16309 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16310
16311 * w32console.c (Fset_screen_color): Doc fix.
16312 (Fget_screen_color): New function.
16313 (syms_of_ntterm): Defsubr it.
16314
16315 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16316 unlink the temporary file if Fcall_process didn't create it in the
16317 first place.
16318 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16319 child process will be redirected to a file specified with `:file'.
16320 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16321 cue to call_process_cleanup not to close that handle.
16322
16323 2011-05-07 Ben Key <bkey76@gmail.com>
16324
16325 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16326 one of two shell specific rules, either bootstrap-temacs-CMD or
16327 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16328 to the previous implementation of the bootstrap-temacs rule.
16329 The bootstrap-temacs-CMD rule is similar to the previous
16330 implementation of the bootstrap-temacs rule except that it
16331 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16332 variable.
16333
16334 These changes, along with some changes to nt/configure.bat,
16335 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16336 earlier fix to add support for --cflags and --ldflags options
16337 that include quotes so that it works whether make uses cmd or
16338 sh as the shell.
16339
16340 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16341
16342 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16343 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16344 is a constant.
16345 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16346 a string. Handle both cases.
16347 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16348 (Fdbus_register_method): Use Qinvalid_function.
16349
16350 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16351
16352 * makefile.w32-in: Update dependencies.
16353 (LISP_H): Add inttypes.h and stdin.h.
16354 (PROCESS_H): Add unistd.h.
16355
16356 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16357
16358 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16359 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16360
16361 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16362
16363 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16364
16365 * term.c (vfatal): Remove stray call to va_end.
16366 It's not needed and the C Standard doesn't allow it here anyway.
16367
16368 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16369 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16370
16371 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16372 bytes.
16373
16374 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16375
16376 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16377
16378 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16379
16380 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16381
16382 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16383
16384 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16385 * charset.c (Fdefine_charset_internal): Don't initialize
16386 charset.code_space[15]. The value was garbage, on hosts with
16387 32-bit int (Bug#8600).
16388
16389 * lread.c (read_integer): Be more consistent with string-to-number.
16390 Use string_to_number to do the actual conversion; this avoids
16391 rounding errors and fixes some other screwups. Without this fix,
16392 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16393 (digit_to_number): Move earlier, for benefit of read_integer.
16394 Return -1 if the digit is out of range for the base, -2 if it is
16395 not a digit in any supported base. (Bug#8602)
16396
16397 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16398
16399 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16400 to match comment at start of function. This also removes a
16401 GCC warning about overflow in a 32+64-bit port.
16402
16403 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16404
16405 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16406 Reported by Stefan Monnier in
16407 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16408 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16409 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16410
16411 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16412 (EMACS_UINTPTR): Likewise, with uintptr_t.
16413
16414 * lisp.h: Prefer 64-bit EMACS_INT if available.
16415 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16416 on 32-bit hosts that have 64-bit int, so that they can access
16417 large files.
16418 However, temporarily disable this change unless the temporary
16419 symbol WIDE_EMACS_INT is defined.
16420
16421 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16422
16423 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16424 This removes an assumption that EMACS_INT and long are the same
16425 width as pointers. The assumption is true for Emacs porting targets
16426 now, but we want to make other targets possible.
16427 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16428 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16429 In the rest of the code, change types of integers that hold casted
16430 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16431 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16432 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16433 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16434 No need to cast type when ORing.
16435 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16436 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16437 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16438 assume EMACS_INT is the same width as char *.
16439 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16440 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16441 Remove no-longer-needed casts.
16442 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16443 (xg_tool_bar_help_callback, xg_make_tool_item):
16444 Use EMACS_INTPTR to hold an integer
16445 that will be cast to void *; this can avoid a GCC warning
16446 if EMACS_INT is not the same width as void *.
16447 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16448 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16449 (current_message_1, set_message_1):
16450 Use a local to convert to proper width without a cast.
16451 * xmenu.c (dialog_selection_callback): Likewise.
16452
16453 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16454 Also, don't assume VALBITS / RAND_BITS is less than 5,
16455 and don't rely on undefined behavior when shifting a 1 left into
16456 the sign bit.
16457 * lisp.h (get_random): Change signature to match.
16458
16459 * lread.c (hash_string): Use size_t, not int, for hash computation.
16460 Normally we prefer signed values; but hashing is special, because
16461 it's better to use unsigned division on hash table sizes so that
16462 the remainder is nonnegative. Also, size_t is the natural width
16463 for hashing into memory. The previous code used 'int', which doesn't
16464 retain enough info to hash well into very large tables.
16465 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16466
16467 * dbusbind.c: Don't possibly lose pointer info when converting.
16468 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16469 Use XPNTR rather than XHASH, so that the high-order bits of
16470 the pointer aren't lost when converting through void *.
16471
16472 * eval.c (Fautoload): Don't double-shift a pointer.
16473
16474 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16475
16476 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16477
16478 * gnutls.c (DEF_GNUTLS_FN):
16479 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16480
16481 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16482
16483 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16484 marker. (Bug#8610)
16485
16486 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16487
16488 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16489 New version that can reserve upto 2GB of heap space.
16490
16491 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16492
16493 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16494
16495 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16496
16497 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16498 `gnutls_certificate_set_x509_key_file'.
16499
16500 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16501
16502 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16503 Update dependencies.
16504
16505 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16506
16507 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16508 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16509 Remove unused parameter `fildes'.
16510 * process.c (read_process_output, send_process): Don't pass it.
16511
16512 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16513
16514 Fix previous change: the library cache is defined in w32.c.
16515 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16516 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16517
16518 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16519
16520 Implement dynamic loading of GnuTLS on Windows.
16521
16522 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16523 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16524 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16525 Declare.
16526
16527 * gnutls.c (Qgnutls_dll): Define.
16528 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16529 (gnutls_*): Declare function pointers.
16530 (init_gnutls_functions): New function to initialize function pointers.
16531 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16532 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16533 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16534 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16535 (emacs_gnutls_write, emacs_gnutls_read)
16536 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16537 (Fgnutls_available_p): New function.
16538 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16539 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16540 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16541
16542 * image.c: Include w32.h.
16543 (Vimage_type_cache): Delete.
16544 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16545 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16546 (w32_delayed_load): Move to w32.c.
16547
16548 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16549
16550 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16551 (w32_delayed_load): Move from image.c. When loading a library, record
16552 its filename in the :loaded-from property of the library id.
16553 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16554 Initialize and staticpro them.
16555 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16556
16557 * process.c: Include lisp.h before w32.h, not after.
16558 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16559 instead of gnutls_record_check_pending.
16560
16561 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16562
16563 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16564
16565 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16566 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16567 as passed in.
16568
16569 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16570
16571 * xterm.c (x_set_frame_alpha): Do not set property on anything
16572 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16573
16574 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16575
16576 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16577
16578 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16579
16580 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16581 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16582 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16583 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16584 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16585 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16586 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16587 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16588 (Qgnutls_bootprop_callbacks_verify): Make static.
16589
16590 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16591
16592 * callproc.c: Indentation fixup.
16593
16594 * sysdep.c (wait_for_termination_1): Make static.
16595 (wait_for_termination, interruptible_wait_for_termination):
16596 Move after wait_for_termination_1.
16597
16598 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16599
16600 * sysdep.c (interruptible_wait_for_termination): New function
16601 which is like wait_for_termination, but allows keyboard
16602 interruptions.
16603
16604 * callproc.c (Fcall_process): Add (:file "file") as an option for
16605 the STDOUT buffer.
16606 (Fcall_process_region): Ditto.
16607
16608 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16609
16610 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16611 rather than `XVECTOR (FOO)->size'.
16612
16613 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16614 inttypes.h, as a gnulib replacement is used if it not available in
16615 system headers.
16616
16617 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16618
16619 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16620 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16621 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16622
16623 * coding.c (coding_alloc_by_realloc): Error out if destination
16624 will grow beyond MOST_POSITIVE_FIXNUM.
16625 (decode_coding_emacs_mule): Abort if there isn't enough place in
16626 charbuf for the composition carryover bytes. Reserve an extra
16627 space for up to 2 characters produced in a loop.
16628 (decode_coding_iso_2022): Abort if there isn't enough place in
16629 charbuf for the composition carryover bytes.
16630
16631 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16632
16633 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16634 aborting when %lld or %lll format is passed.
16635 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16636 %llo or %llx format is passed. (Bug#8545)
16637
16638 * window.c (window_scroll_line_based): Use a marker instead of
16639 simple variables to record original value of point. (Bug#7952)
16640
16641 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16642 produced by %s or %c overflows available buffer space. (Bug#8545)
16643
16644 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16645
16646 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16647 (SIZE_MAX): Move defn after all includes, as they might #define it.
16648
16649 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16650
16651 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16652
16653 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16654
16655 * keyboard.c (Qdelayed_warnings_hook): Define.
16656 (command_loop_1): Run `delayed-warnings-hook'
16657 if Vdelayed_warnings_list is non-nil.
16658 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16659 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16660
16661 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16662
16663 * doprnt.c (doprnt): Don't return value smaller than the buffer
16664 size if the message was truncated. (Bug#8545).
16665
16666 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16667
16668 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16669 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16670
16671 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16672
16673 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16674
16675 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16676
16677 * makefile.w32-in: Update dependencies.
16678
16679 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16680
16681 Improve `doprnt' and its usage. (Bug#8545)
16682 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16683 `format_end'. Remove support for %l as a conversion specifier.
16684 Don't use xrealloc. Improve diagnostics when the %l size modifier
16685 is used. Update the commentary.
16686
16687 * eval.c (verror): Simplify calculation of size_t.
16688
16689 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16690 messages.
16691
16692 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16693
16694 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16695 change.
16696
16697 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16698
16699 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16700 This makes this file independent of the recent pseudovector change.
16701
16702 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16703
16704 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16705
16706 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16707 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16708 Remove unused local.
16709 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16710
16711 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16712 GCC 4.6.0 optimizes based on type-based alias analysis.
16713 For example, if b is of type struct buffer * and v of type struct
16714 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16715 != &v->size, and therefore "v->size = 1; b->size = 2; return
16716 v->size;" must therefore return 1. This assumption is incorrect
16717 for Emacs, since it type-puns struct Lisp_Vector * with many other
16718 types. To fix this problem, this patch adds a new type struct
16719 vectorlike_header that documents the constraints on layout of vectors
16720 and pseudovectors, and helps optimizing compilers not get fooled
16721 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16722 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16723 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16724 the size member.
16725 (XSETPVECTYPE): Rewrite in terms of new macro.
16726 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16727 This is a bit clearer, and further avoids the possibility of
16728 undesirable aliasing.
16729 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16730 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16731 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16732 since Lisp_Subr is a special case (no "next" field).
16733 (ASIZE): Now uses header.size rather than size.
16734 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16735 to avoid the hassle of writing XVECTOR (foo)->header.size.
16736 (struct vectorlike_header): New type.
16737 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16738 object, to help avoid aliasing.
16739 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16740 (SUBRP): Likewise, since Lisp_Subr is a special case.
16741 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16742 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16743 (struct Lisp_Hash_Table): Combine first two members into a single
16744 struct vectorlike_header member. All uses of "size" and "next" members
16745 changed to be "header.size" and "header.next".
16746 * buffer.h (struct buffer): Likewise.
16747 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16748 * frame.h (struct frame): Likewise.
16749 * process.h (struct Lisp_Process): Likewise.
16750 * termhooks.h (struct terminal): Likewise.
16751 * window.c (struct save_window_data, struct saved_window): Likewise.
16752 * window.h (struct window): Likewise.
16753 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16754 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16755 * buffer.c (init_buffer_once): Likewise.
16756 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16757 special case.
16758 * process.c (Fformat_network_address): Use local var for size,
16759 for brevity.
16760
16761 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16762
16763 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16764 * data.c (atof): Remove decl; no longer used or needed.
16765 (digit_to_number): Move to lread.c.
16766 (Fstring_to_number): Use new string_to_number function, to be
16767 consistent with how the Lisp reader treats infinities and NaNs.
16768 Do not assume that floating-point numbers represent EMACS_INT
16769 without losing information; this is not true on most 64-bit hosts.
16770 Avoid double-rounding errors, by insisting on integers when
16771 parsing non-base-10 numbers, as the documentation specifies.
16772 * lisp.h (string_to_number): New decl, replacing ...
16773 (isfloat_string): Remove.
16774 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16775 (read1): Do not accept +. and -. as integers; this
16776 appears to have been a coding error. Similarly, do not accept
16777 strings like +-1e0 as floating point numbers. Do not report
16778 overflow for integer overflows unless the base is not 10 which
16779 means we have no simple and reliable way to continue.
16780 Break out the floating-point parsing into a new
16781 function string_to_number, so that Fstring_to_number parses
16782 floating point numbers consistently with the Lisp reader.
16783 (digit_to_number): Move here from data.c. Make it static inline.
16784 (E_CHAR, EXP_INT): Remove, replacing with ...
16785 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16786 (string_to_number): New function, replacing isfloat_string.
16787 This function checks for valid syntax and produces the resulting
16788 Lisp float number too. Rework it so that string-to-number
16789 no longer mishandles examples like "1.0e+". Use strtoumax,
16790 so that overflow for non-base-10 numbers is reported only when
16791 there's no portable and simple way to convert to floating point.
16792
16793 * textprop.c (set_text_properties_1): Rewrite for clarity,
16794 and to avoid GCC warning about integer overflow.
16795
16796 * intervals.h (struct interval): Use EMACS_INT for members
16797 where EMACS_UINT might cause problems. See
16798 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16799 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16800 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16801 All uses changed.
16802 (offset_intervals): Tell GCC not to worry about length overflow
16803 when negating a negative length.
16804
16805 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16806 (overrun_check_free): Likewise.
16807
16808 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16809 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16810 word size.
16811
16812 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16813 (gnutls_make_error): Rename local to avoid shadowing.
16814 (gnutls_emacs_global_deinit): ifdef out; not used.
16815 (Fgnutls_boot): Use const for pointer to readonly storage.
16816 Comment out unused local. Fix pointer signedness problems.
16817
16818 * lread.c (openp): Don't stuff size_t into an 'int'.
16819 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16820 about possible signed overflow.
16821
16822 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16823 (GDK_KEY_g): Don't define if already defined.
16824 (xg_prepare_tooltip): Avoid pointer signedness problem.
16825 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16826
16827 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16828 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16829
16830 * xfns.c (Fx_window_property): Simplify a bit,
16831 to make a bit faster and to avoid GCC 4.6.0 warning.
16832 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16833
16834 * fns.c (internal_equal): Don't assume size_t fits in int.
16835
16836 * alloc.c (compact_small_strings): Tighten assertion a little.
16837
16838 Replace pEd with more-general pI, and fix some printf arg casts.
16839 * lisp.h (pI): New macro, generalizing old pEd macro to other
16840 conversion specifiers. For example, use "...%"pI"d..." rather
16841 than "...%"pEd"...".
16842 (pEd): Remove. All uses replaced with similar uses of pI.
16843 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16844 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16845 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16846 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16847 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16848 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16849 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16850 64-bit hosts.
16851 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16852 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16853 * print.c (safe_debug_print, print_object): Likewise.
16854 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16855 to int.
16856 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16857 avoiding the 0 flag, which is not portable.
16858 * process.c (Fmake_network_process): Use pI to avoid cast.
16859 * region-cache.c (pp_cache): Likewise.
16860 * xdisp.c (decode_mode_spec): Likewise.
16861 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16862 behavior on 64-bit hosts with printf arg.
16863 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16864 (x_stop_queuing_selection_requests): Likewise.
16865 (x_get_window_property): Don't truncate byte count to an 'int'
16866 when tracing.
16867
16868 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16869 here, since it parses constructs like leading '-' and spaces,
16870 which are not wanted; and it overflows with large numbers.
16871 Instead, simply match F[0-9]+, which is what is wanted anyway.
16872
16873 * alloc.c: Remove unportable assumptions about struct layout.
16874 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16875 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16876 (allocate_vectorlike, make_pure_vector): Use the new macros,
16877 plus offsetof, to remove unportable assumptions about struct layout.
16878 These assumptions hold on all porting targets that I know of, but
16879 they are not guaranteed, they're easy to remove, and removing them
16880 makes further changes easier.
16881
16882 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16883 This doesn't fix a bug but makes the code clearer.
16884 (string_overrun_cookie): Now const. Use initializers that
16885 don't formally overflow signed char, to avoid warnings.
16886 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16887 can cause Emacs to crash when string overrun checking is enabled.
16888 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16889 multiple of sizeof (EMACS_INT); it need not be, if
16890 alignof(EMACS_INT) < sizeof (EMACS_INT).
16891 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16892
16893 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16894
16895 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16896
16897 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16898
16899 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16900 supposed to be handshaking. (Bug#8556)
16901 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16902
16903 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16904
16905 * lisp.h (Qdebug): List symbol.
16906 * eval.c (Qdebug): Restore global linkage.
16907 * keyboard.c (debug-on-event): New variable.
16908 (handle_user_signal): Break into debugger when debug-on-event
16909 matches the current signal symbol.
16910
16911 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16912
16913 * alloc.c (check_sblock, check_string_bytes)
16914 (check_string_free_list): Convert to standard C.
16915
16916 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16917
16918 * w32.c (emacs_gnutls_push): Fix typo.
16919
16920 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16921
16922 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16923 "cast to pointer from integer of different size".
16924
16925 Improve doprnt and its use in verror. (Bug#8545)
16926 * doprnt.c (doprnt): Document the set of format control sequences
16927 supported by the function. Use SAFE_ALLOCA instead of always
16928 using `alloca'.
16929
16930 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16931 is one byte too soon. Don't use xrealloc; instead xfree and
16932 xmalloc anew.
16933
16934 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16935
16936 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16937 callbacks stage.
16938
16939 * gnutls.c: Renamed global_initialized to
16940 gnutls_global_initialized. Added internals for the
16941 :verify-hostname-error, :verify-error, and :verify-flags
16942 parameters of `gnutls-boot' and documented those parameters in the
16943 docstring. Start callback support.
16944 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16945 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16946 on error. Return error code.
16947 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16948 (emacs_gnutls_read): Likewise.
16949 (Fgnutls_boot): Return handshake error code.
16950 (emacs_gnutls_handle_error): New function.
16951 (wsaerror_to_errno): Likewise.
16952
16953 * w32.h (emacs_gnutls_pull): Add prototype.
16954 (emacs_gnutls_push): Likewise.
16955
16956 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16957 (emacs_gnutls_push): Likewise.
16958
16959 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16960
16961 * process.c (wait_reading_process_output): Check if GnuTLS
16962 buffered some data internally if no FDs are set for TLS
16963 connections.
16964
16965 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16966 (LIBS): Link to USER_LIBS.
16967 ($(BLD)/gnutls.$(0)): New target.
16968
16969 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16970
16971 * xdisp.c (handle_single_display_spec): Rename the
16972 display_replaced_before_p argument into display_replaced_p, to
16973 make it consistent with the commentary. Fix typos in the
16974 commentary.
16975
16976 * textprop.c (syms_of_textprop): Remove dead code.
16977 (copy_text_properties): Delete obsolete commentary about an
16978 interface that was deleted long ago. Fix typos in the description
16979 of arguments.
16980
16981 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16982 to changes in oldXMenu/XMenu.h from 2011-04-16.
16983 <menu_help_message, prev_menu_help_message>: Constify.
16984 (IT_menu_make_room): menu->help_text is now `const char **';
16985 adjust.
16986
16987 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16988 to changes in oldXMenu/XMenu.h from 2011-04-16.
16989 (struct XMenu): Declare `help_text' `const char **'.
16990
16991 * xfaces.c <Qunspecified>: Make extern again.
16992
16993 * syntax.c: Include sys/types.h before including regex.h, as
16994 required by POSIX.
16995
16996 * doc.c (get_doc_string): Improve the format passed to `error'.
16997
16998 * doprnt.c (doprnt): Improve commentary.
16999
17000 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17001
17002 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17003 them with etags.
17004
17005 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17006 changes in globals.h immediately force recompilation.
17007 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17008 $(CURDIR)/s/ms-w32.h.
17009 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
17010
17011 * character.c (Fchar_direction): Function deleted.
17012 (syms_of_character): Don't defsubr it.
17013 <char-direction-table>: Deleted.
17014
17015 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17016
17017 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17018 * doprnt.c: Include limits.h.
17019 (SIZE_MAX): New macro.
17020 (doprnt): Return a size_t value. 2nd arg is now size_t.
17021 Many local variables are now size_t instead of int or unsigned.
17022 Improve overflow protection. Support `l' modifier for integer
17023 conversions. Support %l conversion. Don't assume an EMACS_INT
17024 argument for integer conversions and for %c.
17025
17026 * lisp.h (doprnt): Restore prototype.
17027
17028 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17029 $(SRC)/character.h.
17030
17031 * Makefile.in (base_obj): Add back doprnt.o.
17032
17033 * deps.mk (doprnt.o): Add back prerequisites.
17034 (callint.o): Depend on character.h.
17035
17036 * eval.c (internal_lisp_condition_case): Include the handler
17037 representation in the error message.
17038 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17039 when breaking from the loop.
17040
17041 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17042
17043 * callint.c (Fcall_interactively): When displaying error message
17044 about invalid control letter, pass the character's codepoint, not
17045 a pointer to its multibyte form. Improve display of the character
17046 in octal and display also its hex code.
17047
17048 * character.c (char_string): Use %x to display the (unsigned)
17049 codepoint of an invalid character, to avoid displaying a bogus
17050 negative value.
17051
17052 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17053 `error', not SYMBOL_NAME itself.
17054
17055 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17056 character arguments to `error'.
17057
17058 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17059 to `error' in error message about FINAL_CHAR argument. Make sure
17060 FINAL_CHAR is a character, and use %c when it is passed as
17061 argument to `error'.
17062
17063 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17064
17065 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17066
17067 * w32.c: Include <time.h>.
17068 (sys_localtime): New function.
17069
17070 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17071
17072 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17073
17074 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17075
17076 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17077
17078 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17079 zombies (Bug#8467).
17080
17081 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17082
17083 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17084 gl_state.e_property when gl_state.object is Qt.
17085
17086 * insdel.c (make_gap_larger): Remove limitation of buffer size
17087 to <= INT_MAX.
17088
17089 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17090
17091 * xdisp.c (lookup_glyphless_char_display)
17092 (produce_glyphless_glyph): Handle cons cell entry in
17093 glyphless-char-display.
17094 (Vglyphless_char_display): Document it.
17095
17096 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17097 glyphless-char-display.
17098
17099 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17100
17101 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17102
17103 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17104
17105 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17106 definition for no-X builds.
17107
17108 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17109
17110 Static checks with GCC 4.6.0 and non-default toolkits.
17111
17112 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17113
17114 * process.c (keyboard_bit_set): Define only if SIGIO.
17115 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17116 (send_process): Repair possible setjmp clobbering.
17117
17118 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17119
17120 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17121
17122 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17123
17124 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17125 Define only if needed.
17126
17127 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17128 by pacifying GCC about it. Maybe it's time to retire it?
17129 * xfaces.c (USG, __TIMEVAL__): Likewise.
17130
17131 * dispextern.h (struct redisplay_interface): Rename param
17132 to avoid shadowing.
17133 * termhooks.h (struct terminal): Likewise.
17134 * xterm.c (xembed_send_message): Likewise.
17135
17136 * insdel.c (make_gap_smaller): Define only if
17137 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17138
17139 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17140 it.
17141
17142 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17143 so that we aren't warned about unused symbols.
17144
17145 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17146
17147 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17148
17149 * xfns.c (x_real_positions): Mark locals as initialized.
17150
17151 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17152
17153 * xterm.c: Fix problems found by static analysis with other toolkits.
17154 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17155 (x_dispatch_event): Declare static if USE_GTK, and
17156 define if USE_GTK || USE_X_TOOLKIT.
17157 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17158 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17159 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17160 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17161
17162 * xmenu.c (menu_help_callback): Pointer type fixes.
17163 Use const pointers when pointing at readonly data. Avoid pointer
17164 signedness clashes.
17165 (FALSE): Remove unused macro.
17166 (update_frame_menubar): Remove unused decl.
17167
17168 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17169
17170 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17171 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17172 (single_menu_item): Rename local to avoid shadowing.
17173
17174 * keyboard.c (make_lispy_event): Remove unused local var.
17175
17176 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17177 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17178
17179 * bitmaps: Change bitmaps from unsigned char back to the X11
17180 compatible char. Avoid the old compiler warnings about
17181 out-of-range initializers by using, for example, '\xab' rather
17182 than 0xab.
17183
17184 * xgselect.c (xgselect_initialize): Check vs interface
17185 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17186
17187 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17188
17189 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17190 to read-only memory.
17191
17192 * fns.c (vector): Remove; this old hack is no longer needed.
17193
17194 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17195 Remove unused var.
17196 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17197
17198 * xrdb.c (x_load_resources): Omit unused local.
17199
17200 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17201 (x_window): Rename locals to avoid shadowing.
17202 (USG): Use the kludged USG macro, to pacify gcc.
17203
17204 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17205 (x_term_init): Remove local to avoid shadowing.
17206
17207 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17208
17209 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17210 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17211
17212 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17213
17214 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17215
17216 Fix regex.c, syntax.c and friends for buffers > 2GB.
17217 * syntax.h (struct gl_state_s): Declare character position members
17218 EMACS_INT.
17219
17220 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17221
17222 * textprop.c (verify_interval_modification, interval_of):
17223 Declare arguments EMACS_INT.
17224
17225 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17226 EMACS_INT.
17227
17228 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17229
17230 * indent.c (Fvertical_motion): Local variable it_start is now
17231 EMACS_INT.
17232
17233 * regex.c (re_match, re_match_2, re_match_2_internal)
17234 (bcmp_translate, regcomp, regexec, print_double_string)
17235 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17236 (re_compile_pattern, re_exec): Declare arguments and local
17237 variables `size_t' and `ssize_t' and return values `regoff_t', as
17238 appropriate.
17239 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17240 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17241 <compile_stack_type>: `size' and `avail' are now `size_t'.
17242
17243 * regex.h <regoff_t>: Use ssize_t, not int.
17244 (re_search, re_search_2, re_match, re_match_2): Arguments that
17245 specify buffer/string position and length are now ssize_t and
17246 size_t. Return type is regoff_t.
17247
17248 2011-04-16 Ben Key <bkey76@gmail.com>
17249
17250 * nsfont.m: Fixed bugs in ns_get_family and
17251 ns_descriptor_to_entity that were caused by using free to
17252 deallocate memory blocks that were allocated by xmalloc (via
17253 xstrdup). This caused Emacs to crash when compiled with
17254 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17255 --enable-checking=xmallocoverrun). xfree is now used to
17256 deallocate these memory blocks.
17257
17258 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17259
17260 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17261
17262 emacs_write: Accept and return EMACS_INT for sizes.
17263 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17264 et seq.
17265 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17266 Accept and return EMACS_INT.
17267 (emacs_gnutls_write): Return the number of bytes written on
17268 partial writes.
17269 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17270 (emacs_read, emacs_write): Remove check for negative size, as the
17271 Emacs source code has been audited now.
17272 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17273 (emacs_read, emacs_write): Use it.
17274 * process.c (send_process): Adjust to the new signatures of
17275 emacs_write and emacs_gnutls_write. Do not attempt to store
17276 a byte offset into an 'int'; it might overflow.
17277 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17278
17279 * sound.c: Don't assume sizes fit in 'int'.
17280 (struct sound_device.period_size, alsa_period_size):
17281 Return EMACS_INT, not int.
17282 (struct sound_device.write, vox_write, alsa_write):
17283 Accept EMACS_INT, not int.
17284 (wav_play, au_play): Use EMACS_INT to store sizes and to
17285 record read return values.
17286
17287 2011-04-15 Ben Key <bkey76@gmail.com>
17288
17289 * keyboard.c (Qundefined): Don't declare static since it is used
17290 in nsfns.m.
17291 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17292 static since they are used in nsfont.m.
17293
17294 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17295
17296 * process.c (Qprocessp): Don't declare static.
17297 * lisp.h (Qprocessp): Declare again.
17298
17299 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17300
17301 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17302
17303 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17304
17305 Improve C-level modularity by making more things 'static'.
17306
17307 Don't publish debugger-only interfaces to other modules.
17308 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17309 (verify_bytepos, count_markers): Move decls to the only modules
17310 that need them.
17311 * region-cache.h (pp_cache): Likewise.
17312 * window.h (check_all_windows): Likewise.
17313 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17314
17315 * sysdep.c (croak): Now static, if
17316 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17317 * syssignal.h (croak): Declare only if not static.
17318
17319 * alloc.c (refill_memory_reserve): Now static if
17320 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17321 * lisp.h (refill_memory_reserve): Declare only if not static.
17322
17323 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17324 Define only if USE_LUCID.
17325
17326 * xrdb.c (x_customization_string, x_rm_string): Now static.
17327
17328 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17329 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17330
17331 * xdisp.c (draw_row_with_mouse_face): Now static.
17332 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17333
17334 * window.h (check_all_windows): Mark externally visible.
17335
17336 * window.c (window_deletion_count): Now static.
17337
17338 * undo.c: Make symbols static if they're not exported.
17339 (last_undo_buffer, last_boundary_position, pending_boundary):
17340 Now static.
17341
17342 * textprop.c (interval_insert_behind_hooks): Now static.
17343 (interval_insert_in_front_hooks): Likewise.
17344
17345 * term.c: Make symbols static if they're not exported.
17346 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17347 (max_frame_lines, tty_set_terminal_modes):
17348 (tty_reset_terminal_modes, tty_turn_off_highlight):
17349 (get_tty_terminal): Now static.
17350 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17351 * termhooks.h (term_mouse_moveto): Do not declare if
17352 HAVE_WINDOW_SYSTEM.
17353 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17354 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17355
17356 * sysdep.c: Make symbols static if they're not exported.
17357 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17358 Now static.
17359 (sigprocmask_set, full_mask): Remove; unused.
17360 (wait_debugging): Mark as visible.
17361 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17362 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17363
17364 * syntax.c (syntax_temp): Define only if !__GNUC__.
17365
17366 * sound.c (current_sound_device, current_sound): Now static.
17367
17368 * search.c (searchbufs, searchbuf_head): Now static.
17369
17370 * scroll.c (scroll_cost): Remove; unused.
17371 * dispextern.h (scroll_cost): Remove decl.
17372
17373 * region-cache.h (pp_cache): Mark as externally visible.
17374
17375 * process.c: Make symbols static if they're not exported.
17376 (process_tick, update_tick, create_process, chan_process):
17377 (Vprocess_alist, proc_buffered_char, datagram_access):
17378 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17379 (deactivate_process): Mark defn as static, as well as decl.
17380 * lisp.h (create_process): Remove decl.
17381 * process.h (chan_process, Vprocess_alist): Remove decls.
17382
17383 * print.c: Make symbols static if they're not exported.
17384 (print_depth, new_backquote_output, being_printed, print_buffer):
17385 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17386 (print_interval, print_number_index, initial_stderr_stream):
17387 Now static.
17388 * lisp.h (Fprinc): Remove decl.
17389 (debug_output_compilation_hack): Mark as externally visible.
17390
17391 * sysdep.c (croak): Move decl from here to syssignal.h.
17392 * syssignal.h (croak): Put it here, so the API can be checked when
17393 'croak' is called from dissociate_if_controlling_tty.
17394
17395 * minibuf.c: Make symbols static if they're not exported.
17396 (minibuf_save_list, choose_minibuf_frame): Now static.
17397 * lisp.h (choose_minibuf_frame): Remove decl.
17398
17399 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17400
17401 * lread.c: Make symbols static if they're not exported.
17402 (read_objects, initial_obarray, oblookup_last_bucket_number):
17403 Now static.
17404 (make_symbol): Remove; unused.
17405 * lisp.h (initial_obarray, make_symbol): Remove decls.
17406
17407 * keyboard.c: Make symbols static if they're not exported.
17408 (single_kboard, recent_keys_index, total_keys, recent_keys):
17409 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17410 (this_single_command_key_start, echoing, last_auto_save):
17411 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17412 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17413 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17414 (Vlispy_mouse_stem, double_click_count):
17415 Now static.
17416 (force_auto_save_soon): Define only if SIGDANGER.
17417 (ignore_mouse_drag_p): Now static if
17418 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17419 (print_help): Remove; unused.
17420 (stop_character, last_timer_event): Mark as externally visible.
17421 * keyboard.h (ignore_mouse_drag_p): Declare only if
17422 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17423 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17424 * lisp.h (echoing): Remove decl.
17425 (force_auto_save_soon): Declare only if SIGDANGER.
17426 * xdisp.c (redisplay_window): Simplify code, to make it more
17427 obvious that ignore_mouse_drag_p is not accessed if !defined
17428 USE_GTK && !defined HAVE_NS.
17429
17430 * intervals.c: Make symbols static if they're not exported.
17431 (merge_properties_sticky, merge_interval_right, delete_interval):
17432 Now static.
17433 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17434
17435 * insdel.c: Make symbols static if they're not exported.
17436 However, leave prepare_to_modify_buffer alone. It's never
17437 called from outside this function, but that appears to be a bug.
17438 (combine_after_change_list, combine_after_change_buffer):
17439 (adjust_after_replace, signal_before_change): Now static.
17440 (adjust_after_replace_noundo): Remove; unused.
17441 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17442 (signal_before_change): Remove decls.
17443
17444 * indent.c (val_compute_motion, val_vmotion): Now static.
17445
17446 * image.c: Make symbols static if they're not exported.
17447 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17448 if USE_GTK.
17449 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17450 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17451
17452 * fringe.c (standard_bitmaps): Now static.
17453 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17454
17455 * frame.c: Make symbols static if they're not exported.
17456 (x_report_frame_params, make_terminal_frame): Now static.
17457 (get_frame_param): Now static, unless HAVE_NS.
17458 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17459 (x_get_resource_string): Remove; not used.
17460 * frame.h (make_terminal_frame, x_report_frame_params):
17461 (x_get_resource_string); Remove decls.
17462 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17463 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17464
17465 * font.c, fontset.c: Make symbols static if they're not exported.
17466 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17467 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17468 * font.c (font_close_object): Now static.
17469 * font.h (font_close_object): Remove.
17470 * fontset.c (FONTSET_OBJLIST): Remove.
17471 (free_realized_fontset) #if-0 the body, which does nothing.
17472 (face_suitable_for_char_p): #if-0, as it's never called.
17473 * fontset.h (face_suitable_for_char_p): Remove decl.
17474 * xfaces.c (face_at_string_position):
17475 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17476 since 0 is always ASCII.
17477
17478 * fns.c (weak_hash_tables): Now static.
17479
17480 * fileio.c: Make symbols static if they're not exported.
17481 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17482 (Vwrite_region_annotation_buffers): Now static.
17483
17484 * eval.c: Make symbols static if they're not exported.
17485 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17486 * lisp.h (backtrace_list): Remove decl.
17487
17488 * emacs.c: Make symbols static if they're not exported.
17489 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17490 (fatal_error_code, fatal_error_signal_hook, standard_args):
17491 Now static.
17492 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17493 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17494 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17495 * lisp.h (fatal_error_signal_hook): Remove decl.
17496 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17497
17498 * editfns.c: Move a (normally-unused) function to its only use.
17499 * editfns.c, lisp.h (get_operating_system_release): Remove.
17500 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17501 worth the hassle of breaking this out.
17502
17503 * xterm.c: Make symbols static if they're not exported.
17504 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17505 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17506 (x_destroy_window, x_delete_display):
17507 Now static.
17508 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17509 (x_mouse_leave): Remove; unused.
17510 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17511 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17512 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17513 Remove decls.
17514 (x_mouse_leave): Declare only if WINDOWSNT.
17515 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17516 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17517 USE_X_TOOLKIT.
17518
17519 * ftxfont.c: Make symbols static if they're not exported.
17520 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17521 HAVE_FREETYPE.
17522 * font.h (ftxfont_driver): Likewise.
17523
17524 * xfns.c: Make symbols static if they're not exported.
17525 (x_last_font_name, x_display_info_for_name):
17526 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17527 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17528 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17529 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17530 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17531 (last_show_tip_args): Now static.
17532 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17533 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17534 (x_screen_planes): Remove; unused.
17535 * dispextern.h (x_screen_planes): Remove decl.
17536
17537 * dispnew.c: Make symbols static if they're not exported.
17538 * dispextern.h (redraw_garbaged_frames, scrolling):
17539 (increment_row_positions): Remove.
17540 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17541 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17542 Now static.
17543 (redraw_garbaged_frames): Remove; unused.
17544
17545 * xfaces.c: Make symbols static if they're not exported.
17546 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17547 Remove decls.
17548 * xterm.h (defined_color): Remove decls.
17549 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17550 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17551 (menu_face_changed_default, defined_color, free_realized_face):
17552 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17553 (ascii_face_of_lisp_face): Remove; unused.
17554
17555 * xdisp.c: Make symbols static if they're not exported.
17556 * dispextern.h (scratch_glyph_row, window_box_edges):
17557 (glyph_to_pixel_coords, set_cursor_from_row):
17558 (get_next_display_element, set_iterator_to_next):
17559 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17560 (show_mouse_face): Remove decls
17561 * frame.h (message_buf_print): Likewise.
17562 * lisp.h (pop_message, set_message, check_point_in_composition):
17563 Likewise.
17564 * xterm.h (set_vertical_scroll_bar): Likewise.
17565 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17566 (message_buf_print, scratch_glyph_row, displayed_buffer):
17567 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17568 (get_next_display_element, show_mouse_face, window_box_edges):
17569 (frame_to_window_pixel_xy, check_point_in_composition):
17570 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17571 (glyph_to_pixel_coords): Remove; unused.
17572
17573 * dired.c (file_name_completion): Now static.
17574
17575 * dbusbind.c (xd_in_read_queued_messages): Now static.
17576
17577 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17578 * data.c (circular_list_error): Remove.
17579
17580 * commands.h (last_point_position, last_point_position_buffer):
17581 (last_point_position_window): Remove decls.
17582 * keyboard.c: Make these variables static.
17583
17584 * coding.h (coding, code_convert_region, encode_coding_gap):
17585 Remove decls.
17586 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17587 (iso_code_class, detect_coding, code_convert_region): Now static.
17588 (encode_coding_gap): Remove; unused.
17589
17590 * chartab.c (chartab_chars, chartab_bits): Now static.
17591
17592 * charset.h (charset_iso_8859_1): Remove decl.
17593 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17594 Now static.
17595
17596 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17597 * ccl.c (Vccl_program_table): Now static.
17598 (check_ccl_update): Remove; unused.
17599
17600 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17601 * category.h: ... from here.
17602 * category.c (check_category_table, set_category_set): Now static.
17603
17604 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17605 * lisp.h: Remove these decls.
17606
17607 * buffer.c (buffer_count): Remove unused var.
17608
17609 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17610 so that it's not optimized away.
17611 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17612 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17613 exported only to the debugger.
17614
17615 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17616 * atimer.h (run_all_atimers): Remove; not exported.
17617
17618 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17619 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17620 was inaccessible from Lisp.
17621 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17622 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17623
17624 alloc.c: Import and export fewer symbols, and remove unused items.
17625 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17626 is defined.
17627 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17628 it's not optimized away by whole-program optimization.
17629 (message_enable_multibyte, free_misc): Remove.
17630 (catchlist, handlerlist, mark_backtrace):
17631 Declare only if BYTE_MARK_STACK.
17632 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17633 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17634 (message_enable_multibyte): Remove decl.
17635 (free_misc, interval_free_list, float_block, float_block_index):
17636 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17637 (cons_free_list, last_marked_index):
17638 Now static.
17639 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17640 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17641 (mark_backtrace): Define only if BYTE_MARK_STACK.
17642 * xdisp.c (message_enable_multibyte): Now static.
17643
17644 Declare Lisp_Object Q* variables to be 'static' if not exported.
17645 This makes it easier for human readers (and static analyzers)
17646 to see whether these variables are used from other modules.
17647 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17648 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17649 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17650 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17651 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17652 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17653 * xmenu.c, xselect.c:
17654 Declare Q* vars static if they are not used in other modules.
17655 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17656 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17657 Remove decls of unexported vars.
17658 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17659
17660 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17661
17662 Make Emacs functions such as Fatom 'static' by default.
17663 This makes it easier for human readers (and static analyzers)
17664 to see whether these functions can be called from other modules.
17665 DEFUN now defines a static function. To make the function external
17666 so that it can be used in other C modules, use the new macro DEFUE.
17667 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17668 (Finit_image_library):
17669 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17670 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17671 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17672 Remove decls, since these functions are now static.
17673 (Funintern, Fget_internal_run_time): New decls, since these functions
17674 were already external.
17675
17676 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17677 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17678 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17679 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17680 * keyboard.c, keymap.c, lread.c:
17681 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17682 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17683 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17684 Mark functions with DEFUE instead of DEFUN,
17685 if they are used in other modules.
17686 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17687 decls for now-static functions.
17688 * buffer.h (Fdelete_overlay): Remove decl.
17689 * callproc.c (Fgetenv_internal): Mark as internal.
17690 * composite.c (Fremove_list_of_text_properties): Remove decl.
17691 (Fcomposition_get_gstring): New forward static decl.
17692 * composite.h (Fcomposite_get_gstring): Remove decl.
17693 * dired.c (Ffile_attributes): New forward static decl.
17694 * doc.c (Fdocumntation_property): New forward static decl.
17695 * eval.c (Ffetch_bytecode): New forward static decl.
17696 (Funintern): Remove extern decl; now in .h file where it belongs.
17697 * fileio.c (Fmake_symbolic_link): New forward static decl.
17698 * image.c (Finit_image_library): New forward static decl.
17699 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17700 * intervals.h (Fprevious_property_change):
17701 (Fremove_list_of_text_properties): Remove decls.
17702 * keyboard.c (Fthis_command_keys): Remove decl.
17703 (Fcommand_execute): New forward static decl.
17704 * keymap.c (Flookup_key): New forward static decl.
17705 (Fcopy_keymap): Now static.
17706 * keymap.h (Flookup_key): Remove decl.
17707 * process.c (Fget_process): New forward static decl.
17708 (Fprocess_datagram_address): Mark as internal.
17709 * syntax.c (Fsyntax_table_p): New forward static decl.
17710 (skip_chars): Remove duplicate decl.
17711 * textprop.c (Fprevious_property_change): New forward static decl.
17712 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17713 Now internal.
17714 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17715 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17716
17717 * editfns.c (Fformat): Remove unreachable code.
17718
17719 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17720
17721 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17722 change. (Bug#8496)
17723
17724 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17725
17726 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17727 when at ZV. (Bug#8487)
17728
17729 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17730
17731 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17732 (Bug#8437)
17733 * keyboard.c (parse_tool_bar_item): Likewise.
17734 * sound.c (sound_cleanup, alsa_close): Likewise.
17735 * termcap.c (tgetent): Likewise.
17736 * xfns.c (x_default_font_parameter): Likewise.
17737 * xsettings.c (read_and_apply_settings): Likewise.
17738
17739 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17740 (overrun_check_free): Protoize.
17741
17742 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17743
17744 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17745 since callers should never pass a negative size.
17746 Change the signature to match that of plain 'read' and 'write'; see
17747 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17748 * lisp.h: Update prototypes of emacs_write and emacs_read.
17749
17750 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17751
17752 * xdisp.c (redisplay_window): Don't try to determine the character
17753 position of the scroll margin if the window start point w->startp
17754 is outside the buffer's accessible region. (Bug#8468)
17755
17756 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17757
17758 Fix write-region and its subroutines for buffers > 2GB.
17759 * fileio.c (a_write, e_write): Modify declaration of arguments and
17760 local variables to support buffers larger than 2GB.
17761 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17762
17763 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17764 argument, local variables, and return value.
17765
17766 * lisp.h: Update prototypes of emacs_write and emacs_read.
17767
17768 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17769
17770 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17771
17772 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17773
17774 Fix more problems found by GCC 4.6.0's static checks.
17775
17776 * xdisp.c (vmessage): Use a better test for character truncation.
17777
17778 * charset.c (load_charset_map): <, not <=, for optimization,
17779 and to avoid potential problems with integer overflow.
17780 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17781 * casetab.c (set_identity, shuffle): Likewise.
17782 * editfns.c (Fformat): Likewise.
17783 * syntax.c (skip_chars): Likewise.
17784
17785 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17786 This also lets GCC 4.6.0 generate slightly better loop code.
17787
17788 * callint.c (Fcall_interactively): <, not <=, for optimization.
17789 (Fcall_interactively): Count the number of arguments produced,
17790 not the number of arguments given. This is simpler and lets GCC
17791 4.6.0 generate slightly better code.
17792
17793 * ftfont.c: Distingish more carefully between FcChar8 and char.
17794 The previous code passed unsigned char * to a functions like
17795 strlen and xstrcasecmp that expect char *, which does not
17796 conform to the C standard.
17797 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17798 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17799 char * when the C standard requires it.
17800
17801 * keyboard.c (read_char): Remove unused var.
17802
17803 * eval.c: Port to Windows vsnprintf (Bug#8435).
17804 Include <limits.h>.
17805 (SIZE_MAX): Define if the headers do not.
17806 (verror): Do not give up if vsnprintf returns a negative count.
17807 Instead, grow the buffer. This ports to Windows vsnprintf, which
17808 does not conform to C99. Problem reported by Eli Zaretskii.
17809 Also, simplify the allocation scheme, by avoiding the need for
17810 calling realloc, and removing the ALLOCATED variable.
17811
17812 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17813
17814 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17815 But keep the doprint source code for now, as we might revamp it
17816 and use it again (Bug#8435).
17817 * lisp.h (doprnt): Remove.
17818 * Makefile.in (base_obj): Remove doprnt.o.
17819 * deps.mk (doprnt.o): Remove.
17820
17821 error: Print 32- and 64-bit integers portably (Bug#8435).
17822 Without this change, on typical 64-bit hosts error ("...%d...", N)
17823 was used to print both 32- and 64-bit integers N, which relied on
17824 undefined behavior.
17825 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17826 * lisp.h (error, verror): Mark as printf-like functions.
17827 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17828 Report overflow in size calculations when allocating printf buffer.
17829 Do not truncate output string at its first null byte.
17830 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17831 Truncate the output at a character boundary, since vsnprintf does not
17832 do that.
17833 * charset.c (check_iso_charset_parameter): Convert internal
17834 character to string before calling 'error', since %c now has the
17835 printf meaning.
17836 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17837 overflow when computing char to be passed to 'error'. Do not
17838 pass Lisp_Object to 'error'; pass the integer instead.
17839 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17840 formatted with plain %d.
17841
17842 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17843
17844 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17845
17846 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17847
17848 * xterm.c (x_catch_errors): Remove duplicate declaration.
17849
17850 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17851
17852 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17853
17854 2011-04-10 Jim Meyering <meyering@redhat.com>
17855
17856 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17857 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17858 return ssize_t not "int", and use size_t as the buffer length.
17859 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17860 * gnutls.h: Update declarations.
17861 * process.c (read_process_output): Use ssize_t, to match.
17862 (send_process): Likewise.
17863
17864 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17865
17866 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17867
17868 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17869
17870 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17871 Use unsigned char, to match FcChar8 type definition.
17872
17873 * xterm.c (handle_one_xevent):
17874 * xmenu.c (create_and_show_popup_menu):
17875 * xselect.c (x_decline_selection_request)
17876 (x_reply_selection_request): Avoid type-punned deref of X events.
17877
17878 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17879
17880 Fix some uses of `int' instead of EMACS_INT.
17881 * search.c (string_match_1, fast_string_match)
17882 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17883 (scan_buffer, find_next_newline_no_quit)
17884 (find_before_next_newline, search_command, Freplace_match)
17885 (Fmatch_data): Make some `int' variables be EMACS_INT.
17886
17887 * xdisp.c (display_count_lines): 3rd argument and return value now
17888 EMACS_INT. All callers changed.
17889 (pint2hrstr): Last argument is now EMACS_INT.
17890
17891 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17892 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17893 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17894 (decode_coding_utf_16, decode_coding_emacs_mule)
17895 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17896 (decode_coding_ccl, decode_coding_charset)
17897 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17898 (decode_coding_iso_2022, decode_coding_emacs_mule)
17899 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17900 <char_offset, last_offset>: Declare EMACS_INT.
17901 (encode_coding_utf_8, encode_coding_utf_16)
17902 (encode_coding_emacs_mule, encode_invocation_designation)
17903 (encode_designation_at_bol, encode_coding_iso_2022)
17904 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17905 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17906 Declare EMACS_INT.
17907 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17908 (encode_invocation_designation): Last argument P_NCHARS is now
17909 EMACS_INT.
17910 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17911 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17912
17913 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17914 All users changed.
17915
17916 * ccl.c (Fccl_execute_on_string): Declare some variables
17917 EMACS_INT.
17918
17919 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17920
17921 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17922
17923 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17924
17925 * process.c (Fformat_network_address): Doc fix.
17926
17927 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17928
17929 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17930
17931 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17932
17933 * keyboard.c (read_char): Call Lisp function help-form-show,
17934 instead of using internal_with_output_to_temp_buffer.
17935 (Qhelp_form_show): New var.
17936 (syms_of_keyboard): Use DEFSYM macro.
17937
17938 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17939
17940 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17941
17942 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17943
17944 * process.c (Flist_processes): Remove to Lisp.
17945 (list_processes_1): Delete.
17946
17947 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17948
17949 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17950
17951 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17952
17953 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17954
17955 Fix more problems found by GCC 4.6.0's static checks.
17956
17957 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17958
17959 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17960
17961 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17962
17963 * xdisp.c (vmessage): Mark as a printf-like function.
17964
17965 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17966
17967 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17968
17969 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17970 printf-like functions.
17971 (tiff_load): Add casts to remove these marks before passing them
17972 to system-supplied API.
17973
17974 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17975
17976 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17977 This avoids several warnings with gcc -Wstrict-overflow.
17978 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17979 directly, rather than having caller test rule sign. This avoids
17980 some unnecessary tests.
17981 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17982 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17983 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17984
17985 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17986 (xfont_open): Avoid unnecessary tests.
17987
17988 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17989
17990 * composite.h, composite.c (composition_gstring_put_cache):
17991 Use EMACS_INT, not int, for length.
17992
17993 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17994 breaking out part of COMPOSITION_DECODE_RULE.
17995 (COMPOSITION_DECODE_RULE): Use it.
17996 * composite.c (get_composition_id): Remove unused local vars,
17997 by using the new macro.
17998
17999 * textprop.c (set_text_properties_1): Change while to do-while,
18000 since the condition is always true at first.
18001
18002 * intervals.c (graft_intervals_into_buffer): Mark var as used.
18003 (interval_deletion_adjustment): Return unsigned value.
18004 All uses changed.
18005
18006 * process.c (list_processes_1, create_pty, read_process_output):
18007 (exec_sentinel): Remove vars that were set but not used.
18008 (create_pty): Remove unnecessary "volatile"s.
18009 (Fnetwork_interface_info): Avoid possibility of int overflow.
18010 (read_process_output): Do adaptive read buffering even if carryover.
18011 (read_process_output): Simplify nbytes computation if buffered.
18012
18013 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18014
18015 * syntax.c (scan_words): Remove var that was set but not used.
18016 (update_syntax_table): Use unsigned instead of int.
18017
18018 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
18019 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
18020 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
18021
18022 * print.c (print_error_message): Avoid int overflow.
18023
18024 * font.c (font_list_entities): Redo for clarity,
18025 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18026
18027 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
18028 (font_score): Avoid potential overflow in diff calculation.
18029
18030 * fns.c (substring_both): Remove var that is set but not used.
18031 (sxhash): Redo loop for clarity and to avoid wraparound warning.
18032
18033 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18034
18035 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18036 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18037 can always succeed if overflow has undefined behavior.
18038
18039 * search.c (boyer_moore, wordify): Remove vars set but not used.
18040 (wordify): Omit three unnecessary tests.
18041
18042 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18043 All callers changed. This avoids the need for an unused var.
18044
18045 * casefiddle.c (casify_region): Remove var that is set but not used.
18046
18047 * dired.c (file_name_completion): Remove var that is set but not used.
18048
18049 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18050
18051 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
18052 (Finsert_file_contents): Remove unnecessary code checking fd.
18053
18054 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18055 Check for integer overflow on size calculations.
18056
18057 * buffer.c (Fprevious_overlay_change): Remove var that is set
18058 but not used.
18059
18060 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18061 Remove vars that are set but not used.
18062 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18063 (timer_check_2): Mark vars as initialized.
18064
18065 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18066
18067 * image.c (lookup_image): Remove var that is set but not used.
18068 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18069
18070 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18071 that are set but not used.
18072
18073 * xfns.c (make_invisible_cursor): Don't return garbage
18074 if XCreateBitmapFromData fails (Bug#8410).
18075
18076 * xselect.c (x_get_local_selection, x_handle_property_notify):
18077 Remove vars that are set but not used.
18078
18079 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18080 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18081
18082 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18083 Remove var that is set but not used.
18084 (scroll_bar_windows_size): Now size_t, not int.
18085 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18086 Check for overflow.
18087
18088 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18089 (map_tty_color) [!defined MSDOS]: Likewise.
18090
18091 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18092
18093 * coding.c: Remove vars that are set but not used.
18094 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18095 All callers changed.
18096 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18097 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18098 (decode_coding_charset): Remove vars that are set but not used.
18099
18100 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18101 that is set but not used.
18102
18103 * print.c (print_object): Remove var that is set but not used.
18104
18105 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18106 The gnulib version avoids calling malloc in the usual case,
18107 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18108 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18109 * filelock.c (current_lock_owner): Likewise.
18110 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18111 * sysdep.c: Include allocator.h, careadlinkat.h.
18112 (emacs_no_realloc_allocator): New static constant.
18113 (emacs_readlink): New function.
18114 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18115 ../lib/careadlinkat.h.
18116
18117 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18118
18119 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18120 first non-nil return value).
18121
18122 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18123
18124 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18125 if not defined (Bug#8403).
18126
18127 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18128
18129 * xdisp.c (display_count_lines): Remove parameter `start',
18130 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18131 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18132 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18133 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18134 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18135 and thereabouts. All callers changed.
18136 (get_per_char_metric): Remove parameter `f', unused since
18137 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18138
18139 2011-04-02 Jim Meyering <meyering@redhat.com>
18140
18141 do not dereference NULL upon failed strdup
18142 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18143 (ns_get_family): Likewise.
18144
18145 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18146
18147 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18148
18149 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18150
18151 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18152 later (Bug#8403).
18153
18154 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18155
18156 Add lexical binding.
18157
18158 * window.c (Ftemp_output_buffer_show): New fun.
18159 (Fsave_window_excursion):
18160 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18161
18162 * lread.c (lisp_file_lexically_bound_p): New function.
18163 (Fload): Bind Qlexical_binding.
18164 (readevalloop): Remove `evalfun' arg.
18165 Bind Qinternal_interpreter_environment.
18166 (Feval_buffer): Bind Qlexical_binding.
18167 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18168 Mark as dynamic.
18169 (syms_of_lread): Declare `lexical-binding'.
18170
18171 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18172
18173 * keyboard.c (eval_dyn): New fun.
18174 (menu_item_eval_property): Use it.
18175
18176 * image.c (parse_image_spec): Use Ffunctionp.
18177
18178 * fns.c (concat, mapcar1): Accept byte-code-functions.
18179
18180 * eval.c (Fsetq): Handle lexical vars.
18181 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18182 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18183 (FletX, Flet): Obey lexical binding.
18184 (Fcommandp): Handle closures.
18185 (Feval): New `lexical' arg.
18186 (eval_sub): New function extracted from Feval. Use it almost
18187 everywhere where Feval was used. Look up vars in lexical env.
18188 Handle closures.
18189 (Ffunctionp): Move from subr.el.
18190 (Ffuncall): Handle closures.
18191 (apply_lambda): Remove `eval_flags'.
18192 (funcall_lambda): Handle closures and new byte-code-functions.
18193 (Fspecial_variable_p): New function.
18194 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18195 but without exporting it to Lisp.
18196
18197 * doc.c (Fdocumentation, store_function_docstring):
18198 * data.c (Finteractive_form): Handle closures.
18199
18200 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18201 interactive spec.
18202
18203 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18204 New byte-codes.
18205 (exec_byte_code): New function extracted from Fbyte_code to handle new
18206 calling convention for byte-code-functions. Add new byte-codes.
18207
18208 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18209
18210 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18211
18212 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18213
18214 * xdisp.c (redisplay_internal): Fix prototype.
18215
18216 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18217
18218 * xdisp.c (SCROLL_LIMIT): New macro.
18219 (try_scrolling): Use it when setting scroll_limit.
18220 Limit scrolling to 100 screen lines.
18221 (redisplay_window): Even when falling back on "recentering",
18222 position point in the window according to scroll-conservatively,
18223 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18224
18225 (try_scrolling): When point is above the window, allow searching
18226 as far as scroll_max, or one screenful, to compute vertical
18227 distance from PT to the scroll margin position. This prevents
18228 try_scrolling from unnecessarily failing when
18229 scroll-conservatively is set to a value slightly larger than the
18230 window height. Clean up the case of PT below the margin at bottom
18231 of window: scroll_max can no longer be INT_MAX. When aggressive
18232 scrolling is in use, don't let point enter the opposite scroll
18233 margin as result of the scroll.
18234 (syms_of_xdisp) <scroll-conservatively>: Document the
18235 threshold of 100 lines for never-recentering scrolling.
18236
18237 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18238
18239 * dispextern.h (move_it_by_lines):
18240 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18241 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18242 (message_log_check_duplicate): Remove parameters `prev_bol' and
18243 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18244 (redisplay_internal): Remove parameter `preserve_echo_area',
18245 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18246
18247 * indent.c (Fvertical_motion):
18248 * window.c (window_scroll_pixel_based, Frecenter):
18249 Don't pass `need_y_p' to `move_it_by_lines'.
18250
18251 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18252
18253 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18254 steal a few bits to be more compact.
18255 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18256 Remove unneeded casts.
18257
18258 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18259
18260 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18261
18262 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18263 binding" message (bug#7967).
18264
18265 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18266
18267 Fix more problems found by GCC 4.6.0's static checks.
18268
18269 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18270 Remove unused local var.
18271
18272 * editfns.c (Fmessage_box): Remove unused local var.
18273
18274 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18275 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18276 Omit unused local vars.
18277 * window.c (shrink_windows): Omit unused local var.
18278 * menu.c (digest_single_submenu): Omit unused local var.
18279 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18280 Omit unused local var.
18281
18282 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18283 Don't assume string length fits in int.
18284 (keyremap_step, read_key_sequence): Use size_t for sizes.
18285 (read_key_sequence): Don't check last_real_key_start redundantly.
18286
18287 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18288 instead of alloca (Bug#8344).
18289
18290 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18291 (Fbacktrace_frame): Don't assume nframes fits in int.
18292
18293 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18294
18295 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18296 concerns.
18297
18298 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18299
18300 * cm.c (calccost): Turn while-do into do-while, for clarity.
18301
18302 * keyboard.c (syms_of_keyboard): Use the same style as later
18303 in this function when indexing through an array. This also
18304 works around GCC bug 48267.
18305
18306 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18307
18308 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18309
18310 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18311 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18312
18313 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18314 This avoids undefined behavior on integer overflow, and is a bit
18315 more convenient anyway since it is compared to a size_t variable.
18316
18317 Variadic C functions now count arguments with size_t, not int.
18318 This avoids an unnecessary limitation on 64-bit machines, which
18319 caused (substring ...) to crash on large vectors (Bug#8344).
18320 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18321 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18322 All variadic functions and their callers changed accordingly.
18323 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18324 * data.c (arith_driver, float_arith_driver): Likewise.
18325 * editfns.c (general_insert_function): Likewise.
18326 * eval.c (struct backtrace.nargs, interactive_p)
18327 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18328 (funcall_lambda, mark_backtrace): Likewise.
18329 * fns.c (concat): Likewise.
18330 * frame.c (x_set_frame_parameters): Likewise.
18331 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18332 0 if not found, not -1. All callers changed.
18333
18334 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18335 (stack_copy_size): Now size_t, not int.
18336 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18337
18338 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18339
18340 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18341 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18342 All callers changed.
18343
18344 * lisp.h (multibyte_char_to_unibyte):
18345 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18346 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18347 * character.h (CHAR_TO_BYTE8):
18348 * cmds.c (internal_self_insert):
18349 * editfns.c (general_insert_function):
18350 * keymap.c (push_key_description):
18351 * search.c (Freplace_match):
18352 * xdisp.c (message_dolog, set_message_1): All callers changed.
18353
18354 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18355
18356 * keyboard.c (safe_run_hook_funcall): New function.
18357 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18358 don't set the hook to nil, but remove the offending function instead.
18359 (Qcommand_hook_internal): Remove, unused.
18360 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18361 Vcommand_hook_internal.
18362
18363 * eval.c (enum run_hooks_condition): Remove.
18364 (funcall_nil, funcall_not): New functions.
18365 (run_hook_with_args): Call each function through a `funcall' argument.
18366 Remove `cond' argument, now redundant.
18367 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18368 (Frun_hook_with_args_until_failure): Adjust accordingly.
18369 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18370
18371 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18372
18373 * dispextern.h (string_buffer_position): Remove declaration.
18374
18375 * print.c (strout): Remove parameter `multibyte', unused since
18376 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18377
18378 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18379 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18380 All callers changed.
18381
18382 * w32.c (_wsa_errlist): Use braces for struct initializers.
18383
18384 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18385 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18386 All callers changed.
18387 (string_buffer_position): Likewise. Also, make static (it's never
18388 used outside xdisp.c).
18389 (cursor_row_p): Remove parameter `w', unused since
18390 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18391 (decode_mode_spec): Remove parameter `precision', introduced during
18392 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18393 All callers changed.
18394
18395 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18396
18397 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18398
18399 2011-03-27 Anders Lindgren <andlind@gmail.com>
18400
18401 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18402 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18403 (ns_update_auto_hide_menu_bar): New functions.
18404 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18405 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18406 ns_constrain_all_frames.
18407 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18408 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18409
18410 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18411
18412 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18413
18414 2011-03-27 Glenn Morris <rgm@gnu.org>
18415
18416 * syssignal.h: Replace RETSIGTYPE with void.
18417 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18418 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18419 Replace SIGTYPE with void everywhere.
18420 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18421 * s/template.h (SIGTYPE): Remove commented out definition.
18422
18423 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18424
18425 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18426 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18427
18428 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18429
18430 * w32.c (read_unc_volume): Use parameter `henum', instead of
18431 global variable `wget_enum_handle'.
18432
18433 * keymap.c (describe_vector): Remove parameters `indices' and
18434 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18435 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18436
18437 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18438
18439 * keyboard.c (timer_check): Remove parameter `do_it_now',
18440 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18441 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18442 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18443
18444 * keyboard.c (read_char):
18445 * w32menu.c (w32_menu_display_help):
18446 * xmenu.c (show_help_event, menu_help_callback):
18447 Adjust calls to `show_help_echo'.
18448
18449 * gtkutil.c (xg_maybe_add_timer):
18450 * keyboard.c (readable_events):
18451 * process.c (wait_reading_process_output):
18452 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18453
18454 * insdel.c (adjust_markers_gap_motion):
18455 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18456 (gap_left, gap_right): Don't call it.
18457
18458 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18459
18460 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18461 incurred during fontification.
18462
18463 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18464
18465 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18466 (DEFVAR_PER_BUFFER): Don't pass it.
18467
18468 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18469 (scrolling_window): Don't pass it.
18470
18471 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18472
18473 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18474
18475 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18476 and `suffix'.
18477 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18478 of variables specific to SELinux and computation of `encoded_absname'.
18479
18480 * image.c (XPutPixel): Remove unused variable `height'.
18481
18482 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18483
18484 * unexw32.c (get_section_info): Remove unused variable `section'.
18485
18486 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18487 (system_process_attributes): Remove unused variable `sess'.
18488 (sys_read): Remove unused variable `err'.
18489
18490 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18491 (w32_wnd_proc): Remove unused variable `isdead'.
18492 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18493 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18494 (x_create_tip_frame): Remove unused variable `tem'.
18495
18496 * w32inevt.c (w32_console_read_socket):
18497 Remove unused variable `no_events'.
18498
18499 * w32term.c (x_draw_composite_glyph_string_foreground):
18500 Remove unused variable `width'.
18501
18502 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18503
18504 * w32term.c (x_set_glyph_string_clipping):
18505 Don't pass uninitialized region to CombineRgn.
18506
18507 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18508
18509 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18510 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18511 (Fx_close_connection): Remove unused variable `i'.
18512
18513 * w32font.c (w32font_draw): Return number of glyphs.
18514 (w32font_open_internal): Remove unused variable `i'.
18515 (w32font_driver): Add missing initializer.
18516
18517 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18518 (fill_in_menu): Remove unused variable `items_added'.
18519
18520 * w32term.c (last_mouse_press_frame): Remove static global variable.
18521 (w32_clip_to_row): Remove unused variable `f'.
18522 (x_delete_terminal): Remove unused variable `i'.
18523
18524 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18525 (NOTHING): Remove unused static global variable.
18526 (uniscribe_check_otf): Remove unused variable `table'.
18527 (uniscribe_font_driver): Add missing initializers.
18528
18529 2011-03-23 Julien Danjou <julien@danjou.info>
18530
18531 * term.c (Fsuspend_tty, Fresume_tty):
18532 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18533 * window.c (temp_output_buffer_show):
18534 * insdel.c (signal_before_change):
18535 * frame.c (Fhandle_switch_frame):
18536 * fileio.c (Fdo_auto_save):
18537 * emacs.c (Fkill_emacs):
18538 * editfns.c (save_excursion_restore):
18539 * cmds.c (internal_self_insert):
18540 * callint.c (Fcall_interactively):
18541 * buffer.c (Fkill_all_local_variables):
18542 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18543 Use Frun_hooks.
18544 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18545 unconditionally since it does the check itself.
18546
18547 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18548
18549 Fix more problems found by GCC 4.5.2's static checks.
18550
18551 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18552 the first time through the loop, since we know p0 < p1 then.
18553 This also avoids a gcc -Wstrict-overflow warning.
18554
18555 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18556 leading to a memory leak, possible in functions like
18557 load_charset_map_from_file that can allocate an unbounded number
18558 of objects (Bug#8318).
18559
18560 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18561 that could (at least in theory) be that large.
18562
18563 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18564 This is less likely to overflow, and avoids undefined behavior if
18565 overflow does occur. All callers changed. Use strtoul to scan
18566 for the unsigned long integer.
18567 (pint2hrstr): Simplify and tune code slightly.
18568 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18569
18570 * scroll.c (do_scrolling): Work around GCC bug 48228.
18571 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18572
18573 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18574 This also avoids a warning with gcc -Wstrict-overflow.
18575 (validate_x_resource_name): Simplify count usage.
18576 This also avoids a warning with gcc -Wstrict-overflow.
18577
18578 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18579 fail (Bug#8306).
18580
18581 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18582
18583 * process.c (Fmake_network_process): Use socklen_t, not int,
18584 where POSIX says socklen_t is required in portable programs.
18585 This fixes a porting bug on hosts like 64-bit HP-UX, where
18586 socklen_t is wider than int (Bug#8277).
18587 (Fmake_network_process, server_accept_connection):
18588 (wait_reading_process_output, read_process_output):
18589 Likewise.
18590
18591 * process.c: Rename or move locals to avoid shadowing.
18592 (list_processes_1, Fmake_network_process):
18593 (read_process_output_error_handler, exec_sentinel_error_handler):
18594 Rename or move locals.
18595 (Fmake_network_process): Define label "retry_connect" only if needed.
18596 (Fnetwork_interface_info): Fix pointer signedness.
18597 (process_send_signal): Add cast to avoid pointer signedness problem.
18598 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18599 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18600
18601 Make tparam.h and terminfo.c consistent.
18602 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18603 Include tparam.h instead, since it declares them.
18604 * cm.h (PC): Remove extern decl; tparam.h now does this.
18605 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18606 * terminfo.c: Include tparam.h, to check interfaces.
18607 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18608 (tparam): Adjust signature to match interface in tparam.h;
18609 this removes some undefined behavior. Check that outstring and len
18610 are zero, which they always are with Emacs.
18611 * tparam.h (PC, BC, UP): New extern decls.
18612
18613 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18614 (xftfont_open): Rename locals to avoid shadowing.
18615
18616 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18617 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18618 (OTF_TAG_SYM): Omit macro if not needed.
18619 (ftfont_list): Remove unused local.
18620 (get_adstyle_property, ftfont_pattern_entity):
18621 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18622 Rename locals to avoid shadowing.
18623
18624 * xfont.c (xfont_list_family): Mark var as initialized.
18625
18626 * xml.c (make_dom): Now static.
18627
18628 * composite.c (composition_compute_stop_pos): Rename local to
18629 avoid shadowing.
18630 (composition_reseat_it): Remove unused locals.
18631 (find_automatic_composition, composition_adjust_point): Likewise.
18632 (composition_update_it): Mark var as initialized.
18633 (find_automatic_composition): Mark vars as initialized,
18634 with a FIXME (Bug#8290).
18635
18636 character.h: Rename locals to avoid shadowing.
18637 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18638 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18639 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18640 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18641 to avoid shadowing.
18642
18643 * textprop.c (property_change_between_p): Remove; unused.
18644
18645 * intervals.c (interval_start_pos): Now static.
18646
18647 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18648
18649 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18650 Rename locals to avoid shadowing.
18651
18652 * sound.c (wav_play, au_play, Fplay_sound_internal):
18653 Fix pointer signedness.
18654 (alsa_choose_format): Remove unused local var.
18655 (wav_play): Initialize a variable to 0, to prevent undefined
18656 behavior (Bug#8278).
18657
18658 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18659
18660 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18661
18662 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18663 clobbering (Bug#8298).
18664 * sysdep.c (sys_subshell): Likewise.
18665 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18666
18667 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18668 This should get cleaned up, so that child_setup has the
18669 same signature on all platforms.
18670
18671 * callproc.c (call_process_cleanup): Now static.
18672 (relocate_fd): Rename locals to avoid shadowing.
18673
18674 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18675
18676 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18677 not to be necessary, and produces flickering.
18678
18679 2011-03-20 Glenn Morris <rgm@gnu.org>
18680
18681 * config.in: Remove file.
18682
18683 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18684
18685 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18686 are now in src/globals.h.
18687 (syms_of_minibuf): Remove spurious & from previous change.
18688
18689 2011-03-20 Leo Liu <sdl.web@gmail.com>
18690
18691 * minibuf.c (completing-read-function): New variable.
18692 (completing-read-default): Rename from completing-read.
18693 (completing-read): Call completing-read-function.
18694
18695 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18696
18697 * xfaces.c (Fx_load_color_file):
18698 Read color file from absolute filename (bug#8250).
18699
18700 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18701
18702 * makefile.w32-in: Update dependencies.
18703
18704 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18705
18706 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18707
18708 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18709
18710 Fix more problems found by GCC 4.5.2's static checks.
18711
18712 * process.c (make_serial_process_unwind, send_process_trap):
18713 (sigchld_handler): Now static.
18714
18715 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18716 That way, the code declares only the vars that it needs.
18717 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18718 * s/cygwin.h (PTY_ITERATION): Likewise.
18719 * s/darwin.h (PTY_ITERATION): Likewise.
18720 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18721
18722 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18723 * process.c (allocate_pty): Don't declare stb unless it's needed.
18724
18725 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18726 (CONSTANTLIM): Remove; unused.
18727 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18728 Define only if needed.
18729
18730 * unexelf.c (unexec): Name an expression,
18731 to avoid gcc -Wbad-function-cast warning.
18732 Use a different way to cause a compilation error if anyone uses
18733 n rather than nn, a way that does not involve shadowing.
18734 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18735
18736 * deps.mk (unexalpha.o): Remove; unused.
18737
18738 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18739 * unexec.h: New file.
18740 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18741 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18742 Depend on unexec.h.
18743 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18744 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18745 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18746 Change as necessary to match prototype in unexec.h.
18747
18748 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18749 shadowing.
18750 (back_comment, skip_chars): Mark vars as initialized.
18751
18752 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18753 Rename locals to avoid shadowing.
18754
18755 * lread.c (read1): Rewrite so as not to use empty "else".
18756 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18757
18758 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18759
18760 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18761 warning when compiling print.c.
18762
18763 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18764 instead of using an uninitialized var.
18765 (font_sort_entities): Mark var as initialized.
18766
18767 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18768
18769 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18770 pointers to constants.
18771 (font_parse_fcname): Remove unused vars.
18772 (font_delete_unmatched): Now static.
18773 (font_get_spec): Remove; unused.
18774 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18775 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18776 Rename or move locals to avoid shadowing.
18777
18778 * fns.c (require_nesting_list, require_unwind): Now static.
18779 (Ffillarray): Rename locals to avoid shadowing.
18780
18781 * floatfns.c (domain_error2): Define only if needed.
18782 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18783
18784 * alloc.c (mark_backtrace): Move decl from here ...
18785 * lisp.h: ... to here, so that it can be checked.
18786
18787 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18788 (Fdefvar): Rewrite so as not to use empty "else".
18789 (lisp_indirect_variable): Name an expression,
18790 to avoid gcc -Wbad-function-cast warning.
18791 (Fdefvar): Rename locals to avoid shadowing.
18792
18793 * callint.c (quotify_arg, quotify_args): Now static.
18794 (Fcall_interactively): Rename locals to avoid shadowing.
18795 Use const pointer when appropriate.
18796
18797 * lisp.h (get_system_name, get_operating_system_release):
18798 Move decls here, to check interfaces.
18799 * process.c (get_operating_system_release): Move decl to lisp.h.
18800 * xrdb.c (get_system_name): Likewise.
18801 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18802 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18803 some of which prompt warnings from gcc -Wbad-function-cast.
18804 (Fformat_time_string, Fencode_time, Finsert_char):
18805 (Ftranslate_region_internal, Fformat):
18806 Rename or remove local vars to avoid shadowing.
18807 (Ftranslate_region_internal): Mark var as initialized.
18808
18809 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18810 avoid shadowing.
18811
18812 * lisp.h (eassert): Check that the argument compiles, even if
18813 ENABLE_CHECKING is not defined.
18814
18815 * data.c (Findirect_variable): Name an expression, to avoid
18816 gcc -Wbad-function-cast warning.
18817 (default_value, arithcompare, arith_driver, arith_error): Now static.
18818 (store_symval_forwarding): Rename local to avoid shadowing.
18819 (Fmake_variable_buffer_local, Fmake_local_variable):
18820 Mark variables as initialized.
18821 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18822
18823 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18824 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18825 Rename locals to avoid shadowing.
18826 (mark_stack): Move local variables into the #ifdef region where
18827 they're used.
18828 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18829 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18830 needed otherwise.
18831 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18832 (GC_STRING_CHARS): Remove; not used.
18833 (Fmemory_limit): Cast sbrk's returned value to char *.
18834
18835 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18836 avoids undefined behavior in theory.
18837
18838 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18839
18840 Use functions, not macros, for up- and down-casing (Bug#8254).
18841 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18842 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18843 to use the following functions instead of these macros.
18844 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18845 EMACS_INT, since callers assume the returned value fits in int.
18846 (upcase1): Likewise, for UPCASE_TABLE.
18847 (uppercasep, lowercasep, upcase): New static inline functions.
18848 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18849 the race-condition problem in the old DOWNCASE.
18850
18851 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18852 Rename locals to avoid shadowing.
18853 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18854 (regex_compile, re_search_2, re_match_2_internal):
18855 Remove unused local vars.
18856 (FREE_VAR): Rewrite so as not to use empty "else",
18857 which gcc can warn about.
18858 (regex_compile, re_match_2_internal): Mark locals as initialized.
18859 (RETALLOC_IF): Define only if needed.
18860 (WORDCHAR_P): Likewise. This one is never needed, but is used
18861 only in a comment talking about a compiler bug, so put inside
18862 the #if 0 of that comment.
18863 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18864 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18865 Remove; unused.
18866
18867 * search.c (boyer_moore): Rename locals to avoid shadowing.
18868 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18869 (PREV_CHAR_BOUNDARY): Likewise.
18870
18871 * search.c (simple_search): Remove unused var.
18872
18873 * dired.c (compile_pattern): Move decl from here ...
18874 * lisp.h: ... to here, so that it can be checked.
18875 (struct re_registers): New forward decl.
18876
18877 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18878
18879 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18880 All uses changed.
18881 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18882 Rename locals to avoid shadowing.
18883 (Fvertical_motion): Mark locals as initialized.
18884
18885 * casefiddle.c (casify_object, casify_region): Now static.
18886 (casify_region): Mark local as initialized.
18887
18888 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18889
18890 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18891 New macros, so that the caller can use some names other than
18892 gcpro1, gcpro2, etc.
18893 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18894 of the new macros.
18895 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18896 argument, for consistency with GCPRO2_VAR, etc: it is now the
18897 prefix of the variable, not the variable itself. All uses
18898 changed.
18899 * dired.c (directory_files_internal, file_name_completion):
18900 Rename locals to avoid shadowing.
18901
18902 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18903 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18904 dired.c's scmp function, had undefined behavior.
18905 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18906 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18907 * buffer.h: ... to here, because these macros use current_buffer,
18908 and the new implementation with inline functions needs to have
18909 current_buffer in scope now, rather than later when the macros
18910 are used.
18911 (downcase, upcase1): New static inline functions.
18912 (DOWNCASE, UPCASE1): Reimplement using these functions.
18913 This avoids undefined behavior in expressions like
18914 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18915 from race conditions in accessing the global variables
18916 case_temp1 and case_temp2.
18917 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18918 * lisp.h (case_temp1, case_temp2): Remove their decls.
18919 * character.h (ASCII_CHAR_P): Move from here ...
18920 * lisp.h: ... to here, so that the inline functions mentioned
18921 above can use them.
18922
18923 * dired.c (directory_files_internal_unwind): Now static.
18924
18925 * fileio.c (file_name_as_directory, directory_file_name):
18926 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18927 Now static.
18928 (file_name_as_directory): Use const pointers when appropriate.
18929 (Fexpand_file_name): Likewise. In particular, newdir might
18930 point at constant storage, so make it a const pointer.
18931 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18932 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18933 signedness issues.
18934 (Fset_file_times, Finsert_file_contents, auto_save_error):
18935 Rename locals to avoid shadowing.
18936
18937 * minibuf.c (choose_minibuf_frame_1): Now static.
18938 (Ftry_completion, Fall_completions): Rename or remove locals
18939 to avoid shadowing.
18940
18941 * marker.c (bytepos_to_charpos): Remove; unused.
18942
18943 * lisp.h (verify_bytepos, count_markers): New decls,
18944 so that gcc does not warn that these functions aren't declared.
18945
18946 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18947 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18948 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18949 (copy_text): Remove unused local var.
18950
18951 * filelock.c (within_one_second): Now static.
18952 (lock_file_1): Rename local to avoid shadowing.
18953
18954 * buffer.c (fix_overlays_before): Mark locals as initialized.
18955 (fix_start_end_in_overlays): Likewise. This function should be
18956 simplified by using pointers-to-pointers, but that's a different
18957 matter.
18958 (switch_to_buffer_1): Now static.
18959 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18960 (report_overlay_modification): Rename locals to avoid shadowing.
18961
18962 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18963 Fix pointer signedness issue.
18964 (sys_subshell): Mark local as volatile if checking for lint,
18965 to suppress a gcc -Wclobbered warning that does not seem to be right.
18966 (MAXPATHLEN): Define only if needed.
18967
18968 * process.c (serial_open, serial_configure): Move decls from here ...
18969 * systty.h: ... to here, so that they can be checked.
18970
18971 * fns.c (get_random, seed_random): Move extern decls from here ...
18972 * lisp.h: ... to here, so that they can be checked.
18973
18974 * sysdep.c (reset_io): Now static.
18975 (wait_for_termination_signal): Remove; unused.
18976
18977 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18978 (copy_keymap_item, append_key, push_text_char_description):
18979 Now static.
18980 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18981 (DENSE_TABLE_SIZE): Remove; unused.
18982 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18983 (describe_map_tree):
18984 Rename locals to avoid shadowing.
18985
18986 * keyboard.c: Declare functions static if they are not used elsewhere.
18987 (echo_char, echo_dash, cmd_error, top_level_2):
18988 (poll_for_input, handle_async_input): Now static.
18989 (read_char, kbd_buffer_get_event, make_lispy_position):
18990 (make_lispy_event, make_lispy_movement, apply_modifiers):
18991 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18992 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18993 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18994 (read_key_sequence, read_char): Mark locals as initialized.
18995 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18996
18997 * keyboard.h (make_ctrl_char): New decl.
18998 (mark_kboards): Move decl here ...
18999 * alloc.c (mark_kboards): ... from here.
19000
19001 * lisp.h (force_auto_save_soon): New decl.
19002
19003 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
19004 (DEFINE_DUMMY_FUNCTION): New macro.
19005 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19006 Use it.
19007 (main): Add casts to avoid warnings
19008 if GCC considers string literals to be constants.
19009
19010 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19011
19012 * dbusbind.c: Pointer signedness fixes.
19013 (xd_signature, xd_append_arg, xd_initialize):
19014 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19015 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19016 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19017 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19018
19019 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19020 if GCC considers string literals to be constants.
19021 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
19022
19023 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19024
19025 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19026 (print_preprocess, print_object): New macro to fix last change.
19027
19028 * print.c (print_preprocess): Don't forget font objects.
19029
19030 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
19031
19032 * emacs.c (USAGE3): Doc fixes.
19033
19034 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19035
19036 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19037 structure.
19038
19039 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
19040
19041 * lisp.h (VWindow_system, Qfile_name_history):
19042 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19043 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19044 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19045
19046 * w32select.c: Don't #include "keyboard.h".
19047 (run_protected): Add extern declaration for waiting_for_input.
19048
19049 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19050 * w32console.c (detect_input_pending, read_input_pending)
19051 (encode_terminal_code):
19052 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19053 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19054 (w32_system_caret_y, Qfile_name_history):
19055 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19056 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19057 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19058 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19059 * w32proc.c (Qlocal, report_file_error):
19060 * w32term.c (Vwindow_system, updating_frame):
19061 * w32uniscribe.c (initialized, uniscribe_font_driver):
19062 Remove unneeded extern declarations.
19063
19064 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19065
19066 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19067
19068 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19069
19070 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19071 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19072 These macros can no longer be used for assignment.
19073
19074 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19075 Assign struct members directly, instead of using BUF_BEGV etc.
19076 (record_buffer_markers, fetch_buffer_markers): New functions for
19077 recording and fetching special buffer markers.
19078 (set_buffer_internal_1, set_buffer_temp): Use them.
19079
19080 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19081
19082 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19083
19084 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19085 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19086
19087 * xdisp.c (hscroll_window_tree):
19088 (reconsider_clip_changes): Use PT instead of BUF_PT.
19089
19090 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19091
19092 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19093 $(EMACS_ROOT)/lib/intprops.h.
19094
19095 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19096
19097 Fix more problems found by GCC 4.5.2's static checks.
19098
19099 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19100 to unsigned char * to avoid compiler diagnostic.
19101 (xg_free_frame_widgets): Make it clear that a local variable is
19102 needed only if USE_GTK_TOOLTIP.
19103 (gdk_window_get_screen): Make it clear that this macro is needed
19104 only if USE_GTK_TOOLTIP.
19105 (int_gtk_range_get_value): New function, which avoids a diagnostic
19106 from gcc -Wbad-function-cast.
19107 (xg_set_toolkit_scroll_bar_thumb): Use it.
19108 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19109 diagnostic from gcc -Wbad-function-cast.
19110 (get_utf8_string, xg_get_file_with_chooser):
19111 Rename locals to avoid shadowing.
19112 (create_dialog): Move locals to avoid shadowing.
19113
19114 * xgselect.c (xg_select): Remove unused var.
19115
19116 * image.c (four_corners_best): Mark locals as initialized.
19117 (gif_load): Initialize transparent_p to zero (Bug#8238).
19118 Mark another local as initialized.
19119 (my_png_error, my_error_exit): Mark with NO_RETURN.
19120
19121 * image.c (clear_image_cache): Now static.
19122 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19123 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19124 (x_edge_detection): Remove unnecessary cast that
19125 gcc -Wbad-function-cast diagnoses.
19126 (gif_load): Fix pointer signedness.
19127 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19128 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19129
19130 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19131
19132 Improve quality of tests for time stamp overflow.
19133 For example, without this patch (encode-time 0 0 0 1 1
19134 1152921504606846976) returns the obviously-bogus value (-948597
19135 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19136 reports time overflow. See
19137 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19138 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19139 * editfns.c: Include limits.h and intprops.h.
19140 (TIME_T_MIN, TIME_T_MAX): New macros.
19141 (time_overflow): Move earlier, to before first use.
19142 (hi_time, lo_time): New functions, for an accurate test for
19143 out-of-range times.
19144 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19145 (Fget_internal_run_time): Don't assume time_t fits in int.
19146 (make_time): Use list2 instead of Fcons twice.
19147 (Fdecode_time): More accurate test for out-of-range times.
19148 (check_tm_member): New function.
19149 (Fencode_time): Use it, to test for out-of-range times.
19150 (lisp_time_argument): Don't rely on undefined left-shift and
19151 right-shift behavior when checking for time stamp overflow.
19152
19153 * editfns.c (time_overflow): New function, refactoring common code.
19154 (Fformat_time_string, Fdecode_time, Fencode_time):
19155 (Fcurrent_time_string): Use it.
19156
19157 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19158 * dired.c (make_time): Move to ...
19159 * editfns.c (make_time): ... here.
19160 * systime.h: Note the move.
19161
19162 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19163
19164 * fringe.c (update_window_fringes): Remove unused variables.
19165
19166 * unexmacosx.c (copy_data_segment): Also copy __got section.
19167 (Bug#8223)
19168
19169 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19170
19171 * termcap.c [MSDOS]: Include "msdos.h".
19172 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19173 Constify `char *' arguments and their references according to
19174 prototypes in tparam.h.
19175
19176 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19177
19178 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19179 Adapt all references accordingly.
19180
19181 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19182
19183 2011-03-11 Tom Tromey <tromey@redhat.com>
19184
19185 * buffer.c (syms_of_buffer): Remove obsolete comment.
19186
19187 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19188
19189 * termhooks.h (encode_terminal_code): Declare prototype.
19190
19191 * msdos.c (encode_terminal_code): Don't declare prototype.
19192
19193 * term.c (encode_terminal_code): Now external again, used by
19194 w32console.c and msdos.c.
19195
19196 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19197 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19198
19199 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19200
19201 Fix some minor problems found by GCC 4.5.2's static checks.
19202
19203 * fringe.c (update_window_fringes): Mark locals as initialized
19204 (Bug#8227).
19205 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19206
19207 * alloc.c (mark_fringe_data): Move decl from here ...
19208 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19209 to check its interface.
19210 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19211
19212 * fontset.c (free_realized_fontset): Now static.
19213 (Fset_fontset_font): Rename local to avoid shadowing.
19214 (fontset_font): Mark local as initialized.
19215 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19216
19217 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19218
19219 * xselect.c (x_disown_buffer_selections): Remove; not used.
19220 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19221 (x_own_selection, Fx_disown_selection_internal): Rename locals
19222 to avoid shadowing.
19223 (x_handle_dnd_message): Remove local to avoid shadowing.
19224
19225 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19226 so that the caller can use some name other than gcpro1.
19227 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19228 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19229 (Fx_backspace_delete_keys_p):
19230 Use them to avoid shadowing, and rename vars to avoid shadowing.
19231 (x_decode_color, x_set_name, x_window): Now static.
19232 (Fx_create_frame): Add braces to silence GCC warning.
19233 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19234 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19235 Remove unused locals.
19236 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19237 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19238 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19239 macros.
19240
19241 * xterm.h (x_mouse_leave): New decl.
19242
19243 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19244 Remove unused functions.
19245 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19246 (x_calc_absolute_position): Now static.
19247 (XTread_socket): Don't define label "out" unless it's used.
19248 Don't declare local "event" unless it's used.
19249 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19250 unless they are used.
19251 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19252 (x_fatal_error_signal): Remove; not used.
19253 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19254 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19255 (x_error_catcher, x_connection_closed, x_error_handler):
19256 (x_error_quitter, xembed_send_message, x_iconify_frame):
19257 (my_log_handler): Rename locals to avoid shadowing.
19258 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19259 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19260
19261 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19262 Rename or move locals to avoid shadowing.
19263 (tty_defined_color, merge_face_heights): Now static.
19264 (free_realized_faces_for_fontset): Remove; not used.
19265 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19266 does not deduce is never used uninitialized.
19267 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19268 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19269
19270 * terminal.c (store_terminal_param): Now static.
19271
19272 * xmenu.c (menu_highlight_callback): Now static.
19273 (set_frame_menubar): Remove unused local.
19274 (xmenu_show): Rename parameter to avoid shadowing.
19275 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19276 since they might point to immutable storage.
19277 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19278 since it's unused otherwise.
19279
19280 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19281 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19282 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19283 avoids a gcc -Wuninitialized diagnostic.
19284 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19285 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19286 does not deduce are never used uninitialized.
19287
19288 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19289
19290 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19291 * window.c (window_loop, size_window):
19292 (run_window_configuration_change_hook, enlarge_window): Likewise.
19293
19294 * window.c (display_buffer): Now static.
19295 (size_window): Mark variables that gcc -Wuninitialized
19296 does not deduce are never used uninitialized.
19297 * window.h (check_all_windows): New decl, to forestall
19298 gcc -Wmissing-prototypes diagnostic.
19299 * dispextern.h (bidi_dump_cached_states): Likewise.
19300
19301 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19302 shadowing.
19303 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19304 Include <limits.h>.
19305 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19306 and to avoid gcc -Wuninitialized warning.
19307 (load_charset_map): Mark variables that gcc -Wuninitialized
19308 does not deduce are never used uninitialized.
19309 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19310
19311 * coding.c (coding_set_source, coding_set_destination):
19312 Use "else { /* comment */ }" rather than "else /* comment */;"
19313 for clarity, and to avoid gcc -Wempty-body warning.
19314 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19315 a block, when the outer 'i' will do.
19316 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19317 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19318 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19319 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19320 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19321 Rename locals to avoid shadowing.
19322 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19323 * coding.c (emacs_mule_char, encode_invocation_designation):
19324 Now static, since they're not used elsewhere.
19325 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19326 (decode_coding_object, encode_coding_object, detect_coding_system):
19327 (decode_coding_emacs_mule): Mark variables that gcc
19328 -Wuninitialized does not deduce are never used uninitialized.
19329 (detect_coding_iso_2022): Initialize a local variable that might
19330 be used uninitialized. Leave a FIXME because it's not clear that
19331 this initialization is needed. (Bug#8211)
19332 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19333 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19334 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19335 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19336 Remove unused macros.
19337
19338 * category.c (hash_get_category_set): Remove unused local var.
19339 (copy_category_table): Now static, since it's not used elsewhere.
19340 * character.c (string_count_byte8): Likewise.
19341
19342 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19343 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19344
19345 * chartab.c (copy_sub_char_table): Now static, since it's not used
19346 elsewhere.
19347 (sub_char_table_ref_and_range, char_table_ref_and_range):
19348 Rename locals to avoid shadowing.
19349 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19350
19351 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19352 (BIDI_BOB): Remove unused macro.
19353
19354 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19355 deduce are never used uninitialized.
19356 * term.c (encode_terminal_code): Likewise.
19357
19358 * term.c (encode_terminal_code): Now static. Remove unused local.
19359
19360 * tparam.h: New file.
19361 * term.c, tparam.h: Include it.
19362 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19363 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19364 Move these decls to tparam.h, and make them agree with what
19365 is actually in tparam.c. The previous trick of using incompatible
19366 decls in different modules does not conform to the C standard.
19367 All callers of tparam changed to use tparam's actual API.
19368 * tparam.c (tparam1, tparam, tgoto):
19369 Use const pointers where appropriate.
19370
19371 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19372 * cm.h (struct cm): Likewise.
19373 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19374 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19375 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19376 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19377 (turn_on_face, init_tty): Likewise.
19378 * termchar.h (struct tty_display_info): Likewise.
19379
19380 * term.c (term_mouse_position): Rename local to avoid shadowing.
19381
19382 * alloc.c (mark_ttys): Move decl from here ...
19383 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19384
19385 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19386
19387 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19388
19389 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19390
19391 * search.c (compile_pattern_1): Remove argument regp, unused since
19392 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19393 (compile_pattern): Don't pass it.
19394
19395 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19396
19397 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19398 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19399 for ! HAVE_GTK3.
19400 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19401
19402 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19403
19404 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19405 gdk_window_get_screen, gdk_window_get_geometry,
19406 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19407 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19408 (xg_get_pixbuf_from_pixmap): New function.
19409 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19410 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19411 Call xg_get_pixbuf_from_pixmap instead of
19412 gdk_pixbuf_get_from_drawable.
19413 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19414 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19415 (xg_check_special_colors): Use GtkStyleContext and its functions
19416 for HAVE_GTK3.
19417 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19418 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19419 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19420 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19421 Call gtk_widget_get_preferred_size.
19422 (xg_frame_resized): gdk_window_get_geometry only takes 5
19423 parameters.
19424 (xg_win_to_widget, xg_event_is_for_menubar):
19425 Call gdk_x11_window_lookup_for_display.
19426 (xg_set_widget_bg): New function.
19427 (delete_cb): New function.
19428 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19429 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19430 (xg_set_background_color): Call xg_set_widget_bg.
19431 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19432 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19433 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19434 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19435 if ! HAVE_GTK3.
19436 (update_frame_tool_bar): Call gtk_widget_hide.
19437 (xg_initialize): Use GDK_KEY_g.
19438
19439 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19440 if ! HAVE_GTK3
19441 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19442
19443 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19444 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19445 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19446
19447 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19448
19449 * w32xfns.c (select_palette): Check success of RealizePalette against
19450 GDI_ERROR, not zero.
19451
19452 See ChangeLog.11 for earlier changes.
19453
19454 ;; Local Variables:
19455 ;; coding: utf-8
19456 ;; End:
19457
19458 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19459
19460 This file is part of GNU Emacs.
19461
19462 GNU Emacs is free software: you can redistribute it and/or modify
19463 it under the terms of the GNU General Public License as published by
19464 the Free Software Foundation, either version 3 of the License, or
19465 (at your option) any later version.
19466
19467 GNU Emacs is distributed in the hope that it will be useful,
19468 but WITHOUT ANY WARRANTY; without even the implied warranty of
19469 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19470 GNU General Public License for more details.
19471
19472 You should have received a copy of the GNU General Public License
19473 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.