* src/editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
[bpt/emacs.git] / src / ChangeLog
1 2012-11-16 Glenn Morris <rgm@gnu.org>
2
3 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4
5 2012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
8
9 2012-11-14 Eli Zaretskii <eliz@gnu.org>
10
11 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
12 use the same value of thread handle.
13 (start_timer_thread): If the timer thread exited (due to error),
14 clean up by closing the two handles it used. Duplicate the caller
15 thread's handle here, so it gets duplicated only once, when
16 launching the timer thread. Set priority of the timer thread, not
17 the caller thread.
18 (getitimer): Don't duplicate the caller thread's handle here.
19 (Bug#12832)
20
21 2012-11-13 Jan Djärv <jan.h.d@swipnet.se>
22
23 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
24 called (Bug#12834).
25
26 2012-11-12 Eli Zaretskii <eliz@gnu.org>
27
28 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
29 passed to pint2str and pint2hrstr to be at most the size of the
30 frame's decode_mode_spec_buffer. This avoids crashes with very
31 large values of FIELD_WIDTH argument to decode_mode_spec.
32 (Bug#12867)
33
34 2012-11-07 Martin Rudalics <rudalics@gmx.at>
35
36 * window.c (Fsplit_window_internal): Set combination limit of
37 new parent window to t iff Vwindow_combination_limit is t;
38 fixing a regression introduced with the change from 2012-09-22.
39 (Fwindow_combination_limit, Fset_window_combination_limit):
40 Fix doc-strings.
41
42 2012-11-06 Eli Zaretskii <eliz@gnu.org>
43
44 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
45 amount when the scroll margins are too large. When scrolling
46 backwards in the buffer, give up if cannot reach point or the
47 scroll margin within a reasonable number of screen lines.
48 Fixes point position in window under scroll-up/down-aggressively when
49 point is positioned many lines beyond the window top/bottom.
50 (Bug#12811)
51
52 2012-11-05 Eli Zaretskii <eliz@gnu.org>
53
54 * ralloc.c (relinquish): If real_morecore fails to return memory
55 to the system, don't crash; instead, leave the last heap
56 unchanged and return. (Bug#12774)
57
58 2012-11-03 Eli Zaretskii <eliz@gnu.org>
59
60 * lisp.mk: Adjust comments to the fact that term/internal is now
61 loaded from loadup.el.
62
63 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
64 (msdos_fatal_signal): New function.
65 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
66 its argument list.
67
68 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
69 for GCC versions before 4.
70 (emacs_raise): Define to call msdos_fatal_signal.
71
72 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
73 iterator when starting in the middle of a display or overlay
74 string. (Bug#12745)
75
76 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
77
78 * widget.c (resize_cb): New function.
79 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
80 (EmacsFrameResize): Check if all is up to date before changing frame
81 size.
82
83 2012-11-01 Eli Zaretskii <eliz@gnu.org>
84
85 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
86
87 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
88
89 Fix crash when using Emacs as commit editor for git (Bug#12697).
90 * callproc.c (setpgrp): Remove macro, as we now use setpgid
91 and it is configured in conf_post.h.
92 (Fcall_process): Don't invoke both setsid and setpgid; the former
93 is enough, if it exists.
94 * callproc.c (Fcall_process, child_setup):
95 * process.c (create_process): Use setpgid.
96 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
97 for the real thing.
98 * dispnew.c (init_display): Initialize the foreground group
99 if we are running a tty display.
100 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
101 * lisp.h (init_foreground_group): New decl.
102 * sysdep.c (inherited_pgroup): New static var.
103 (init_foreground_group, tcsetpgrp_without_stopping)
104 (narrow_foreground_group, widen_foreground_group): New functions.
105 (init_sys_modes): Narrow foreground group.
106 (reset_sys_modes): Widen foreground group.
107
108 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
109
110 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
111
112 2012-10-31 Martin Rudalics <rudalics@gmx.at>
113
114 * minibuf.c (read_minibuf): Restore current buffer since
115 choose_minibuf_frame calling Fset_frame_selected_window may
116 change it (Bug#12766).
117
118 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
119
120 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
121
122 2012-10-30 Kenichi Handa <handa@gnu.org>
123
124 * font.c (Ffont_at): If WINDOW is specified and it is not
125 displaying the current buffer, signal an error.
126
127 2012-10-29 Daniel Colascione <dancol@dancol.org>
128
129 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
130 In preparation for fixing bug#12739, move these functions from
131 here...
132
133 * coding.h, coding.c: ... to here, and compile them only when
134 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
135 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
136
137 2012-10-28 Eli Zaretskii <eliz@gnu.org>
138
139 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
140 (timer_loop, getitimer, setitimer): Use it instead of
141 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
142 'clock'.
143 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
144 literal 10000.
145
146 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
147
148 * nsterm.m (NO_APPDEFINED_DATA): New define.
149 (last_appdefined_event_data): New variable
150 (last_appdefined_event): Remove.
151 (ns_select): Initialize t from last_appdefined_event_data instead
152 of [last_appdefined_event data1].
153 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
154 remove last_appdefined_event (Bug#12698).
155
156 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
157
158 * frame.c (x_set_font): Catch internal error.
159
160 2012-10-27 Eli Zaretskii <eliz@gnu.org>
161
162 Avoid overflow in w32 implementation of interval timers.
163 When possible, for ITIMER_PROF count only times the main thread
164 actually executes.
165 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
166 'volatile ULONGLONG' types. All the other data which was
167 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
168 (GetThreadTimes_Proc): New typedef.
169 (w32_get_timer_time): New function, returns a suitable time value
170 for the timer.
171 (timer_loop): Enter critical section when accessing ULONGLONG
172 values of the itimer_data struct, as these accesses are no longer
173 atomic. Call 'w32_get_timer_time' instead of 'clock'.
174 Remove unused variable.
175 (init_timers): Initialize s_pfn_Get_Thread_Times.
176 (start_timer_thread): Don't assign itimer->caller_thread here.
177 (getitimer): Assign itimer->caller_thread here.
178 (setitimer): Always call getitimer to get the value of ticks_now.
179 (sys_spawnve): Avoid compiler warning about format mismatch.
180
181 2012-10-26 Eli Zaretskii <eliz@gnu.org>
182
183 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
184 mouse movement events if the menu bar is active. This avoids
185 producing a busy "hour-glass" cursor by Windows if the mouse
186 pointer is positioned over a tooltip shown for some menu item.
187
188 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
189
190 Don't assume process IDs fit in int.
191 * emacs.c (shut_down_emacs) [!DOS_NT]:
192 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
193 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
194 Use pid_t, not int, to store process IDs, as 'int'
195 is not wide enough on a few platforms (e.g., AIX and IRIX).
196
197 2012-10-23 Kenichi Handa <handa@gnu.org>
198
199 The following change is to make face-font-rescale-alist work
200 correctly for non-ASCII fonts.
201
202 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
203 (font_open_for_lface): Handle Vface_font_rescale_alist.
204
205 2012-10-23 Chong Yidong <cyd@gnu.org>
206
207 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
208
209 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
210
211 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
212 for screen font.
213 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
214
215 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
216 event (Bug#12681).
217
218 2012-10-21 Glenn Morris <rgm@gnu.org>
219
220 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
221
222 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
223
224 Port to OpenBSD 5.1.
225 * frame.c (Fmouse_position, Fmouse_pixel_position):
226 * xdisp.c (produce_stretch_glyph):
227 Declare local vars only when they're needed.
228 This is clearer and avoids a warning on OpenBSD about unused vars.
229 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
230 This is safer, and avoids OpenBSD warnings about unused vars.
231 * keyboard.c (record_menu_key): Remove unnecessary decl.
232 (poll_timer): Define only if POLL_FOR_INPUT is defined.
233 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
234 as our definition clashes with OpenBSD's.
235 * xfaces.c (load_face_colors, check_lface_attrs)
236 (get_lface_attributes_no_remap, get_lface_attributes)
237 (lface_fully_specified_p, x_supports_face_attributes_p)
238 (tty_supports_face_attributes_p, face_fontset, realize_face)
239 (realize_x_face, realize_tty_face):
240 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
241 merely Lisp_Object *. This is more informative and avoids
242 a warning on OpenBSD about accessing beyond an object's size.
243
244 2012-10-20 Chong Yidong <cyd@gnu.org>
245
246 * lread.c (Fload): Doc fix (Bug#12592).
247
248 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
249
250 * font.c (Ffont_at): Fix previous change.
251
252 2012-10-19 Eli Zaretskii <eliz@gnu.org>
253
254 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
255 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
256 for the reasons.
257
258 * alloc.c (NSTATICS): Decrease to 0x800.
259
260 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
261
262 * fns.c (Fnreverse): Include the problem element when signalling an
263 error (bug#12677).
264
265 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
266
267 * nsterm.m (ns_select): Check writefds before call to
268 FD_ISSET (Bug#12668).
269
270 2012-10-18 Daniel Colascione <dancol@dancol.org>
271
272 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
273 (staticpro): If we run out of staticpro slots, die with an
274 informative error instead of just calling emacs_abort.
275
276 2012-10-18 Martin Rudalics <rudalics@gmx.at>
277
278 Fix two flaws reported by Dmitry Antipov.
279 * window.c (Ftemp_output_buffer_show): Remove.
280 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
281 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
282
283 2012-10-17 Eli Zaretskii <eliz@gnu.org>
284
285 * makefile.w32-in ($(BLD)/w32.$(O)):
286 ($(BLD)/vm-limit.$(O)):
287 ($(BLD)/term.$(O)):
288 ($(BLD)/unexw32.$(O)):
289 ($(BLD)/fileio.$(O)):
290 ($(BLD)/dispnew.$(O)): Update dependencies.
291
292 * w32term.h (w32_initialize_display_info, initialize_w32_display):
293 Add prototypes.
294
295 * w32proc.c: Include ctype.h.
296
297 * w32.h (init_environment, check_windows_init_file)
298 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
299 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
300 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
301 (sys_link): Add prototypes.
302
303 * w32.c: Include w32select.h.
304 (sys_access, e_malloc, sys_select): Add prototypes.
305 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
306
307 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
308
309 * unexw32.c: Include lisp.h and w32.h.
310
311 * term.c [WINDOWSNT]: Include w32term.h.
312
313 * process.c [WINDOWSNT]: Add prototype of sys_select.
314
315 * fileio.c [WINDOWSNT]: Include w32.h.
316
317 * dispnew.c [WINDOWSNT]: Include w32.h.
318
319 * cygw32.c (Fcygwin_convert_path_to_windows)
320 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
321 Lisp_Object values. (Bug#12661)
322
323 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
324 to Lisp_Object. (Bug#12661)
325
326 2012-10-17 Kenichi Handa <handa@gnu.org>
327
328 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
329 invalidate.
330
331 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
332
333 * buffer.c (Fkill_buffer): When unchaining the marker,
334 reset its buffer pointer to NULL (Bug#12652).
335
336 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
337
338 Do not verify indirection counters of killed buffers (Bug#12579).
339 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
340 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
341
342 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
343
344 * alloc.c (Fmake_byte_code): Fix typo in comment.
345 * print.c (print_interval): Define as static to match prototype.
346 * indent.c (disptab_matches_widthtab, recompute_width_table):
347 Convert to eassert.
348
349 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
350
351 * editfns.c (get_system_name): Remove.
352 * lisp.h (get_system_name): Remove prototype.
353 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
354 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
355
356 2012-10-15 Daniel Colascione <dancol@dancol.org>
357
358 * dbusbind.c: Add comment explaining reason for previous change.
359
360 2012-10-15 Martin Rudalics <rudalics@gmx.at>
361
362 * window.c (Fwindow_end): Rewrite check whether cached position
363 can be used (Bug#12600).
364 (resize_frame_windows, grow_mini_window, shrink_mini_window):
365 Set windows_or_buffers_changed.
366
367 2012-10-15 Daniel Colascione <dancol@dancol.org>
368
369 * dbusbind.c: Fix cygw32 build break when compiling with dbus
370 enabled by undefining the symbol "interface", which the platform
371 headers define to something incompatible.
372
373 2012-10-14 Daniel Colascione <dancol@dancol.org>
374
375 * image.c (init_tiff_functions, init_imagemagick_functions)
376 (init_svg_functions): Fix cygw32 build break by using these
377 functions only when WINDOWSNT _and_ HAVE_NTGUI.
378
379 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
380
381 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
382
383 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
384
385 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
386
387 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
388
389 * coding.c (detect_coding): Set coding->id before calling
390 this->detector.
391
392 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
393
394 * fileio.c: Formatting fixes.
395
396 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
397
398 Fix some stat-related races.
399 * fileio.c (Fwrite_region): Avoid race condition if a file is
400 removed or renamed by some other process immediately after Emacs
401 writes it but before Emacs stats it. Do not assume that stat (or
402 fstat) succeeds.
403 * image.c (slurp_file): Resolve the file name with fopen + fstat
404 rather than stat + fopen.
405 (pbm_read_file) [0]: Remove unused code with stat race.
406 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
407 Remove ineffective code with stat race.
408
409 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
410
411 * doc.c (get_doc_string): Don't signal an error if the file is missing.
412
413 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
414
415 * nsterm.m (hold_event_q): New static variable.
416 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
417 ! q_event_ptr.
418 (hold_event): New function.
419 (ns_read_socket): If hold_event_q have events, store them and
420 return (Bug#12384).
421 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
422 is zero (Bug#12384).
423
424 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
425
426 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
427
428 2012-10-12 Eli Zaretskii <eliz@gnu.org>
429
430 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
431
432 * fileio.c (check_existing): New function.
433 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
434 instead of calling 'stat', when what's needed is to check whether
435 a file exists. This avoids expensive system calls on MS-Windows.
436 (Bug#12587)
437
438 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
439
440 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
441 determine whether a file exists and is not a directory.
442
443 * lisp.h (check_existing): Add prototype.
444
445 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
446
447 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
448
449 2012-10-12 Glenn Morris <rgm@gnu.org>
450
451 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
452
453 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
454
455 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
456
457 * eval.c (Fautoload): Remember previous autoload status in load-history.
458
459 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
460
461 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
462 * lread.c (load_each_byte, new_backquote_flag, readchar)
463 (read_filtered_event, lisp_file_lexically_bound_p)
464 (safe_to_load_version, Fload, complete_filename_p, openp)
465 (build_load_history, readevalloop, read_escape, read1)
466 (string_to_number, read_vector, read_list):
467 * macros.c (Fstart_kbd_macro):
468 * marker.c (CONSIDER):
469 * menu.c (parse_single_submenu, digest_single_submenu)
470 (find_and_return_menu_selection, Fx_popup_menu):
471 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
472 (Ftry_completion):
473 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
474 (ns_menu_show):
475 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
476 (xmenu_show, xdialog_show):
477 Use bool for booleans.
478 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
479 as it's not a predicate. All uses changed. Omit unnecessary
480 buffer termination.
481
482 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
483
484 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
485 (save_excursion_restore): Do not restore mark if it was not saved.
486
487 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
488
489 * marker.c (cached_modiff): EMACS_INT, not int.
490
491 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
492 instead of having a wrong decl.
493 * nsmenu.m (waiting_for_input): Remove wrong decl.
494
495 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
496
497 keyboard.c, keymap.c: Use bool for booleans.
498 * dispnew.c (sit_for): Distinguish between 3-way display_option
499 and boolean do_display.
500 * keyboard.c (single_kboard, this_command_key_count_reset)
501 (waiting_for_input, echoing, immediate_quit, input_pending)
502 (interrupt_input, interrupts_deferred, pop_kboard)
503 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
504 (command_loop_1, adjust_point_for_property)
505 (safe_run_hooks_error, input_polling_used, read_char):
506 (help_char_p, readable_events, kbd_buffer_events_waiting)
507 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
508 (lucid_event_type_list_p, get_input_pending):
509 (gobble_input, menu_separator_name_p, menu_bar_item)
510 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
511 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
512 (keyremap_step, test_undefined, read_key_sequence)
513 (detect_input_pending, detect_input_pending_ignore_squeezables)
514 (detect_input_pending_run_timers, requeued_events_pending_p)
515 (quit_throw_to_read_char, Fset_input_interrupt_mode):
516 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
517 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
518 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
519 (accessible_keymaps_1, Fkey_description, push_key_description):
520 (shadow_lookup, struct where_is_internal_data)
521 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
522 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
523 (describe_map, describe_vector):
524 * menu.c (single_menu_item):
525 * nsmenu.m (ns_update_menubar):
526 * process.c (wait_reading_process_output):
527 * search.c (scan_buffer, scan_newline):
528 Use bool for boolean.
529 * keyboard.c (timers_run, swallow_events)
530 (detect_input_pending_run_timers):
531 * process.c (wait_reading_process_output):
532 Use unsigned for counter where wraparound-on-overflow is desired,
533 since unsigned is guaranteed to have that behavior and signed is not.
534 (read_char): Use ptrdiff_t for string length.
535 (get_input_pending): Remove first argument, since it was always
536 the same pointer-to-int (now pointer-to-boolean) &input_pending,
537 and behave as if it had that value. Return new value of
538 input_pending. All callers changed.
539 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
540 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
541 a string length.
542 * keymap.c (push_key_description): Omit last arg, which was always 1.
543 All callers changed.
544
545 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
546
547 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
548
549 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
550 ($(BLD)/term.$(O)): Update dependencies.
551
552 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
553
554 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
555 * lisp.h (enum pvec_type): Adjust comments and omit explicit
556 initializer for PVEC_NORMAL_VECTOR.
557
558 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
559
560 Clean out old termopts cruft.
561 * termopts.h (flow_control, meta_key): Remove unused decls.
562 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
563 Don't include termopts.h.
564
565 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
566
567 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
568
569 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
570
571 * commands.h (immediate_quit): Remove duplicate decl.
572
573 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
574
575 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
576 caching.
577 (nsfont_open): Remove setting of Vfonts_in_cache.
578 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
579
580 2012-10-09 Eli Zaretskii <eliz@gnu.org>
581
582 * w32fns.c (w32_last_error): Change the return value to DWORD, to
583 match what GetLastError returns. Explain why the function is
584 needed.
585
586 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
587 'is_tooltip_frame', to avoid confusion with its global namesake.
588
589 2012-10-08 Daniel Colascione <dancol@dancol.org>
590
591 * xdisp.c (start_hourglass): Call w32_note_current_window when
592 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
593 build that caused Emacs to display the hourglass cursor forever.
594
595 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
596 which is broken under remote desktop, calculate the number of
597 colors available for a display based on the display's number of
598 planes and number of bits per pixel per plane. (bug#10397).
599
600 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
601
602 * nsfont.m (Vfonts_in_cache): New variable.
603 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
604 are used. Add cached fonts to Vfonts_in_cache.
605 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
606
607 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
608
609 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
610 in nt/config.nt.
611 (FONT_H): Define after FRAME_H.
612 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
613 Update dependencies.
614
615 * w32term.c: Remove leftover declaration of keyboard_codepage.
616
617 2012-10-08 Eli Zaretskii <eliz@gnu.org>
618
619 * makefile.w32-in (FONT_H): Add $(FRAME_H).
620 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
621 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
622 (GLOBAL_SOURCES): Add cygw32.c.
623 ($(BLD)/unexw32.$(O)):
624 ($(BLD)/w32.$(O)):
625 ($(BLD)/w32console.$(O)):
626 ($(BLD)/w32fns.$(O)):
627 ($(BLD)/w32heap.$(O)):
628 ($(BLD)/w32menu.$(O)):
629 ($(BLD)/w32proc.$(O)): Add w32common.h.
630
631 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
632 'const char *'.
633 (x_to_w32_color): Don't modify the argument, modify a copy instead.
634
635 2012-10-08 Daniel Colascione <dancol@dancol.org>
636
637 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
638 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
639 accidental message numbering hole. Change other messages to
640 match.
641
642 * w32select.h (HAVE_W32SELECT): Remove.
643
644 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
645 w32common.h instead of w32heap.h.
646
647 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
648 (get_allocation_unit, get_processor_type, get_w32_major_version)
649 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
650 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
651 (OS_NT, os_subtype, cache_system_info): Move declarations to
652 w32common.
653
654 * w32heap.c: Include w32common.h.
655 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
656 (w32_minor_version, w32_build_number, w32_subtype):
657 Remove duplicate definitions.
658
659 * w32fns.c: Include w32common.h; include w32heap.h only in
660 WINDOWSNT.
661
662 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
663 Use `report_file_error' instead of `error' in order to better
664 inform users of what went wrong. Increase NTGUI_UNICODE file
665 dialog box file name length to 32k, the maximum allowed by the NT
666 kernel.
667
668 * w32common.h: New file.
669 (ROUND_UP, ROUND_DOWN, get_page_size)
670 (get_allocation_unit, get_processor_type, get_w32_major_version)
671 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
672 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
673 (OS_NT, os_subtype, cache_system_info): Move here.
674
675 * unexw32.c, unexcw.c: Include w32common.h.
676
677 * emacs.c (main): Use (defined (WINDOWSNT) || defined
678 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
679 to call syms_of_w32select.
680
681 * cygw32.h: Remove obsolete EXFUN declarations.
682
683 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
684
685 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
686 of w32inevt.o from SOME_MACHINE_OBJECTS.
687
688 2012-10-08 Daniel Colascione <dancol@dancol.org>
689
690 * image.c: Permanent fix for JPEG compilation issue --- limit
691 jpeglib `boolean' redefinition to Cygwin builds.
692
693 2012-10-08 Eli Zaretskii <eliz@gnu.org>
694
695 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
696
697 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
698 Cygwin.
699
700 2012-10-08 Daniel Colascione <dancol@dancol.org>
701
702 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
703 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
704 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
705 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
706 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
707 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
708 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
709 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
710 now a supported configuration.
711
712 * Makefile.in: consolidate image variables into LIBIMAGE; add
713 W32_OBJ and W32_LIBS. Compile new files.
714
715 * conf_post.h:
716 (_DebPrint) declare tracing facility for W32 debugging. We need
717 to unify tracing later.
718
719 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
720 unconditional use of W32 Unicode functions. Cygwin runs only on
721 100% Unicode operating systems.
722
723 * cygw32.c: New file. Define Cygwin-specific facilities.
724 (Fcygwin_convert_path_to_windows)
725 (Fcygwin_convert_path_from_windows): New user functions for
726 accessing Cygwin path-munging routines.
727
728 * cygw32.h: New file.
729 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
730 UTF-16LE strings temporarily inside non-Lisp-visible string
731 objects.
732
733 (w32_strerror): Just what it says on the tin.
734
735 * emacs.c: Make the NS fork-then-exec code for daemon-launching
736 also run for Cygwin; both systems have the same problem with using
737 GUI facilities in a forked child. Also call syms_of_cygw32,
738 syms_of_w32select in correct places.
739
740 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
741 needs fork-then-exec for daemon launching.
742
743 * font.h: Include frame.h.
744
745 * image.c: Use the image library cache machinery only when we're
746 compiling for native WINDOWSNT; Cygwin can use shared libraries
747 like any other Unixlike system.
748
749 * keyboard.c: Clarify a comment regarding the input loop.
750
751 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
752 functions directly instead of trying to detect at runtime that our
753 host operating system supports them. We make this change for two
754 reasons: Cygwin lacks support for the multibyte character
755 conversion functions used by the legacy menu code, and Cygwin
756 never needs to rely on non-Unicode APIs.
757
758 * unexw32.c (hinst): Declare extern.
759
760 * w32.c: Change header order;
761 (w32_strerror): Move to w32fns.c because we need it for
762 non-WINDOWSNT builds.
763
764 * w32.h: Add #error macro to make sure we don't include w32.h for
765 Cygwin builds. Remove w32select declarations.
766
767 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
768 w32fns.c. w32console.c is WINDOWSNT-only.
769
770 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
771 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
772 POSIXy alternative.
773 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
774 (w32_major_version, w32_minor_version, w32_build_number)
775 (os_subtype, sound_type): Define here
776 (w32_defined_color): Make color parameter const for consistency
777 with other _defined_color functions.
778 (w32_createwindow): Unconditionally call w32_init_class instead of
779 doing so only when hprevinst is non-NULL. Plumbing hprevinst
780 through the code is complex and unnecessary because class
781 registration is practically free.
782 (w32_name_of_message): New EMACSDEBUG-only function.
783 (Fset_message_beep): Move here
784 (Fx_open_connection): Require that the display name for Windows be
785 "w32" for consistency, emacsclient disambiguation, and maybe, one
786 day, multi-window-system support.
787 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
788 Cygwin files for W32 GUI facilities, since these clearly don't
789 expect Cygwin names.
790 (_DebPrint): Define.
791 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
792 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
793 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
794 (w32_last_error): Remove.
795
796 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
797
798 * w32heap.c (syspage_mask): Declare here.
799 (cache_system_info): Remove.
800
801 * w32inevt.c (faked_key): Define globally, not statically.
802 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
803 (w32_console_toggle_lock_key): Move to w32fns.c.
804
805 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
806
807 * w32proc.c (_DebPrint): Move to w32fns.c.
808 * w32select.c: Include string.h, stdio.h for Cygwin.
809 * w32select.h: New File.
810
811 * w32term.c: Include io.h for non-CYGWIN builds; needed for
812 get_osfhandle.
813 (w32_message_fd): New variable. Under Cygwin, holds the file
814 descriptor the system used to tell us about pending thread
815 messages.
816
817 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
818 that prevented compilation under non-WINDOWSNT systems.
819
820 (w32_initialize): Open /dev/windows and assign it to
821 w32_message_fd. Provide w32 feature.
822
823 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
824 (WM_EMACS_INPUT_READY): add.
825 (prepend_msg, w32_message_fd): Declare globally.
826
827 * w32xfns.c:
828 (keyboard_handle): Use only when WINDOWSNT.
829 (notify_msg_ready): New function. Posts a message to the main
830 thread's message queue under CYGWIN, which wakes up the main
831 thread from select(2) by making the /dev/windows file descriptor
832 ready. Under WINDOWSNT, it sets an event the same way the old
833 code did.
834
835 (post, prepend_msg): Actually call notify_msg_ready instead of
836 setting the input event directly.
837
838 2012-10-07 Eli Zaretskii <eliz@gnu.org>
839
840 * ralloc.c (relinquish): If a heap is ready to be relinquished,
841 but it still has blocs in it, don't return it to the system,
842 instead of aborting. (Bug#12402)
843
844 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
845
846 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
847
848 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
849 MAC_OS_X_VERSION_10_6.
850 (syms_of_nsterm): Remove comment about Panther and above for
851 ns-antialias-text.
852 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
853 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
854 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
855
856 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
857 MAC_OS_X_VERSION_10_4.
858
859 * nsmenu.m (fillWithWidgetValue:): Remove code for <
860 MAC_OS_X_VERSION_10_2.
861
862 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
863
864 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
865 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
866
867 * nsterm.m (ns_in_resize): Remove (Bug#12479).
868 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
869 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
870 Remove ns_in_resize check.
871 (ns_clear_frame_area): Remove resize handle code.
872
873 * nsfns.m (ns_in_resize): Remove.
874 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
875 Remove ns_in_resize check.
876
877 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
878
879 Improve sys_siglist detection.
880 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
881 defined as a macro, as is done in Solaris.
882 (sys_siglist_entries): New macro.
883 (save_strsignal): Use it.
884 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
885 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
886
887 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
888
889 * nsfns.m (Fx_create_frame): Call x_default_parameter with
890 fullscreen/Fullscreen.
891
892 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
893 tobar_height is new.
894
895 * nsterm.m (x_make_frame_visible): Check for fullscreen.
896 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
897 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
898 (windowDidResize:): Check for correct window if old style fullscreen.
899 Capitalize word in comment. Remove incorrect comment.
900 (initFrameFromEmacs:): tbar_height renamed tibar_height.
901 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
902 error in drawing background.
903 (toggleFullScreen:): Remove comment. Rearrange calls.
904 Set toolbar values to zero, save old height in tobar_height.
905 Restore tool bar height when leaving fullscreen.
906 (canBecomeMainWindow): New function.
907
908 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
909
910 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
911
912 2012-10-05 Eli Zaretskii <eliz@gnu.org>
913
914 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
915
916 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
917 that time stamps of directories could also be changed.
918 Don't request the too broad GENERIC_WRITE, only the more restrictive
919 FILE_WRITE_ATTRIBUTES access rights.
920
921 * fileio.c (Fset_file_times): Special-case ignoring errors for
922 directories only on MSDOS, not on MS-Windows.
923
924 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
925
926 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
927
928 2012-10-04 Eli Zaretskii <eliz@gnu.org>
929
930 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
931 see whether CreateFile failed.
932
933 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
934
935 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
936 to avoid similar races.
937 * keyboard.c (pending_signals): Now bool, not int.
938
939 Port timers to OpenBSD, plus check for timer failures.
940 OpenBSD problem reported by Han Boetes.
941 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
942 and/or setitimer.
943 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
944 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
945 like OpenBSD, which has timer_settime but does not declare it.
946 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
947 whether to use itimerspec-related primitives. All uses of
948 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
949
950 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
951
952 * profiler.c (handle_profiler_signal): Fix a malloc race
953 that caused Emacs to hang on Fedora 17 when profiling Lisp.
954
955 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
956
957 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
958
959 2012-10-02 Eli Zaretskii <eliz@gnu.org>
960
961 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
962 consistent with the change in return value of 'safe_strsignal'.
963
964 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
965
966 Prefer plain 'static' to 'static inline' (Bug#12541).
967 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
968 (bidi_set_sor_type, bidi_push_embedding_level)
969 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
970 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
971 (bidi_cache_search, bidi_cache_ensure_space)
972 (bidi_cache_iterator_state, bidi_cache_find)
973 (bidi_peek_at_next_level, bidi_set_paragraph_end)
974 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
975 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
976 Now 'static', not 'static inline'.
977
978 Count overruns when profiling; change units to ns.
979 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
980 Give extra weight to samples after overruns, to attempt to count
981 the time more accurately.
982 (setup_cpu_timer): Change sampling interval units from ms to ns, since
983 the underlying primitives nominally do ns.
984 (Fprofiler_cpu_start): Document the change. Mention that
985 the sampling intervals are only approximate.
986
987 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
988
989 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
990
991 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
992 case for the special 0 coding-system.
993
994 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
995 (Fmake_overlay): Remove redundant tests.
996 (fix_start_end_in_overlays): Remove redundant recentering.
997
998 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
999
1000 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1001 Update dependencies.
1002
1003 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1004
1005 Fix a malloc race condition involving strsignal.
1006 A signal can arrive in the middle of a malloc, and Emacs's signal
1007 handler can invoke strsignal, which can invoke malloc, which is
1008 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1009 Fix it by altering the signal handler so that it does not invoke
1010 strsignal.
1011 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1012 * process.c (status_message): Use const pointer, in case strsignal
1013 is #defined to safe_strsignal.
1014 * sysdep.c (sys_siglist, init_signals): Always define and
1015 initialize a substitute sys_siglist if the system does not define
1016 one, even if HAVE_STRSIGNAL.
1017 (safe_strsignal): Rename from strsignal. Always define,
1018 using sys_siglist. Return a const pointer.
1019 * syssignal.h (safe_strsignal): New decl.
1020 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1021
1022 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1023
1024 * w32proc.c (timer_loop): Fix code that waits for timer
1025 expiration, to avoid high CPU usage.
1026
1027 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1028
1029 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1030 (sweep_weak_table): Remove redundant prototypes.
1031
1032 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1033
1034 * emacs.c: Move the inclusion of TERM_HEADER after including
1035 windows.h on WINDOWSNT. This avoids compilation problems with
1036 MSVC.
1037
1038 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1039
1040 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1041 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1042 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1043 as the previous version used 'void *'.
1044
1045 * ralloc.c (ROUNDUP): Fix last change.
1046 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1047 'size_t'.
1048
1049 * w32proc.c <disable_itimers>: New static flag.
1050 (init_timers): Initialize it to zero, after creating the critical
1051 sections used by the timer threads.
1052 (term_timers): Set to 1 before deleting the critical sections.
1053 (getitimer, setitimer): If disable_itimers is non-zero, return an
1054 error indication without doing anything. Reported by Fabrice
1055 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1056 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1057 return results.
1058 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1059 support timers.
1060
1061 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1062 term_ntproc after all the other bookkeeping, to get timers working
1063 as long as possible.
1064
1065 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1068 Suggested by Juri Linkov in
1069 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1070
1071 Prefer plain 'static' to 'static inline' (Bug#12541).
1072 With static functions, modern compilers inline pretty well by
1073 themselves; advice from programmers often hurts as much as it helps.
1074 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1075 this change shrinks the text size of the Emacs executable by 1.1%
1076 without affecting CPU significantly in my benchmark.
1077 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1078 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1079 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1080 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1081 (bset_auto_fill_function, bset_auto_save_file_format)
1082 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1083 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1084 (bset_cache_long_line_scans, bset_case_fold_search)
1085 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1086 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1087 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1088 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1089 (bset_header_line_format, bset_indicate_buffer_boundaries)
1090 (bset_indicate_empty_lines, bset_invisibility_spec)
1091 (bset_left_fringe_width, bset_major_mode, bset_mark)
1092 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1093 (bset_name, bset_overwrite_mode, bset_pt_marker)
1094 (bset_right_fringe_width, bset_save_length)
1095 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1096 (bset_scroll_up_aggressively, bset_selective_display)
1097 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1098 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1099 (set_buffer_overlays_after):
1100 * category.c (bset_category_table):
1101 * charset.c (read_hex):
1102 * coding.c (produce_composition, produce_charset)
1103 (handle_composition_annotation, handle_charset_annotation)
1104 (char_encodable_p):
1105 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1106 (assign_row, set_frame_matrix_frame, make_current)
1107 (add_row_entry):
1108 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1109 * fns.c (maybe_resize_hash_table):
1110 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1111 * gmalloc.c (register_heapinfo):
1112 * image.c (lookup_image_type):
1113 * intervals.c (set_interval_object, set_interval_left)
1114 (set_interval_right, copy_interval_parent, rotate_right)
1115 (rotate_left, balance_possible_root_interval):
1116 * keyboard.c (kset_echo_string, kset_kbd_queue)
1117 (kset_keyboard_translate_table, kset_last_prefix_arg)
1118 (kset_last_repeatable_command, kset_local_function_key_map)
1119 (kset_overriding_terminal_local_map, kset_real_last_command)
1120 (kset_system_key_syms, clear_event, set_prop):
1121 * lread.c (digit_to_number):
1122 * marker.c (attach_marker, live_buffer, set_marker_internal):
1123 * nsterm.m (ns_compute_glyph_string_overhangs):
1124 * process.c (pset_buffer, pset_command)
1125 (pset_decode_coding_system, pset_decoding_buf)
1126 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1127 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1128 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1129 * syntax.c (bset_syntax_table, dec_bytepos):
1130 * terminal.c (tset_param_alist):
1131 * textprop.c (interval_has_some_properties)
1132 (interval_has_some_properties_list):
1133 * window.c (wset_combination_limit, wset_dedicated)
1134 (wset_display_table, wset_hchild, wset_left_fringe_width)
1135 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1136 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1137 (wset_right_fringe_width, wset_right_margin_cols)
1138 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1139 (wset_vertical_scroll_bar_type, wset_window_parameters):
1140 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1141 (wset_column_number_displayed, wset_region_showing)
1142 (window_box_edges, run_window_scroll_functions)
1143 (append_glyph_string_lists, prepend_glyph_string_lists)
1144 (append_glyph_string, set_glyph_string_background_width)
1145 (append_glyph, append_composite_glyph)
1146 (take_vertical_position_into_account):
1147 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1148 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1149 (lface_hash, lface_same_font_attributes_p, lookup_face):
1150 * xml.c (libxml2_loaded_p):
1151 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1152 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1153 Now 'static', not 'static inline'.
1154
1155 * bidi.c: Tune.
1156 (bidi_copy_it): Do the whole copy with a single memcpy.
1157 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1158
1159 Revert the FOLLOW-SYMLINKS change for file-attributes.
1160 Doing it right would require several changes to Tramp, and there's
1161 not enough time to get that tested before the freeze today.
1162 * dired.c (directory_files_internal, Ffile_attributes):
1163 Undo last change.
1164
1165 * frame.c (x_report_frame_params): Port better to wider ints.
1166 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1167 or that pointers can be printed in 15 decimal digits.
1168 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1169
1170 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1171
1172 Support x64 build on MS-Windows.
1173 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1174 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1175 compatibility with x64.
1176 (x_get_focus_frame): Add prototype.
1177
1178 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1179 defining an XRectangle structure.
1180
1181 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1182 arithmetics for compatibility with x64.
1183
1184 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1185 compatibility with x64.
1186
1187 * w32heap.h: Adjust prototypes and declarations.
1188
1189 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1190 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1191 DWORD, long, and unsigned long, for compatibility with x64.
1192 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1193 (sbrk): Argument is now of type ptrdiff_t.
1194
1195 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1196 less than 0x0500.
1197 (w32_msg_pump): Use WPARAM type for 'result'.
1198
1199 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1200 architecture.
1201 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1202 compatibility with x64.
1203
1204 * vm-limit.c (lim_data): Now size_t.
1205 (check_memory_limits): Adjust prototypes of real_morecore and
1206 __morecore to receive argument of type ptrdiff_t. Use size_t for
1207 five_percent and data_size.
1208
1209 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1210 variables, for compatibility with x64.
1211 (rva_to_section, offset_to_section, relocate_offset)
1212 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1213 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1214 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1215 for compatibility with x64.
1216
1217 * sysdep.c (STDERR_FILENO): Define if not already defined.
1218
1219 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1220 (__morecore): Argument type is now ptrdiff_t.
1221 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1222 (relinquish): Use ptrdiff_t type for 'excess'.
1223 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1224
1225 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1226 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1227 instead of a literal number.
1228
1229 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1230 (min): Define only if not already defined.
1231
1232 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1233 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1234 hosts.
1235
1236 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1237 'bitmaps' is a pointer.
1238
1239 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1240
1241 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1242
1243 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1244
1245 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1246 * dired.c (directory_files_internal, Ffile_attributes):
1247 New arg follow_symlinks. All uses changed.
1248
1249 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1250
1251 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1252
1253 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1254
1255 Support atimers and CPU profiler via profile.c on MS-Windows.
1256 * w32proc.c (sig_mask, crit_sig): New static variables.
1257 (sys_signal): Support SIGALRM and SIGPROF.
1258 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1259 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1260 sigfillset, and sigprocmask are no longer no-ops.
1261 (sigismember): New function.
1262 (struct itimer_data): New definition.
1263 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1264 (crit_prof): New static variables.
1265 (MAX_SINGLE_SLEEP): New definition.
1266 (timer_loop, stop_timer_thread, term_timers, init_timers)
1267 (start_timer_thread, getitimer, setitimer): New functions.
1268 (alarm): No longer a no-op, calls setitimer.
1269
1270 * w32.c (term_ntproc): Call term_timers.
1271 (init_ntproc): Make sure all signals are unblocked at startup, to
1272 erase any traces of dumping. Call init_timers.
1273
1274 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1275 Windows-specific code to display the hourglass mouse pointer is no
1276 longer used.
1277 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1278 to hourglass timer expiration.
1279 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1280 Remove, no longer used.
1281 (w32_note_current_window, show_hourglass, hide_hourglass):
1282 New functions, in support of hourglass cursor display similar to other
1283 window systems.
1284 (syms_of_w32fns): Don't initialize hourglass_timer.
1285
1286 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1287 WINDOWSNT as well.
1288 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1289
1290 * w32.h (init_timers, term_timers): Add prototypes.
1291
1292 2012-09-30 Kenichi Handa <handa@gnu.org>
1293
1294 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1295 to the buffer relocation which may be caused by ccl_driver.
1296
1297 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1298
1299 * xfns.c (Fx_file_dialog): Update comment.
1300
1301 * w32fns.c (Fx_file_dialog): Update comment.
1302
1303 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1304 Initialize panel name field if OSX >= 10.6.
1305
1306 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1307
1308 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1309
1310 * nsterm.m (NEW_STYLE_FS): New define.
1311 (ns_fullscreen_hook, windowWillEnterFullScreen)
1312 (windowDidEnterFullScreen, windowWillExitFullScreen)
1313 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1314 (setFSValue): New functions.
1315 (EmacsFSWindow): New implementation.
1316 (canBecomeKeyWindow): New function for EmacsFSWindow.
1317 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1318 (dealloc): Release nonfs_window if in fullscreen.
1319 (updateFrameSize:): Call windowDidMove to update top/left.
1320 (windowWillResize:toSize:): Check if frame is still maximized.
1321 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1322 next_maximized, maximized_width, maximized_height and nonfs_window.
1323 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1324 tbar_height.
1325 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1326 fullscreen. Set maximized_width/height. Act on next_maximized.
1327
1328 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1329 (EmacsView): Add variables for fullscreen.
1330 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1331 (EmacsFSWindow): New interface for fullscreen.
1332
1333 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1334
1335 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1336
1337 2012-09-30 Chong Yidong <cyd@gnu.org>
1338
1339 * fns.c (Frandom): Doc fix.
1340
1341 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1342
1343 * window.c (Vwindow_combination_limit): New default value.
1344 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1345
1346 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1347
1348 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1349 Suggested by Eli Zaretskii in
1350 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1351
1352 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1353
1354 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1355 HAVE_TIMER_SETTIME is defined.
1356
1357 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1358
1359 Profiler improvements: more-accurate timers, overflow checks.
1360 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1361 signal.h, setjmp.h. Include systime.h instead.
1362 (saturated_add): New function.
1363 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1364 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1365 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1366 New static vars.
1367 (enum profiler_cpu_running): New enum.
1368 (profiler_cpu_running): Now of that enum type, not bool.
1369 All uses changed to store the new value.
1370 (handle_profiler_signal): Rename from sigprof_handler_1,
1371 for consistency with other handlers. Do not check whether
1372 cpu_log is a hash-table if garbage collecting, since it
1373 doesn't matter in that case.
1374 (deliver_profiler_signal): Rename from sigprof_handler,
1375 for consistency with other handlers.
1376 (setup_cpu_timer): New function, with much of what used to be in
1377 Fprofiler_cpu_start. Check for out-of-range argument.
1378 Prefer timer_settime if available, and prefer
1379 thread cputime clocks, then process cputime clocks, then
1380 monotonic clocks, to the old realtime clock. Use make_timeval
1381 to round more-correctly when falling back to setitimer.
1382 (Fprofiler_cpu_start): Use it.
1383 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1384 Don't assume that passing NULL as the 2nd argument of setitimer
1385 is the same as passing a pointer to all-zero storage.
1386 Ignore SIGPROF afterwards.
1387 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1388 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1389 non-fatal signal handlers. Ignore SIGPROF on startup.
1390 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1391 in profiler.c, since sysdep.c now uses it.
1392
1393 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1394 Suggested by Eli Zaretskii in
1395 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1396
1397 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1398
1399 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1400
1401 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1402
1403 * lisp.h (struct backtrace): Remove indirection for `function' field.
1404 * xdisp.c (redisplay_internal):
1405 * profiler.c (record_backtrace, sigprof_handler_1):
1406 * alloc.c (Fgarbage_collect):
1407 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1408 (Fbacktrace_frame): Adjust accordingly.
1409
1410 2012-09-28 Glenn Morris <rgm@gnu.org>
1411
1412 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1413 (Frun_hook_with_args_until_failure): Doc fixes.
1414
1415 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1416
1417 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1418 Qautomatic_redisplay and change the symbol name. All users changed.
1419
1420 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1421
1422 * profiler.c (sigprof_handler): Fix race condition.
1423
1424 2012-09-28 Glenn Morris <rgm@gnu.org>
1425
1426 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1427
1428 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1429
1430 Check more robustly for timer_settime.
1431 * Makefile.in (LIB_TIMER_TIME): New macro.
1432 (LIBES): Add it.
1433 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1434 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1435 call timer_settime.
1436
1437 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1438
1439 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1440
1441 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1442
1443 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1444
1445 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1446
1447 * character.h (MAYBE_UNIFY_CHAR): Remove.
1448 * charset.c, charset.h (maybe_unify_char): Now static.
1449 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1450 Since this stuff is now private to charset.c, there's no need for
1451 a public macro and no need to inline by hand.
1452
1453 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1454 Stefan Monnier <monnier@iro.umontreal.ca>
1455 Juanma Barranquero <lekktu@gmail.com>
1456
1457 * profiler.c: New file.
1458 * Makefile.in (base_obj): Add profiler.o.
1459 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1460 ($(BLD)/profiler.$(O)): New target.
1461 * emacs.c (main): Call syms_of_profiler.
1462 * alloc.c (Qautomatic_gc): New constant.
1463 (MALLOC_PROBE): New macro.
1464 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1465 (total_bytes_of_live_objects): New function.
1466 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1467 Call malloc_probe for the memory profiler.
1468 (syms_of_alloc): Define Qautomatic_gc.
1469 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1470 race condition.
1471 (struct backtrace): Move definition...
1472 * lisp.h (struct backtrace): ..here.
1473 (Qautomatic_gc, profiler_memory_running): Declare vars.
1474 (malloc_probe, syms_of_profiler): Declare functions.
1475 * xdisp.c (Qautomatic_redisplay): New constant.
1476 (redisplay_internal): Record itself in backtrace_list.
1477 (syms_of_xdisp): Define Qautomatic_redisplay.
1478
1479 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1480 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1481
1482 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1483
1484 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1485
1486 Prefer POSIX timers if available.
1487 They avoid a race if the timer is too close to the current time.
1488 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1489 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1490 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1491
1492 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1493
1494 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1495 CHAR_STRING_ADVANCE.
1496 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1497 STRING_CHAR_ADVANCE.
1498
1499 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1500
1501 Move Vlibrary_cache to emacs.c and reset before dumping.
1502
1503 * lisp.h (reset_image_types): Declare.
1504 [WINDOWSNT] (Vlibrary_cache): Declare.
1505
1506 * image.c (reset_image_types): New function.
1507
1508 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1509 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1510 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1511
1512 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1513 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1514
1515 * w32.h (Vlibrary_cache): Do not declare.
1516
1517 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1518
1519 * w32proc.c (sys_signal): Handle all signals defined by the
1520 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1521 handlers for signals supported by Windows. Don't override
1522 term_ntproc as the handler for SIGABRT.
1523 (sigaction): Rewrite to call sys_signal instead of duplicating its
1524 code.
1525 (sys_kill): Improve commentary.
1526
1527 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1528 consistency with a signature of a signal handler. All callers
1529 changed.
1530 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1531 install term_ntproc as a signal handler for SIGABRT, as that
1532 should be done by the dumped Emacs.
1533
1534 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1535
1536 * w32select.c (term_w32select): Protect against repeated
1537 invocation by setting clipboard_owner to NULL after calling
1538 DestroyWindow.
1539
1540 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1541 and term_ntproc to their modified signatures.
1542
1543 * character.c (char_string, string_char): Remove calls to
1544 MAYBE_UNIFY_CHAR. See the discussion starting at
1545 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1546 for the details.
1547
1548 2012-09-25 Chong Yidong <cyd@gnu.org>
1549
1550 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1551
1552 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1553
1554 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1555 when encountering an unknown bytecode.
1556
1557 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1558
1559 image.c, indent.c: Use bool for booleans.
1560 * dispextern.h (struct image_type): Members valid_p, load, init
1561 now return bool, not int. All uses changed.
1562 * image.c: Omit unnecessary static decls.
1563 (x_create_bitmap_mask, x_build_heuristic_mask):
1564 Return void, not int, since callers don't care about the return value.
1565 (x_create_bitmap_mask, define_image_type, valid_image_p)
1566 (struct image_keyword, parse_image_spec, image_spec_value)
1567 (check_image_size, image_background)
1568 (image_background_transparent, x_clear_image_1)
1569 (postprocess_image, lookup_image, x_check_image_size)
1570 (x_create_x_image_and_pixmap, xbm_image_p)
1571 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1572 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1573 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1574 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1575 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1576 (png_image_p, init_png_functions, png_load_body, png_load)
1577 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1578 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1579 (init_gif_functions, gif_load, imagemagick_image_p)
1580 (imagemagick_load_image, imagemagick_load, svg_image_p)
1581 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1582 (gs_load):
1583 * nsimage.m (ns_load_image):
1584 * nsterm.m (ns_defined_color):
1585 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1586 * xfns.c (x_defined_color):
1587 * xterm.c (x_alloc_lighter_color_for_widget)
1588 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1589 (x_alloc_lighter_color):
1590 * indent.c (disptab_matches_widthtab, current_column)
1591 (scan_for_column, string_display_width, indented_beyond_p)
1592 (compute_motion, vmotion, Fvertical_motion):
1593 Use bool for booleans.
1594
1595 2012-09-24 Chong Yidong <cyd@gnu.org>
1596
1597 * chartab.c (Fset_char_table_default): Obsolete function removed.
1598
1599 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1600
1601 Move pid_t related decls out of lisp.h.
1602 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1603 (interruptible_wait_for_termination):
1604 Move these decls from lisp.h to syswait.h, since they use pid_t.
1605 Needed on FreeBSD; see Herbert J. Skuhra in
1606 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1607 * callproc.c: Include syswait.h.
1608
1609 gnutls.c, gtkutil.c: Use bool for boolean.
1610 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1611 (emacs_gnutls_handle_error):
1612 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1613 (xg_hide_tooltip, xg_create_frame_widgets)
1614 (create_dialog, xg_uses_old_file_dialog)
1615 (xg_get_file_with_chooser, xg_get_file_with_selection)
1616 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1617 (xg_item_label_same_p, xg_update_menubar)
1618 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1619 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1620 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1621 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1622 (update_frame_tool_bar, free_frame_tool_bar):
1623 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1624 * nsmenu.m (ns_update_menubar):
1625 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1626 * xfns.c (Fx_show_tip) [USE_GTK]:
1627 Use bool for boolean.
1628 * gtkutil.c (xg_update_frame_menubar):
1629 * xmenu.c (update_frame_menubar):
1630 Return void, not int, since caller ignores return value.
1631 * gtkutil.c (xg_change_toolbar_position):
1632 Return void, not 1.
1633
1634 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1635
1636 * makefile.w32-in (BLOCKINPUT_H): Remove.
1637 (SYSSIGNAL_H): New macro.
1638 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1639 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1640 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1641 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1642 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1643 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1644 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1645 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1646 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1647 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1648 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1649 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1650 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1651 ($(BLD)/w32xfns.$(O)): Update dependencies.
1652
1653 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1654
1655 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1656 fatal_error_backtrace.
1657
1658 * w32proc.c (sys_kill): Undo last change: don't do anything when
1659 invoked to deliver SIGABRT to our own process. This is now
1660 handled by emacs_raise.
1661
1662 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1663
1664 * w32term.c (w32_read_socket): Remove leftover reference to
1665 interrupt_input_pending.
1666
1667 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1668
1669 Do not use SA_NODEFER.
1670 Problem reported by Dani Moncayo in
1671 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1672 * alloc.c (die):
1673 * sysdep.c (emacs_abort): Do not reset signal handler.
1674 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1675 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1676 wanted even on POSIXish hosts, and it doesn't work on Windows.
1677
1678 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1679
1680 * xterm.c (x_term_init): Call fixup_locale before and after calling
1681 gtk_init (Bug#12392).
1682
1683 2012-09-23 Chong Yidong <cyd@gnu.org>
1684
1685 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1686 Vdynamic_library_alist.
1687
1688 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1689 (Fgnutls_available_p): Caller changed.
1690
1691 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1692 (Flibxml_parse_xml_region): Likewise.
1693
1694 * dispextern.h (struct image_type): Remove arg from init function.
1695
1696 * image.c (Finit_image_library, lookup_image_type)
1697 (define_image_type): Remove now-unneeded second arg.
1698 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1699 (init_tiff_functions, init_gif_functions, init_svg_functions):
1700 Arglist and w32_delayed_load calling convention changed.
1701 (gs_type): Remove init_gs_functions; there is no such function.
1702 (valid_image_p, make_image): Fix caller to lookup_image_type.
1703
1704 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1705
1706 Simplify and avoid signal-handling races (Bug#12471).
1707 * alloc.c (die):
1708 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1709 Avoid recursive loop if there's a fatal error in the function itself.
1710 * atimer.c (pending_atimers):
1711 * blockinput.h: Don't include "atimer.h"; no longer needed.
1712 (interrupt_input_pending): Remove. All uses removed.
1713 pending_signals now counts both atimers and ordinary interrupts.
1714 This is less racy than having three separate pending-signal flags.
1715 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1716 (input_blocked_p):
1717 Rename from their upper-case counterparts BLOCK_INPUT,
1718 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1719 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1720 This makes it easier to access volatile variables more accurately.
1721 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1722 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1723 that's more reliable if the code is buggy and sets
1724 interrupt_input_blocked to a negative value. All uses changed.
1725 * atimer.c (deliver_alarm_signal):
1726 Remove. No need to deliver this to the parent; any thread can
1727 handle this signal now. All uses replaced by underlying handler.
1728 * atimer.c (turn_on_atimers):
1729 * dispnew.c (handle_window_change_signal):
1730 * emacs.c (handle_danger_signal):
1731 * keyboard.c (kbd_buffer_get_event):
1732 Don't reestablish signal handler; not needed with sigaction.
1733 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1734 (UNBLOCK_INPUT_TO):
1735 Rework to avoid unnecessary accesses to volatile variables.
1736 (UNBLOCK_INPUT_TO): Now a function.
1737 (totally_unblock_input, unblock_input): New decls.
1738 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1739 (init_data): Remove. Necessary stuff now done in init_signal.
1740 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1741 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1742 (fatal_error_code): Remove; no longer needed.
1743 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1744 it doesn't always backtrace. All uses changed. No need to reset
1745 signal to default, since sigaction and/or die does that for us now.
1746 Use emacs_raise (FOO), not kill (getpid (), FOO).
1747 (main): Check more-accurately whether we're dumping.
1748 Move fatal-error setup to sysdep.c
1749 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1750 * gtkutil.c (xg_get_file_name, xg_get_font):
1751 Remove no-longer-needed signal-mask manipulation.
1752 * keyboard.c, process.c (POLL_FOR_INPUT):
1753 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1754 * keyboard.c (read_avail_input): Remove.
1755 All uses replaced by gobble_input.
1756 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1757 (kbd_buffer_store_event_hold, gobble_input):
1758 (record_asynch_buffer_change) [USABLE_SIGIO]:
1759 (store_user_signal_events):
1760 No need to mess with signal mask.
1761 (gobble_input): If blocking input and there are terminals, simply
1762 set pending_signals to 1 and return. All hooks changed to not
1763 worry about whether input is blocked.
1764 (process_pending_signals): Clear pending_signals before processing
1765 them, in case a signal comes in while we're processing.
1766 By convention callers now test pending_signals before calling us.
1767 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1768 New functions, to support changes to blockinput.h.
1769 (handle_input_available_signal): Now extern.
1770 (reinvoke_input_signal): Remove. All uses replaced by
1771 handle_async_input.
1772 (quit_count): Now volatile, since a signal handler uses it.
1773 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1774 All callers changed. Block SIGINT only if not already blocked.
1775 Clear sigmask reliably, even if Fsignal returns, which it can.
1776 Omit unnecessary accesses to volatile var.
1777 (quit_throw_to_read_char): No need to restore sigmask.
1778 * keyboard.c (gobble_input, handle_user_signal):
1779 * process.c (wait_reading_process_output):
1780 Call signal-handling code rather than killing ourselves.
1781 * lisp.h: Include <float.h>, for...
1782 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1783 (pending_signals): Now volatile.
1784 (syms_of_data): Now const if IEEE floating point.
1785 (handle_input_available_signal) [USABLE_SIGIO]:
1786 (terminate_due_to_signal, record_child_status_change): New decls.
1787 * process.c (create_process): Avoid disaster if memory is exhausted
1788 while we're processing a vfork, by tightening the critical section
1789 around the vfork.
1790 (send_process_frame, process_sent_to, handle_pipe_signal)
1791 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1792 ignores SIGPIPE.
1793 (send_process): No need for setjmp/longjmp any more, since the
1794 SIGPIPE stuff is now gone. Instead, report an error if errno
1795 is EPIPE.
1796 (record_child_status_change): Now extern. PID and W are now args.
1797 Return void, not bool. All callers changed.
1798 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1799 Remove. All uses removed. This bug should be fixed now in a
1800 different way.
1801 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1802 and record the child status change directly. This avoids the
1803 need to futz with the signal mask.
1804 (process_fatal_action): Move here from emacs.c.
1805 (emacs_sigaction_flags): New function, containing
1806 much of what used to be in emacs_sigaction_init.
1807 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1808 caught by emacs, to make races less likely.
1809 (deliver_process_signal): Rename from handle_on_main_thread.
1810 All uses changed.
1811 (BACKTRACE_LIMIT_MAX): Now at top level.
1812 (thread_backtrace_buffer, threadback_backtrace_pointers):
1813 New static vars.
1814 (deliver_thread_signal, deliver_fatal_thread_signal):
1815 New functions, for more-accurate delivery of thread-specific signals.
1816 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1817 (deliver_arith_signal): Handle in this thread, not
1818 in the main thread, since it's triggered by this thread.
1819 (maybe_fatal_sig): New function.
1820 (init_signals): New arg DUMPING so that we can be more accurate
1821 about whether we're dumping. Caller changed.
1822 Treat thread-specific signals differently from process-general signals.
1823 Block all signals while handling fatal error; that's safer.
1824 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1825 on IEEE hosts.
1826 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1827 Ignore SIGPIPE unless batch.
1828 (emacs_backtrace): Output backtrace for the appropriate thread,
1829 which is not necessarily the main thread.
1830 * syssignal.h: Include <stdbool.h>.
1831 (emacs_raise): New macro.
1832 * xterm.c (x_connection_signal): Remove; no longer needed
1833 now that we use sigaction.
1834 (x_connection_closed): No need to mess with sigmask now.
1835 (x_initialize): No need to reset SIGPIPE handler here, since
1836 init_signals does this for us now.
1837
1838 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1839
1840 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1841 background rect may be larger (Bug#12245).
1842
1843 2012-09-23 Chong Yidong <cyd@gnu.org>
1844
1845 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1846
1847 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1848
1849 * .gdbinit: Just stop at fatal_error_backtrace.
1850 See Stefan Monnier's request in
1851 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1852 Remove no-longer-used query of system type.
1853
1854 2012-09-22 Chong Yidong <cyd@gnu.org>
1855
1856 * search.c (Freplace_match): Doc fix (Bug#12325).
1857
1858 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1859
1860 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1861 (Fline_end_position): Doc fix.
1862
1863 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1864
1865 2012-09-22 Chong Yidong <cyd@gnu.org>
1866
1867 * dispextern.h (struct image_type): Add new slot, storing a type
1868 initialization function.
1869
1870 * image.c (define_image_type): Call the image initializer function
1871 if it is defined. Arguments and return value changed.
1872 (valid_image_p, make_image): Callers changed.
1873 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1874 (gif_type, imagemagick_type, svg_type, gs_type):
1875 Add initialization functions.
1876 (Finit_image_library): Call lookup_image_type.
1877 (CHECK_LIB_AVAILABLE): Macro deleted.
1878 (lookup_image_type): Call define_image_type here, rather than via
1879 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1880 (syms_of_image): Move define_image_type calls for xbm_type and
1881 pbm_type to lookup_image_type.
1882
1883 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1884
1885 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1886 'idle_timers' from here ...
1887 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1888 lists, to avoid infloops when the timer does something stupid,
1889 like reinvoke itself with the same or smaller time-out.
1890 (Bug#12447)
1891
1892 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1893
1894 * window.c (Fsplit_window_internal): Handle only Qt value of
1895 Vwindow_combination_limit separately.
1896 (Qtemp_buffer_resize): New symbol.
1897 (Vwindow_combination_limit): New default value.
1898 Rewrite doc-string.
1899
1900 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1901
1902 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1903 the new overlay string. (Bug#10159)
1904
1905 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1906
1907 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1908 or that fprintf is async-signal-safe. POSIX doesn't require
1909 either assumption.
1910
1911 2012-09-22 Chong Yidong <cyd@gnu.org>
1912
1913 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1914 (Bug#8207).
1915
1916 2012-09-22 Kenichi Handa <handa@gnu.org>
1917
1918 * composite.c (composition_reseat_it): Handle the case that a
1919 grapheme cluster is not covered by a single font (Bug#12352).
1920
1921 2012-09-21 Chong Yidong <cyd@gnu.org>
1922
1923 * image.c (define_image_type): Avoid adding duplicate types to
1924 image_types (Bug#12463). Suggested by Jörg Walter.
1925
1926 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1927
1928 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1929 (print_load_command_name): Add case LC_DATA_IN_CODE.
1930 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1931
1932 2012-09-21 Glenn Morris <rgm@gnu.org>
1933
1934 * eval.c (Frun_hook_with_args_until_success)
1935 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1936
1937 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1938
1939 * fileio.c (Ffile_selinux_context): Only call freecon when
1940 lgetfilecon succeeded.
1941 (Fset_file_selinux_context): Likewise. (Bug#12444)
1942
1943 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1944
1945 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1946 reordering, locate the cursor by calling set_cursor_from_row; if
1947 that fails, clear the desired glyph matrix before returning a
1948 failure indication to the caller. Fixes leaving garbled display
1949 when fast scrolling with a down-key. (Bug#12403)
1950 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1951 scrolling through multibyte text.
1952
1953 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1954
1955 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1956 calling mark_vectorlike since that's the one that marks the window.
1957 (mark_discard_killed_buffers): Mark the final cdr.
1958 * window.h (struct window): Move prev/next_buffers to the
1959 non-standard fields.
1960 * window.c (make_window): Initialize prev/next_buffers manually.
1961
1962 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1963
1964 Omit unused arg EXPECTED from socket hooks.
1965 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1966 * nsterm.m (ns_term_init):
1967 * termhooks.h (struct terminal.read_socket_hook):
1968 * w32inevt.c (w32_console_read_socket):
1969 * w32term.c (w32_read_socket):
1970 * xterm.c (XTread_socket):
1971 Omit unused arg EXPECTED. All callers changed.
1972 (store_user_signal_events): Return void, not int, since callers no
1973 longer care about the return value. All uses changed.
1974
1975 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1976
1977 * w32gui.h (XParseGeometry): Do not declare.
1978
1979 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1980
1981 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1982 Ignore 'expected'. See Eli Zaretskii in
1983 <http://bugs.gnu.org/12471#8> (last line).
1984
1985 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1986 (XParseGeometry): Now static. Substitute extremal values for
1987 values that are out of range.
1988
1989 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1990
1991 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1992
1993 * nsfns.m (XParseGeometry): Remove.
1994 (Fx_create_frame): Call x_set_offset to correctly interpret
1995 top_pos in geometry.
1996
1997 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1998 (Fx_parse_geometry): If there is a space in string, call
1999 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2000
2001 2012-09-17 Eli Zaretskii <eliz@gnu.org>
2002
2003 * search.c (scan_buffer): Use character positions in calls to
2004 region_cache_forward and region_cache_backward, not byte
2005 positions. (Bug#12196)
2006
2007 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2008 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2009
2010 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2011 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2012 emacs_blocked_malloc, now deleted.
2013
2014 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2015
2016 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2017 The workaround was for improving performance on Solaris 2.4, but
2018 is getting in the way now. Emacs will still work if someone is
2019 still running Solaris 2.4 in a museum somewhere; Sun dropped
2020 support for Solaris 2.4 in 2003.
2021 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2022 * process.c (create_process) [HAVE_WORKING_VFORK]:
2023 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2024 since Emacs no longer uses vfork on that platform.
2025
2026 2012-09-17 Glenn Morris <rgm@gnu.org>
2027
2028 * emacs.c: Use COPYRIGHT.
2029
2030 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2031
2032 Remove configure's --without-sync-input option (Bug#12450).
2033 When auditing signal-handling in preparation for cleaning it up,
2034 I found that SYNC_INPUT has race conditions and would be a real
2035 pain to fix. Since it's an undocumented and deprecated
2036 configure-time option, now seems like a good time to remove it.
2037 Also see <http://bugs.gnu.org/11080#16>.
2038 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2039 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2040 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2041 (malloc_hysteresis):
2042 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2043 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2044 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2045 (dont_register_blocks, bytes_used_when_reconsidered)
2046 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2047 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2048 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2049 Remove. All uses removed.
2050 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2051 implementation, one that depends on whether the new macro
2052 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2053 is defined.
2054 * atimer.c (run_timers, handle_alarm_signal):
2055 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2056 (handle_async_input, process_pending_signals)
2057 (handle_input_available_signal, init_keyboard):
2058 * nsterm.m (ns_read_socket):
2059 * process.c (wait_reading_process_output):
2060 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2061 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2062 (emacs_write):
2063 * xterm.c (XTread_socket):
2064 Assume SYNC_INPUT.
2065 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2066 * eval.c (handling_signal): Remove. All uses removed.
2067 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2068 All uses replaced with the SYNC_INPUT version.
2069 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2070 Remove decls.
2071 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2072 Now static.
2073
2074 * font.c (Ffont_shape_gstring): Remove unused local.
2075
2076 2012-09-16 Glenn Morris <rgm@gnu.org>
2077
2078 * Makefile.in (clean): No longer run nextstep's clean.
2079
2080 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2081 (ns_frag): Remove.
2082 (ns-app): Move here from ns.mk, and simplify.
2083 (clean): Simplify nextstep entry.
2084 * ns.mk: Remove file.
2085
2086 2012-09-17 Kenichi Handa <handa@gnu.org>
2087
2088 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2089 not covert the last few charactes.
2090
2091 2012-09-16 Kenichi Handa <handa@gnu.org>
2092
2093 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2094 here, but just check the validity of glyphs in the glyph-string.
2095
2096 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2097
2098 * window.c (Fwindow_parameter, Fset_window_parameter):
2099 Accept any window as argument (Bug#12452).
2100
2101 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2102
2103 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2104 to ns_term_init to avoid memory leak.
2105
2106 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2107 explicit retain/release.
2108 (ns_term_init): Only allow one display. Initialize outerpool and
2109 ns_*_types.
2110
2111 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2112
2113 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2114 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2115 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2116 the Microsoft problem in a different way, by altering ../nt/config.nt.
2117
2118 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2119
2120 * w32xfns.c:
2121 * w32uniscribe.c:
2122 * w32term.c:
2123 * w32select.c:
2124 * w32reg.c:
2125 * w32proc.c:
2126 * w32menu.c:
2127 * w32inevt.c:
2128 * w32heap.c:
2129 * w32font.c:
2130 * w32fns.c:
2131 * w32console.c:
2132 * w32.c:
2133 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2134 by lisp.h. This completes removal of setjmp.h inclusion
2135 erroneously announced in the previous commit. (Bug#12446)
2136
2137 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2138 more accurate.
2139
2140 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2141 not defined as a macro. The latter happens on MS-Windows.
2142 (Bug#12446)
2143
2144 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2145
2146 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2147 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2148 Some instances of '#include <setjmp.h>' removed, if the
2149 only reason for the instance was because "lisp.h" was included.
2150 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2151 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2152 and _longjmp with the new symbols. Emacs already uses _setjmp if
2153 available, so this change affects only POSIXish hosts that have
2154 sigsetjmp but not _setjmp, such as some versions of Solaris and
2155 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2156 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2157 (png_load_body) [HAVE_PNG]:
2158 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2159 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2160 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2161 since PNG requires jmp_buf. This is the only exception to the
2162 general rule that we now use sys_setjmp and sys_longjmp.
2163 This exception is OK since this code does not change the signal
2164 mask or longjmp out of a signal handler.
2165
2166 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2167
2168 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2169 Include "syssignal.h", for 'main_thread'.
2170
2171 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2172
2173 Avoid out-of-range marker position (Bug#12426).
2174 * insdel.c (replace_range, replace_range_2):
2175 Adjust markers before overlays, as suggested by comments.
2176 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2177 Remove redundant check before calling offset_intervals.
2178
2179 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2180
2181 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2182 current buffer (Bug#12387).
2183
2184 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2185
2186 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2187
2188 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2189
2190 Use a more backwards-compatible timer format (Bug#12430).
2191 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2192 vector element, not from the 4th, since PSECS is now at the end.
2193 (Fcurrent_idle_time): Doc fix.
2194
2195 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2196
2197 Function to mark objects and remove killed buffers at once.
2198 * alloc.c (discard_killed_buffers): Rename to ...
2199 (mark_discard_killed buffers) ... new name. Add marking
2200 of remaining objects. Fix comment. Adjust users.
2201 (mark_object): Do not touch frame buffer lists here.
2202 * frame.c (delete_frame): Reset frame buffer lists here.
2203
2204 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2205
2206 Better workaround for GNOME bug when --enable-gcc-warnings.
2207 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2208 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2209 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2210
2211 Simplify SIGIO usage (Bug#12408).
2212 The code that dealt with SIGIO was crufty and confusing, e.g., it
2213 played tricks like "#undef SIGIO" but these tricks were not used
2214 consistently. Simplify mostly by not #undeffing standard symbols,
2215 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2216 or not as we please) rather than "defined SIGIO" (standard symbol
2217 that we probably shouldn't #undef).
2218 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2219 Modules that need it can include it.
2220 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2221 * dispextern.h (ignore_sigio): New decl.
2222 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2223 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2224 * emacs.c (shut_down_emacs):
2225 * keyboard.c (kbd_buffer_store_event_hold):
2226 Use ignore_sigio rather than invoking 'signal' directly.
2227 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2228 for FIONREAD.
2229 (FIONREAD, SIGIO): Do not #undef.
2230 (tty_read_avail_input): Use #error rather than a syntax error.
2231 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2232 for I_PIPE, used by SETUP_SLAVE_PTY.
2233 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2234 * sysdep.c (croak): Remove; no longer needed. This bit of
2235 temporary code, with Fred N. Fish's comment that it's temporary,
2236 has been in Emacs since at least 1992!
2237 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2238 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2239 * syssignal.h (croak): Remove decl.
2240 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2241 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2242 now that we're termios-only.
2243 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2244 * term.c (dissociate_if_controlling_tty): Use #error rather than
2245 a run-time error.
2246
2247 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2248 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2249 to work around GNOME bug 683906.
2250 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2251 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2252 This works around GCC bug 54561.
2253
2254 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2255
2256 More fixes for 'volatile' and setjmp/longjmp.
2257 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2258 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2259 (png_load_body) [HAVE_PNG]:
2260 (jpeg_load_body) [HAVE_JPEG]:
2261 New function, with most of the old parent function's body.
2262 (png_load) [HAVE_PNG]:
2263 (jpeg_load) [HAVE_JPEG]:
2264 Invoke the new function, to avoid longjmp munging our locals.
2265 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2266 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2267 longjmp is passed 2, as the C standard doesn't guarantee this.
2268 Instead, store the failure code into mgr->failure_code.
2269
2270 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2271
2272 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2273 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2274 (syms_of_keyboard): Remove support for unread-command-char.
2275
2276 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2277
2278 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2279 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2280 violation. (Bug#12426)
2281
2282 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2283
2284 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2285
2286 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2287
2288 * eval.c: Add `inhibit-debugger'.
2289 (Qinhibit_debugger): New symbol.
2290 (call_debugger): Bind it instead of Qdebug_on_error.
2291 (maybe_call_debugger): Test Vinhibit_debugger.
2292 (syms_of_eval): Define inhibit-debugger.
2293 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2294 (syms_of_xdisp): Remove inhibit-debug-on-message.
2295
2296 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2297
2298 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2299 If a nonvolatile local variable is written before a _longjmp to
2300 the frame containing the variable, and is read after the _longjmp,
2301 the value read is indeterminate. Some local variables of type
2302 'struct handler' and 'struct catchtag' are used in this way, so
2303 mark each of their slots as volatile if the slot can be set before
2304 _longjmp and read afterwards.
2305 * lisp.h (struct handler): var and chosen_clause are now volatile.
2306 (struct catchtag): val, next, and pdlcount are now volatile.
2307
2308 * bidi.c (bidi_push_it, bidi_pop_it):
2309 * fns.c (copy_hash_table):
2310 * image.c (define_image_type):
2311 * keyboard.c (kbd_buffer_store_event_hold):
2312 * process.c (Fprocess_send_eof):
2313 * xfaces.c (x_create_gc) [HAVE_NS]:
2314 * xgselect.c (xg_select):
2315 Prefer assignment to memcpy when either will do.
2316
2317 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2318 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2319 time an item is removed. No need to mark this function 'inline';
2320 the compiler knows better than we do.
2321
2322 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2323
2324 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2325 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2326 to change_frame_size (Bug#12388).
2327 (windowDidResize:): Pass YES to updateFrameSize.
2328
2329 * nsterm.h: Add delay parameter to updateFrameSize.
2330
2331 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2332
2333 Discard killed buffers from deleted window and frame objects.
2334 This reduces an amount of references to killed buffers and
2335 helps GC to reclaim them faster.
2336 * alloc.c (discard_killed_buffers): New function.
2337 (mark_object): Use it for deleted windows and frames.
2338 (mark_object): If symbol's value is set up for a killed buffer
2339 or deleted frame, restore its global binding.
2340 * data.c (swap_in_global_binding): Add GC notice.
2341 (swap_in_symval_forwarding): Use convenient set_blv_where.
2342 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2343 * window.h: ... to here.
2344
2345 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2346
2347 Convenient macro to check whether the buffer is live.
2348 * buffer.h (BUFFER_LIVE_P): New macro.
2349 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2350 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2351
2352 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2353
2354 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2355 composition cases (Bug#12364).
2356
2357 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2358 overhang of succeeding glyphs overlapping box cursor.
2359
2360 * w32term.c (x_draw_glyph_string): Likewise.
2361
2362 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2363
2364 Simplify, document, and port floating-point (Bug#12381).
2365 The porting part of this patch fixes bugs on non-IEEE platforms
2366 with frexp, ldexp, logb.
2367 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2368 Now static.
2369 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2370 support, by removing commented-out code and briefly listing the
2371 C89 functions excluded. The commented-out stuff was confusing
2372 maintenance, e.g., we thought we needed cbrt but it was commented out.
2373 (logb): Remove decl; no longer needed.
2374 (isfinite): New macro, if not already supplied.
2375 (isnan): Don't replace any existing macro.
2376 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2377 are present on all C89 platforms.
2378 (Ffrexp): Do not special-case zero, as frexp does the right thing
2379 for that case.
2380 (Flogb): Do not use logb, as it doesn't have the desired meaning
2381 on hosts that use non-base-2 floating point. Instead, stick with
2382 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2383 frexp, to avoid getting an unspecified result.
2384
2385 * xdisp.c (Qinhibit_debug_on_message): Now static.
2386
2387 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2388
2389 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2390 NSBezierPath (Bug#12131).
2391
2392 2012-09-10 Chong Yidong <cyd@gnu.org>
2393
2394 * fns.c (Fdelq, Fdelete): Doc fix.
2395
2396 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2397
2398 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2399 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2400
2401 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2402
2403 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2404 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2405 Use it.
2406
2407 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2408
2409 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2410 left fringe if the window has a left margin. This avoids leaving
2411 traces of the cursor because its leftmost pixel is not drawn over.
2412
2413 * dispnew.c (update_window_line): When the left margin area of a
2414 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2415 that screen line. (Bug#12277)
2416
2417 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2418
2419 Assume C89 or later for math functions (Bug#12381).
2420 This simplifies the code, and makes it a bit smaller and faster,
2421 and (most important) makes it easier to clean up signal handling
2422 since we can stop worring about floating-point exceptions in
2423 library code. That was a problem before C89, but the problem
2424 went away many years ago on all practical Emacs targets.
2425 * data.c, image.c, lread.c, print.c:
2426 Don't include <math.h>; no longer needed.
2427 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2428 might be autoconfigured, as that never happens.
2429 * data.c (fmod):
2430 * doprnt.c (DBL_MAX_10_EXP):
2431 * print.c (DBL_DIG):
2432 Remove. C89 or later always defines these.
2433 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2434 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2435 (arith_error, domain_error, domain_error2):
2436 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2437 no longer needed -- we simply return what C returns. All uses removed.
2438 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2439 the wrapped code.
2440 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2441 Remove. All uses expanded, as these macros are no longer used
2442 more than once and are now more trouble than they're worth.
2443 (Ftan): Use tan, not sin / cos.
2444 (Flogb): Assume C89 frexp.
2445 (fmod_float): Assume C89 fmod.
2446 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2447 (init_floatfns): Remove. All uses removed.
2448
2449 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2450
2451 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2452 compositeToPoint for OSX < 10.6 (Bug#12390).
2453
2454 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2455
2456 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2457 This produces more-accurate results.
2458
2459 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2460
2461 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2462 changes (Bug#12088).
2463
2464 2012-09-08 Chong Yidong <cyd@gnu.org>
2465
2466 * syntax.c (Fstring_to_syntax): Doc fix.
2467
2468 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2469
2470 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2471 in the internal border.
2472 (x_set_window_size): Remove static variables and their usage.
2473 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2474 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2475 Remove fringe/internal border adjustment (Bug#11052).
2476 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2477 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2478 (ns_fix_rect_ibw): Remove.
2479 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2480 (ns_dumpglyphs_box_or_relief): Ditto.
2481 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2482 adjustment.
2483 (ns_dumpglyphs_image): Ditto.
2484 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2485 border adjustment.
2486 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2487 their usage. Add fringe_extended_p and its use as in other terms.
2488 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2489 scroll bar was removed.
2490 (updateFrameSize): New function.
2491 (windowDidResize): Move code to updateFrameSize and call it.
2492
2493 * nsterm.h (EmacsView): Add updateFrameSize.
2494
2495 2012-09-07 Chong Yidong <cyd@gnu.org>
2496
2497 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2498
2499 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2500
2501 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2502
2503 More signal-handler cleanup (Bug#12327).
2504 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2505 Problem introduced when merging patches. Noted by Eli Zaretskii in
2506 <http://bugs.gnu.org/12327#67>.
2507 * floatfns.c: Comment fix.
2508 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2509 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2510 and anyway the declaration is harmless even if SIGDANGER is not defined.
2511 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2512 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2513 source files not surprisingly expected syssignal.h to define, or
2514 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2515 Include <sys/ioctl.h>, for FIONREAD.
2516 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2517 This eliminates a problem whereby other files mysteriously had
2518 to include "syssignal.h" before including "systty.h" if they
2519 wanted to use "#ifdef SIGIO".
2520
2521 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2522
2523 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2524
2525 * w32.c (sigemptyset): Empty the set.
2526 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2527
2528 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2529
2530 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2531
2532 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2533 (mark_object): Likewise for frame objects.
2534
2535 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2536
2537 * syssignal.h (handle_on_main_thread): Always declare,
2538 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2539 This ports to platforms without HAVE_PTHREAD.
2540
2541 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2542
2543 Signal-handler cleanup (Bug#12327).
2544 Emacs's signal handlers were written in the old 4.2BSD style with
2545 sigblock and sigmask and so forth, and this led to some
2546 inefficiencies and confusion. Rewrite these to use
2547 pthread_sigmask etc. without copying signal sets around. Also,
2548 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2549 'signal', and instead use functions that do not attempt to take
2550 over the system name space. This patch causes Emacs's text
2551 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2552 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2553 Do not include <signal.h> or "syssignal.h", as these
2554 modules do not use signals.
2555 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2556 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2557 Do not include <signal.h>, as "syssignal.h" does that for us now.
2558 * atimer.c (sigmask_atimers): New function.
2559 (block_atimers, unblock_atimers): New functions,
2560 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2561 All uses replaced.
2562 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2563 no longer needed here.
2564 * emacs.c (main): Inspect existing signal handler with sigaction,
2565 so that there's no need to block and unblock SIGHUP.
2566 * sysdep.c (struct save_signal): New member 'action', replacing
2567 old member 'handler'.
2568 (save_signal_handlers, restore_signal_handlers):
2569 Use sigaction instead of 'signal' to save and restore.
2570 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2571 New function. All users of 'signal' modified to use set_sighandler
2572 if they're writeonly, and to use sys_signal if they're read+write.
2573 (emacs_sigaction_init, forwarded_signal): New functions.
2574 (sys_signal): Remove. All uses replaced by calls to sigaction
2575 and emacs_sigaction_init, or by direct calls to 'signal'.
2576 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2577 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2578 all uses replaced by pthread_sigmask etc. calls.
2579 * syssignal.h: Include <signal.h>.
2580 (emacs_sigaction_init, forwarded_signal): New decls.
2581 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2582 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2583 (sigmask, sys_sigmask): Remove; no longer needed.
2584 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2585 (sigblock, sigunblock, sigfree):
2586 (sigsetmask) [!defined sigsetmask]:
2587 Remove. All uses replaced by pthread_sigmask.
2588 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2589 no longer need to be replaced, and its typical old uses
2590 are now done via emacs_sigaction_init and sigaction.
2591 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2592 (sys_sigdel): Remove; unused.
2593 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2594
2595 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2596
2597 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2598 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2599
2600 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2601
2602 Explicitly mark buffer_defaults and buffer_local_symbols.
2603 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2604 mark_local_symbols here.
2605 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2606 since special buffers aren't marked here any more.
2607 (allocate_buffer): Chain new buffer with all_buffers here...
2608 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2609 not here.
2610 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2611 (syms_of_buffer): Remove staticpro of the above.
2612 (init_buffer_once): Set names for buffer_defaults and
2613 buffer_local_symbols.
2614
2615 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2616
2617 Use bool for booleans in font-related modules.
2618 * font.c (font_intern_prop, font_style_to_value)
2619 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2620 (generate_otf_features, font_check_otf_features, font_check_otf)
2621 (font_match_p, font_list_entities, font_at):
2622 * fontset.c (fontset_id_valid_p, reorder_font_vector
2623 (fontset_find_font, Fset_fontset_font)
2624 (face_suitable_for_char_p) [0]:
2625 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2626 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2627 (m17n_flt_initialized, ftfont_shape_by_flt):
2628 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2629 * nsfont.m (nsfont_draw):
2630 * w32font.c (w32font_draw):
2631 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2632 Use bool for booleans.
2633 * font.h: Adjust to above API changes.
2634 (struct font, struct font_driver, struct font_driver_list):
2635 Use bool for booleans.
2636 (struct font): Remove useless member encoding_type.
2637 All users removed.
2638 * fontset.c, xftfont.c: Omit unnecessary static decls.
2639
2640 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2641
2642 * alloc.c (mark_object): Revert window marking code
2643 since it's unsafe for the Fset_window_configuration.
2644
2645 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2646
2647 Fix race conditions with signal handlers and errno (Bug#12327).
2648 Be more systematic about preserving errno whenever a signal
2649 handler returns, even if it's not in the main thread. Do this by
2650 renaming signal handlers to distinguish between signal delivery
2651 and signal handling. All uses changed.
2652 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2653 * data.c (deliver_arith_signal): Rename from arith_error.
2654 * dispnew.c (deliver_window_change_signal): Rename from
2655 window_change_signal.
2656 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2657 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2658 * keyboard.c (deliver_input_available_signal): Rename from
2659 input_available_signal.
2660 (deliver_user_signal): Rename from handle_user_signal.
2661 (deliver_interrupt_signal): Rename from interrupt_signal.
2662 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2663 (deliver_child_signal): Rename from sigchld_handler.
2664 * atimer.c (handle_alarm_signal):
2665 * data.c (handle_arith_signal):
2666 * dispnew.c (handle_window_change_signal):
2667 * emacs.c (handle_fatal_signal, handle_danger_signal):
2668 * keyboard.c (handle_input_available_signal):
2669 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2670 * process.c (handle_pipe_signal, handle_child_signal):
2671 New functions, with the actual signal-handling code taken from the
2672 original respective signal handlers, sans the sporadic attempts to
2673 preserve errno, since that's now done by handle_on_main_thread.
2674 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2675 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2676 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2677 Move to sysdep.c.
2678 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2679 Move initialization of main_thread to sysdep.c's init_signals.
2680 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2681 our usage, and simplifies the mainline code.
2682 (record_child_status_change): New static function, as a helper
2683 for handle_child_signal, and with most of the old child handler's
2684 contents.
2685 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2686 (handle_child_signal): Use the above.
2687 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2688 Moved here from emacs.c.
2689 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2690 code moved here from emacs.c's main function.
2691 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2692 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2693 This lets callers save and restore errno properly.
2694
2695 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2696
2697 Remove redundant or unused things here and there.
2698 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2699 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2700 * editfns.c (Fcompare_buffer_substrings): Likewise.
2701 * frame.h (struct terminal, struct font_driver_list):
2702 Remove redundant declarations.
2703 * window.h (Qleft, Qright): Likewise.
2704
2705 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2706
2707 Do not mark objects from deleted buffers, windows and frames.
2708 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2709 (mark_object): Likewise for windows and frames.
2710
2711 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2712
2713 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2714 buffer_defaults and buffer_local_symbols as valid objects.
2715 Return special value to denote them.
2716
2717 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2720 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2721 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2722 (file_name_absolute_p, Fsubstitute_in_file_name):
2723 (check_executable, check_writable, Ffile_accessible_directory_p)
2724 (Fset_file_selinux_context, Fdefault_file_modes)
2725 (Finsert_file_contents, choose_write_coding_system)
2726 (Fwrite_region, build_annotations, a_write, e_write)
2727 (Fdo_auto_save):
2728 * filelock.c (boot_time_initialized, get_boot_time)
2729 (get_boot_time_1, lock_file_1, within_one_second):
2730 * floatfns.c (in_float):
2731 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2732 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2733 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2734 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2735 * window.c (compare_window_configurations):
2736 Use bool for booleans.
2737 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2738 (Fdefault_file_modes): Now mode_t, not int, for modes.
2739 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2740 (internal_delete_file): Now returns void, not a (boolean) int,
2741 since nobody was looking at the return value.
2742 * lisp.h, window.h: Adjust to above API changes.
2743
2744 * xdisp.c (set_message): Simplify and reindent last change.
2745
2746 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2747
2748 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2749
2750 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2751
2752 * eval.c (call_debugger): Make the function non-static so that we
2753 can call it from set_message.
2754
2755 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2756 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2757
2758 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2759
2760 Give more-useful info on a fatal error (Bug#12328).
2761 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2762 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2763 of doing the work ourselves.
2764 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2765 do most of the work.
2766 (fatal_error_backtrace): New function, taken from the guts
2767 of the old fatal_error_signal, but with a new option to output
2768 a backtrace.
2769 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2770 info about the signal than just its number.
2771 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2772 * sysdep.c: Include <execinfo.h>
2773 (emacs_backtrace): New function, taken partly from the previous
2774 code of the 'die' function.
2775 (emacs_abort): Call fatal_error_backtrace rather than abort.
2776
2777 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2778
2779 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2780 eager (load-time) macro-expansion.
2781 * lisp.mk (lisp): Add macroexp.
2782
2783 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2784
2785 Simplify redefinition of 'abort' (Bug#12316).
2786 Do not try to redefine the 'abort' function. Instead, redo
2787 the code so that it calls 'emacs_abort' rather than 'abort'.
2788 This removes the need for the NO_ABORT configure-time macro
2789 and makes it easier to change the abort code to do a backtrace.
2790 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2791 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2792 Remove; sysdep.c's emacs_abort now takes its place.
2793 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2794 'abort' changed to use 'emacs_abort'.
2795 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2796 (abort) [!defined abort]: Rename to ...
2797 (emacs_abort): ... new name.
2798 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2799 the place of the old 'abort' in emacs.c.
2800 * w32.c, w32fns.c (abort): Do not #undef.
2801 * w32.c (emacs_abort): Rename from w32_abort.
2802
2803 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2804
2805 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2806 offsets[j].dv, since the y axis of the screen coordinates points
2807 down, while the y axis of the font definition coordinates points
2808 up. This fixes display of Arabic diacritics such as KASRA and
2809 KASRATAN. (Bug#11860)
2810
2811 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2812
2813 Be more systematic about _setjmp vs setjmp.
2814 * alloc.c (test_setjmp, mark_stack):
2815 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2816 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2817 (png_load, my_error_exit, jpeg_load):
2818 * process.c (send_process_trap, send_process):
2819 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2820 The underscored versions are up to 30x faster on some hosts.
2821 Formerly, the code used setjmp+longjmp sometimes and
2822 _setjmp+_longjmp at other times, with no particular reason to
2823 prefer setjmp+longjmp.
2824
2825 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2826
2827 Fix minor problem found by static checking.
2828 * buffer.c (Fdelete_all_overlays): Return nil.
2829
2830 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2831
2832 * buffer.c (Fdelete_all_overlays): New function.
2833
2834 2012-09-03 Chong Yidong <cyd@gnu.org>
2835
2836 * gtkutil.c: Add extern decl for Qxft.
2837
2838 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2839
2840 * emacs.c, eval.c: Use bool for boolean.
2841 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2842 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2843 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2844 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2845 (main, decode_env_path, Fdaemon_initialized):
2846 * eval.c (call_debugger, Finteractive_p, interactive_p):
2847 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2848 (maybe_call_debugger, Fbacktrace):
2849 * process.c (read_process_output, exec_sentinel):
2850 Use bool for booleans.
2851 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2852 All callers changed.
2853 * eval.c (interactive_p): Omit always-true boolean argument
2854 EXCLUDE_SUBRS_P. All callers changed.
2855 * dispextern.h, lisp.h: Reflect above API changes.
2856 * firstfile.c (dummy): Use the address of 'main', whose signature
2857 won't change, instead of the address of 'initialize', whose
2858 signature just changed from int to bool.
2859 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2860 * msdos.c (fatal_error_in_progress): ... from here.
2861 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2862 of incrementing it.
2863 (redisplay_internal, unwind_redisplay): Simply clear
2864 REDISPLAYING_P when unwinding, instead of saving its previous,
2865 always-false value and then restoring it.
2866
2867 Clean up some extern decls.
2868 Mostly, this hoists extern decls out of .c files and into .h files.
2869 That way, we're more likely to catch errors if the interfaces change.
2870 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2871 declare xg_mark_data.
2872 * dispextern.h (x_frame_parm_handlers):
2873 * font.h (Qxft):
2874 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2875 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2876 (Qultra_bold, Qoblique, Qitalic):
2877 Move extern decl here from .c file.
2878 * alloc.c (xg_mark_data) [USE_GTK]:
2879 * doc.c (Qclosure):
2880 * eval.c (Qlexical_binding):
2881 * fns.c (time) [!HAVE_UNISTD_H]:
2882 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2883 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2884 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2885 * lread.c (Qinternal_interpreter_environment):
2886 * minibuf.c (Qbuffer):
2887 * process.c (QCfamily, QCfilter):
2888 * widget.c (free_frame_faces):
2889 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2890 * xfont.c (x_clear_errors):
2891 * xterm.c (x_frame_parm_handlers):
2892 Remove now-redundant extern decls.
2893 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2894 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2895 Now static.
2896 * xfaces.c: Remove unnecessary static decls.
2897 * xterm.c (updating_frame): Remove decl of nonexistent object.
2898
2899 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2900 when building globals.h, as the objects that are not built on
2901 this host are not needed to compile C files on this host.
2902
2903 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2904
2905 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2906
2907 * frame.h: Add missing prototype for x_wm_set_size_hint.
2908
2909 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2910
2911 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2912 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2913 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2914 (Fsubstitute_command_keys):
2915 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2916 (save_excursion_save, save_excursion_restore)
2917 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2918 (format_time_string, general_insert_function)
2919 (make_buffer_string, make_buffer_string_both)
2920 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2921 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2922 (copy_text, insert_1, insert_1_both, insert_from_string)
2923 (insert_from_string_before_markers, insert_from_string_1)
2924 (insert_from_buffer, insert_from_buffer_1, replace_range)
2925 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2926 (del_range_2, modify_region):
2927 * intervals.c (intervals_equal, balance_possible_root_interval)
2928 (adjust_intervals_for_insertion, merge_properties_sticky)
2929 (graft_intervals_into_buffer, lookup_char_property)
2930 (adjust_for_invis_intang, set_point_both)
2931 (get_property_and_range, compare_string_intervals)
2932 (set_intervals_multibyte_1, set_intervals_multibyte):
2933 * keyboard.c (decode_timer):
2934 Use bool for boolean.
2935 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2936 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2937
2938 2012-09-02 Chong Yidong <cyd@gnu.org>
2939
2940 * keymap.c (push_key_description): Print M-TAB as C-M-i
2941 (Bug#11758).
2942
2943 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2944
2945 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2946 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2947 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2948 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2949 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2950 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2951 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2952
2953 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2954
2955 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2956 more than one grapheme cluster passed to the shaper: compute the
2957 offset adjustment values separately for each cluster. (Bug#11860)
2958
2959 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2960 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2961 about implicit conversions from integer to pointer.
2962
2963 2012-09-01 Daniel Colascione <dancol@dancol.org>
2964
2965 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2966 system used too early.
2967
2968 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2969
2970 Better seed support for (random).
2971 * emacs.c (main): Call init_random.
2972 * fns.c (Frandom): Set the seed from a string argument, if given.
2973 Remove long-obsolete Gentzel cruft.
2974 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2975 (init_random): New function.
2976
2977 2012-09-01 Daniel Colascione <dancol@dancol.org>
2978
2979 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2980 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2981 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2982 x_wm_set_size_hint, x_query_colors, x_real_positions,
2983 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2984 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2985 all of which have been moved to common code.
2986
2987 * xfaces.c: Include TERM_HEADER instead of listing all possible
2988 window-system headers.
2989
2990 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2991 to match header.
2992
2993 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2994 directly accessing frame internals.
2995
2996 * w32font.h: Include font.h. Define syms_of_w32font and
2997 globals_of_w32font.
2998
2999 * process.c: Include TERM_HEADER instead of listing all possible
3000 window-system headers.
3001
3002 * nsterm.h: Remove declarations now in frame.h.
3003 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
3004
3005 * menu.c: Include TERM_HEADER instead of listing all possible
3006 window-system headers.
3007
3008 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3009 window system.
3010
3011 * keyboard.c: Include TERM_HEADER instead of listing all possible
3012 window-system headers.
3013
3014 * image.c: Include TERM_HEADER instead of listing all possible
3015 window-system headers. Declare Vlibrary_cache when compiling for
3016 Windows.
3017
3018 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3019 window system declarations.
3020
3021 * frame.h: Move common functions here: set_frame_menubar,
3022 x_set_window_size, x_sync, x_get_focus_frame,
3023 x_set_mouse_position, x_set_mouse_pixel_position,
3024 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3025 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3026 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3027 x_activate_menubar, x_real_positions, x_bitmap_icon,
3028 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3029 and x_query_colors.
3030
3031 * frame.c: Include TERM_HEADER instead of listing all possible
3032 window-system headers.
3033
3034 * font.c: Include TERM_HEADER instead of listing all possible
3035 window-system headers.
3036
3037 * emacs.c: Include TERM_HEADER.
3038
3039 * dispnew.c: Include TERM_HEADER instead of listing all possible
3040 window-system headers.
3041
3042 * ccl.h: Include character.h.
3043
3044 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3045 the current window system; include in list of objects to link into
3046 Emacs.
3047
3048 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3049
3050 Remove mark_ttys function and fix tty_display_info initialization.
3051 * lisp.h (mark_ttys): Remove prototype.
3052 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3053 to mark_ttys because all possible values of 'top_frame' slot are
3054 the frames which are reachable from Vframe_list.
3055 * term.c (mark_ttys): Remove.
3056 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3057
3058 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3059
3060 Change struct frame bitfields from unsigned char to unsigned.
3061 * frame.h (struct frame): Change type of 'display_preempted',
3062 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3063 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3064 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3065 bitfields from unsigned char to unsigned.
3066
3067 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3068
3069 Remove unused member of struct x_output and struct w32_output.
3070 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3071 * w32term.h (struct w32_output): Likewise.
3072
3073 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3074
3075 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3076 does not become zero (Bug#12234).
3077
3078 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3079
3080 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3081 for GCC 4.7.1 x86-64.
3082
3083 2012-08-30 Glenn Morris <rgm@gnu.org>
3084
3085 * lread.c (init_lread): For out-of-tree builds, only add the
3086 source directory's site-lisp dir to the load-path if it exists,
3087 consistent with in-tree builds. (Bug#12302)
3088
3089 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3090
3091 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3092 button_values to NULL. Call setStykeMask so dialogs get a close button.
3093 (windowShouldClose:): Set window_closed.
3094 (dealloc): New member, free button_values.
3095 (process_dialog:): Make member function. Remove window argument,
3096 replace window with self. Count buttons and allocate and store values
3097 in button_values.
3098 (addButton:value:row:): value is int with the name tag. Call setTag
3099 with tag. Remove return self, declare return value as void.
3100 (addString:row:): Remove return self, declare return value as void.
3101 (addSplit): Remove return self, declare return value as void.
3102 (clicked:): Remove return self, declare return value as void.
3103 Set dialog_return to button_values[seltag]. Code formatting change.
3104 (initFromContents:isQuestion:): Adjust call to process_dialog.
3105 Code formatting change.
3106 (timeout_handler:): Set timer_fired to YES.
3107 (runDialogAt:): Set timer_fired to NO.
3108 Handle click on close button as quit.
3109
3110 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3111 Add window_closed and button_values. Add void as return value for
3112 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3113 Add process_dialog as new member.
3114
3115 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3116
3117 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3118 is not one of the heaps we manage. (Bug#12242)
3119
3120 2012-08-28 Glenn Morris <rgm@gnu.org>
3121
3122 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3123
3124 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3125
3126 * window.c (Fset_window_configuration): Remove handling of
3127 auto-buffer-name window parameter. Install revision of reverted
3128 fix.
3129
3130 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3131
3132 Do not allow to set major mode for a dead buffer.
3133 * buffer.c (Fset_buffer_major_mode): Signal an error
3134 if the buffer is dead.
3135 (Fother_buffer, other_buffer_safely): Remove redundant
3136 nested declaration.
3137
3138 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3139
3140 Always use set_buffer_if_live to restore original buffer at unwind.
3141 * buffer.h (record_unwind_current_buffer): New function.
3142 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3143 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3144 * undo.c, window.c: Adjust users.
3145 * buffer.c (set_buffer_if_live): Fix comment.
3146
3147 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3148
3149 Fix usage of set_buffer_internal.
3150 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3151 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3152 * coding.c (decode_coding): Omit redundant test.
3153 * fileio.c (decide_coding_unwind): Likewise.
3154 * fns.c (secure_hash): Likewise.
3155 * insdel.c (modify_region): Likewise.
3156 * keyboard.c (command_loop_1): Likewise.
3157 * print.c (PRINTFINISH): Likewise.
3158 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3159
3160 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3161
3162 * dispnew.c: Use bool for boolean.
3163 (frame_garbaged, display_completed, delayed_size_change)
3164 (fonts_changed_p, add_window_display_history)
3165 (add_frame_display_history, verify_row_hash)
3166 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3167 (row_equal_p, realloc_glyph_pool)
3168 (allocate_matrices_for_frame_redisplay)
3169 (showing_window_margins_p)
3170 (adjust_frame_glyphs_for_frame_redisplay)
3171 (build_frame_matrix_from_leaf_window, make_current)
3172 (mirrored_line_dance, mirror_line_dance, update_frame)
3173 (update_window_tree, update_single_window)
3174 (check_current_matrix_flags, update_window, update_text_area)
3175 (update_window_line, set_window_update_flags, scrolling_window)
3176 (update_frame_1, scrolling, buffer_posn_from_coords)
3177 (do_pending_window_change, change_frame_size)
3178 (change_frame_size_1, sit_for):
3179 Use bool for boolean.
3180 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3181 and remove last int (actually boolean) argument, which was always 0.
3182 All callers changed.
3183 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3184 * dispextern.h (struct composition_it): Use bool for boolean.
3185 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3186 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3187 * dired.c (file_name_completion):
3188 Use bool for boolean. (This was missed in an earlier change.)
3189
3190 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3191
3192 * window.c (Fset_window_configuration): Revert first part of
3193 last change.
3194
3195 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3196
3197 * nsterm.h (NSPanel): New class variable dialog_return.
3198
3199 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3200 Initialize dialog_return.
3201 (windowShouldClose:): Use stop instead of stopModalWithCode.
3202 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3203 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3204 event.
3205 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3206 modal loop returns.
3207
3208 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3209
3210 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3211 * composite.c (find_composition, composition_gstring_p)
3212 (composition_reseat_it, find_automatic_composition):
3213 * data.c (let_shadows_buffer_binding_p)
3214 (let_shadows_global_binding_p, set_internal, make_blv)
3215 (Fmake_variable_buffer_local, Fmake_local_variable)
3216 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3217 (cons_to_signed, arith_driver):
3218 * dbusbind.c (xd_in_read_queued_messages):
3219 * dired.c (directory_files_internal, file_name_completion):
3220 Use bool for booleans.
3221 * dired.c (file_name_completion):
3222 * process.h (fd_callback):
3223 Omit int (actually boolean) argument. It wasn't being used.
3224 All uses changed.
3225 * composite.h, lisp.h: Reflect above API changes.
3226
3227 * cmds.c, coding.c: Use bool for booleans.
3228 * cmds.c (move_point, Fself_insert_command):
3229 * coding.h (struct composition status, struct coding_system):
3230 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3231 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3232 (emacs_mule_char, decode_coding_emacs_mule)
3233 (encode_coding_emacs_mule, detect_coding_iso_2022)
3234 (decode_coding_iso_2022, encode_invocation_designation)
3235 (encode_designation_at_bol, encode_coding_iso_2022)
3236 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3237 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3238 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3239 (encode_coding_raw_text, detect_coding_charset)
3240 (decode_coding_charset, encode_coding_charset, detect_eol)
3241 (detect_coding, get_translation_table, produce_chars)
3242 (consume_chars, reused_workbuf_in_use)
3243 (make_conversion_work_buffer, code_conversion_save)
3244 (decode_coding_object, encode_coding_object)
3245 (detect_coding_system, char_encodable_p)
3246 (Funencodable_char_position, code_convert_region)
3247 (code_convert_string, code_convert_string_norecord)
3248 (Fset_coding_system_priority):
3249 * fileio.c (Finsert_file_contents):
3250 Use bool for booleans.
3251 * coding.h, lisp.h: Reflect above API changes.
3252 * coding.c: Remove unnecessary static function decls.
3253 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3254 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3255 not a boolean 'int', since callers never look at the return value.
3256 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3257 * coding.h (decoding_buffer_size, encoding_buffer_size)
3258 (emacs_mule_string_char): Remove unused extern decls.
3259 (struct iso_2022_spec, struct coding_system):
3260 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3261 (struct emacs_mule_spec): Remove unused field 'full_support'.
3262 All initializations removed.
3263 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3264
3265 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3266
3267 Fix spare memory change (Bug#12286).
3268 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3269 (valid_lisp_object_p): Likewise.
3270
3271 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3272
3273 * window.c (Fset_window_configuration): Record any window's old
3274 buffer if it's replaced (see Bug#8789). If the new current
3275 buffer doesn't appear in the selected window, go to its old
3276 point (Bug#12208).
3277
3278 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3279
3280 Special MEM_TYPE_SPARE to denote reserved memory.
3281 * alloc.c (enum mem_type): New memory type.
3282 (refill_memory_reserve): Use new type for spare memory.
3283 This prevents live_cons_p and live_string_p from incorrect
3284 detection of uninitialized objects from spare memory as live.
3285
3286 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3287
3288 Spelling fixes.
3289 * Makefile.in (.PHONY): versioclean -> versionclean.
3290
3291 Remove unused external symbols.
3292 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3293 * window.c (Qwindow_valid_p, decode_valid_window):
3294 Now static, not extern.
3295 * data.c (Qinterval): Remove; unused.
3296 (syms_of_data): Do not define 'interval'.
3297 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3298 * window.h (decode_valid_window):
3299 Remove decls.
3300
3301 * character.c, charset.c, chartab.c: Use bool for booleans.
3302 * character.c (lisp_string_width, string_count_byte8)
3303 (string_escape_byte8):
3304 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3305 (load_charset_map_from_file, map_charset_chars)
3306 (Fdefine_charset_internal, define_charset_internal)
3307 (Fdeclare_equiv_charset, find_charsets_in_text)
3308 (Ffind_charset_region, char_charset, Fiso_charset):
3309 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3310 (sub_char_table_set, sub_char_table_set_range)
3311 (char_table_set_range, optimize_sub_char_table)
3312 (map_sub_char_table):
3313 Use bool for boolean.
3314 * character.c (str_to_unibyte): Omit last boolean argument; it was
3315 always 0. All callers changed.
3316 * character.h, charset.h: Adjust to match previous changes.
3317 * character.h (char_printable_p): Remove decl of nonexistent function.
3318 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3319 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3320 are all boolean, so make them single-bit bitfields.
3321
3322 * lisp.h (ASET): Remove attempt to detect side effects.
3323 It was meant to be temporary and it often doesn't work,
3324 because when IDX has side effects the behavior of IDX==IDX
3325 is undefined. See Stefan Monnier in
3326 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3327
3328 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3329
3330 * lisp.h (functionp): New function (extracted from Ffunctionp).
3331 (FUNCTIONP): Use it.
3332 * eval.c (Ffunctionp): Use it.
3333
3334 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3335
3336 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3337 as that's faster and simpler than static storage. Don't bother
3338 with the g_main_context_query overhead if g_main_context_pending
3339 says no events are pending.
3340 (gfds, gfds_size): Remove these static vars.
3341 (xgselect_initialize): Remove; no longer needed.
3342 All uses and decls removed.
3343
3344 * emacs.c (fatal_error_signal_hook): Remove.
3345 All uses removed. This leftover from old code was always 0.
3346
3347 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3348 * casefiddle.c (casify_object, casify_region):
3349 * casetab.c (set_case_table):
3350 * category.c, category.h (word_boundary_p):
3351 * category.h (CHAR_HAS_CATEGORY):
3352 Use bool for booleans, instead of int.
3353
3354 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3355
3356 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3357
3358 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3359
3360 On assertion failure, print backtrace if available.
3361 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3362 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3363 * Makefile.in (LIB_EXECINFO): New macro.
3364 (LIBES): Use it.
3365
3366 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3367 * bytecode.c (exec_byte_code):
3368 * callint.c (check_mark, Fcall_interactively):
3369 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3370 (getenv_internal, sync_process_alive, call_process_exited):
3371 * lisp.h (USE_SAFE_ALLOCA):
3372 Use bool for booleans, instead of int.
3373 * lisp.h, process.h: Adjust prototypes to match above changes.
3374 * callint.c (Fcall_interactively): Don't assume the mark's
3375 offset fits in 'int'.
3376
3377 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3378
3379 * buffer.c, buffer.h: Use bool for boolean.
3380 * buffer.c (reset_buffer_local_variables)
3381 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3382 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3383 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3384 (overlay_touches_p, overlay_strings, Foverlay_put)
3385 (report_overlay_modification, call_overlay_mod_hooks):
3386 (mmap_enlarge, mmap_set_vars):
3387 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3388 Use bool for booleans, instead of int.
3389 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3390 since the 1-or-0 return value is always ignored anyway.
3391 (mmap_initialized_p):
3392 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3393 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3394
3395 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3396
3397 * bidi.c: Use bool for boolean.
3398 This is a bit more readable, and makes the text segment of bidi.o
3399 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3400 Presumably it's faster too.
3401 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3402 Now bool.
3403 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3404 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3405 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3406 (bidi_explicit_dir_char, bidi_level_of_next_char)
3407 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3408 Use bool for booleans, instead of int.
3409 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3410 (bidi_unshelve_cache): Adjust decls to match code.
3411
3412 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3413
3414 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3415 argument.
3416
3417 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3418
3419 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3420 * atimer.h: Include <stdbool.h>.
3421
3422 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3423
3424 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3425 compile time tests instead of run time tests on systems that do
3426 not use them.
3427 (FRAME_MAC_P): Remove leftover from deleted code.
3428 * frame.c (syms_of_frame): Remove leftover from deleted code.
3429
3430 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3431
3432 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3433
3434 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3435
3436 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3437 Otherwise, the compiler complains about (A?B:C) where B is void
3438 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3439 (fontset_add): Return void, for FONTSET_ADD.
3440
3441 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3442
3443 * alloc.c: Use bool for booleans.
3444 (gc_in_progress, abort_on_gc)
3445 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3446 (dont_register_blocks) [GC_MALLOC_CHECK]:
3447 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3448 (check_string_bytes, make_specified_string, memory_full)
3449 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3450 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3451 (mark_stack, valid_pointer_p, make_pure_string)
3452 (Fgarbage_collect, survives_gc_p, gc_sweep):
3453 Use bool for booleans, instead of int.
3454 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3455 Remove unused local.
3456 * alloc.c (PURE_POINTER_P):
3457 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3458 * editfns.c (Fformat):
3459 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3460 (Fdo_auto_save):
3461 * fns.c (sweep_weak_table):
3462 * lisp.h (suppress_checking, push_message, survives_gc_p)
3463 (make_pure_string, gc_in_progress, abort_on_gc):
3464 * lread.c (readchar, read1):
3465 * print.c (Fprin1_to_string):
3466 * xdisp.c (push_message):
3467 Use bool for booleans affected directly or indirectly by
3468 alloc.c's changes.
3469
3470 Make recently-introduced setters macros.
3471 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3472 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3473 (set_fontset_default, set_fontset_fallback): Rename from their
3474 upper-case counterparts, and make them functions rather than macros.
3475 This is more consistent with the other recently-introduced setters.
3476 These don't need to be inline, since they're local.
3477
3478 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3479
3480 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3481 the loop (Bug#12247).
3482
3483 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 * lisp.h (vcopy): Use memcpy rather than our own loop.
3486 This fixes a performance regression introduced by the recent
3487 addition of vcopy. This means 'vcopy' will need to be modified
3488 for a copying collector, but that's OK. Also, tighten the
3489 checking in the assertion.
3490
3491 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3492
3493 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3494 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3495 non-base glyph for the width of the base character, according to
3496 what x_draw_composite_glyph_string_foreground expects.
3497 Generate WADJUST value according to composition_gstring_width's
3498 expectations, to produce correct width of the composed character.
3499 Reverse the sign of the DU offset produced by ScriptPlace.
3500
3501 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3502
3503 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3504
3505 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3506
3507 Avoid direct writes to contents member of struct Lisp_Vector.
3508 * lisp.h (vcopy): New function to copy data into vector.
3509 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3510 * fns.c (Ffillarray): Use ASET.
3511 * keyboard.c (timer_check_2): Use AREF and ASET.
3512 (append_tool_bar_item, Frecent_keys): Use vcopy.
3513 * lread.c (read_vector): Use ASET.
3514 * msdos.c (Frecent_doskeys): Use vcopy.
3515 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3516 (Finternal_merge_in_global_face): Use ASET and vcopy.
3517 * xfont.c (xfont_list_pattern): Likewise.
3518
3519 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3520
3521 * window.c (Fwindow_point): For the selected window always return
3522 the position of its buffer's point.
3523 (Fset_window_point): For the selected window always go in its
3524 buffer to the specified position.
3525
3526 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3527
3528 Setter macros for fontsets.
3529 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3530 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3531 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3532 Adjust users.
3533
3534 2012-08-20 Glenn Morris <rgm@gnu.org>
3535
3536 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3537 Don't assume that `ln -f' works.
3538
3539 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3540
3541 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3542 and later about non-assignments with no effect. See discussion at
3543 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3544 details.
3545
3546 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3547
3548 Inline setter functions for Lisp_Objects slots of struct specbinding.
3549 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3550 Adjust users.
3551
3552 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3553
3554 * window.c (select_window): Always make selected window's buffer
3555 current.
3556
3557 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3558
3559 Use AREF and ASET for docstrings of category tables.
3560 * category.h (CATEGORY_DOCSTRING): Use AREF.
3561 (SET_CATEGORY_DOCSTRING): Use ASET.
3562 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3563
3564 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3565
3566 Inline setter functions for hash table members.
3567 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3568 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3569 (set_hash_key_and_value, set_hash_index, set_hash_next)
3570 (set_hash_hash): New functions.
3571 * charset.c, fns.c: Adjust users.
3572
3573 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3574
3575 Inline getter and setter functions for per-buffer values.
3576 * buffer.h (per_buffer_default, set_per_buffer_default)
3577 (per_buffer_value, set_per_buffer_value): New functions.
3578 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3579 * buffer.c, data.c: Adjust users.
3580
3581 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3582
3583 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3584
3585 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 Rely on <config.h> + <unistd.h> to declare 'environ',
3588 as gnulib does this if the system doesn't.
3589 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3590 Remove declaration. MS-Windows declares it on stdlib.h which is
3591 included by conf_post.h.
3592 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3593 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3594 * vm-limit.c: Include <unistd.h>, for 'environ'.
3595
3596 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3597 (start_of_data): Remove decl; mem-limits.h provides it.
3598
3599 * xdisp.c (handle_invisible_prop): Make it a bit faster
3600 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3601
3602 2012-08-19 Chong Yidong <cyd@gnu.org>
3603
3604 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3605 ends (Bug#3874).
3606
3607 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3608
3609 * .gdbinit: Use call instead of set when calling a function in the
3610 inferior.
3611
3612 * data.c (set_internal): Don't use set_blv_found.
3613 (Fkill_local_variable): Likewise.
3614
3615 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3616
3617 * nsfont.m (ns_ascii_average_width): Ensure the string
3618 ascii_printable is initialized with a null-terminated character
3619 array. Otherwise, it can contain undesired extra characters.
3620
3621 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3622
3623 port new setting code to Sun C 5.8 2005/10/13
3624 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3625 Return void, not Lisp_Object. Otherwise, the compiler
3626 complains about (A?B:C) where B is void and C is Lisp_Object
3627 when compiling CHAR_TABLE_SET, due to the recent change to
3628 the API of sub_char_table_set_contents.
3629
3630 2012-08-18 Chong Yidong <cyd@gnu.org>
3631
3632 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3633 for the string case (Bug#3874).
3634
3635 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3636
3637 * buffer.h (BSET): Remove (Bug#12215).
3638 Replace all uses with calls to new setter functions.
3639 (bset_bidi_paragraph_direction, bset_case_canon_table)
3640 (bset_case_eqv_table, bset_directory, bset_display_count)
3641 (bset_display_time, bset_downcase_table)
3642 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3643 (bset_last_selected_window, bset_local_var_alist)
3644 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3645 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3646 (bset_width_table):
3647 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3648 (bset_auto_fill_function, bset_auto_save_file_format)
3649 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3650 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3651 (bset_cache_long_line_scans, bset_case_fold_search)
3652 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3653 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3654 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3655 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3656 (bset_header_line_format, bset_indicate_buffer_boundaries)
3657 (bset_indicate_empty_lines, bset_invisibility_spec)
3658 (bset_left_fringe_width, bset_major_mode, bset_mark)
3659 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3660 (bset_name, bset_overwrite_mode, bset_pt_marker)
3661 (bset_right_fringe_width, bset_save_length)
3662 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3663 (bset_scroll_up_aggressively, bset_selective_display)
3664 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3665 (bset_word_wrap, bset_zv_marker):
3666 * category.c (bset_category_table):
3667 * syntax.c (bset_syntax_table):
3668 New setter functions.
3669
3670 * process.h (PSET): Remove (Bug#12215).
3671 Replace all uses with calls to new setter functions.
3672 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3673 (PROCESS_INLINE): New macro.
3674 (pset_childp): New setter function.
3675 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3676 * process.c (PROCESS_INLINE):
3677 Define to EXTERN_INLINE, so that the corresponding functions
3678 are compiled into code.
3679 (pset_buffer, pset_command, pset_decode_coding_system)
3680 (pset_decoding_buf, pset_encode_coding_system)
3681 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3682 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3683 (pset_type, pset_write_queue): New setter functions.
3684
3685 * window.h (WSET): Remove (Bug#12215).
3686 Replace all uses with calls to new setter functions.
3687 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3688 (WINDOW_INLINE): New macro.
3689 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3690 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3691 (wset_total_lines, wset_vertical_scroll_bar)
3692 (wset_window_end_pos, wset_window_end_valid)
3693 (wset_window_end_vpos): New setter functions.
3694 * window.c (WINDOW_INLINE):
3695 Define to EXTERN_INLINE, so that the corresponding functions
3696 are compiled into code.
3697 (wset_combination_limit, wset_dedicated, wset_display_table)
3698 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3699 (wset_new_normal, wset_new_total, wset_next_buffers)
3700 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3701 (wset_prev_buffers, wset_right_fringe_width)
3702 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3703 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3704 (wset_window_parameters):
3705 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3706 (wset_column_number_displayed, wset_region_showing):
3707 New setter functions.
3708
3709 * termhooks.h (TSET): Remove (Bug#12215).
3710 Replace all uses with calls to new setter functions.
3711 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3712 (TERMHOOKS_INLINE): New macro.
3713 (tset_charset_list, tset_selection_alist): New setter functions.
3714 * terminal.c (TERMHOOKS_INLINE):
3715 Define to EXTERN_INLINE, so that the corresponding functions
3716 are compiled into code.
3717 (tset_param_alist): New setter function.
3718
3719 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3720
3721 * keyboard.h (KSET): Remove (Bug#12215).
3722 Replace all uses with calls to new setter functions.
3723 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3724 (KEYBOARD_INLINE): New macro.
3725 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3726 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3727 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3728 New setter functions.
3729 * keyboard.c (KEYBOARD_INLINE):
3730 Define to EXTERN_INLINE, so that the corresponding functions
3731 are compiled into code.
3732 (kset_echo_string, kset_kbd_queue)
3733 (kset_keyboard_translate_table, kset_last_prefix_arg)
3734 (kset_last_repeatable_command, kset_local_function_key_map)
3735 (kset_overriding_terminal_local_map, kset_real_last_command)
3736 (kset_system_key_syms): New setter functions.
3737
3738 * frame.h (FSET): Remove (Bug#12215).
3739 Replace all uses with calls to new setter functions.
3740 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3741 (FRAME_INLINE): New macro.
3742 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3743 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3744 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3745 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3746 (fset_param_alist, fset_root_window, fset_scroll_bars)
3747 (fset_selected_window, fset_title, fset_tool_bar_items)
3748 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3749 * frame.c (FRAME_INLINE):
3750 Define to EXTERN_INLINE, so that the corresponding functions
3751 are compiled into code.
3752 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3753
3754 A few more naming-convention fixes for getters and setters.
3755 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3756 and rename from buffer_overlays_set_before.
3757 (set_buffer_overlays_after): Move here from buffer.h, and rename
3758 from buffer_overlays_set_after.
3759 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3760 All uses changed.
3761 (set_buffer_intervals): Rename from buffer_set_intervals.
3762 * intervals.c (set_interval_object): Move here from intervals.h,
3763 and rename from interval_set_object.
3764 (set_interval_left): Move here from intervals.h, and rename from
3765 interval_set_left.
3766 (set_interval_right): Move here from intervals.h, and rename from
3767 interval_set_right.
3768 (copy_interval_parent): Move here from intervals.h, and rename from
3769 interval_copy_parent.
3770 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3771 (set_interval_plist): Rename from interval_set_plist.
3772 Return void, not Lisp_Object, since no caller uses the result.
3773 * lisp.h (string_intervals): Rename from string_get_intervals.
3774 (set_string_intervals): Rename from string_set_intervals.
3775
3776 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3777 (set_char_table_contents): Rename from char_table_set_contents.
3778 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3779 All uses changed. See the end of
3780 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3781
3782 * lisp.h (CSET): Remove (Bug#12215).
3783 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3784 (set_char_table_purpose): New functions,
3785 replacing CSET. All uses changed. For example, replace
3786 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3787 "set_char_table_parent (char_table, parent);".
3788 The old version was confusing because it used the same name
3789 'parent' for two different things.
3790
3791 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3792
3793 Functions to get and set Lisp_Object fields of buffer-local variables.
3794 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3795 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3796 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3797 * data.c, eval.c, frame.c: Adjust users.
3798
3799 2012-08-17 Chong Yidong <cyd@gnu.org>
3800
3801 * xfaces.c (merge_face_vectors): If the target font specfies a
3802 font spec, make the font's attributes take precedence over
3803 directly-specified attributes.
3804 (merge_face_ref): Recognize :font.
3805
3806 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3807
3808 Do not use memcpy for copying intervals.
3809 * intervals.c (reproduce_interval): New function.
3810 (reproduce_tree, reproduce_tree_obj): Use it.
3811 (reproduce_tree_obj): Remove prototype.
3812
3813 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3814
3815 * lisp.h (duration_to_sec_usec): Remove unused decl.
3816
3817 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3818
3819 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3820 to an allocated instance of NSString, not to the class itself.
3821
3822 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3823
3824 * makefile.w32-in (C_CTYPE_H): New macro.
3825 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3826 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3827 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3828
3829 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3830
3831 Use ASCII tests for character types.
3832 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3833 * xfns.c, xterm.c:
3834 Don't include <ctype.h>; was not needed.
3835 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3836 * sysdep.c, xfaces.c:
3837 Include <c-ctype.h> instead of <ctype.h>.
3838 * nsterm.m: Include <c-ctype.h>.
3839 * charset.c (read_hex):
3840 * doc.c (Fsnarf_documentation):
3841 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3842 (DRIVE_LETTER) [DOS_NT]:
3843 (Ffile_name_directory, Fexpand_file_name)
3844 (Fsubstitute_in_file_name):
3845 * font.c (font_parse_xlfd, font_parse_fcname):
3846 * frame.c (x_set_font_backend):
3847 * gtkutil.c (xg_get_font):
3848 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3849 * nsimage.m (hexchar):
3850 * nsterm.m (ns_xlfd_to_fontname):
3851 * sysdep.c (system_process_attributes):
3852 * xfaces.c (hash_string_case_insensitive):
3853 Use C-locale tests instead of locale-specific tests for character
3854 types, since we want the ASCII interpretation here, not the
3855 interpretation suitable for whatever happens to be the current locale.
3856
3857 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3858
3859 Consistently check windows for validity/liveness
3860 (Bug#11984, Bug#12025, Bug#12026).
3861 * lisp.h (CHECK_VALID_WINDOW): New macro.
3862 * window.c (decode_window): Rename to decode_live_window.
3863 (decode_valid_window, Fwindow_valid_p): New functions.
3864 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3865 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3866 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3867 (Fwindow_prev_sibling, Fwindow_combination_limit)
3868 (Fset_window_combination_limit, Fwindow_use_time)
3869 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3870 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3871 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3872 (Fwindow_hscroll, Fset_window_hscroll)
3873 (Fwindow_redisplay_end_trigger)
3874 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3875 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3876 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3877 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3878 (Fwindow_end, Fset_window_point, Fset_window_start)
3879 (Fpos_visible_in_window_p, Fwindow_line_height)
3880 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3881 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3882 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3883 (Fset_window_parameter, Fwindow_display_table)
3884 (Fset_window_display_table, Fdelete_other_windows_internal)
3885 (Fset_window_buffer, Fset_window_new_total)
3886 (Fset_window_new_normal, Fdelete_window_internal)
3887 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3888 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3889 (Fwindow_scroll_bars): Check whether argument window is a valid or
3890 live window. Update doc-strings.
3891 (syms_of_window): New symbol Qwindow_valid_p.
3892 * keyboard.c (Fposn_at_x_y): Check whether argument
3893 frame_or_window denotes a valid window.
3894
3895 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3896
3897 Fix previous char table change.
3898 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3899 * chartab.c (optimize_sub_char_table): Likewise.
3900
3901 2012-08-16 Chong Yidong <cyd@gnu.org>
3902
3903 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3904
3905 * xfont.c (xfont_open):
3906 * xftfont.c (xftfont_open): Set the font's max_width field.
3907
3908 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3909 min_width to space_width and average_width to the average over
3910 printable ASCII characters.
3911 (ns_char_width): Code cleanup.
3912 (ns_ascii_average_width): New utility function.
3913
3914 * font.h (struct font): Update comments.
3915
3916 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3917
3918 Simple interface to set Lisp_Object fields of character tables.
3919 * lisp.h (CSET): New macro.
3920 (char_table_set_extras, char_table_set_contents)
3921 (sub_char_table_set_contents): New function.
3922 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3923 * syntax.c: Adjust users.
3924
3925 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3926
3927 * eval.c (eval_sub): Bind lexical-binding.
3928 * lread.c (Qlexical_binding): Make non-static.
3929
3930 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3931
3932 * nsmenu.m (popupSession): Remove.
3933 (pop_down_menu): Remove endModalSession.
3934 (timeout_handler:): New method.
3935 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3936 Call runModalForWindow. Check timer_fired when it returns.
3937 If not set, cancel timer and break out of loop.
3938 Otherwise loop again, with a new timeout.
3939
3940 * nsterm.m: Include fcntl.h if present.
3941 (fd_entry, t_readfds, inNsSelect): Remove.
3942 (select_writefds, select_valid, select_timeout, selfds)
3943 (select_mutex, apploopnr): Add.
3944 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3945 Otherwise call kbd_buffer_store_event.
3946 (ns_send_appdefined): Remove release of fd_entry.
3947 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3948 Increment and decrement apploopnr.
3949 (ns_select): If no file descriptors, just do a NSTimer.
3950 Otherwise copy read/write masks and start select thread (fd_handler).
3951 Start main loop and wait for application defined event.
3952 Inform select thread to stop selecting after main loop is exited.
3953 (ns_term_init): Create selfds pipe and set non-blocking.
3954 Initialize select_mutex. Start the select thread (fd_handler).
3955 (fd_handler:): Loop forever, wait for info from the main thread
3956 to either start or stop selecting. When select returns, send
3957 and appdefined event.
3958 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3959 If not call kbd_buffer_store_event.
3960
3961 * nsterm.h (EmacsApp): fd_handler takes id argument.
3962 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3963
3964 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3965
3966 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3967
3968 * region-cache.c (move_cache_gap): Update gap_len using the actual
3969 growth of the boundaries array. Do not change cache_len.
3970 (Bug#12196)
3971
3972 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3973
3974 Generalize and cleanup font subsystem checks.
3975 * font.h (FONT_DEBUG, font_assert): Remove.
3976 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3977 Change font_assert to eassert. Use eassert where appropriate.
3978
3979 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3980
3981 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3982
3983 2012-08-15 Chong Yidong <cyd@gnu.org>
3984
3985 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3986 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3987 extract the font descriptor instead of just the font name.
3988 In that case, return a font spec instead of a string.
3989 (x_last_font_name): Move to this file from xfns.c.
3990
3991 * xfns.c (Fx_select_font): The return value can also be a font
3992 spec. Move x_last_font_name management to gtkutil.c.
3993
3994 * xfaces.c: Make font weight and style symbols non-static.
3995
3996 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3997
3998 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3999 (bug#12117).
4000
4001 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4002
4003 * alloc.c (Fgarbage_collect): Use plural form consistently.
4004
4005 2012-08-14 Eli Zaretskii <eliz@gnu.org>
4006
4007 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4008 iteration through the command loop. Fixes a problem whereby mouse
4009 movements are ignored until the first mouse click.
4010
4011 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4012
4013 Use bool, not int, for Lisp booleans.
4014 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4015 makes Emacs a bit smaller and presumably a bit faster.
4016 * lisp.h: Include <stdbool.h>.
4017 (struct Lisp_Boolfwd, defvar_bool):
4018 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4019 * regex.c [!emacs]: Include <stdbool.h>.
4020 (false, true): Remove; <stdbool.h> does this for us now.
4021
4022 2012-08-14 Chong Yidong <cyd@gnu.org>
4023
4024 * character.c (Fcharacterp): Doc fix (Bug#12076).
4025
4026 * data.c (Findirect_variable): Doc fix (Bug#11040).
4027
4028 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4029
4030 * editfns.c (Fformat): Doc fix (Bug#12059).
4031 (Fsave_current_buffer): Doc fix (Bug#11542).
4032
4033 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4034
4035 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4036 (bug#12022).
4037
4038 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4039
4040 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4041 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4042 * minibuf.c (choose_minibuf_frame, read_minibuf):
4043 * w32fns.c (x_create_tip_frame):
4044 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4045 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4046
4047 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4048
4049 * intervals.c (offset_intervals): Remove obsolete comment.
4050
4051 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4052
4053 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4054
4055 2012-08-14 Gergely Risko <gergely@risko.hu>
4056
4057 * coding.c (decode_coding): Record buffer modification before
4058 disabling undo_list (Bug#11773).
4059
4060 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4061
4062 Revert and cleanup some recent overlay changes.
4063 * buffer.h (enum overlay_type): Remove.
4064 (buffer_get_overlays, buffer_set_overlays): Likewise.
4065 (buffer_set_overlays_before, buffer_set_overlays_after):
4066 New function. Adjust users.
4067 (unchain_both): Add eassert.
4068
4069 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4070
4071 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4072
4073 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4074
4075 * gtkutil.c (xg_mark_data): Don't assume C99.
4076
4077 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4078
4079 * gtkutil.c (xg_frame_tb_info): New struct.
4080 (TB_INFO_KEY): New define.
4081 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4082 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4083 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4084 if not present.
4085 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4086 is up to date. Otherwise store new data.
4087 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4088
4089 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4090
4091 Use KSET for write access to Lisp_Object members of struct kboard.
4092 * keyboard.h (KSET): New macro.
4093 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4094 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4095 * xterm.c: Adjust users.
4096
4097 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4098
4099 Use BSET for write access to Lisp_Object members of struct buffer.
4100 * buffer.h (BSET): New macro.
4101 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4102 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4103 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4104 * window.c, xdisp.c, xfns.c: Adjust users.
4105
4106 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4107
4108 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4109
4110 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4111
4112 * nsterm.m (not_in_argv): New function.
4113 (application:openFile, application:openTempFile:):
4114 (application:openFileWithoutUI:, application:openFiles:): Open file
4115 if not_in_argv returns non-zero (bug#12171).
4116
4117 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4118 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4119 Define for Gtk+ versions less than 3.2.
4120 (xg_get_font_name): Use those functions/macros here.
4121 Reported by Frans Oilinki <moilinki@gmail.com>.
4122
4123 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4124
4125 * unexmacosx.c (copy_data_segment): Copy initialized data in
4126 statically linked libraries from input file rather than memory.
4127
4128 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4129 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4130 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4131
4132 2012-08-10 Glenn Morris <rgm@gnu.org>
4133
4134 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4135 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4136
4137 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4138
4139 Fix last change to allow compilation with low optimization levels.
4140 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4141 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4142
4143 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4144
4145 Use common inline syntax in intervals.h.
4146 * intervals.h (INTERVALS_INLINE): New macro.
4147 Change all users from LISP_INLINE.
4148
4149 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4150
4151 Define Qnone once for all platforms.
4152 * frame.c (Qnone): Define here.
4153 (syms_of_frame): DEFSYM it.
4154 * lisp.h (Qnone): New declaration.
4155 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4156 * xfns.c: Remove duplication. Adjust users.
4157
4158 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4159
4160 Remove unused macros from intervals.h.
4161 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4162 * intervals.c: Adjust comment.
4163
4164 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4165
4166 * w32fns.c <w32_unicode_gui>: New static variable.
4167 (globals_of_w32fns): Initialize it according to os_subtype.
4168 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4169 testing os_subtype.
4170
4171 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4172 Eli Zaretskii <eliz@gnu.org>
4173
4174 Fix bug #10299 with Unicode characters sent by customized
4175 keyboards created by MSKLC.
4176 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4177 (w32_init_class): Use it to initialize the Emacs class with either
4178 ANSI or Unicode API calls.
4179 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4180 later.
4181 (w32_wnd_proc): If the character code sent by WM_CHAR or
4182 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4183 original message. Call DefWindowProcW on NT and later.
4184
4185 2012-08-10 Glenn Morris <rgm@gnu.org>
4186
4187 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4188
4189 * lisp.h (DIRECTORY_SEP): Let configure set it.
4190
4191 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 Use TSET for write access to Lisp_Object slots of struct terminal.
4194 * termhooks.h (TSET): New macro.
4195 * coding.c, terminal.c, xselect.c: Adjust users.
4196
4197 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4198
4199 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4200 the failing expression, include them in the error message.
4201 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4202 * lisp.h (internal_condition_case_n): Update declaration.
4203
4204 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4205
4206 Inline functions to examine and change buffer overlays.
4207 * buffer.c (unchain_both): New function.
4208 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4209 (buffer_has_overlays): New function.
4210 (enum overlay_type): New enum.
4211 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4212 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4213
4214 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4215
4216 Inline functions to examine and change buffer intervals.
4217 * alloc.c (mark_interval_tree): Remove.
4218 (MARK_INTERVAL_TREE): Simplify.
4219 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4220 * intervals.c (buffer_balance_intervals): New function.
4221 (graft_intervals_into_buffer): Adjust indentation.
4222 (set_intervals_multibyte): Simplify.
4223 * buffer.h (BUF_INTERVALS): Remove.
4224 (buffer_get_intervals, buffer_set_intervals): New function.
4225 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4226 * intervals.c, textprop.c: Adjust users.
4227
4228 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4229
4230 Inline functions to examine and change string intervals.
4231 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4232 (string_get_intervals, string_set_intervals): New function.
4233 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4234 * lread.c, print.c, textprop.c: Adjust users.
4235
4236 2012-08-08 Glenn Morris <rgm@gnu.org>
4237
4238 * lisp.mk (lisp): Remove language/persian.elc.
4239
4240 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4241
4242 Cleanup intervals.
4243 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4244 (NULL_INTERVAL_P): Likewise. Adjust users.
4245 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4246 Adjust comment. Move under #if 0.
4247 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4248 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4249
4250 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4251
4252 Check total length of intervals with eassert.
4253 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4254 * intervals.c: Change all users to eassert.
4255
4256 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4257
4258 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4259 Rename fields to match removal of FGET and WGET and disuse of
4260 INTERNAL_FIELD in Lisp_Cons.
4261
4262 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4263
4264 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4265 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4266 name since all xname users are fixed long time ago. Do not
4267 use INTERNAL_FIELD.
4268 (set_symbol_name, set_symbol_function, set_symbol_plist):
4269 (set_symbol_next, set_overlay_plist): New function.
4270 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4271 (struct Lisp_Overlay): Likewise.
4272 (CVAR, MVAR, SVAR): Remove.
4273 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4274 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4275 * xterm.c: Adjust users.
4276 * .gdbinit: Change to use name field of struct Lisp_Symbol
4277 where appropriate.
4278
4279 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4280
4281 Basic functions to set Lisp_Object and pointer slots of intervals.
4282 * intervals.h (interval_set_parent, interval_set_object):
4283 (interval_set_left, interval_set_right, interval_set_plist):
4284 (interval_copy_parent): New function.
4285 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4286 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4287 Adjust indentation.
4288 (INTERVAL_SIZE): Remove. Adjust users.
4289 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4290
4291 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4292
4293 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4294 * process.h (PGET): Remove.
4295 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4296 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4297
4298 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4299
4300 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4301 * window.h (WGET): Remove.
4302 (struct window): Do not use INTERNAL_FIELD.
4303 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4304 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4305 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4306 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4307 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4308 Adjust users.
4309
4310 2012-08-07 Chong Yidong <cyd@gnu.org>
4311
4312 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4313 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4314 (Fdelete_window_internal): Signal an error if the window is not on
4315 a live frame (Bug#12025).
4316
4317 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4318
4319 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4320 * frame.h (FGET): Remove.
4321 (struct frame): Do not use INTERNAL_FIELD.
4322 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4323 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4324 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4325 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4326
4327 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4328
4329 * w32.c: Silence compiler warnings.
4330 (map_w32_filename): Remove unused variable `is_fat'.
4331 (chase_symlinks): Add parentheses around expression.
4332
4333 2012-08-06 Glenn Morris <rgm@gnu.org>
4334
4335 * sysdep.c: Respect BROKEN_GETWD.
4336
4337 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4338 Let configure handle it.
4339 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4340
4341 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4342
4343 Use GCALIGNMENT where appropriate.
4344 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4345 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4346 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4347
4348 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4349
4350 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4351 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4352
4353 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4354
4355 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4356 that should be sufficient for everyone.
4357
4358 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4359
4360 * keyboard.c (timer_check_2): Add break so timer_check returns next
4361 timeout.
4362
4363 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4364
4365 Fix Windows build errors introduced after converting to WGET and WSET.
4366 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4367 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4368
4369 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4370
4371 * nsterm.m (ns_frame_rehighlight): Use FSET.
4372
4373 * nsmenu.m (ns_update_menubar): Use FSET.
4374
4375 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4376
4377 Separate read and write access to Lisp_Object slots of Lisp_Process.
4378 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4379 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4380
4381 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4382
4383 Separate read and write access to Lisp_Object slots of struct window.
4384 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4385 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4386 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4387 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4388 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4389 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4390 Adjust users.
4391
4392 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4393
4394 Fix Windows build errors introduced after converting to FGET and FSET.
4395 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4396 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4397 (w32_judge_scroll_bars): Change to use FSET.
4398 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4399
4400 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4401
4402 Fix replacement typo.
4403 * window.c (replace_window): Set root_window instead of
4404 selected_window. This fixes a total window subsystem
4405 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4406
4407 2012-08-06 Glenn Morris <rgm@gnu.org>
4408
4409 * lisp.mk (lisp): Add language/persian.elc.
4410
4411 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4412
4413 Separate read and write access to Lisp_Object slots of struct frame.
4414 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4415 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4416 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4417 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4418 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4419
4420 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4421
4422 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4423
4424 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4425
4426 Generalize common compile-time constants.
4427 * lisp.h (header_size, bool_header_size, word_size): Now here.
4428 (struct Lisp_Vector): Add comment.
4429 (struct Lisp_Bool_Vector): Move up to define handy constants.
4430 (VECSIZE, PSEUDOVECSIZE): Simplify.
4431 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4432 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4433 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4434 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4435 * xfont.c, xmenu.c: Use word_size where appropriate.
4436
4437 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4438
4439 * search.c (Freplace_match): Treat \? in the replacement text
4440 literally (Bug#8161).
4441
4442 2012-08-05 Chong Yidong <cyd@gnu.org>
4443
4444 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4445 * frame.c (Vdelete_frame_functions):
4446 * emacs.c (Vkill_emacs_hook): Doc fix.
4447
4448 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4449
4450 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4451 --with-x-toolkit=no builds.
4452 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4453
4454 2012-08-04 Chong Yidong <cyd@gnu.org>
4455
4456 * syntax.c (Fmodify_syntax_entry): Doc fix.
4457
4458 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4459
4460 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4461 * w32.c (init_environment): Change the default values of many
4462 environment variables in dflt_envvars[] to NULL, to avoid pushing
4463 them into environment when they were not already defined.
4464 Remove the code that deletes site-lisp subdirectories from the default
4465 value of EMACSLOADPATH, as it is no longer needed.
4466 (check_windows_init_file): Now external, not static.
4467 Use Vload_path as is, without adding anything, as this function is now
4468 called when Vload_path is already set up.
4469
4470 * w32.h (check_windows_init_file): Add prototype.
4471
4472 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4473 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4474 compatibility with Posix platforms.
4475 (main): Move the call to check_windows_init_file to here from
4476 w32.c.
4477 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4478 any, in the DEFALT argument into the root of the Emacs build or
4479 installation tree, as appropriate.
4480
4481 * callproc.c (init_callproc_1): Call decode_env_path instead of
4482 doing its equivalent by hand.
4483 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4484 the code that sets Vexec_path run on MS-Windows.
4485
4486 * lread.c (init_lread): Add comments to #ifdef's.
4487
4488 * msdos.c (dos_set_window_size, IT_update_begin)
4489 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4490 instead of direct references.
4491
4492 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4493
4494 Export DEFAULT_REHASH_* to GDB.
4495 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4496 Now constants, not macros.
4497
4498 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4499
4500 Remove unnecessary casts involving pointers.
4501 These casts are no longer needed now that we assume C89 or later,
4502 since they involve casting to or from void *.
4503 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4504 (make_pure_float, make_pure_vector):
4505 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4506 * macros.c (Fstart_kbd_macro):
4507 * menu.c (find_and_return_menu_selection):
4508 * minibuf.c (read_minibuf_noninteractive):
4509 * sysdep.c (closedir):
4510 * xdisp.c (x_produce_glyphs):
4511 * xfaces.c (compare_fonts_by_sort_order):
4512 * xfns.c (x_real_positions, select_visual):
4513 * xselect.c (x_stop_queuing_selection_requests)
4514 (x_get_window_property, x_get_window_property_as_lisp_data):
4515 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4516 Remove unnecessary pointer casts.
4517 * alloc.c (record_xmalloc): New function.
4518 * lisp.h (record_xmalloc): New decl.
4519 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4520 more like a function. This is because the pointer cast is not
4521 needed. All uses changed.
4522 * print.c (print_string, print_error_message): Avoid length recalc.
4523
4524 Improve fix for macroexp crash with debugging (Bug#12118).
4525 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4526 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4527 not supposed to be invoked from the garbage collector.
4528 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4529 (gc_aset): New function, which is like ASET but can be
4530 used in the garbage collector.
4531 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4532 (set_hash_index): Use it instead of ASET.
4533
4534 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4535
4536 Support symlinks on latest versions of MS-Windows.
4537 * w32.c: Include winioctl.h and aclapi.h.
4538 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4539 (revert_to_self): Forward declarations of static functions.
4540 <static BOOL g_b_init_get_security_info>:
4541 <g_b_init_create_symbolic_link>: New static flags.
4542 (globals_of_w32): Initialize them to zero.
4543 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4544 (map_w32_filename): Improve commentary. Simplify switch.
4545 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4546 headers (most versions of MinGW w32api don't).
4547 (get_security_info, create_symbolic_link)
4548 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4549 New functions.
4550 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4551 in the argument file name.
4552 (sys_access): Call unc_volume_file_attributes only if
4553 GetFileAttributes fails with network-related error codes.
4554 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4555 have the required privileges.
4556 (get_file_security_desc_by_name): Rename from
4557 get_file_security_desc.
4558 (stat_worker): New function, with most of the guts of 'stat', and
4559 with addition of handling of symlinks and support for 'lstat'.
4560 If possible, get file's attributes and security information by
4561 handle, not by name. Produce S_IFLNK bit for symlinks, when
4562 called from 'lstat'.
4563 (stat, lstat): New functions, call 'stat_worker'.
4564 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4565 symlinks when the underlying filesystem supports them.
4566
4567 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 Fix macroexp crash on Windows with debugging (Bug#12118).
4570 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4571 checking subscripts; problem introduced with the recent
4572 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4573 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4574 since it's used in non-static inline functions now.
4575
4576 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4577 Don't assume buffer size fits in 'int'. Remove unused local.
4578
4579 Use C99-style 'extern inline' if available.
4580 * buffer.h (BUFFER_INLINE):
4581 * category.h (CATEGORY_INLINE):
4582 * character.h (CHARACTER_INLINE):
4583 * charset.h (CHARSET_INLINE):
4584 * composite.h (COMPOSITE_INLINE):
4585 * dispextern.h (DISPEXTERN_INLINE):
4586 * lisp.h (LISP_INLINE):
4587 * systime.h (SYSTIME_INLINE):
4588 New macro, replacing 'static inline' in this header.
4589 * buffer.h, category.h, character.h, charset.h, composite.h:
4590 * dispextern.h, lisp.h, systime.h:
4591 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4592 * alloc.c (LISP_INLINE):
4593 * buffer.c (BUFFER_INLINE):
4594 * category.c (CATEGORY_INLINE):
4595 * character.c (CHARACTER_INLINE):
4596 * charset.c (CHARSET_INLINE):
4597 * composite.c (COMPOSITE_INLINE):
4598 * dispnew.c (DISPEXTERN_INLINE):
4599 * sysdep.c (SYSTIME_INLINE):
4600 Define to EXTERN_INLINE, so that the corresponding functions
4601 are compiled into code.
4602 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4603 (INLINE_HEADER_END): New macros.
4604 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4605 since it's used in non-static inline functions now.
4606 (VALMASK) [!USE_LSB_TAG]: Likewise.
4607
4608 2012-08-02 Glenn Morris <rgm@gnu.org>
4609
4610 * s/: Remove empty directory.
4611
4612 * s/ms-w32.h: Move to ../nt/inc.
4613 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4614 Update for new ms-w32.h location.
4615
4616 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4617
4618 Port to Solaris 8.
4619 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4620
4621 2012-08-02 Glenn Morris <rgm@gnu.org>
4622
4623 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4624 hard-coding the path separator.
4625
4626 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4627
4628 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4629 This how ASET and AREF are supposed to work, and makes
4630 it easier to think about future improvements. See
4631 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4632 * charset.h (set_charset_attr): New function.
4633 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4634 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4635 (aref_addr): New function. All uses of &AREF(...) changed.
4636 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4637 (set_hash_index): New functions. All lvalue-style uses of
4638 HASH_KEY etc. changed.
4639 * keyboard.c (set_prop): New function. All lvalue-style uses
4640 of PROP changed.
4641
4642 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4643
4644 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4645 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4646 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4647 * nsfns.m (ns_set_name_as_filename): Likewise.
4648 * nsmenu.m (ns_update_menubar): Likewise.
4649 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4650
4651 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4652
4653 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4654 Adapt to latest changes in field names of the corresponding Lisp
4655 objects.
4656
4657 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4658
4659 2012-08-01 Glenn Morris <rgm@gnu.org>
4660
4661 * s/msdos.h: Remove file.
4662 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4663 * Makefile.in (S_FILE): Remove.
4664 (config_h): Remove S_FILE.
4665
4666 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4667
4668 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4669 Remove; moved to nt/config.nt.
4670
4671 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4672
4673 Use INTERNAL_FIELD for conses and overlays.
4674 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4675 Remove obsolete comment.
4676 (MVAR): New macro.
4677 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4678 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4679
4680 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4681
4682 Use INTERNAL_FIELD for symbols.
4683 * lisp.h (SVAR): New macro. Adjust users.
4684 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4685 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4686
4687 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4688
4689 Use INTERNAL_FIELD for processes.
4690 * process.h (PVAR): New macro. Adjust style.
4691 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4692 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4693
4694 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4695
4696 Use INTERNAL_FIELD for windows.
4697 * window.h (WVAR): New macro.
4698 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4699 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4700 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4701 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4702 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4703 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4704
4705 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4706
4707 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4708
4709 2012-08-01 Glenn Morris <rgm@gnu.org>
4710
4711 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4712 Move to configure.ac.
4713
4714 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4715
4716 * makefile.w32-in (CONFIG_H): Update dependencies.
4717 (CONF_POST_H): New macro.
4718
4719 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4720
4721 2012-07-31 Glenn Morris <rgm@gnu.org>
4722
4723 * Makefile.in (S_FILE): No longer set by configure.
4724
4725 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4726 is available.
4727 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4728
4729 * process.h (NULL_DEVICE):
4730 * emacs.c (SEPCHAR):
4731 * editfns.c (USER_FULL_NAME): Let configure set them.
4732
4733 * s/README, s/template.h: Remove files.
4734
4735 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4736
4737 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4738 Move to configure.ac.
4739
4740 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4741
4742 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4743 resulting renaming of 'struct frame' members.
4744
4745 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4746
4747 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4748 after introduction of FVAR.
4749
4750 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4751
4752 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4753
4754 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4755 instead of compositeToPoint.
4756 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4757
4758 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4759
4760 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4761
4762 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4763 * lisp.h (INTERNAL_FIELD): New macro.
4764 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4765 (BVAR): Change to use INTERNAL_FIELD.
4766 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4767 (KVAR): Change to use INTERNAL_FIELD.
4768 * frame.h (FVAR): New macro.
4769 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4770 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4771 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4772 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4773 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4774
4775 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4776
4777 Miscellaneous fixes for non-default X toolkits.
4778 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4779 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4780 Move under #ifdef USE_LUCID.
4781 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4782 definition and usage to avoid warnings.
4783
4784 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4785
4786 * nsterm.m (openFiles): Fix previous checkin.
4787
4788 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4789
4790 * indent.c (compute_motion): Remove unused local.
4791
4792 2012-07-31 Glenn Morris <rgm@gnu.org>
4793
4794 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4795
4796 * conf_post.h [USG5_4]:
4797 Move remaining contents of s/usg5-4-common.h here.
4798 * s/usg5-4-common.h: Remove file.
4799
4800 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4801 * s/irix6-5.h: Remove file.
4802
4803 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4804 * s/darwin.h: Remove file.
4805
4806 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4807 * s/hpux10-20.h: Remove file, which is now empty.
4808
4809 2012-07-30 Glenn Morris <rgm@gnu.org>
4810
4811 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4812 * Makefile.in (config_h): Add conf_post.h.
4813 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4814
4815 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4816
4817 * nsterm.m (ns_do_open_file): New variable.
4818 (ns_term_init): Set ns_do_open_file to YES after run returns.
4819 (openFile, openTempFile, openFileWithoutUI, openFiles):
4820 Open files only if ns_do_open_file.
4821
4822 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4823
4824 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4825 This no-op macro hasn't been needed for many years.
4826 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4827
4828 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4829 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4830 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4831 gdb_make_enums_visible.
4832 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4833 (DIRECTORY_SEP): Now a constant, not a macro.
4834
4835 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4836
4837 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4838 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4839
4840 * w32term.c <w32_keyboard_codepage>: Renamed from
4841 keyboard_codepage and now external. All users changed.
4842
4843 * w32term.h: Add declaration of w32_keyboard_codepage.
4844
4845 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4846 the codepage to translate keys to Unicode. If this argument is
4847 -1, use the value returned by GetConsoleCP. All callers changed.
4848
4849 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4850
4851 Update .PHONY listings in makefiles.
4852 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4853 bootstrap-clean, distclean, maintainer-clean, versioclean,
4854 extraclean, frc.
4855
4856 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4857 This is a bit clearer. Fix some commentary typos.
4858
4859 2012-07-30 Glenn Morris <rgm@gnu.org>
4860
4861 * s/netbsd.h: Let configure include signal.h if needed.
4862 Remove file, which is now empty.
4863
4864 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4865 Let configure set them.
4866 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4867 No more need to undefine.
4868
4869 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4870
4871 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4872 non-single-byte char when adding meta modifier. (Bug#12090)
4873
4874 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4875
4876 Convert safe_call to use variable number of arguments.
4877 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4878 (safe_call2): Fix comment.
4879 * lisp.h (safe_call): Adjust prototype.
4880 * coding.c (encode_coding_object): Change to use safe_call2.
4881 * xfaces.c (merge_face_heights): Change to use safe_call1.
4882
4883 2012-07-30 Glenn Morris <rgm@gnu.org>
4884
4885 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4886 does that unconditionally. Remove file, which is now empty.
4887
4888 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4889 Remove empty files.
4890
4891 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4892
4893 Export to GDB most of lisp.h's remaining object-like macros.
4894 * lisp.h (min, max): Move earlier, because they're used earlier now.
4895 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4896 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4897 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4898 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4899 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4900 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4901 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4902 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4903 Now constants, for GDB. They need not be macros.
4904 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4905 Now constants, for GDB, as well as macros, for static initializers.
4906 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4907 Move to after the definition of struct Lisp_Char_Table,
4908 since the former now needs that type defined.
4909 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4910 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4911 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4912 New enums, for gdb_make_enums_visible.
4913 (GLYPH_MODE_LINE_FACE): Remove; unused.
4914 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4915 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4916 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4917 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4918 enum maxargs, enum MAX_ALLOCA.
4919 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4920 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4921 no longer needed, now that they are done in lisp.h.
4922
4923 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4924
4925 Cleanup string bytes checking.
4926 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4927 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4928 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4929 (check_sblock, compact_small_strings): Simplify.
4930
4931 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4934 These macros are confusing and no longer need to be defined, as
4935 the enum values now suffice. All uses replaced with definiens.
4936 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4937
4938 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4939
4940 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4941 ($(BLD)/w32console.$(O)): Update dependencies.
4942
4943 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4944
4945 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4946 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4947 time. Adjust users.
4948 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4949
4950 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4951
4952 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4953 setting sitelisp (Bug#12010).
4954
4955 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4956
4957 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4958
4959 * w32heap.c (cache_system_info):
4960 * w32.c (sys_rename):
4961 * w32proc.c (find_child_console, sys_kill): All users changed.
4962
4963 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4966
4967 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4968
4969 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4970
4971 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4972
4973 Cleanup statistics calculation in Fgarbage_collect.
4974 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4975 Fix zombies percentage calculation. Simplify elapsed time calculation.
4976
4977 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4978
4979 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4980 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4981 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4982 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4983 (replace_range, replace_range_2, del_range_2): Change to eassert.
4984 * marker.c (byte_char_debug_check): Adjust style.
4985
4986 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4989 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4990 long-ago-commented-out code that talks about "WIN32".
4991 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4992 All uses changed.
4993
4994 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4995
4996 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4997 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4998 Simplify by using alignof.
4999 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5000 * lisp.h: Include <stdalign.h>.
5001 (GCALIGNMENT): New macro and constant.
5002 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5003 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5004 (stdalign): New macro, if not already defined.
5005
5006 2012-07-28 Eli Zaretskii <eliz@gnu.org>
5007
5008 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5009 * w32inevt.c: Include w32inevt.h.
5010 (w32_read_console_input): New inline function, calls either
5011 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5012 w32_console_unicode_input.
5013 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5014 (w32_kbd_patch_key, key_event): Use the codepage returned by
5015 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5016 (key_event): use uChar.UnicodeChar only if
5017 w32_console_unicode_input is non-zero.
5018
5019 * w32console.c: Include w32heap.h.
5020 <w32_console_unicode_input>: New global variable.
5021 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5022 family of Windows, zero otherwise.
5023
5024 * w32inevt.h: Declare w32_console_unicode_input.
5025
5026 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5027 --without-x. (Bug#11742)
5028
5029 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5030
5031 Adjust GDB to reflect pvec_type changes (Bug#12036).
5032 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5033 2012-07-04 changes to pseudovector representation.
5034 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5035
5036 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5037
5038 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5039 bus address.
5040 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5041
5042 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5043
5044 * alloc.c (listn): Fix the order the arguments are consed onto the
5045 list.
5046
5047 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5048 enumeration constants, as PURE and HEAP are too general, and clash
5049 with other headers and sources, such as gmalloc.c and the
5050 MS-Windows system headers. All users changed.
5051
5052 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5053
5054 Revert last save_excursion_save and save_excursion_restore changes.
5055 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5056 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5057
5058 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5059
5060 Fix recently-introduced typos in Windows port.
5061 Reported by Martin Rudalics <rudalics@gmx.at>.
5062 * w32.c (init_environment): Replace comma with semicolon.
5063 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5064
5065 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5066
5067 Improve GDB symbol export (Bug#12036).
5068 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5069 arms of an 'if', not using conditional expressions; otherwise GDB
5070 complains about the types in the unevaluated arm when the argument
5071 is an integer literal.
5072 (xgetint): Simplify expression.
5073 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5074 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5075 Zaretskii in <http://bugs.gnu.org/12036#13>.
5076 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5077 needed now that we have gdb_make_enums_visible.
5078 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5079 (enum enum_USE_LSB_TAG):
5080 New enum types, packaging up enums that need to be exported to GDB.
5081
5082 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5083
5084 Utility function to make a list from specified amount of objects.
5085 * lisp.h (enum constype): New datatype.
5086 (listn): New prototype.
5087 * alloc.c (listn): New function.
5088 (Fmemory_use_count, syms_of_alloc): Use it.
5089 * buffer.c (syms_of_buffer): Likewise.
5090 * callint.c (syms_of_callint): Likewise.
5091 * charset.c (define_charset_internal): Likewise.
5092 * coding.c (syms_of_coding): Likewise.
5093 * keymap.c (syms_of_keymap): Likewise.
5094 * search.c (syms_of_search): Likewise.
5095 * syntax.c (syms_of_syntax): Likewise.
5096 * w32.c (init_environment): Likewise.
5097 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5098 * xdisp.c (syms_of_xdisp): Likewise.
5099 * xfns.c (syms_of_xfns): Likewise.
5100
5101 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5102
5103 Fast save_excursion_save and save_excursion_restore.
5104 * lisp.h (struct Lisp_Excursion): New data type.
5105 (PVEC_EXCURSION): New pseudovector type.
5106 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5107 to deal with it. Adjust comments.
5108 (init_marker, attach_marker): New prototype.
5109 (unchain_marker): Adjust prototype.
5110 * marker.c (attach_marker): Change to global.
5111 (init_marker): New function.
5112 * alloc.c (Fmake_marker, build_marker): Use it.
5113 (build_marker): More easserts.
5114 (mark_object): Handle struct Lisp_Excursion.
5115 * editfns.c (save_excursion_save, save_excursion_restore):
5116 Reimplement to use struct Lisp_Excursion. Add comments.
5117
5118 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 Fix export of symbols to GDB (Bug#12036).
5121 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5122 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5123 emacs.c, as this is a more-suitable home. Had this been done earlier
5124 the fix for 12036 would have avoided some of the problems noted in
5125 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5126 would have been more obvious.
5127 * emacs.c: Do not include <verify.h>; no longer needed.
5128 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5129 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5130 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5131 Remove; now done in lisp.h.
5132 * lisp.h (PUBLISH_TO_GDB): New macro.
5133 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5134 (DATA_SEG_BITS): Use it.
5135 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5136 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5137 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5138 not be usable in #if. This simplifies things.
5139
5140 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5141
5142 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5143
5144 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5145
5146 Simplify export of symbols to GDB (Bug#12036).
5147 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5148 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5149 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5150 Adjust to changes in lisp.h and emacs.c, by using
5151 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5152 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5153 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5154 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5155 instead of gdb_valbits.
5156 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5157 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5158 instead of gdb_array_mark_flag.
5159 (xboolvector): Get size from $->size, not $->header.size.
5160 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5161 (xreload, hook-run, hookpost-run): Remove.
5162 * emacs.c: Include <verify.h>.
5163 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5164 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5165 Remove.
5166 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5167 (gdb_USE_LSB_TAG): New enum constants.
5168 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5169 Also define these as enum constants, so they're visible to GDB.
5170 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5171 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5172 as constants, so they're visible to GDB.
5173 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5174 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5175 Now enum constants, not macros, so they're visible to GDB.
5176 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5177 more convenient now. All uses changed.
5178 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5179 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5180
5181 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5182
5183 Explicitly free restriction data that are not needed anymore.
5184 * editfns.c (save_restriction_restore): Free restriction data.
5185
5186 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5187
5188 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5189 add argument, tune behavior, and adjust all callers.
5190
5191 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5192
5193 Use typedef for EMACS_INT, EMACS_UINT.
5194 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5195 than macros. This simplifies debugging in the usual case, since
5196 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5197 and it allows expressions involving EMACS_INT casts.
5198 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5199
5200 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5201
5202 * nsterm.m (ns_read_socket): Return early if there is a modal
5203 window (Bug#12043).
5204
5205 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5206
5207 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5208 that FOCUS-FRAME can be omitted.
5209
5210 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5211
5212 Adjust buffer text indirection counters at the end of Fkill_buffer.
5213 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5214 buffer is definitely dead. This should really fix an issue reported
5215 by Christoph Scholtes again. (Bug#12007).
5216 (init_buffer_once): Initialize indirection counters of
5217 buffer_defaults and buffer_local_symbols (for sanity and safety).
5218
5219 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5220
5221 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5222 and continuation glyphs on tooltip frames, leave them at zero.
5223 Avoids continued lines in tooltips. (Bug#11832)
5224
5225 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5226
5227 Simplify copy_overlay.
5228 * buffer.c (copy_overlay): Simplify. Use build_marker.
5229 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5230
5231 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5232
5233 * print.c (print_object): Don't crash when a frame's name is nil
5234 or invalid. (Bug#12025)
5235
5236 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5237 it signals an error when a tooltip frame is being created.
5238
5239 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5240
5241 Cleanup miscellaneous objects allocation and initialization.
5242 * alloc.c (allocate_misc): Change to static. Add argument to
5243 specify the subtype. Adjust comment and users.
5244 (build_overlay): New function.
5245 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5246 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5247 (allocate_misc): Remove prototype.
5248 (build_overlay): Add prototype.
5249
5250 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5251
5252 Swap buffer text indirection counters in Fbuffer_swap_text.
5253 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5254 This avoids crash reported by Christoph Scholtes at
5255 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5256
5257 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5258
5259 * nsmenu.m (Popdown_data): New struct.
5260 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5261 free Popdown_data.
5262 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5263 (initWithContentRect): Make imgView and contentView non-static
5264 and autorelease them. Also autorelease img and matrix (Bug#12005).
5265 (dealloc): Remove (Bug#12005).
5266
5267 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5268
5269 Adjust consing_since_gc when objects are explicitly freed.
5270 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5271 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5272 (free_cons, free_misc): Subtract object size from consing_since_gc.
5273
5274 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5275
5276 Simplify and cleanup markers positioning code.
5277 * marker.c (attach_marker): More useful eassert.
5278 (live_buffer, set_marker_internal): New function.
5279 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5280 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5281
5282 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5283
5284 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5285 as it's limited by the amount of memory, not by INT_MAX.
5286
5287 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5288
5289 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5290 in special-event-map. See the discussion at
5291 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5292 for the reasons.
5293
5294 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5295 info.dwItemData. Fixes crashes on 64-bit Windows.
5296 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5297
5298 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5299
5300 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5301 (conversationIdentifier): Return value is NSInteger.
5302 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5303
5304 2012-07-21 Chong Yidong <cyd@gnu.org>
5305
5306 * window.c (decode_any_window): Signal an error if the window is
5307 on a dead frame (Bug#11984).
5308
5309 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5310
5311 Add indirection counting to speed up Fkill_buffer.
5312 * buffer.h (struct buffer): New member.
5313 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5314 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5315 base buffer indirection counter.
5316 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5317 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5318 through buffer list if indirection counter is 0.
5319
5320 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5321
5322 Extend the value returned by Fgarbage_collect with heap statistics.
5323 * alloc.c (Qheap): New symbol.
5324 (syms_of_alloc): DEFSYM it.
5325 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5326 (Fmemory_free): Remove.
5327 (syms_of_alloc): Don't defsubr it.
5328 * buffer.c (Fcompact_buffer): Remove.
5329 (syms_of_buffer): Don't defsubr it.
5330
5331 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5332
5333 Make maybe_gc inline.
5334 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5335 * lisp.h (consing_since_gc, gc_relative_threshold)
5336 (memory_full_cons_threshold): Revert declaration.
5337 (maybe_gc): Remove prototype, define as inline.
5338 * alloc.c: Remove old commented-out code.
5339 (consing_since_gc, gc_relative_threshold)
5340 (memory_full_cons_threshold): Revert to global.
5341 (maybe_gc): Remove.
5342
5343 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5344
5345 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5346 * lisp.h (build_unibyte_string): New function.
5347 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5348 * sysdep.c, w32fns.c, xfns.c: Use it.
5349 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5350 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5351 Adjust users accordingly.
5352 * font.h (font_open_by_name): Adjust prototype.
5353
5354 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5355
5356 Cleanup calls to Fgarbage_collect.
5357 * lisp.h (maybe_gc): New prototype.
5358 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5359 Remove declarations.
5360 * alloc.c (maybe_gc): New function.
5361 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5362 Make them static.
5363 * bytecode.c (MAYBE_GC): Use maybe_gc.
5364 * eval.c (eval_sub, Ffuncall): Likewise.
5365 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5366 to avoid dependency from auto-save feature.
5367
5368 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5369
5370 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5371 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5372 'for_each_per_buffer_object_at'.
5373 All uses changed. It's better to use upper-case for macros that
5374 cannot be implemented as functions, to give the reader a clue
5375 that they're special.
5376
5377 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5378
5379 * alloc.c (Fgarbage_collect): Tweak docstring.
5380
5381 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5382
5383 Tweak the value returned from Fgarbage_collect again.
5384 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5385 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5386 Adjust documentation.
5387 (total_vector_bytes): Rename to total_vector_slots, adjust
5388 accounting.
5389 (total_free_vector_bytes): Rename to total_free_vector_slots,
5390 adjust accounting.
5391 (Qstring_bytes, Qvector_slots): New symbols.
5392 (syms_of_alloc): DEFSYM them.
5393
5394 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5395
5396 Buffer compaction primitive which may be used from Lisp.
5397 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5398 (syms_of_buffer): Register Fcompact_buffer.
5399 * alloc.c (Fgarbage_collect): Use compact_buffer.
5400 * buffer.h (compact_buffer): New prototype.
5401 (struct buffer_text): New member.
5402
5403 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5404
5405 New macro to iterate over all buffers, miscellaneous cleanups.
5406 * lisp.h (all_buffers): Remove declaration.
5407 * buffer.h (all_buffers): Add declaration, with comment.
5408 (for_each_buffer): New macro.
5409 * alloc.c (Fgarbage_collect, mark_object): Use it.
5410 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5411 (init_buffer): Likewise.
5412 * data.c (Fset_default): Likewise.
5413 * coding.c (code_conversion_restore): Remove redundant check
5414 for dead buffer.
5415 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5416
5417 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5418
5419 Fix bug that created negative-length intervals.
5420 * intervals.c (merge_interval_right, merge_interval_left):
5421 Do not zero out this interval if it is absorbed by its children,
5422 as this interval's total length doesn't change in that case. See
5423 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5424
5425 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5426
5427 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5428 when invoking (make-bool-vector N t) and N is a positive
5429 multiple of 8 -- the last 8 bits were mistakenly cleared.
5430
5431 Remove some struct layout assumptions in bool vectors.
5432 * alloc.c (bool_header_size): New constant.
5433 (header_size, word_size): Move earlier, as they're now used earlier.
5434 Use 'word_size' in a few more places, where it's appropriate.
5435 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5436 padding before the data member of a bool vector.
5437 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5438 than doing the check by hand with an abort ().
5439
5440 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5441
5442 * eval.c (Fdefvar): Don't check constants since we only set the var if
5443 it's not yet defined anyway (bug#11904).
5444
5445 * lisp.h (last_undo_boundary): Declare new var.
5446 * keyboard.c (command_loop_1): Set it.
5447 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5448 were auto-added by the command loop (bug#11774).
5449
5450 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5451
5452 * w32font.c (Qsymbol): Remove local definition.
5453 (syms_of_w32font): Don't DEFSYM it.
5454
5455 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5456
5457 Fix sweep_vectors to handle large bool vectors correctly.
5458 * alloc.c (sweep_vectors): Account total_vector_bytes for
5459 bool vectors larger than VBLOCK_BYTES_MAX.
5460
5461 2012-07-18 Chong Yidong <cyd@gnu.org>
5462
5463 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5464 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5465
5466 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5467
5468 Return more descriptive data from Fgarbage_collect.
5469 Suggested by Stefan Monnier in
5470 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5471 * alloc.c (bounded_number): New function.
5472 (total_buffers, total_vectors): New variable.
5473 (total_string_size): Rename to total_string_bytes, adjust users.
5474 (total_vector_size): Rename to total_vector_bytes, adjust users.
5475 (sweep_vectors): Account total_vectors and total_vector_bytes.
5476 (Fgarbage_collect): New return value. Adjust documentation.
5477 (gc_sweep): Account total_buffers.
5478 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5479 (VECTOR_SIZE): Remove.
5480 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5481 (Qinterval, Qmisc): New symbols.
5482 (syms_of_data): Initialize them.
5483 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5484 (Qcons, Qbuffer): New declarations.
5485
5486 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5487
5488 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5489 Round up, not down. Improve doc.
5490
5491 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5492
5493 Restore old code in allocate_string_data to avoid Faset breakage.
5494 Reported by Julien Danjou <julien@danjou.info> in
5495 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5496 * alloc.c (allocate_string_data): Restore old code with minor
5497 adjustments, fix comment to explain this subtle issue.
5498
5499 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5500
5501 Remove FILE_SYSTEM_CASE.
5502 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5503
5504 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5505 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5506 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5507 call-process-region passes it through expand-file-name.
5508
5509 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5510
5511 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5512
5513 Fix crash when creating indirect buffer (Bug#11917)
5514 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5515 Don't handle unbound variables specially if non-zero.
5516 (Fbuffer_local_variables): Pass zero.
5517 (clone_per_buffer_values): Pass non-zero.
5518
5519 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5520
5521 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5522 to make the loop interruptible.
5523
5524 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5525
5526 * gnutls.c (emacs_gnutls_handshake): Only retry if
5527 GNUTLS_E_INTERRUPTED.
5528
5529 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5530
5531 Cleanup and convert miscellaneous checks to eassert.
5532 * alloc.c (mark_interval): Fix comment, partially rephrase
5533 old comment from intervals.h (see below).
5534 * intervals.c (find_interval, adjust_intervals_for_insertion)
5535 (delete_interval, adjust_intervals_for_deletion)
5536 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5537 Convert to eassert.
5538 (adjust_intervals_for_insertion, make_new_interval):
5539 Remove obsolete and unused code.
5540 * intervals.h (struct interval): Remove obsolete comment.
5541 * textprotp.c (erase_properties): Remove unused code.
5542 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5543 (Fremove_list_of_text_properties): Convert to eassert.
5544
5545 2012-07-17 Chong Yidong <cyd@gnu.org>
5546
5547 * editfns.c (Finsert_char): Doc fix.
5548
5549 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5550
5551 Fix previous change to make Fmemory_free always accurate.
5552 * alloc.c (make_interval): Update total_free_intervals.
5553 (make_float): Likewise for total_free_floats.
5554 (free_cons, Fcons): Likewise for total_free_conses.
5555 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5556 Likewise for total_free_vector_bytes.
5557 (Fmake_symbol): Likewise for total_free_symbols.
5558 (bytes_free): Remove.
5559
5560 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5561
5562 Simple free memory accounting feature.
5563 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5564 (sweep_vectors): Accumulate size of free vectors.
5565 (Fgarbage_collect): Setup bytes_free.
5566 (Fmemory_free): New function.
5567 (syms_of_alloc): Register it.
5568
5569 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5570
5571 Cleanup overlays checking.
5572 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5573 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5574 eassert and OVERLAYP.
5575 (sort_overlays): Change to use OVERLAYP.
5576
5577 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5578
5579 * editfns.c (Finsert_char): Make it interactive, and make the
5580 second arg optional. Copy interactive spec and docstring from
5581 ucs-insert.
5582
5583 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5584
5585 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5586 Unlike the other wrapped functions, fabs has an unspecified
5587 effect on errno.
5588
5589 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5590
5591 * nsterm.m (keyDown): Interpret flags without left/right bits
5592 as the left key (Bug#11670).
5593
5594 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5595
5596 Remove empty and useless init functions.
5597 * lisp.h (init_character_once, init_fns, init_image)
5598 (init_filelock, init_sound): Remove prototype.
5599 * character.c (init_character_once): Remove.
5600 * filelock.c (init_filelock): Likewise.
5601 * fns.c (init_fns): Likewise.
5602 * image.c (init_image): Likewise.
5603 * sound.c (init_sound): Likewise.
5604 * emacs.c (main): Adjust accordingly.
5605
5606 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5607
5608 * gtkutil.h: Tiny cleanups.
5609 (use_old_gtk_file_dialog): Remove useless declaration.
5610 (xg_uses_old_file_dialog): Add suggested const attribute.
5611
5612 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5613
5614 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5615 (bidi_paragraph_init): Use it to limit search forward for a strong
5616 directional character in abnormally large paragraphs full of
5617 neutral or weak characters. (Bug#11943)
5618
5619 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5620
5621 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5622 the toolbar (Bug#9451).
5623 (xg_make_tool_item): Give the widget event box a transparent
5624 background.
5625
5626 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5627
5628 Cleanup basic allocation variables and functions.
5629 * alloc.c (ignore_warnings, init_intervals, init_float)
5630 (init_cons, init_symbol, init_marker): Remove.
5631 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5632 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5633 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5634 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5635 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5636 (staticidx, init_alloc_once, init_strings, free_ablock):
5637 Remove redundant initialization.
5638 * fns.c (init_weak_hash_tables): Remove.
5639 * lisp.h (init_weak_hash_tables): Remove prototype.
5640
5641 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5642
5643 Use zero_vector where appropriate.
5644 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5645 accordingly.
5646 * lisp.h (zero_vector): New declaration.
5647 * font.c (null_vector): Remove.
5648 (syms_of_font): Remove initialization and staticpro.
5649 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5650 * keymap.c (Faccessible_keymaps): Likewise.
5651
5652 2012-07-15 Leo Liu <sdl.web@gmail.com>
5653
5654 * fringe.c: Fix typo in comments.
5655
5656 2012-07-14 Leo Liu <sdl.web@gmail.com>
5657
5658 * fringe.c: Add a new bitmap exclamation-mark.
5659
5660 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5661
5662 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5663
5664 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5665 (HAVE_MENUS): Don't define, defined by editing config.in with
5666 msdos/sed2v2.inp.
5667 (GMALLOC_INHIBIT_VALLOC): Don't define.
5668 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5669
5670 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5671
5672 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5673
5674 2012-07-14 Glenn Morris <rgm@gnu.org>
5675
5676 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5677 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5678 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5679
5680 2012-07-13 Glenn Morris <rgm@gnu.org>
5681
5682 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5683
5684 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5685 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5686
5687 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5688
5689 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5690 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5691 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5692 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5693 where appropriate.
5694 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5695 as boolean expression.
5696 (x_set_window_size): Remove unused variable toolbar.
5697 (ns_get_color_default, ns_mod_to_lisp): Remove.
5698 (ns_mouse_position): Remove unused variables xchar and ychar.
5699 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5700 (ns_set_vertical_scroll_bar): Remove unused variable count.
5701 (ns_delete_terminal): Remove unused variable i.
5702 (ns_term_init): Remove unused variables r, g and b.
5703 (mouseDown): Remove unused variable window.
5704 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5705 (initFrameFromEmacs): Remove unused variable vbextra.
5706 (mouseEntered): Remove unused variables p and dpyinfo.
5707 (mouseExited): Remove unused variables p and r.
5708 (ns_define_frame_cursor, ns_clear_frame_area)
5709 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5710 (menuDown): Assign [sender tag] to variable and cast the variable.
5711
5712 * nsterm.h (menuDown): Add id as type to argument sender.
5713 (ns_display_info_for_name): Add Lisp_Object argument.
5714 (ns_term_init): Add Lisp_Object argument.
5715 (ns_map_event_to_object): Add void argument.
5716 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5717 prototype with arguments and only declare if __OBJC__.
5718 (nxatoms_of_nsselect): Add void argument.
5719 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5720 (ns_alloc_autorelease_pool): Add void argument.
5721 (ns_release_autorelease_pool): Add void* argument.
5722 (ns_get_defaults_value): Add const char* argument.
5723
5724 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5725 (initFromContents): Use SSDATA where appropriate.
5726 (ns_update_menubar): Add braces to ambigous if-else.
5727 (initWithTitle): Put () around assignment in if statement.
5728 (ns_menu_show): Remove unused variables window and keymap.
5729 (update_frame_tool_bar): Remove unused variable selected_p.
5730 (initWithContentRect): Remove unused variable this_cmd_name.
5731
5732 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5733 appropriate.
5734 (setXBMColor): Remove unused variable len.
5735 (setPixmapData): Put () around assignment in loop statement.
5736
5737 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5738 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5739 where appropriate.
5740 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5741 around assignment in loop statement.
5742 (nsfont_open): Remove unused variable i.
5743 (nsfont_open): Remove unused variable len.
5744 (nsfont_draw): Remove unused variable cs.
5745
5746 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5747 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5748 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5749 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5750 (Fns_font_name, Fns_perform_service)
5751 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5752 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5753 (ns_set_name): Remove unused variable view.
5754 (x_set_menu_bar_lines): Remove unused variable olines.
5755 (x_set_tool_bar_lines): Remove unused variable root_window.
5756 (Fns_list_colors): Put () around assignment in while statement.
5757 (Fns_perform_service): Remove unused variable len.
5758 (Fns_display_usable_bounds): Remove unused variable top.
5759 (syms_of_nsfns): Remove unused variable i.
5760
5761 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5762 memcpy (Bug#11907).
5763
5764 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5765
5766 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5767 and free it with DestroyExceptionInfo (Bug#11558).
5768
5769 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5770
5771 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5772 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5773 Set here, not in nt/config.nt.
5774
5775 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5776
5777 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5778 cursor overflow into the last glyph on display line when the right
5779 fringe is off. (Bug#11832)
5780
5781 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5782
5783 * xdisp.c (produce_special_glyphs): Now static.
5784 * dispextern.h (produce_special_glyphs): Remove decl.
5785
5786 2012-07-13 Glenn Morris <rgm@gnu.org>
5787
5788 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5789 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5790
5791 * s/usg5-4-common.h (USG, USG5):
5792 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5793 * s/sol2-6.h (SOLARIS2):
5794 * s/irix6-5.h (IRIX6_5):
5795 * s/hpux10-20.h (USG, USG5, HPUX):
5796 * s/gnu-linux.h (USG, GNU_LINUX):
5797 * s/freebsd.h (BSD_SYSTEM):
5798 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5799 * s/cygwin.h (CYGWIN):
5800 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5801 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5802
5803 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5804
5805 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5806
5807 2012-07-13 Glenn Morris <rgm@gnu.org>
5808
5809 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5810
5811 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5812
5813 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5814 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5815
5816 2012-07-12 Glenn Morris <rgm@gnu.org>
5817
5818 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5819
5820 * process.c (init_process_emacs): Rename from init_process.
5821 The old name is also the name of a Mach system call.
5822 * lisp.h, emacs.c: Update for this name change.
5823 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5824 longer needed.
5825
5826 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5827
5828 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5829 memmove call that removes glyphs covered by the left truncation
5830 glyph. Improve commentary.
5831 (display_line): Fix display of continuation glyphs on GUI frames
5832 when the right fringe is turned off and variable-size fonts are
5833 used in the window. Move the code that appends a stretch glyph to
5834 produce_special_glyphs, so that it could be used for truncation
5835 and continuation glyphs alike.
5836 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5837 glyph of a suitably computed width, to align the special glyphs at
5838 the window margin. Code moved from display_line. (Bug#11832)
5839
5840 2012-07-12 Glenn Morris <rgm@gnu.org>
5841
5842 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5843
5844 * s/gnu-linux.h, s/hpux10-20.h:
5845 Do not unconditionally define HAVE_XRMSETDATABASE.
5846
5847 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5848
5849 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5850
5851 Fix typos that broke OS X build.
5852 Reported by Randal L. Schwartz in
5853 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5854 * nsterm.m (ns_timeout): Add missing local decl.
5855 (ns_get_color): snprintf -> sprintf, to fix typo.
5856
5857 2012-07-12 Glenn Morris <rgm@gnu.org>
5858
5859 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5860 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5861 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5862 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5863
5864 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5865 Move PTY_OPEN to configure.
5866
5867 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5868 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5869 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5870
5871 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5872
5873 Use empty_unibyte_string where applicable.
5874 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5875 * lread.c (read1): Likewise.
5876 * xsettings.c (syms_of_xsettings): Likewise.
5877
5878 2012-07-12 Glenn Morris <rgm@gnu.org>
5879
5880 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5881 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5882 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5883 * s/hpux10-20.h (RUN_TIME_REMAP):
5884 * s/bsd-common.h (TABDLY): Move to configure.
5885
5886 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5887
5888 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5889
5890 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5891 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5892
5893 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5894
5895 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5896 * s/template.h: Move NARROWPROTO to configure.
5897
5898 2012-07-11 Glenn Morris <rgm@gnu.org>
5899
5900 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5901 unused since 2011-01-17 change to systty.h.
5902
5903 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5904 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5905 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5906
5907 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5908
5909 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5910
5911 2012-07-11 Glenn Morris <rgm@gnu.org>
5912
5913 * s/darwin.h, s/gnu-linux.h, s/template.h:
5914 Move INTERRUPT_INPUT to configure.
5915
5916 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5917
5918 Minor adjustments to interning code.
5919 * lisp.h (intern, intern_c_string): Redefine as static inline
5920 wrappers for intern_1 and intern_c_string_1, respectively.
5921 (intern_1, intern_c_string_1): Rename prototypes.
5922 * lread.c (intern_1, intern_c_string_1, oblookup):
5923 Simplify Vobarray checking.
5924 * font.c (font_intern_prop): Likewise. Adjust comment.
5925 * w32font.c (intern_font_name): Likewise.
5926
5927 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5928
5929 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5930
5931 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5932 of Fcar/Fcdr if possible.
5933 * font.c (check_otf_features): Likewise.
5934 * fontset.c (Fnew_fontset): Likewise.
5935 * gnutls.c (Fgnutls_boot): Likewise.
5936 * minibuf.c (read_minibuf): Likewise.
5937 * msdos.c (IT_set_frame_parameters): Likewise.
5938 * xmenu.c (Fx_popup_dialog): Likewise.
5939 * w32menu.c (Fx_popup_dialog): Likewise.
5940
5941 2012-07-11 Glenn Morris <rgm@gnu.org>
5942
5943 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5944 since nothing has defined it on these platforms.
5945
5946 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5947 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5948
5949 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5950 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5951 Move CLASH_DETECTION to configure.
5952
5953 * s/gnu.h: Remove file, which is now empty.
5954
5955 * s/gnu.h, s/gnu-linux.h:
5956 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5957
5958 2012-07-11 John Wiegley <johnw@newartisans.com>
5959
5960 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5961 function attribute, so we only use it if it exists in the
5962 compiler.
5963
5964 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5965
5966 Avoid call to strlen in fast_c_string_match_ignore_case.
5967 * search.c (fast_c_string_match_ignore_case): Change to use
5968 length argument. Adjust users accordingly.
5969 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5970
5971 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5972
5973 Assume mkdir, rmdir.
5974 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5975 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5976
5977 Assume rename.
5978 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5979
5980 Assume perror.
5981 * s/hpux10-20.h (HAVE_PERROR): Remove.
5982 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5983 Remove dummy definition, as this problem was obsolete long ago.
5984
5985 Assume strerror.
5986 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5987
5988 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5989
5990 Avoid calls to strlen in font processing functions.
5991 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5992 (font_open_by_name): Change to use length argument.
5993 Adjust users accordingly.
5994 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5995 Adjust prototypes.
5996 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5997 Change to return ptrdiff_t.
5998 (xfont_list_pattern, xfont_match): Use length returned by
5999 xfont_decode_coding_xlfd.
6000 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6001
6002 2012-07-11 Glenn Morris <rgm@gnu.org>
6003
6004 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6005 Move DONT_REOPEN_PTY to configure.
6006
6007 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6008 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6009
6010 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6011
6012 Remove "#define unix" that is no longer needed (Bug#11905).
6013 * s/aix4-2.h (unix): Remove; no longer needed.
6014
6015 EMACS_TIME simplification (Bug#11875).
6016 This replaces macros (which typically do not work in GDB)
6017 with functions, typedefs and enums, making the code easier to debug.
6018 The functional style also makes code easier to read and maintain.
6019 * systime.h: Include <sys/time.h> on all hosts, not just if
6020 WINDOWSNT, since 'struct timeval' is needed in general.
6021 (EMACS_TIME): Now a typedef, not a macro.
6022 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6023 not macros.
6024 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6025 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6026 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6027 (EMACS_TIME_LE): Now functions, not macros.
6028 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6029 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6030 which are not functions. All uses rewritten to use:
6031 (make_emacs_time): New function.
6032 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6033 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6034 not functions. All uses rewritten to use the following, respectively:
6035 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6036 (add_emacs_time, sub_emacs_time): New functions.
6037 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6038 * fileio.c (Fcopy_file):
6039 * xterm.c (XTflash): Get the current time closer to when it's used.
6040 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6041
6042 * bytecode.c (targets): Suppress -Woverride-init warnings.
6043
6044 Simplify by avoiding confusing use of strncpy etc.
6045 * doc.c (Fsnarf_documentation):
6046 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6047 * frame.c (Fmake_terminal_frame):
6048 * gtkutil.c (get_utf8_string):
6049 * lread.c (openp):
6050 * nsmenu.m (ns_update_menubar):
6051 * regex.c (regerror):
6052 Prefer memcpy to strncpy and strncat when either will do.
6053 * fileio.c (Fsubstitute_in_file_name):
6054 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6055 (menu_separator_name_p):
6056 * nsmenu.m (ns_update_menubar):
6057 Prefer memcmp to strncmp when either will do.
6058 * nsterm.m: Include <ftoastr.h>.
6059 (ns_get_color):
6060 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6061 Prefer snprintf to strncpy.
6062 * nsterm.m (ns_term_init):
6063 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6064 * nsterm.m (ns_term_init):
6065 Avoid the need for strncpy, by using build_string or
6066 make_unibyte_string directly. Use dtoastr, not snprintf.
6067 * process.c (Fmake_network_process): Diagnose service names that
6068 are too long, rather than silently truncating them or creating
6069 non-null-terminated names.
6070 (Fnetwork_interface_info): Likewise, for interface names.
6071 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6072 Prefer sprintf to strncat.
6073 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6074 Prefer vsnprintf to vsprintf + strncpy.
6075
6076 2012-07-10 Glenn Morris <rgm@gnu.org>
6077
6078 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6079 Clarify fallback case.
6080
6081 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6082
6083 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6084 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6085 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6086 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6087 where argument type is known to be a Lisp_Cons.
6088
6089 2012-07-10 Tom Tromey <tromey@redhat.com>
6090
6091 * bytecode.c (BYTE_CODE_THREADED): New macro.
6092 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6093 (enum byte_code_op): New type.
6094 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6095 (exec_byte_code): Use them. Use token threading when applicable.
6096
6097 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6098
6099 Optimize pure C strings initialization.
6100 * lisp.h (make_pure_string): Fix prototype.
6101 (build_pure_c_string): New function, defined as static inline. This
6102 provides a better opportunity to optimize away calls to strlen when
6103 the function is called with compile-time constant argument.
6104 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6105 argument, adjust users accordingly. Use build_pure_c_string where
6106 appropriate.
6107 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6108 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6109 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6110
6111 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6112
6113 Avoid calls to strlen in miscellaneous functions.
6114 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6115 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6116 * lread.c (openp): Likewise.
6117
6118 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6119
6120 Avoid calls to strlen in path processing functions.
6121 * fileio.c (file_name_as_directory): Add comment. Change to add
6122 srclen argument and return the length of result. Adjust users
6123 accordingly.
6124 (directory_file_name): Fix comment. Change to add srclen argument,
6125 swap 1st and 2nd arguments to obey the common convention.
6126 Adjust users accordingly.
6127 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6128
6129 2012-07-10 Glenn Morris <rgm@gnu.org>
6130
6131 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6132 Move PENDING_OUTPUT_COUNT definition to configure.
6133
6134 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6135 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6136 * s/gnu.h (DATA_START): Move definitions to configure.
6137
6138 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6139 We include usg5-4-common.h, which defines them both.
6140
6141 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6142 O_RDONLY already includes it).
6143
6144 Stop ns builds setting the EMACSLOADPATH environment variable.
6145 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6146 Now it does not set EMACSLOADPATH, just returns the load-path string.
6147 * nsterm.h: Update accordingly.
6148 * lread.c [HAVE_NS]: Include nsterm.h.
6149 (init_lread) [HAVE_NS]: Use ns_load_path.
6150 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6151
6152 2012-07-09 Glenn Morris <rgm@gnu.org>
6153
6154 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6155 since the included bsd-common.h does so.
6156
6157 Stop ns builds setting the EMACSPATH environment variable.
6158 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6159 (ns_init_paths): Do not set EMACSPATH.
6160 * nsterm.h (ns_exec_path): Add it.
6161 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6162 Use ns_exec_path.
6163
6164 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6165
6166 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6167
6168 * process.c (wait_reading_process_output): 'waitchannels' was unset
6169 when read_kbd || !NILP (wait_for_cell); fix this.
6170
6171 Add GCC-style 'const' attribute to functions that can use it.
6172 * character.h (char_resolve_modifier_mask):
6173 * keyboard.h (make_ctrl_char):
6174 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6175 (init_character_once, next_almost_prime, init_fns, init_image)
6176 (flush_pending_output, init_sound):
6177 * mem-limits.h (start_of_data):
6178 * menu.h (finish_menu_items):
6179 Add ATTRIBUTE_CONST.
6180 * emacs.c (DEFINE_DUMMY_FUNCTION):
6181 Declare the dummy function with ATTRIBUTE_CONST.
6182 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6183 Add decls with ATTRIBUTE_CONST.
6184
6185 Minor improvements to make_formatted_string.
6186 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6187 where int is good enough, as vsprintf returns an int.
6188 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6189
6190 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6191
6192 Use make_formatted_string to avoid double length calculation.
6193 * lisp.h (make_formatted_string): New prototype.
6194 * alloc.c (make_formatted_string): New function.
6195 * buffer.c (Fgenerate_new_buffer_name): Use it.
6196 * dbusbind.c (syms_of_dbusbind): Likewise.
6197 * editfns.c (Fcurrent_time_zone): Likewise.
6198 * filelock.c (get_boot_time): Likewise.
6199 * frame.c (make_terminal_frame, set_term_frame_name)
6200 (x_report_frame_params): Likewise.
6201 * image.c (gs_load): Likewise.
6202 * minibuf.c (get_minibuffer): Likewise.
6203 * msdos.c (dos_set_window_size): Likewise.
6204 * process.c (make_process): Likewise.
6205 * xdisp.c (ensure_echo_area_buffers): Likewise.
6206 * xsettings.c (apply_xft_settings): Likewise.
6207
6208 2012-07-09 Glenn Morris <rgm@gnu.org>
6209
6210 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6211 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6212 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6213 * nsterm.h (ns_etc_directory): Add it.
6214 * callproc.c [HAVE_NS]: Include nsterm.h.
6215 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6216
6217 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6218
6219 Move marker debugging code under MARKER_DEBUG.
6220 * marker.c (MARKER_DEBUG): Move marker debugging code under
6221 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6222 for bootstrap with --enable-checking (~3x slowdown reported
6223 by Juanma Barranquero <lekktu@gmail.com>).
6224 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6225
6226 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6227
6228 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6229 See <http://bugs.gnu.org/11825#29>.
6230
6231 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6232
6233 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6234 has no font, use the frame's font. (Bug#11813)
6235 (display_line): Add commentary about displaying truncation glyphs
6236 on GUI frames.
6237 (produce_special_glyphs): Move here from term.c.
6238
6239 * term.c (produce_special_glyphs): Move to xdisp.c.
6240
6241 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6242 section.
6243
6244 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6245
6246 * xdisp.c (display_line): Avoid warning about implicit declaration
6247 of FRAME_FONT.
6248
6249 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6250
6251 * lisp.h: Remove empty conditional.
6252
6253 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6254
6255 * lread.c (load_path_check): Now static.
6256
6257 Fix some minor --with-ns problems found by static checking.
6258 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6259 (x_set_font) [!HAVE_X_WINDOWS]:
6260 * image.c (xpm_load_image) [HAVE_NS]:
6261 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6262 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6263 Remove unused local.
6264 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6265 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6266 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6267 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6268 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6269 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6270 Fix pointer signedness problem.
6271 * xfaces.c (FRAME_X_FONT_TABLE):
6272 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6273
6274 2012-07-07 Glenn Morris <rgm@gnu.org>
6275
6276 * lread.c (load_path_check): New function, split from init_lread.
6277 (init_lread): Reorganize. Motivation:
6278 If EMACSLOADPATH is set, check/warn about that rather than the
6279 defaults, which we are not going to use. Hence we can remove
6280 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6281 Don't warn if site-lisp directories are missing.
6282 If not installed, start from a blank load-path, since
6283 PATH_LOADSEARCH refers to the eventual installation directories.
6284
6285 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6286
6287 Support truncation and continuation glyphs on GUI frames, when
6288 fringes are disabled. (Bug#11832)
6289 * xdisp.c (init_iterator): Get dimensions of truncation and
6290 continuation glyphs even if on GUI frames.
6291 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6292 or both, are absent.
6293 (start_display, move_it_in_display_line_to): Handle the case of a
6294 GUI frame without a fringe to display continuation or truncation
6295 glyphs.
6296 (insert_left_trunc_glyphs): Support GUI frames: make sure
6297 truncation glyphs overwrite enough glyphs from the current line to
6298 have sufficient space in pixels.
6299 (display_line): Support truncation and continuation glyphs on GUI
6300 frames. If some spare pixels are left on the line after inserting
6301 the truncation glyphs, fill that space with a stretch glyph of a
6302 suitably computed width.
6303
6304 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6305 produce_glyphs, to support GUI sessions.
6306
6307 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6308
6309 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6310
6311 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6312
6313 Do not require float-time's arg to fit in time_t (Bug#11825).
6314 This works better on hosts where time_t is unsigned, and where
6315 float-time is applied to the (negative) difference between two times.
6316 * editfns.c (decode_time_components): Last arg is now double *,
6317 not int *, and means to store all the result as a double, without
6318 worrying about whether the seconds part fits in time_t.
6319 All callers changed.
6320 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6321 All callers changed.
6322 (Ffloat_time): Do not fail merely because the specified time falls
6323 outside of time_t range.
6324
6325 2012-07-07 Glenn Morris <rgm@gnu.org>
6326
6327 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6328 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6329 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6330
6331 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6332
6333 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6334 Update dependencies.
6335
6336 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6337
6338 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6339
6340 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6341 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6342 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6343 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6344 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6345 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6346
6347 * xfont.c (compare_font_names): Redo to omit the need for casts.
6348
6349 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6350
6351 * xfns.c (Fx_change_window_property): Doc fix.
6352 * w32fns.c (Fx_change_window_property): Doc fix.
6353
6354 * w32fns.c (Fx_window_property): Accept the same arguments as the
6355 X Windows version. Doc fix.
6356 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6357
6358 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6359 Eli Zaretskii <eliz@gnu.org>
6360
6361 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6362 Windows-specific code from nt/config.nt moved here.
6363 Obsolete settings removed.
6364
6365 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6366
6367 * process.c: Avoid unnecessary calls to gettime.
6368 (wait_reading_process_output): Don't get the time of day
6369 when gobbling data immediately and not waiting, as there's no need
6370 for it in that case. This removes a FIXME.
6371
6372 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6373
6374 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6375 is defined (Bug#11768).
6376
6377 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6378
6379 Fix marker debugging code.
6380 * marker.c (byte_char_debug_check): Do not perform the check
6381 if buffer is not multibyte.
6382 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6383 Call byte_char_debug_check with correct arguments.
6384
6385 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6386
6387 Compile marker debugging code only if ENABLE_CHECKING is defined.
6388 * marker.c (byte_char_debug_check, count_markers):
6389 Use only if ENABLE_CHECKING is defined.
6390 (byte_debug_flag): Remove.
6391 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6392 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6393
6394 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6395
6396 Avoid code repetition in marker-related functions.
6397 * marker.c (attach_marker): New function.
6398 (Fset_marker, set_marker_restricted, set_marker_both)
6399 (set_marker_restricted_both): Use it.
6400 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6401 Consistently rename charno to charpos.
6402 (marker_position): Add eassert.
6403 (marker_byte_position): Convert to eassert.
6404
6405 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6406
6407 Simplify list operations in unchain_overlay and unchain_marker.
6408 * buffer.c (unchain_overlay): Simplify. Add comment.
6409 * marker.c (unchain_marker): Simplify. Fix comments.
6410
6411 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6412
6413 Introduce fast path for the widely used marker operation.
6414 * alloc.c (build_marker): New function.
6415 * lisp.h (build_marker): New prototype.
6416 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6417 * composite.c (autocmp_chars): Likewise.
6418 * editfns.c (buildmark): Remove.
6419 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6420 (save_restriction_save): Use build_marker.
6421 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6422 * window.c (save_window_save): Likewise.
6423
6424 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6425
6426 Do not use Fdelete_overlay in delete_all_overlays
6427 to avoid redundant calls to unchain_overlay.
6428 * buffer.c (drop_overlay): New function.
6429 (delete_all_overlays, Fdelete_overlay): Use it.
6430 * minibuf.c (get_minibuffer): Fix comment.
6431
6432 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6433
6434 Port to OpenBSD 5.1 amd64.
6435 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6436 This is needed for OpenBSD, and should be harmless on all BSD systems.
6437 Also, include <sys/sysctl.h>, as it should be available on all
6438 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6439 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6440 use p_pid member, not kp_proc.pid.
6441
6442 2012-07-06 Glenn Morris <rgm@gnu.org>
6443
6444 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6445
6446 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6447
6448 More xmalloc and related cleanup.
6449 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6450 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6451 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6452 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6453 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6454 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6455 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6456 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6457 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6458 * xterm.c:
6459 Omit needless casts involving void * pointers and allocation.
6460 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6461 as the former is more robust if P's type is changed.
6462 Prefer xzalloc to xmalloc + memset 0.
6463 Simplify malloc-or-realloc to realloc.
6464 Don't worry about xmalloc returning a null pointer.
6465 Prefer xstrdup to xmalloc + strcpy.
6466 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6467 growing it.
6468 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6469 alloca of a constant.
6470
6471 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6472
6473 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6474 hscroll is larger than the line width. Fixes long and futile
6475 looping inside extend_face_to_end_of_line (on a TTY) producing
6476 glyphs that are not needed and thrown away.
6477
6478 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6479
6480 * marker.c (set_marker_restricted_both): Simplify by using
6481 clip_to_bounds.
6482
6483 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6484
6485 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6486
6487 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6488
6489 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6490 not defined (Bug#11768).
6491 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6492 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6493 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6494 followed by gtk_box_set_homogeneous (Bug#11768).
6495 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6496 (update_theme_scrollbar_width, xg_create_scroll_bar):
6497 Use gtk_scrollbar_new (Bug#11768).
6498 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6499 (is_box_type): New function (Bug#11768).
6500 (xg_tool_item_stale_p): Call is_box_type.
6501 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6502 with default display (Bug#11768).
6503
6504 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6505
6506 * xdisp.c (window_hscroll_limited): New function.
6507 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6508 coordinates when window's hscroll is set to insanely large
6509 values. (Bug#11857)
6510
6511 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6512
6513 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6514 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6515
6516 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6517
6518 Cleanup xmalloc.
6519 * lisp.h (xzalloc): New prototype. Omit needless casts.
6520 * alloc.c (xzalloc): New function. Omit needless casts.
6521 * charset.c: Omit needless casts. Convert all calls to
6522 xmalloc with following memset to xzalloc.
6523 * dispnew.c: Likewise.
6524 * fringe.c: Likewise.
6525 * image.c: Likewise.
6526 * sound.c: Likewise.
6527 * term.c: Likewise.
6528 * w32fns.c: Likewise.
6529 * w32font.c: Likewise.
6530 * w32term.c: Likewise.
6531 * xfaces.c: Likewise.
6532 * xfns.c: Likewise.
6533 * xterm.c: Likewise.
6534 * atimer.c: Omit needless casts.
6535 * buffer.c: Likewise.
6536 * callproc.c: Likewise.
6537 * ccl.c: Likewise.
6538 * coding.c: Likewise.
6539 * composite.c: Likewise.
6540 * doc.c: Likewise.
6541 * doprnt.c: Likewise.
6542 * editfns.c: Likewise.
6543 * emacs.c: Likewise.
6544 * eval.c: Likewise.
6545 * filelock.c: Likewise.
6546 * fns.c: Likewise.
6547 * gtkutil.c: Likewise.
6548 * keyboard.c: Likewise.
6549 * lisp.h: Likewise.
6550 * lread.c: Likewise.
6551 * minibuf.c: Likewise.
6552 * msdos.c: Likewise.
6553 * print.c: Likewise.
6554 * process.c: Likewise.
6555 * region-cache.c: Likewise.
6556 * search.c: Likewise.
6557 * sysdep.c: Likewise.
6558 * termcap.c: Likewise.
6559 * terminal.c: Likewise.
6560 * tparam.c: Likewise.
6561 * w16select.c: Likewise.
6562 * w32.c: Likewise.
6563 * w32reg.c: Likewise.
6564 * w32select.c: Likewise.
6565 * w32uniscribe.c: Likewise.
6566 * widget.c: Likewise.
6567 * xdisp.c: Likewise.
6568 * xmenu.c: Likewise.
6569 * xrdb.c: Likewise.
6570 * xselect.c: Likewise.
6571
6572 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6573
6574 * fileio.c (time_error_value): Check the right error number.
6575 Problem reported by Troels Nielsen in
6576 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6577
6578 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6581 This should be fixed in a better way; see Eli Zaretskii in
6582 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6583 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6584
6585 * fileio.c (time_error_value): Rename from special_mtime.
6586 The old name's problems were noted by Eli Zaretskii in
6587 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6588
6589 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6590 This variable's comment says Emacs needs at least one GDB-visible
6591 symbol of type enum pvec_type, to work around GDB problems.
6592 The symbol's value doesn't matter.
6593
6594 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6595 that causes compilation to fail on pre-C99 compilers.
6596
6597 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6598
6599 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6600 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6601
6602 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6603
6604 * buffer.c (init_buffer_once): Fix initialization of
6605 headers for buffer_defaults and buffer_local_symbols.
6606 Reported by Juanma Barranquero <lekktu@gmail.com>.
6607
6608 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6609
6610 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6611 * lisp.h (enum pvec_type): Use fewer bits.
6612 (PSEUDOVECTOR_SIZE_BITS): New constant.
6613 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6614 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6615 change in pvec_type.
6616 (PSEUDOVECTOR_TYPEP): New macro.
6617 (TYPED_PSEUDOVECTORP): Use it.
6618 * fns.c (internal_equal): Adapt code to extract pvectype.
6619 * emacs.c (gdb_pvec_type): Update type.
6620 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6621 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6622 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6623 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6624 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6625 abusing vector->header.next.nbytes.
6626 (live_vector_p): Use PVEC_TYPE.
6627 (mark_object): Adapt code to extract pvectype. Use switch.
6628
6629 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6632 Tighten new eassert a bit.
6633
6634 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6635
6636 Fix compilation with --enable-gcc-warnings and -O1
6637 optimization level.
6638 * doprnt.c (doprnt): Change type of tem to int, initialize
6639 to avoid compiler warning. Add eassert.
6640 * search.c (simple_search): Initialize match_byte to avoid
6641 compiler warning. Add eassert.
6642
6643 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6644
6645 Avoid weird behavior with large horizontal scrolls.
6646 Without this change, for example, large hscroll values would
6647 mess up Emacs's display on Fedora 15 x86, presumably due to
6648 overflows in int calculations in the display code.
6649 Also, if buffers had long lines, Emacs would freeze.
6650 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6651 (set_window_hscroll): New function, containing the old guts of
6652 Fset_window_hscroll. Return the clipped value.
6653 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6654 This avoids the need to check against PTRDIFF_MAX.
6655
6656 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6657
6658 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6659
6660 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6661
6662 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6663
6664 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6665 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6666 since GCC 4.4.6 issues a bogus warning for them.
6667
6668 Fix bugs in file timestamp newness comparisons.
6669 * fileio.c (Ffile_newer_than_file_p):
6670 * lread.c (Fload): Use full timestamp resolution of files,
6671 not just the 1-second resolution, so that files that are only
6672 slightly newer still count as newer.
6673 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6674 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6675
6676 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6677
6678 * fileio.c: Improve handling of file time marker. (Bug#11852)
6679 (special_mtime): New function.
6680 (Finsert_file_contents, Fverify_visited_file_modtime):
6681 Use it to set special mtime values consistently.
6682
6683 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6684
6685 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6686 marker for non-existing file. (Bug#11852)
6687
6688 2012-07-03 Glenn Morris <rgm@gnu.org>
6689
6690 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6691 and did not make it into globals.h).
6692
6693 2012-07-03 Tom Tromey <tromey@redhat.com>
6694
6695 * window.c (Fset_window_margins, Fset_window_fringes)
6696 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6697 * textprop.c (Fprevious_property_change): No longer static.
6698 * syntax.c (Fsyntax_table_p): No longer static.
6699 * process.c (Fget_process, Fprocess_datagram_address): No longer
6700 static.
6701 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6702 * keyboard.c (Fcommand_execute): No longer static.
6703 Remove EXFUN.
6704 * insdel.c (Fcombine_after_change_execute): No longer static.
6705 * image.c (Finit_image_library): No longer static.
6706 * fileio.c (Fmake_symbolic_link): No longer static.
6707 * eval.c (Ffetch_bytecode): No longer static.
6708 * editfns.c (Fuser_full_name): No longer static.
6709 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6710 No longer static.
6711 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6712 static.
6713 * dired.c (Ffile_attributes): No longer static.
6714 * composite.c (Fcomposition_get_gstring): No longer static.
6715 * callproc.c (Fgetenv_internal): No longer static.
6716
6717 * ccl.h: Remove EXFUNs.
6718 * buffer.h: Remove EXFUNs.
6719 * dispextern.h: Remove EXFUNs.
6720 * intervals.h: Remove EXFUNs.
6721 * fontset.h: Remove EXFUN.
6722 * font.h: Remove EXFUNs.
6723 * dosfns.c (system_process_attributes): Remove EXFUN.
6724 * keymap.h: Remove EXFUNs.
6725 * lisp.h: Remove EXFUNs.
6726 * w32term.h: Remove EXFUNs.
6727 * window.h: Remove EXFUNs.
6728 * xsettings.h: Remove EXFUN.
6729 * xterm.h: Remove EXFUN.
6730
6731 2012-07-03 Glenn Morris <rgm@gnu.org>
6732
6733 * lisp.h (Frandom): Make it visible to C.
6734 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6735 buffer for invisible buffers. (Bug#1229)
6736
6737 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6738
6739 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6740 values which aren't power of 2.
6741 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6742 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6743 accordingly.
6744
6745 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6746
6747 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6748
6749 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6750
6751 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6752
6753 * alloc.c (allocate_vector_block): Remove redundant
6754 calls to mallopt if DOUG_LEA_MALLOC is defined.
6755 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6756 avoid calls to mallopt if zero_vector is returned.
6757
6758 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6759
6760 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6761 is enabled, avoid dereferencing NULL current_sblock if
6762 running undumped.
6763
6764 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6765
6766 Cleanup basic buffer management.
6767 * buffer.h (struct buffer): Change layout to use generic vector
6768 marking code. Fix some comments. Change type of 'clip_changed'
6769 to bitfield. Remove unused #ifndef old.
6770 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6771 (GET_OVERLAYS_AT): Fix indentation.
6772 (for_each_per_buffer_object_at): New macro.
6773 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6774 (Fbuffer_local_variables): Use it.
6775 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6776 * alloc.c (allocate_buffer): Adjust to match new layout of
6777 struct buffer. Fix comment.
6778 (mark_overlay): New function.
6779 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6780 Lisp area of struct buffer.
6781 (mark_object): Use it. Adjust marking of misc objects
6782 and related comments.
6783
6784 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6787 wrapper that is not needed because the wrapped code is a no-op (zero
6788 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6789 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6790
6791 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6792
6793 * alloc.c (mark_buffer): Simplify. Remove prototype.
6794 (mark_object): Add comment. Reorganize marking of vector-like
6795 objects. Use CHECK_LIVE for all vector-like objects except buffers
6796 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6797 Avoid redundant calls to mark_vectorlike for bool vectors.
6798
6799 2012-06-30 Glenn Morris <rgm@gnu.org>
6800
6801 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6802
6803 * epaths.in (PATH_SITELOADSEARCH): New.
6804 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6805 This is rather than relying on --enable-locallisppath elements
6806 having "site-lisp" in their names. (Bug#10208#25, 11658)
6807
6808 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6809
6810 * w32proc.c (sys_select): Accept and ignore one more argument.
6811
6812 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6813
6814 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6815 (pselect) [!MS_DOS]: Redirect to sys_select.
6816
6817 * sysdep.c: Don't include dos.h and dosfns.h.
6818
6819 * process.c (sys_select):
6820 * msdos.c (sys_select): Accept one more argument and ignore it.
6821
6822 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6823 adapt data types and code to that.
6824
6825 * dosfns.c:
6826 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6827 which clashes with the gnulib function of the same name.
6828
6829 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6830
6831 * font.c (font_style_to_value, font_style_symbolic)
6832 (font_prop_validate_style): Add type checks for values in
6833 font_style_table.
6834
6835 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6836 argument.
6837 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6838 uses.
6839
6840 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6841
6842 * xdisp.c (try_window_id): Undo last change.
6843
6844 * w32.c (getwd): Adjust commentary about startup_dir.
6845 (init_environment): Always call sys_access, even in non-MSVC
6846 builds. Don't chdir to the directory of the Emacs executable.
6847 This undoes code from 1997 which was justified by the need to
6848 "avoid conflicts when removing and renaming directories". But its
6849 downside was that every relative file name was being interpreted
6850 relative to the directory of the Emacs executable, which can never
6851 be TRT. In particular, it broke sys_access when called with
6852 relative file names.
6853 (sys_access): Map GetLastError to errno.
6854
6855 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6856
6857 * window.h (struct window): Change type of 'fringes_outside_margins'
6858 to bitfield. Fix comment. Adjust users accordingly.
6859 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6860 Adjust comment.
6861 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6862 to ptrdiff_t.
6863
6864 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6865
6866 * gnutls.c (emacs_gnutls_handshake):
6867 Add QUIT to make the loop interruptible.
6868
6869 2012-06-29 Glenn Morris <rgm@gnu.org>
6870
6871 * charset.c (init_charset): Make lack of etc/charsets fatal.
6872
6873 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6874
6875 * editfns.c (region_limit): Fix type mismatch.
6876
6877 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6878
6879 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6880 undefined. Convert from xassert to eassert.
6881 * nsmenu.m: Convert from xassert to eassert.
6882 * nsterm.m: Likewise.
6883
6884 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6885
6886 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6887
6888 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 Avoid integer overflow on scroll-left and scroll-right.
6891 * window.c (HSCROLL_MAX): New macro.
6892 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6893 overflow when requested scroll falls outside ptrdiff_t range.
6894
6895 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6896
6897 * window.h (struct window): Change type of 'hscroll',
6898 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6899 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6900 Adjust users accordingly.
6901 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6902 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6903 from EMACS_INT to ptrdiff_t.
6904 (make_window): Omit redundant initialization.
6905
6906 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6907
6908 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6909
6910 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6911
6912 * window.h (struct window): Change type of 'use_time' and
6913 'sequence_number' from Lisp_Object to int.
6914 * frame.c (make_frame): Adjust users accordingly.
6915 * print.c (print_object): Likewise.
6916 * window.c (select_window, Fwindow_use_time, make_parent_window)
6917 (make_window): Likewise.
6918
6919 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6920
6921 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6922 enabled with --enable-checking=[all,glyphs] configure option.
6923 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6924 adjust comments accordingly.
6925 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6926 undefined, adjust comments accordingly.
6927 * image.c: Likewise.
6928 * scroll.c: Likewise.
6929 * w32fns.c: Likewise.
6930 * w32term.c: Likewise.
6931 * xdisp.c: Likewise.
6932 * xfaces.c: Likewise.
6933 * xfns.c: Likewise.
6934 * xterm.c: Likewise.
6935
6936 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6937
6938 Generalize run-time debugging checks.
6939 * dispextern.h (XASSERTS): Remove.
6940 * fontset.c (xassert): Remove.
6941 Convert from xassert to eassert.
6942 * alloc.c: Convert from xassert to eassert.
6943 * bidi.c: Likewise.
6944 * dispnew.c: Likewise.
6945 * fns.c: Likewise.
6946 * fringe.c: Likewise.
6947 * ftfont.c: Likewise.
6948 * gtkutil.c: Likewise.
6949 * image.c: Likewise.
6950 * keyboard.c: Likewise.
6951 * menu.c: Likewise.
6952 * process.c: Likewise.
6953 * scroll.c: Likewise.
6954 * sound.c: Likewise.
6955 * term.c: Likewise.
6956 * w32console.c: Likewise.
6957 * w32fns.c: Likewise.
6958 * w32term.c: Likewise.
6959 * window.c: Likewise.
6960 * xdisp.c: Likewise.
6961 * xfaces.c: Likewise.
6962 * xfns.c: Likewise.
6963 * xselect.c: Likewise.
6964 * xterm.c: Likewise.
6965
6966 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6967
6968 * fns.c (maybe_resize_hash_table): Output message when growing the
6969 purify-hashtable.
6970
6971 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6972
6973 * alloc.c (allocate_string_data): Remove dead code.
6974 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6975 avoid GCC warning about unused macro.
6976
6977 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6978
6979 * alloc.c (allocate_string): Omit intervals initialization.
6980 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6981 as in make_pure_string and make_pure_c_string.
6982
6983 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6984
6985 * alloc.c (allocate_string): Fix last change.
6986
6987 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6988
6989 * alloc.c (allocate_string): Remove two redundant calls
6990 to memset, add explicit initialization where appropriate.
6991
6992 2012-06-27 Glenn Morris <rgm@gnu.org>
6993
6994 * lisp.mk (lisp): Remove paths.elc.
6995
6996 2012-06-27 Chong Yidong <cyd@gnu.org>
6997
6998 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6999
7000 2012-06-26 John Wiegley <johnw@newartisans.com>
7001
7002 * unexmacosx.c (copy_data_segment): Add two section names used
7003 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7004
7005 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7006 when building with Clang.
7007
7008 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7009
7010 * eval.c (Fapply): Allow calling it with a single argument.
7011
7012 2012-06-26 Eli Zaretskii <eliz@gnu.org>
7013
7014 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7015 _stricmp and _strnicmp.
7016 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7017
7018 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7019
7020 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7021 allocated window.
7022 (allocate_process): Likewise for new process.
7023 (allocate_terminal): Change to use offsetof.
7024 (allocate_frame): Likewise.
7025 * frame.c (make_frame): Omit redundant initialization.
7026 * window.c (make_parent_window): Use memset.
7027 (make_window): Omit redundant initialization.
7028 * process.c (make_process): Omit redundant initialization.
7029 * terminal.c (create_terminal): Likewise.
7030
7031 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7032
7033 * term.c (delete_tty): Remove redundant call to memset.
7034
7035 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7036
7037 * alloc.c: Remove build_string.
7038 * lisp.h: Define build_string as static inline. This provides
7039 a better opportunity to optimize away calls to strlen when the
7040 function is called with compile-time constant argument.
7041 * image.c (imagemagick_error): Convert to build_string.
7042 * w32proc.c (sys_spawnve): Likewise.
7043 * xterm.c (x_term_init): Likewise.
7044
7045 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7046
7047 Use sprintf return value instead of invoking strlen on result.
7048 In the old days this wasn't portable, since some sprintf
7049 implementations returned char *. But they died out years ago and
7050 Emacs already assumes sprintf returns int.
7051 Similarly for float_to_string.
7052 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7053 * ccl.c (ccl_driver):
7054 * character.c (string_escape_byte8):
7055 * data.c (Fnumber_to_string):
7056 * doprnt.c (doprnt):
7057 * print.c (print_object):
7058 * xdisp.c (message_dolog):
7059 * xfns.c (syms_of_xfns):
7060 Use sprintf or float_to_string result to avoid need to call strlen.
7061 * data.c (Fnumber_to_string):
7062 Use make_unibyte_string, since the string must be ASCII.
7063 * lisp.h, print.c (float_to_string): Now returns int length.
7064 * term.c (produce_glyphless_glyph):
7065 Use sprintf result rather than recomputing it.
7066
7067 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7068 * Makefile.in (ALL_CFLAGS):
7069 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7070 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7071
7072 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7073
7074 * dispextern.h (xstrcasecmp): Define to library function
7075 strcasecmp if available.
7076 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7077
7078 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7079
7080 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7081 Avoid comma operator.
7082 * menu.c (push_submenu_start, push_submenu_end)
7083 (push_left_right_boundary, push_menu_pane): Likewise.
7084 * msdos.c (dos_rawgetc): Likewise.
7085
7086 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7087
7088 * xfns.c (xic_create_fontsetname): Remove redundant calls
7089 to memset.
7090
7091 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7092
7093 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7094 sprintf already null-terminates its output.
7095
7096 * xfns.c (x_window): Remove redundant cast.
7097
7098 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7099
7100 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7101 `const char *' to `char *' to avoid compiler warning.
7102
7103 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7106 instead of truncating it to 63 (admittedly a generous limit).
7107
7108 * process.c: Fix spelling and caps in comments.
7109
7110 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7111
7112 * emacs.c (setpgrp): Remove definition, unused.
7113 * sysdep.c (setpgrp): Remove definition, not used in this file.
7114
7115 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7116
7117 * makefile.w32-in: Update dependencies.
7118
7119 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7120
7121 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7122 (SYSTIME_H): Add nt/inc/sys/time.h.
7123
7124 * systime.h [WINDOWSNT]: Include sys/time.h.
7125
7126 * s/ms-w32.h (struct timespec): Definition moved from
7127 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7128
7129 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7130
7131 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7132 * buffer.h (buffer_slot_type_mismatch):
7133 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7134 * eval.c (unwind_to_catch):
7135 * image.c (my_png_error, my_error_exit):
7136 * keyboard.c (quit_throw_to_read_char, user_error)
7137 (Fexit_recursive_edit, Fabort_recursive_edit):
7138 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7139 (wrong_type_argument, buffer_overflow, __executable_start)
7140 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7141 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7142 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7143 (fatal):
7144 (child_setup) [!DOS_NT]:
7145 * lread.c (end_of_file_error, invalid_syntax):
7146 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7147 * puresize.h (pure_write_error):
7148 * search.c (matcher_overflow):
7149 * sound.c (sound_perror, alsa_sound_perror):
7150 * sysdep.c, syssignal.h (croak):
7151 * term.c (maybe_fatal, vfatal):
7152 * textprop.c (text_read_only):
7153 * undo.c (user_error):
7154 * unexmacosx.c (unexec_error):
7155 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7156 Use _Noreturn rather than NO_RETURN.
7157 No need for separate decl merely because of _Noreturn.
7158 * sound.c (sound_warning, parse_sound):
7159 Remove unnecessary forward decls.
7160
7161 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7162
7163 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7164 * lisp.h (WAIT_READING_MAX): New macro.
7165 * dispnew.c (Fsleep_for, sit_for):
7166 * keyboard.c (kbd_buffer_get_event):
7167 * process.c (Faccept_process_output):
7168 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7169 This improves on the previous patch, which introduced a bug
7170 when time_t is unsigned and as wide as intmax_t.
7171 See <http://bugs.gnu.org/9000#51>.
7172
7173 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7174
7175 * dispnew.c (sit_for, Fsleep_for):
7176 * keyboard.c (kbd_buffer_get_event):
7177 * process.c (Faccept_process_output): Avoid compiler warnings when
7178 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7179
7180 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7181
7182 * makefile.w32-in: Update dependencies.
7183
7184 * w32.c (ltime): Add return type and declare static.
7185 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7186
7187 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7188
7189 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7190 Privately reported by Herbert J. Skuhra.
7191 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7192 All uses changed.
7193 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7194 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7195
7196 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7197
7198 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7199 last argument of make_unibyte_string.
7200
7201 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7202 language ID in the event parameters.
7203
7204 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7205 event.code, not the obscure "character set ID".
7206
7207 2012-06-23 Chong Yidong <cyd@gnu.org>
7208
7209 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7210
7211 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7212
7213 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7214 * w32.c (fdutimens): New function.
7215
7216 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7217
7218 * s/ms-w32.h (pselect): Redirect to sys_select.
7219
7220 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7221
7222 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7223 in the logic of incrementing and decrementing the value of
7224 use_relocatable_buffers.
7225
7226 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7227
7228 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7229 Privately reported by Herbert J. Skuhra.
7230 [__FreeBSD__]: Remove "*/" typo after "#include".
7231 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7232 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7233 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7234 Don't assume EMACS_TIME and struct timeval are the same type.
7235
7236 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7237
7238 Support higher-resolution time stamps (Bug#9000).
7239 The time stamps are only nanosecond-resolution at the C level,
7240 since that's the best that any real-world system supports now.
7241 But they are picosecond-resolution at the Lisp level, as that's
7242 easy, and leaves room for future OS improvements.
7243
7244 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7245 (LIBES): Use it.
7246
7247 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7248 Don't get current time unless it's needed.
7249
7250 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7251 now provides it if it's absent.
7252 (start_atimer): Port to higher-res time stamps.
7253 Check for time stamp overflow. Don't get current time more
7254 often than is needed.
7255
7256 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7257 Include systime.h, not time.h.
7258 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7259
7260 * dired.c: Include stat-time.h.
7261 (Ffile-attributes): File times now have higher resolution.
7262
7263 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7264 (struct image): Timestamp now has higher resolution.
7265
7266 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7267 has at least microseconds now. All uses removed.
7268 (update_frame, update_single_window, update_window, update_frame_1)
7269 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7270 (duration_to_sec_usec): Remove; no longer needed.
7271
7272 * editfns.c (time_overflow): Now extern.
7273 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7274 (float-time, Fformat_time_string, Fcurrent_time_string)
7275 (Fcurrent_time_zone): Accept and generate higher-resolution
7276 time stamps.
7277 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7278 (decode_time_components, lisp_seconds_argument): New functions.
7279 (make_time): Now static.
7280 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7281 Report an error if the time is invalid, rather than having the caller
7282 do that.
7283
7284 * fileio.c: Include <stat-time.h>
7285 (Fcopy_file): Copy higher-resolution time stamps.
7286 Prefer to set the time stamp via a file descriptor if that works.
7287 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7288 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7289 (Fvisited_file_modtime, Fset_visited_file_modtime):
7290 Support higher-resolution time stamps.
7291
7292 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7293
7294 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7295
7296 * image.c (prepare_image_for_display, clear_image_cache)
7297 (lookup_image): Port to higer-resolution time stamps.
7298
7299 * keyboard.c (start_polling, bind_polling_period):
7300 Check for time stamp overflow.
7301 (read_char, kbd_buffer_get_event, timer_start_idle)
7302 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7303 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7304 Port to higher-resolution time stamps. Do not assume time_t is signed.
7305 (decode_timer): New function. Timers are now vectors of length 9,
7306 not 8, to accommodate the picosecond component.
7307 (timer_check_2): Use it.
7308
7309 * nsterm.m (select_timeout, timeval_subtract): Remove.
7310 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7311 as they're a bit more accurate and handle overflow better.
7312 (ns_select): Change prototype to be compatible with pselect.
7313 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7314 * nsterm.h (ns_select): Adjust prototype.
7315
7316 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7317 us-resolution time stamps.
7318 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7319
7320 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7321
7322 * lisp.h (time_overflow): New decl.
7323 (wait_reading_process_output): First arg is now intmax_t, not int,
7324 to accommodate larger waits.
7325
7326 * process.h (struct Lisp_Process.read_output_delay):
7327 Now counts nanoseconds, not microseconds.
7328 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7329 EMACS_HAS_USECS.
7330 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7331 (wait_reading_process_output):
7332 Port to ns-resolution time stamps.
7333 (Faccept_process_output, wait_reading_process_output):
7334 Check for time stamp overflow. Do not assume time_t is signed.
7335 (select_wrapper): Remove; we now use pselect.
7336 (Fprocess_attributes): Now generates ns-resolution time stamps.
7337
7338 * sysdep.c: Include utimens.h. Don't include utime.h
7339 or worry about struct utimbuf; gnulib does that for us now.
7340 (gettimeofday): Remove; gnulib provides a substitute.
7341 (make_timeval): New function.
7342 (set_file_times): Now sets ns-resolution time stamps.
7343 New arg FD; all uses changed.
7344 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7345 (system_process_attributes):
7346 Now returns ns-resolution time stamp. All uses changed.
7347 Check for time stamp overflow.
7348
7349 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7350 provides a substitute now.
7351
7352 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7353 since it guarantees struct timespec.
7354 (EMACS_TIME): Now struct timespec, so that we can support
7355 ns-resolution time stamps.
7356 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7357 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7358 (EMACS_USECS): Remove.
7359 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7360 so multiply the arg by 1000 before storing it.
7361 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7362 New macros.
7363 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7364 Port to ns-resolution time stamps.
7365 (EMACS_TIME_NEG_P): Remove; replaced by....
7366 (EMACS_TIME_SIGN): New macro.
7367 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7368 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7369 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7370 (make_timeval, make_lisp_time, decode_time_components): New decls.
7371 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7372 that it mishandled time_t overflow. You can't compare by subtracting!
7373 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7374 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7375
7376 * term.c: Include <sys/time.h>.
7377 (timeval_to_Time): New function, for proper overflow wraparound.
7378 (term_mouse_position, term_mouse_click): Use it.
7379
7380 * undo.c (record_first_change): Support higher-resolution time stamps
7381 in the undo buffer.
7382 (Fprimitive_undo): Use them when restoring time stamps.
7383
7384 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7385 (w32_get_internal_run_time):
7386 Port to higher-resolution Emacs time stamps.
7387 (ltime): Now accepts single 64-bit integer, as that's more convenient
7388 for callers.
7389
7390 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7391
7392 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7393 for compatibility with pselect. Support ns-resolution time stamps.
7394
7395 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7396
7397 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7398 Check for time stamp overflow, and support ns-resolution time stamps.
7399
7400 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7401 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7402 (timeval_subtract): Remove; no longer needed.
7403 (XTflash, XTring_bell, x_wait_for_event):
7404 Port to ns-resolution time stamps. Don't assume time_t is signed.
7405
7406 2012-06-22 Chong Yidong <cyd@gnu.org>
7407
7408 * xdisp.c (x_consider_frame_title): Revert last change.
7409
7410 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7411
7412 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7413 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7414 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7415 staticidx goes up to 1597 out of 1600 = 0x640.)
7416
7417 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7418
7419 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7420 Otherwise, the umask might be mistakenly 0 while handling input signals.
7421
7422 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7423
7424 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7425
7426 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7427
7428 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7429 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7430 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7431 access to `contents' member of Lisp_Vector objects with AREF and ASET
7432 where appropriate.
7433
7434 2012-06-19 Chong Yidong <cyd@gnu.org>
7435
7436 * frame.c (delete_frame): When selecting a frame on a different
7437 text terminal, do not alter the terminal's top-frame.
7438
7439 * xdisp.c (format_mode_line_unwind_data): Record the target
7440 frame's selected window and its terminal's top-frame.
7441 (unwind_format_mode_line): Restore them.
7442 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7443 Callers changed.
7444 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7445 since tty frames can be explicitly named.
7446 (prepare_menu_bars): Likewise.
7447
7448 * term.c (Ftty_top_frame): New function.
7449
7450 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7451
7452 Port byte-code-meter to modern targets.
7453 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7454 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7455 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7456 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7457 (METER_1, METER_2): Simplify.
7458
7459 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7460
7461 * data.c (Fdefalias): Return `symbol' (bug#11686).
7462
7463 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7464
7465 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7466 gets killed during executing of this function (Bug#11665).
7467 Try to always return Qt when the buffer has been actually killed.
7468 (Vkill_buffer_query_functions): In doc-string say that functions
7469 run by this hook should not change the current buffer.
7470
7471 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7472
7473 Fix recently-introduced process.c problems found by static checking.
7474 * process.c (write_queue_push, write_queue_pop, send_process):
7475 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7476 (write_queue_pop): Fix pointer signedness problem.
7477 (send_process): Remove unused local.
7478
7479 2012-06-17 Chong Yidong <cyd@gnu.org>
7480
7481 * xdisp.c (redisplay_internal): No need to redisplay terminal
7482 frames that are not on top.
7483
7484 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7485
7486 * process.c (make_process): Initialize write_queue.
7487 (write_queue_push, write_queue_pop): New functions.
7488 (send_process): Use them to maintain correct ordering of process
7489 writes (Bug#10815).
7490
7491 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7492
7493 * lisp.h (eassert): Assume C89 or later.
7494 This removes the need for CHECK.
7495 (CHECK): Remove. Its comments about always evaluating its
7496 argument were confusing, as 'eassert' typically does not evaluate
7497 its argument.
7498
7499 * coding.c (produce_chars): Use ptrdiff_t, not int.
7500
7501 * xterm.c (x_draw_underwave): Check for integer overflow.
7502 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7503
7504 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7505
7506 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7507 referenced (Bug#11583).
7508
7509 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7510
7511 Implement wave-style variant of underlining.
7512 * dispextern.h (face_underline_type): New enum.
7513 (face): Add field for underline type.
7514 * nsterm.m (ns_draw_underwave): New function.
7515 (ns_draw_text_decoration): Use it.
7516 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7517 New functions.
7518 (x_draw_glyph_string): Use them.
7519 * xfaces.c (Qline, Qwave): New Lisp objects.
7520 (check_lface_attrs, merge_face_ref)
7521 (Finternal_set_lisp_face_attribute, realize_x_face):
7522 Handle wave-style underline face attributes.
7523 * xterm.c (x_draw_underwave): New function.
7524 (x_draw_glyph_string): Use it.
7525
7526 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7527
7528 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7529 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7530 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7531 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7532 ($(BLD)/w32select.$(O)): Update dependencies.
7533
7534 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7535
7536 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7537 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7538 * character.c (_fetch_multibyte_char_p): Remove.
7539 * alloc.c: Include "character.h" before "buffer.h".
7540 * bidi.c: Likewise.
7541 * buffer.c: Likewise.
7542 * bytecode.c: Likewise.
7543 * callint.c: Likewise.
7544 * callproc.c: Likewise.
7545 * casefiddle.c: Likewise.
7546 * casetab.c: Likewise.
7547 * category.c: Likewise.
7548 * cmds.c: Likewise.
7549 * coding.c: Likewise.
7550 * composite.c: Likewise.
7551 * dired.c: Likewise.
7552 * dispnew.c: Likewise.
7553 * doc.c: Likewise.
7554 * dosfns.c: Likewise.
7555 * editfns.c: Likewise.
7556 * emacs.c: Likewise.
7557 * fileio.c: Likewise.
7558 * filelock.c: Likewise.
7559 * font.c: Likewise.
7560 * fontset.c: Likewise.
7561 * fringe.c: Likewise.
7562 * indent.c: Likewise.
7563 * insdel.c: Likewise.
7564 * intervals.c: Likewise.
7565 * keyboard.c: Likewise.
7566 * keymap.c: Likewise.
7567 * lread.c: Likewise.
7568 * macros.c: Likewise.
7569 * marker.c: Likewise.
7570 * minibuf.c: Likewise.
7571 * nsfns.m: Likewise.
7572 * nsmenu.m: Likewise.
7573 * print.c: Likewise.
7574 * process.c: Likewise.
7575 * regex.c: Likewise.
7576 * region-cache.c: Likewise.
7577 * search.c: Likewise.
7578 * syntax.c: Likewise.
7579 * term.c: Likewise.
7580 * textprop.c: Likewise.
7581 * undo.c: Likewise.
7582 * unexsol.c: Likewise.
7583 * w16select.c: Likewise.
7584 * w32fns.c: Likewise.
7585 * w32menu.c: Likewise.
7586 * window.c: Likewise.
7587 * xdisp.c: Likewise.
7588 * xfns.c: Likewise.
7589 * xmenu.c: Likewise.
7590 * xml.c: Likewise.
7591 * xselect.c: Likewise.
7592
7593 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7594
7595 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7596 If all the glyphs of the glyph row came from strings, and we have no
7597 cursor positioning clues, put the cursor on the first glyph of the
7598 row.
7599 (handle_face_prop): Use chunk-relative overlay string index when
7600 indexing into it->string_overlays array. (Bug#11653)
7601 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7602 the rightmost. (Bug#11720)
7603
7604 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7605
7606 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7607 (CATEGORY_MEMBER): Enforce 1/0 value.
7608 * category.c (_temp_category_set): Remove.
7609
7610 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7611
7612 * window.c (Fdelete_other_windows_internal)
7613 (Fdelete_window_internal): Don't access frame's mouse highlight
7614 info of the initial frame. (Bug#11677)
7615
7616 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7617
7618 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7619 Assume USE_2_TAGS_FOR_INTS.
7620 (xreload): Adjust $tagmask width to match recent lisp.h change.
7621
7622 Simplify lisp.h in minor ways that should not affect code.
7623 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7624 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7625 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7626 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7627 (INTTYPEBITS): New macro, for clarity.
7628 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7629 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7630 Simplify now that USE_LSB_TAG is always defined.
7631 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7632 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7633
7634 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7635
7636 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7637
7638 2012-06-13 Glenn Morris <rgm@gnu.org>
7639
7640 * s/bsd-common.h (BSD4_3):
7641 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7642
7643 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7644
7645 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7646 instead of union.
7647 (XLI, XIL): Define.
7648 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7649 Use them.
7650 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7651 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7652 * alloc.c (widen_to_Lisp_Object): Remove.
7653 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7654 * frame.c (delete_frame): Remove outdated comment.
7655 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7656 USE_LISP_UNION_TYPE.
7657 (Fw32_unregister_hot_key): Likewise.
7658 (Fw32_toggle_lock_key): Likewise.
7659 * w32menu.c (add_menu_item): Likewise.
7660 (w32_menu_display_help): Use XIL instead of checking
7661 USE_LISP_UNION_TYPE.
7662 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7663 (init_heap): Likewise.
7664 * w32term.c (w32_read_socket): Update comment.
7665
7666 2012-06-13 Glenn Morris <rgm@gnu.org>
7667
7668 * s/usg5-4-common.h, src/s/unixware.h:
7669 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7670
7671 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7672
7673 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7674
7675 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7676 * alloc.c (make_number) [!defined make_number]:
7677 Remove, as lisp.h always defines this now.
7678 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7679 (roundup_size): Verify that it is a power of 2.
7680 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7681 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7682 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7683 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7684 USE_LSB_TAG now is always defined to be either 0 or 1.
7685 All uses changed.
7686 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7687 code works fine either way, and efficiency is not a concern here,
7688 as the union type is for debugging, not for production.
7689 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7690 Use an inline function on all platforms when using the union type,
7691 since this is simpler and 'static inline' can be used portably
7692 within Emacs now.
7693 (LISP_INITIALLY_ZERO): New macro.
7694 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7695 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7696
7697 2012-06-12 Glenn Morris <rgm@gnu.org>
7698
7699 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7700
7701 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7702
7703 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7704 Move BROKEN_SIGIO to configure.
7705
7706 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7707 Move NO_TERMIO to configure.
7708
7709 2012-06-12 Chong Yidong <cyd@gnu.org>
7710
7711 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7712 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7713 MagickExportImagePixels is undefined.
7714
7715 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7716
7717 * image.c (imagemagick_load_image): Remove unused label.
7718
7719 2012-06-11 Glenn Morris <rgm@gnu.org>
7720
7721 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7722 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7723 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7724 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7725
7726 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7727
7728 * alloc.c (make_byte_code): New function.
7729 (Fmake_byte_code): Use it. Don't purify here.
7730 * lread.c (read1): Use it as well to avoid extra allocation.
7731
7732 2012-06-11 Chong Yidong <cyd@gnu.org>
7733
7734 * image.c (imagemagick_load_image): Implement transparency.
7735
7736 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7737
7738 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7739 account for preceding backslashes. (Bug#11663)
7740
7741 2012-06-09 Chong Yidong <cyd@gnu.org>
7742
7743 * term.c: Support italics in capable terminals (Bug#9652).
7744 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7745 (turn_on_face): Output using TS_enter_italic_mode if available.
7746 Don't handle unused blinking and alt-charset cases.
7747 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7748 and tty_alt_charset_p cases.
7749 (tty_capable_p, init_tty): Support italics.
7750
7751 * termchar.h (struct tty_display_info): Add field for italics.
7752 Remove unused blink field.
7753
7754 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7755 Handle slant.
7756
7757 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7758 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7759 tty_alt_charset_p. Add tty_italic_p.
7760
7761 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7762
7763 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7764 dbus_type_is_basic if available.
7765 (xd_extract_signed, xd_extract_unsigned): Rename from
7766 extract_signed and extract_unsigned, respectively. Adapt callers.
7767
7768 2012-06-09 Chong Yidong <cyd@gnu.org>
7769
7770 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7771
7772 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7773 case (Bug#9752).
7774
7775 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7776
7777 * xdisp.c (vmessage): Treat frame message as multibyte.
7778 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7779 would generate the diagnostic "Making \302\247 buffer-local while
7780 let-bound!".
7781
7782 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7783
7784 * dispnew.c (showing_window_margins_p): Undo last change, which
7785 was done due to an inadvertent commit.
7786 (adjust_frame_glyphs_for_frame_redisplay): Do call
7787 showing_window_margins_p.
7788
7789 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7790
7791 * eval.c (Fmake_var_non_special): New primitive.
7792 (syms_of_eval): Defsubr it.
7793 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7794
7795 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7796
7797 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7798 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7799
7800 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7801
7802 * alloc.c (allocate_vectorlike): Fix last change.
7803
7804 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7805
7806 Block-based vector allocation of small vectors.
7807 * lisp.h (struct vectorlike_header): New field `nbytes',
7808 adjust comment accordingly.
7809 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7810 to denote vector blocks. Adjust users (live_vector_p,
7811 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7812 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7813 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7814 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7815 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7816 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7817 (roundup_size): New constant.
7818 (struct vector_block): New data type.
7819 (vector_blocks, vector_free_lists, zero_vector): New variables.
7820 (all_vectors): Rename to `large_vectors'.
7821 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7822 (sweep_vectors): New functions.
7823 (allocate_vectorlike): Return `zero_vector' as the only vector of
7824 0 items. Allocate new vector from block if vector size is less than
7825 or equal to VBLOCK_BYTES_MAX.
7826 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7827 (init_alloc_once): Add call to init_vectors.
7828
7829 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7830
7831 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7832
7833 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7834
7835 * doprnt.c (doprnt): Truncate multibyte char correctly.
7836 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7837 would mishandle a string argument "Xc" if X was a multibyte
7838 character of length 2: it would truncate after X's first byte
7839 rather than including all of X.
7840
7841 2012-06-06 Chong Yidong <cyd@gnu.org>
7842
7843 * buffer.c (word_wrap): Doc fix.
7844
7845 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7846
7847 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7848
7849 2012-06-03 Glenn Morris <rgm@gnu.org>
7850
7851 * xdisp.c (tool-bar-style): Doc fix.
7852
7853 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7854
7855 * Makefile.in (PAXCTL): Define.
7856 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7857 binary via PaX flags if the paxctl utility is available.
7858 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7859 Restore PaX flags to their default. (Bug#11398)
7860
7861 2012-06-03 Chong Yidong <cyd@gnu.org>
7862
7863 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7864 buffer (Bug#11226).
7865
7866 2012-06-03 Chong Yidong <cyd@gnu.org>
7867
7868 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7869 (note_mode_line_or_margin_highlight): If there is no help echo,
7870 use mode-line-default-help-echo. Handle the case where the mouse
7871 position is past the end of the mode line string.
7872
7873 * buffer.c (buffer_local_value_1): New function, split from
7874 Fbuffer_local_value; can return Qunbound.
7875 (Fbuffer_local_value): Use it.
7876 (Vmode_line_format): Docstring tweaks.
7877
7878 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7879
7880 * sysdep.c (system_process_attributes): Improve comment.
7881
7882 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7883
7884 * keyboard.c: Export real-this-command to Elisp.
7885 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7886 and DEFVAR it. Update all users.
7887
7888 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7889
7890 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7891
7892 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7893 Convert pctcpu and pctmem to Lisp float properly.
7894 Let the compiler fold better, as 100.0/0x8000 is exact.
7895
7896 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7897
7898 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7899 cons_block.
7900
7901 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7902
7903 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7904
7905 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7906
7907 For a 'struct window', replace some Lisp_Object fields to
7908 bitfields where appropriate, remove unused fields.
7909 * window.h (struct window): Remove unused 'last_mark_x' and
7910 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7911 change its type from Lisp_Object to bitfield.
7912 Change type of 'force_start', 'optional_new_start',
7913 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7914 fields from Lisp_Object to bitfield. Adjust users accordingly.
7915
7916 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7917
7918 Pacify gcc -Wdouble-precision when using Xaw.
7919 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7920 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7921 Use 'float' consistently, rather than 'float' in most places
7922 and 'double' in a couple of places.
7923
7924 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7925
7926 * xdisp.c (handle_stop): Detect whether we have overlay strings
7927 loaded by testing it->current.overlay_string_index to be
7928 non-negative, instead of checking whether n_overlay_strings is
7929 positive. (Bug#11587)
7930
7931 2012-05-31 Chong Yidong <cyd@gnu.org>
7932
7933 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7934
7935 * doc.c (Fsubstitute_command_keys): Doc fix.
7936
7937 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7938
7939 * search.c (search_buffer): Remove calls to
7940 r_alloc_inhibit_buffer_relocation, as it is now called by
7941 maybe_unify_char, which was the cause of relocation of buffer text
7942 in bug#11519.
7943
7944 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7945
7946 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7947 for the duration of call to load_charset, to avoid problems with
7948 callers of maybe_unify_char that access buffer text through C
7949 pointers.
7950
7951 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7952 decrement the inhibition flag, instead of just setting or
7953 resetting it.
7954
7955 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7956
7957 Remove obsolete '#define static' cruft.
7958 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7959 This #undef was "temporary" in 2000; it is no longer needed
7960 now that '#define static' has gone away.
7961 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7962 (gray_bitmap_bits): Remove; no longer needed.
7963 All uses replaced with definiens.
7964 * xterm.c: Include "bitmaps/gray.xbm".
7965
7966 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7967
7968 Clean up __executable_start, monstartup when --enable-profiling.
7969 The following changes affect the code only when profiling.
7970 * dispnew.c (__executable_start): Rename from safe_bcopy.
7971 Define only on platforms that need it.
7972 * emacs.c: Include <sys/gmon.h> when profiling.
7973 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7974 (__executable_start): Remove decl, since lisp.h does it now.
7975 (safe_bcopy): Remove decl; no longer has that name.
7976 (main): Coalesce #if into single bit of code, for simplicity.
7977 Cast pointers to uintptr_t, since standard libraries want integers
7978 and not pointers.
7979 * lisp.h (__executable_start): New decl.
7980
7981 2012-05-31 Glenn Morris <rgm@gnu.org>
7982
7983 * image.c (Fimagemagick_types): Doc fix.
7984
7985 2012-05-30 Jim Meyering <meyering@redhat.com>
7986
7987 * callproc.c (Fcall_process_region): Include directory component
7988 in mkstemp error message (Bug#11586).
7989
7990 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7991
7992 * alloc.c, lisp.h (make_pure_vector): Now static.
7993
7994 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7995
7996 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7997 Move to byte-run.el.
7998 (Fautoload): Do the hash-doc more carefully.
7999 * data.c (Fdefalias): Purify definition, except for keymaps.
8000 (Qdefun): Move from eval.c.
8001 * lisp.h (Qdefun): Remove.
8002 * lread.c (read1): Tiny simplification.
8003
8004 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
8005
8006 Do not create empty overlays with the evaporate property (Bug#9642).
8007 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8008 Bug#9642, but explicitly check that the buffer the overlay would
8009 be moved to is live and rearrange lines to make sure that errors
8010 will not put the overlay in an inconsistent state.
8011 (Fdelete_overlay): Cosmetics.
8012
8013 2012-05-28 Eli Zaretskii <eliz@gnu.org>
8014
8015 * w32term.c (my_bring_window_to_top): New function.
8016 (x_raise_frame): Use handle returned by DeferWindowPos, which
8017 could be different from the original one.
8018 Call my_bring_window_to_top instead of my_set_foreground_window.
8019 (Bug#11513)
8020
8021 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8022 by calling BringWindowToTop.
8023
8024 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8025 (WM_EMACS_END): Increase by one.
8026
8027 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8028
8029 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8030 This avoids undefined behavior that might cause the eassert
8031 to not catch an out-of-range value.
8032
8033 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8034
8035 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8036 Update dependencies.
8037
8038 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8039
8040 * bidi.c (bidi_mirror_char): Fix last change.
8041
8042 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8043
8044 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8045 when referring to sectname field in printf format.
8046
8047 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8048
8049 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8050 Only r_alloc_inhibit_buffer_relocation needed to be added;
8051 the others were already declared.
8052
8053 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8054 before checking whether it's out of range. Put the check inside
8055 eassert. See
8056 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8057
8058 2012-05-27 Ken Brown <kbrown@cornell.edu>
8059
8060 * callproc.c (Fcall_process): Restore a line that was accidentally
8061 commented out in the 2011-02-13 change (bug#11547).
8062
8063 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8064
8065 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8066 defined on ralloc.c.
8067
8068 * buffer.c [REL_ALLOC]: Remove prototypes of
8069 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8070 they are now on lisp.h.
8071
8072 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8073
8074 * search.c (search_buffer): Use it to inhibit relocation of buffer
8075 text while re_search_2 is doing its job, because re_search_2 is
8076 passed C pointers to buffer text. (Bug#11519)
8077
8078 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8079 Update value to 24.
8080
8081 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8082 state after an additional call to move_it_in_display_line_to, keep
8083 the values of it->max_ascent and it->max_descent found for the
8084 entire line.
8085 (pos_visible_p): Revert the comparison against bottom_y to what it
8086 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8087 (Bug#11464)
8088
8089 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8090
8091 Fix coding-related core dumps with gcc -ftrapv.
8092 The code was computing A - B, where A and B are pointers, and B is
8093 random garbage. This can lead to core dumps on platforms that
8094 have special pointer registers, and it also leads to core dumps on
8095 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8096 A - B only when B is initialized properly.
8097 * coding.c (coding_set_source, coding_set_destination): Return void.
8098 (coding_change_source, coding_change_destinations): New functions,
8099 with the old behaviors of coding_set_source and coding_set_destination.
8100 All callers that need an offset changed to use these new functions.
8101
8102 2012-05-26 Glenn Morris <rgm@gnu.org>
8103
8104 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8105
8106 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8107
8108 Extend mouse support on W32 text-mode console.
8109 * xdisp.c (draw_row_with_mouse_face):
8110 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8111
8112 * w32console.c: Include window.h.
8113 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8114 New functions.
8115 (initialize_w32_display): Initialize mouse-highlight data.
8116
8117 * w32inevt.c: Include termchar.h and window.h.
8118 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8119 moves, call note_mouse_highlight. If help_echo changed, call
8120 gen_help_event to produce help-echo message in the echo area.
8121 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8122 highlight info.
8123
8124 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8125
8126 * lread.c (read1): Simplify slightly to avoid an overflow warning
8127 with GCC 4.7.0 on x86-64.
8128
8129 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8130
8131 * bidi.c (bidi_mirror_char): Revert last change: an int is
8132 definitely wide enough here.
8133
8134 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8135
8136 Fix integer width and related bugs (Bug#9874).
8137 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8138 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8139 (string_bytes, check_sblock, allocate_string_data):
8140 (compact_small_strings, Fmake_bool_vector, make_string)
8141 (make_unibyte_string, make_multibyte_string)
8142 (make_string_from_bytes, make_specified_string)
8143 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8144 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8145 (mark_vectorlike):
8146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8147 (allocate_pseudovector):
8148 Use int, not EMACS_INT, where int is wide enough.
8149 (inhibit_garbage_collection, Fgarbage_collect):
8150 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8151 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8152 int might not be wide enough.
8153 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8154 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8155 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8156 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8157 (bidi_level_of_next_char, bidi_move_to_visually_next):
8158 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8159 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8160 (Fkill_buffer, Fset_buffer_major_mode)
8161 (advance_to_char_boundary, Fbuffer_swap_text)
8162 (Fset_buffer_multibyte, overlays_at, overlays_in)
8163 (overlay_touches_p, struct sortvec, record_overlay_string)
8164 (overlay_strings, recenter_overlay_lists)
8165 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8166 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8167 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8168 (Foverlay_recenter, last_overlay_modification_hooks_used)
8169 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8171 (validate_region): Omit unnecessary test for b <= e,
8172 since that's guaranteed by the previous test.
8173 (adjust_overlays_for_delete): Avoid pos + length overflow.
8174 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8175 (report_overlay_modification):
8176 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8177 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8178 Omit pointer cast, which isn't needed anyway, and doesn't work
8179 after the EMACS_INT -> ptrdiff_t change.
8180 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8181 * buffer.h: Adjust decls to match defn changes elsewhere.
8182 (struct buffer_text, struct buffer):
8183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8184 Use EMACS_INT, not int, where int might not be wide enough.
8185 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8186 not int, to avoid needless 32-bit limit on 64-bit hosts.
8187 (exec_byte_code): Use tighter memory-full test, one that checks
8188 for alloca overflow. Don't compute the address of the object just
8189 before an array, as that's not portable. Use EMACS_INT, not
8190 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8191 * callint.c (Fcall_interactively):
8192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8193 * callproc.c (call_process_kill, Fcall_process):
8194 Don't assume pid_t fits into an Emacs fixnum.
8195 (call_process_cleanup, Fcall_process, child_setup):
8196 Don't assume pid_t fits into int.
8197 (call_process_cleanup, Fcall_process, delete_temp_file)
8198 (Fcall_process_region):
8199 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8200 (Fcall_process): Simplify handling of volatile integers.
8201 Use int, not EMACS_INT, where int will do.
8202 * casefiddle.c (casify_object, casify_region, operate_on_word)
8203 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8205 (casify_object): Avoid integer overflow when overallocating buffer.
8206 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8207 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8208 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8209 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8210 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8211 integers are now checked earlier. All uses replaced with XINT.
8212 (ccl_driver):
8213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8214 For CCL_MapSingle, check that content and value are in int range.
8215 (ccl_driver, Fregister_code_conversion_map):
8216 Check that Vcode_version_map_vector is a vector.
8217 (resolve_symbol_ccl_program): Check that vector header is in range.
8218 Always copy the vector, so that we can check its contents reliably
8219 now rather than having to recheck each instruction as it's being
8220 executed. Check that vector words fit in 'int'.
8221 (ccl_get_compiled_code, Fregister_ccl_program)
8222 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8223 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8224 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8225 contents are in range.
8226 (Fccl_execute_on_string): Check that status is in range.
8227 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8228 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8229 Accept and return EMACS_INT, not int, because callers can pass values
8230 out of 'int' range.
8231 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8232 (multibyte_chars_in_text, parse_str_as_multibyte)
8233 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8234 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8235 (string_escape_byte8, Fget_byte):
8236 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8237 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8238 avoid mishandling large integers.
8239 * character.h: Adjust decls to match defn changes elsewhere.
8240 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8241 (Ffind_charset_region):
8242 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8243 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8244 (load_charset_map_from_vector, Fdefine_charset_internal):
8245 Don't assume fixnum fits in int.
8246 (load_charset_map_from_vector, Fmap_charset_chars):
8247 Remove now-unnecessary CHECK_NATNUMs.
8248 (Fdefine_charset_internal): Check ranges here, more carefully.
8249 Don't rely on undefined behavior with signed left shift overflow.
8250 Don't assume unsigned int fits into fixnum, or that fixnum fits
8251 into unsigned int. Don't require max_code to be a valid fixnum;
8252 that's not true for gb10830 4-byte on a 32-bit host. Allow
8253 invalid_code to be a cons, for the same reason. Require code_offset
8254 to be a character. Avoid int overflow if max_char is close
8255 to INT_MAX.
8256 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8257 this is intended anyway and avoids some undefined behavior.
8258 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8259 INDEX_TO_CODE_POINT, as that's what it expects.
8260 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8261 * charset.h (DECODE_CHAR): Return int, not unsigned;
8262 this is what was intended anyway, and it avoids undefined behavior.
8263 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8264 integer-overflow issues.
8265 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8266 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8267 where the argument is EMACS_INT, and this behavior is not intended.
8268 * chartab.c (Fmake_char_table, Fset_char_table_range)
8269 (uniprop_get_decoder, uniprop_get_encoder):
8270 Don't assume fixnum fits in int.
8271 * cmds.c (move_point): New function, that does the gist of
8272 Fforward_char and Fbackward_char, but does so while checking
8273 for integer overflow more accurately.
8274 (Fforward_char, Fbackward_char): Use it.
8275 (Fforward_line, Fend_of_line, internal_self_insert)
8276 (internal_self_insert):
8277 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8278 Fix a FIXME, by checking for integer overflow when calculating
8279 target_clm and actual_clm.
8280 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8281 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8282 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8283 (coding_alloc_by_making_gap, alloc_destination)
8284 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8285 (encode_coding_utf_16, detect_coding_emacs_mule)
8286 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8287 (detect_coding_iso_2022, decode_coding_iso_2022)
8288 (encode_invocation_designation, encode_designation_at_bol)
8289 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8290 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8291 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8292 (encode_coding_ccl, encode_coding_raw_text)
8293 (detect_coding_charset, decode_coding_charset)
8294 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8295 (produce_composition, produce_charset, produce_annotation)
8296 (decode_coding, handle_composition_annotation)
8297 (handle_charset_annotation, consume_chars, decode_coding_gap)
8298 (decode_coding_object, encode_coding_object, detect_coding_system)
8299 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8300 (code_convert_region, code_convert_string)
8301 (Fdefine_coding_system_internal)
8302 (coding_set_source, coding_set_destination):
8303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8304 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8305 (Fdefine_coding_system_internal):
8306 Don't assume fixnums fit in int.
8307 (decode_coding_gap, decode_coding_object, encode_coding_object)
8308 (Fread_coding_system, Fdetect_coding_region)
8309 (Funencodable_char_position, Fcheck_coding_systems_region)
8310 (get_translation, handle_composition_annotation, consume_chars):
8311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8312 (consume_chars): Rewrite to not calculate an address outside buffer.
8313 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8314 Don't access memory outside of the args array.
8315 (Fdefine_coding_system_internal): Check for charset-id overflow.
8316 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8317 result of ENCODE_CHAR.
8318 * coding.h: Adjust decls to match defn changes elsewhere.
8319 (struct coding_system):
8320 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8321 * composite.c (get_composition_id, find_composition)
8322 (run_composition_function, update_compositions)
8323 (compose_text, composition_gstring_put_cache)
8324 (composition_gstring_p, composition_gstring_width)
8325 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8326 (composition_compute_stop_pos, composition_reseat_it)
8327 (composition_update_it, struct position_record)
8328 (find_automatic_composition, composition_adjust_point)
8329 (Fcomposition_get_gstring, Ffind_composition_internal):
8330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8331 (update_compositions):
8332 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8333 * composite.h: Adjust decls to match defn changes elsewhere.
8334 (struct composition):
8335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8336 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8337 Do not attempt to compute the address of the object just before a
8338 buffer; this is not portable.
8339 (Faref, Faset):
8340 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8341 (Faset): Use int, not EMACS_INT, where int is wide enough.
8342 (Fstring_to_number): Don't assume fixnums fit in int.
8343 (Frem): Don't assume arg is nonnegative.
8344 * dbusbind.c (xd_append_arg): Check for integers out of range.
8345 (Fdbus_call_method): Don't overflow the timeout int.
8346 (extract_signed, extract_unsigned): New functions.
8347 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8348 (xd_get_connection_references): Return ptrdiff_t, not int.
8349 All uses changed.
8350 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8351 (xd_read_message_1):
8352 Use int, not unsigned, where the dbus API uses int.
8353 (Fdbus_message_internal): Don't overflow mtype.
8354 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8355 * dired.c (directory_files_internal, file_name_completion, scmp)
8356 (file_name_completion_stat):
8357 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8358 (file_name_completion): Don't overflow matchcount.
8359 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8360 * dispextern.h: Adjust decls to match defn changes elsewhere.
8361 (struct text_pos, struct glyph, struct bidi_saved_info)
8362 (struct bidi_string_data, struct bidi_it, struct composition_it)
8363 (struct it):
8364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8365 (struct display_pos, struct composition_it, struct it):
8366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8367 * dispnew.c (increment_matrix_positions)
8368 (increment_row_positions, mode_line_string)
8369 (marginal_area_string):
8370 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8371 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8373 (duration_to_sec_usec): New function, to check for overflow better.
8374 (Fsleep_for, sit_for): Use it.
8375 * doc.c (get_doc_string, store_function_docstring):
8376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8377 (get_doc_string, Fsnarf_documentation):
8378 Use int, not EMACS_INT, where int is wide enough.
8379 (get_doc_string):
8380 Use SAFE_ALLOCA, not alloca.
8381 Check for overflow when converting EMACS_INT to off_t.
8382 * doprnt.c (doprnt):
8383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8384 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8385 Don't assume uid_t fits into fixnum.
8386 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8387 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8388 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8389 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8390 (general_insert_function)
8391 (Finsert_char, make_buffer_string, make_buffer_string_both)
8392 (update_buffer_properties, Fbuffer_substring)
8393 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8394 (Fsubst_char_in_region, check_translation)
8395 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8396 (transpose_markers, Ftranspose_regions):
8397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8398 (clip_to_bounds): Move to lisp.h as an inline function).
8399 (Fconstrain_to_field): Don't assume integers are nonnegative.
8400 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8401 (Fsubst_char_in_region, Fsave_restriction):
8402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8403 (Femacs_pid): Don't assume pid_t fits into fixnum.
8404 (lo_time): Use int, not EMACS_INT, when int suffices.
8405 (lisp_time_argument): Check for usec out of range.
8406 (Fencode_time): Don't assume fixnum fits in int.
8407 (Fuser_login_name, Fuser_full_name): Signal an error
8408 if a uid argument is out of range, rather than relying on
8409 undefined behavior.
8410 (Fformat_time_string): Remove now-unnecessary check.
8411 lisp_time_argument checks for out-of-range usec now.
8412 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8413 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8414 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8415 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8416 (init_cmdargs, Fdump_emacs):
8417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8418 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8419 the bottom (typically) 32 bits of the fixnum.
8420 * eval.c (specpdl_size, call_debugger):
8421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8422 (when_entered_debugger, Fbacktrace_debug):
8423 Don't assume fixnum can fit in int.
8424 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8425 the object just before a buffer; this is not portable.
8426 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8427 (grow_specpdl, unbind_to):
8428 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8429 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8430 (grow_specpdl): Simplify allocation by using xpalloc.
8431 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8432 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8433 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8435 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8436 (a_write, e_write):
8437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8438 (Fcopy_file, non_regular_nbytes, read_non_regular)
8439 (Finsert_file_contents):
8440 Use int, not EMACS_INT, where int is wide enough.
8441 (READ_BUF_SIZE): Verify that it fits in int.
8442 (Finsert_file_contents): Check that counts are in proper range,
8443 rather than assuming fixnums fit into ptrdiff_t etc.
8444 Don't assume fixnums fit into int.
8445 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8446 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8447 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8448 (string_char_to_byte, string_byte_to_char)
8449 (string_make_multibyte, string_to_multibyte)
8450 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8451 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8452 (substring_both, Fdelete, internal_equal, Ffillarray)
8453 (Fclear_string, mapcar1)
8454 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8455 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8456 (larger_vector, make_hash_table, maybe_resize_hash_table)
8457 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8458 (Fmaphash, secure_hash):
8459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8460 (concat): Check for string index and length overflow.
8461 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8462 (Frequire):
8463 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8464 (larger_vector): New API (vec, incr_min, size_max) replaces old
8465 one (vec, new_size, init). This catches size overflow.
8466 INIT was removed because it was always Qnil.
8467 All callers changed.
8468 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8469 the upper bound on a hash table index size.
8470 (make_hash_table, maybe_resize_hash_table): Use it.
8471 (secure_hash): Computer start_byte and end_byte only after
8472 they're known to be in ptrdiff_t range.
8473 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8474 (Ffont_get_glyphs, Ffont_at):
8475 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8476 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8477 (Flist_fonts, Fopen_font):
8478 Don't assume fixnum can fit in int.
8479 (check_gstring): Don't assume index can fit in int.
8480 (font_match_p): Check that fixnum is a character, not a nonnegative
8481 fixnum, since the later code needs to stuff it into an int.
8482 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8483 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8484 conversion overflow issues.
8485 (Fopen_font): Check for integer out of range.
8486 (Ffont_get_glyphs): Don't assume index can fit in int.
8487 * font.h: Adjust decls to match defn changes elsewhere.
8488 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8489 integer overflow.
8490 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8491 printmax_t, where ptrdiff_t is wide enough.
8492 (Finternal_char_font):
8493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8494 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8495 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8496 (Fset_frame_position, x_set_frame_parameters)
8497 (x_set_line_spacing, x_set_border_width)
8498 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8499 Check that fixnums are in proper range for system types.
8500 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8502 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8503 Use SAFE_ALLOCA_LISP, not alloca.
8504 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8505 intptr_t is wide enough.
8506 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8507 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8508 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8509 Check for fixnum out of range.
8510 * ftfont.c (ftfont_list): Don't assume index fits in int.
8511 Check that fixnums are in proper range for system types.
8512 (ftfont_shape_by_flt):
8513 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8514 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8516 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8517 Check that fixnums are in proper range for system types.
8518 * gnutls.h: Adjust decls to match defn changes elsewhere.
8519 * gtkutil.c (xg_dialog_run):
8520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8521 (update_frame_tool_bar):
8522 Check that fixnums are in proper range for system types.
8523 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8524 (lookup_image): Check that fixnums are in range for system types.
8525 * indent.c (last_known_column, last_known_column_point):
8526 (current_column_bol_cache):
8527 (skip_invisible, current_column, check_display_width):
8528 (check_display_width, scan_for_column, current_column_1)
8529 (Findent_to, Fcurrent_indentation, position_indentation)
8530 (indented_beyond_p, Fmove_to_column, compute_motion):
8531 (Fcompute_motion, Fvertical_motion):
8532 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8533 (last_known_column_modified): Use EMACS_INT, not int.
8534 (check_display_width):
8535 (Fcompute_motion):
8536 Check that fixnums and floats are in proper range for system types.
8537 (compute_motion): Don't assume index or fixnum fits in int.
8538 (compute_motion, Fcompute_motion):
8539 Use int, not EMACS_INT, when it is wide enough.
8540 (vmotion): Omit local var start_hpos that is always 0; that way
8541 we don't need to worry about overflow in expressions involving it.
8542 * indent.h: Adjust decls to match defn changes elsewhere.
8543 (struct position):
8544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8545 Use int, not EMACS_INT, where int is wide enough.
8546 Remove unused members ovstring_chars_done and tab_offset;
8547 all uses removed.
8548 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8549 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8550 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8551 (make_gap, copy_text, insert, insert_and_inherit)
8552 (insert_before_markers, insert_before_markers_and_inherit)
8553 (insert_1, count_combining_before, count_combining_after)
8554 (insert_1_both, insert_from_string)
8555 (insert_from_string_before_markers, insert_from_string_1)
8556 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8557 (adjust_after_replace, adjust_after_insert, replace_range)
8558 (replace_range_2, del_range, del_range_1, del_range_byte)
8559 (del_range_both, del_range_2, modify_region)
8560 (prepare_to_modify_buffer, signal_before_change)
8561 (signal_after_change, Fcombine_after_change_execute):
8562 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8563 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8564 (balance_an_interval, split_interval_right, split_interval_left)
8565 (find_interval, next_interval, update_interval)
8566 (adjust_intervals_for_insertion, delete_node, delete_interval)
8567 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8568 (static_offset_intervals, offset_intervals)
8569 (merge_interval_right, merge_interval_left, make_new_interval)
8570 (graft_intervals_into_buffer, temp_set_point_both)
8571 (temp_set_point, set_point, adjust_for_invis_intang)
8572 (set_point_both, move_if_not_intangible, get_property_and_range)
8573 (get_local_map, copy_intervals, copy_intervals_to_string)
8574 (compare_string_intervals, set_intervals_multibyte_1):
8575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8576 * intervals.h: Adjust decls to match defn changes elsewhere.
8577 (struct interval):
8578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8579 * keyboard.c (this_command_key_count, this_single_command_key_start)
8580 (before_command_key_count, before_command_echo_length, echo_now)
8581 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8582 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8583 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8584 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8585 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8586 (last_non_minibuf_size, last_point_position, echo_truncate)
8587 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8588 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8589 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8590 (stuff_buffered_input):
8591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8592 (last_auto_save, command_loop_1, read_char):
8593 Use EMACS_INT, not int, to avoid integer overflow.
8594 (record_char): Avoid overflow in total_keys computation.
8595 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8596 * keyboard.h: Adjust decls to match defn changes elsewhere.
8597 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8598 (Fkey_description, Fdescribe_vector, Flookup_key):
8599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8600 (click_position): New function, to check that positions are in range.
8601 (Fcurrent_active_maps):
8602 (describe_command):
8603 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8604 (Faccessible_keymaps, Fkey_description):
8605 (preferred_sequence_p):
8606 Don't assume fixnum can fit into int.
8607 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8608 Check for integer overflow in size calculations.
8609 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8610 avoid mishandling large integers.
8611 * lisp.h: Adjust decls to match defn changes elsewhere.
8612 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8613 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8614 (struct Lisp_Marker):
8615 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8616 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8617 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8618 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8619 All callers changed.
8620 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8621 Assume the arg has valid form, since it always does.
8622 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8623 unsigned integer system type.
8624 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8625 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8627 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8628 (duration_to_sec_usec): New decl.
8629 * lread.c (read_from_string_index, read_from_string_index_byte)
8630 (read_from_string_limit, readchar, unreadchar, openp)
8631 (read_internal_start, read1, oblookup):
8632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8633 (Fload, readevalloop, Feval_buffer, Feval_region):
8634 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8635 (openp): Check for out-of-range argument to 'access'.
8636 (read1): Use int, not EMACS_INT, where int is wide enough.
8637 Don't assume fixnum fits into int.
8638 Fix off-by-one error that can read outside a buffer.
8639 (read_filtered_event): Use duration_to_sec_usec
8640 to do proper overflow checking on durations.
8641 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8642 in size calculation.
8643 (Fexecute_kbd_macro):
8644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8645 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8646 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8647 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8648 (set_marker_both, set_marker_restricted_both, marker_position)
8649 (marker_byte_position, Fbuffer_has_markers_at):
8650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8651 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8652 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8653 It now merely ensures that the menu is large enough, without
8654 necessarily growing it, as this avoids some integer overflow issues.
8655 All callers changed.
8656 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8658 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8659 Use SAFE_ALLOCA_LISP, not alloca.
8660 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8661 to EMACS_INT. Check that fixnums are in proper range for system types.
8662 * minibuf.c (minibuf_prompt_width, string_to_object)
8663 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8664 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8665 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8666 (get_minibuffer, read_minibuf_unwind):
8667 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8668 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8669 this simplifies overflow checking. All callers changed.
8670 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8671 (Ftest_completion):
8672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8673 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8674 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8675 Check that fixnums are in proper range for system types.
8676 (Fx_create_frame, Fx_show_tip):
8677 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8678 * nsfont.m (ns_findfonts, nsfont_list_family):
8679 Don't assume fixnum fits in long.
8680 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8681 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8682 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8683 wide enough.
8684 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8685 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8686 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8687 (PRINTDECLARE, PRINTPREPARE):
8688 (strout, print_string):
8689 (print, print_preprocess, print_check_string_charset_prop)
8690 (print_object):
8691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8692 (PRINTDECLARE):
8693 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8694 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8695 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8696 (printchar, strout): Use xpalloc to catch size calculation overflow.
8697 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8698 (print_error_message): Use SAFE_ALLOCA, not alloca.
8699 (print_object): Use int, not EMACS_INT, where int is wide enough.
8700 (print_depth, new_backquote_output, print_number_index):
8701 Use ptrdiff_t, not int, where int might not be wide enough.
8702 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8703 (Fset_process_window_size, Fformat_network_address)
8704 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8705 (sigchld_handler):
8706 Check that fixnums are in proper range for system types.
8707 (Fsignal_process): Simplify by avoiding a goto.
8708 Check for process-ids out of pid_t range rather than relying on
8709 undefined behavior.
8710 (process_tick, update_tick): Use EMACS_INT, not int.
8711 (Fformat_network_address, read_process_output, send_process)
8712 (Fprocess_send_region, status_notify):
8713 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8714 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8715 (wait_reading_process_output, read_process_output, exec_sentinel):
8716 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8717 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8718 (Faccept_process_output): Use duration_to_sec_usec to do proper
8719 overflow checking on durations.
8720 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8721 Don't assume pid_t fits in int.
8722 * process.h (struct Lisp_Process): Members tick and update_tick
8723 are now of type EMACS_INT, not int.
8724 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8725 configured --with-wide-int.
8726 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8727 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8728 * search.c (looking_at_1, string_match_1):
8729 (fast_string_match, fast_c_string_match_ignore_case)
8730 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8731 (scan_newline, find_before_next_newline, search_command)
8732 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8733 (set_search_regs, wordify):
8734 (Freplace_match):
8735 (Fmatch_data):
8736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8737 (string_match_1, search_buffer, set_search_regs):
8738 (Fmatch_data):
8739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8740 (wordify): Check for overflow in size calculation.
8741 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8742 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8743 Check that fixnums are in proper range for system types.
8744 * sound.c (struct sound_device)
8745 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8747 (Fplay_sound_internal):
8748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8749 * syntax.c (struct lisp_parse_state, find_start_modiff)
8750 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8751 (Fparse_partial_sexp):
8752 Don't assume fixnums can fit in int.
8753 (struct lisp_parse_state, find_start_pos, find_start_value)
8754 (find_start_value_byte, find_start_begv)
8755 (update_syntax_table, char_quoted, dec_bytepos)
8756 (find_defun_start, prev_char_comend_first, back_comment):
8757 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8758 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8760 (Finternal_describe_syntax_value): Check that match_lisp is a
8761 character, not an integer, since the code stuffs it into int.
8762 (scan_words, scan_sexps_forward):
8763 Check that fixnums are in proper range for system types.
8764 (Fforward_word):
8765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8766 (scan_sexps_forward):
8767 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8768 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8769 * syntax.h: Adjust decls to match defn changes elsewhere.
8770 (struct gl_state_s):
8771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8772 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8773 MOST_POSITIVE_FIXNUM.
8774 * sysdep.c (wait_for_termination_1, wait_for_termination)
8775 (interruptible_wait_for_termination, mkdir):
8776 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8777 (emacs_read, emacs_write):
8778 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8779 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8780 and double all fit in int.
8781 * term.c (set_tty_color_mode):
8782 Check that fixnums are in proper range for system types.
8783 * termhooks.h (struct input_event):
8784 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8785 * textprop.c (validate_interval_range, interval_of)
8786 (Fadd_text_properties, set_text_properties_1)
8787 (Fremove_text_properties, Fremove_list_of_text_properties)
8788 (Ftext_property_any, Ftext_property_not_all)
8789 (copy_text_properties, text_property_list, extend_property_ranges)
8790 (verify_interval_modification):
8791 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8792 (Fnext_single_char_property_change)
8793 (Fprevious_single_char_property_change):
8794 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8795 (copy_text_properties):
8796 Check for integer overflow in index calculation.
8797 * undo.c (last_boundary_position, record_point, record_insert)
8798 (record_delete, record_marker_adjustment, record_change)
8799 (record_property_change):
8800 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8801 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8803 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8804 (Fx_hide_tip, Fx_file_dialog):
8805 * w32menu.c (set_frame_menubar):
8806 Use ptrdiff_t, not int, for consistency with rest of code.
8807 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8808 (select_window, Fdelete_other_windows_internal)
8809 (window_scroll_pixel_based, window_scroll_line_based)
8810 (Frecenter, Fset_window_configuration):
8811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8812 (Fset_window_hscroll, run_window_configuration_change_hook)
8813 (set_window_buffer, temp_output_buffer_show, scroll_command)
8814 (Fscroll_other_window, Frecenter):
8815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8816 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8817 Don't assume fixnum fits in int.
8818 (Fset_window_scroll_bars):
8819 Check that fixnums are in proper range for system types.
8820 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8821 (string_pos, c_string_pos, number_of_chars, init_iterator)
8822 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8823 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8824 (compute_display_string_end, handle_face_prop)
8825 (face_before_or_after_it_pos, handle_invisible_prop)
8826 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8827 (display_prop_intangible_p, string_buffer_position_lim)
8828 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8829 (get_overlay_strings_1, get_overlay_strings)
8830 (iterate_out_of_display_property, forward_to_next_line_start)
8831 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8832 (get_next_display_element, set_iterator_to_next)
8833 (get_visually_first_element, compute_stop_pos_backwards)
8834 (handle_stop_backwards, next_element_from_buffer)
8835 (move_it_in_display_line_to, move_it_in_display_line)
8836 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8837 (add_to_log, message_dolog, message_log_check_duplicate)
8838 (message2, message2_nolog, message3, message3_nolog
8839 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8840 (current_message_1, truncate_echo_area, truncate_message_1)
8841 (set_message, set_message_1, store_mode_line_noprop)
8842 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8843 (text_outside_line_unchanged_p, check_point_in_composition)
8844 (reconsider_clip_changes)
8845 (redisplay_internal, set_cursor_from_row, try_scrolling)
8846 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8847 (redisplay_window, find_last_unchanged_at_beg_row)
8848 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8849 (trailing_whitespace_p, find_row_edges, display_line)
8850 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8851 (display_mode_element, store_mode_line_string)
8852 (pint2str, pint2hrstr, decode_mode_spec)
8853 (display_count_lines, display_string, draw_glyphs)
8854 (x_produce_glyphs, x_insert_glyphs)
8855 (rows_from_pos_range, mouse_face_from_buffer_pos)
8856 (fast_find_string_pos, mouse_face_from_string_pos)
8857 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8859 (safe_call, init_from_display_pos, handle_fontified_prop)
8860 (handle_single_display_spec, load_overlay_strings)
8861 (with_echo_area_buffer, setup_echo_area_for_printing)
8862 (display_echo_area, echo_area_display)
8863 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8864 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8865 (redisplay_window, dump_glyph_row, display_mode_line)
8866 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8867 (handle_display_spec, display_prop_string_p):
8868 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8869 (handle_single_display_spec, build_desired_tool_bar_string)
8870 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8871 (get_specified_cursor_type):
8872 Check that fixnums are in proper range for system types.
8873 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8874 (Flookup_image_map):
8875 Don't assume fixnums fit in int.
8876 (compare_overlay_entries):
8877 Avoid mishandling comparisons due to subtraction overflow.
8878 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8879 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8880 (handle_tool_bar_click):
8881 Use int, not unsigned, since we prefer signed and the signedness
8882 doesn't matter here.
8883 (get_next_display_element, next_element_from_display_vector):
8884 Use int, not EMACS_INT, when int is wide enough.
8885 (start_hourglass): Use duration_to_sec_usec to do proper
8886 overflow checking on durations.
8887 * xfaces.c (Fbitmap_spec_p):
8888 Check that fixnums are in proper range for system types.
8889 (compare_fonts_by_sort_order):
8890 Avoid mishandling comparisons due to subtraction overflow.
8891 (Fx_family_fonts, realize_basic_faces):
8892 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8893 (Fx_family_fonts):
8894 Don't assume fixnum fits in int.
8895 Use SAFE_ALLOCA_LISP, not alloca.
8896 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8897 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8898 (face_at_buffer_position, face_for_overlay_string)
8899 (face_at_string_position):
8900 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8901 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8902 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8903 (Fx_show_tip):
8904 Check that fixnums are in proper range for system types.
8905 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8906 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8908 (Fx_change_window_property): Don't assume fixnums fit in int.
8909 * xfont.c (xfont_chars_supported):
8910 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8911 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8912 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8913 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8914 * xml.c (parse_region):
8915 * xrdb.c (magic_file_p):
8916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8917 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8918 (x_get_local_selection, x_reply_selection_request)
8919 (x_handle_selection_request, wait_for_property_change):
8920 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8921 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8922 short is wide enough.
8923 (x_send_client_event): Don't assume fixnum fits in int.
8924 * xterm.c (x_x_to_emacs_modifiers):
8925 Don't assume EMACS_INT overflows nicely into int.
8926 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8927 may come from Lisp.
8928 (handle_one_xevent): NATNUMP can eval its arg twice.
8929 (x_connection_closed):
8930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8931 * xterm.h: Adjust decls to match defn changes elsewhere.
8932 (struct scroll_bar): Use struct vectorlike_header
8933 rather than rolling our own approximation.
8934 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8935
8936 2012-05-25 Glenn Morris <rgm@gnu.org>
8937
8938 * lisp.mk (lisp): Update for more files being compiled now.
8939
8940 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8941
8942 * lread.c: Remove `read_pure' which makes no difference.
8943 (read_pure): Remove var.
8944 (unreadpure): Remove function.
8945 (readevalloop): Don't call read_list with -1 flag.
8946 (read1, read_vector): Don't test read_pure any more.
8947 (read_list): Simplify.
8948
8949 * fileio.c, character.h: Minor style tweaks.
8950
8951 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8952
8953 * window.h (clip_changed): Remove useless declaration.
8954
8955 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8956
8957 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8958 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8959
8960 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8961
8962 Remove src/m/*.
8963 This directory predates autoconf and is no longer needed nowadays.
8964 Move its few remaining bits of functionality to where they're needed.
8965 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8966 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8967 * m/template.h: Remove.
8968 * Makefile.in (M_FILE): Remove. All uses removed.
8969 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8970 * lisp.h (USE_LSB_TAG):
8971 * mem-limits.h (EXCEEDS_LISP_PTR):
8972 Use VAL_MAX, not VALBITS, in #if.
8973 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8974 (EMACS_UINT): Define unconditionally now.
8975 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8976 (BITS_PER_EMACS_INT): New constants, replacing
8977 what used to be in config.h, but not useful in #if.
8978 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8979 define them any more.
8980 (VAL_MAX): New macro.
8981 (VALMASK): Use it.
8982 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8983 BITS_PER_EMACS_INT, in #if.
8984 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8985 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8986 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8987 * s/ms-w32.h (DATA_START):
8988 Move here from removed file m/intel386.h.
8989 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8990 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8991
8992 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8993
8994 Assume C89 or later.
8995 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8996 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8997 (xrealloc):
8998 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8999 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9000 * textprop.c, tparam.c (NULL): Remove.
9001 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9002 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9003 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9004 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9005 * xterm.c (input_signal_count): Assume volatile works.
9006
9007 2012-05-21 Ken Brown <kbrown@cornell.edu>
9008
9009 * xgselect.c (xg_select): Fix first argument in call to 'select'
9010 (bug#11508).
9011
9012 2012-05-20 Ken Brown <kbrown@cornell.edu>
9013
9014 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
9015 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
9016
9017 2012-05-19 Ken Brown <kbrown@cornell.edu>
9018
9019 * xfns.c (x_in_use): Remove `static' qualifier.
9020 * xterm.h (x_in_use): Declare.
9021 * xgselect.c: Include xterm.h.
9022 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9023 and `display_arg' (bug#9754).
9024
9025 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9026
9027 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9028
9029 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9030 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9031
9032 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9033
9034 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9035
9036 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9037 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9038
9039 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9040 reference to image_cache->refcount.
9041 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9042
9043 2012-05-17 Juri Linkov <juri@jurta.org>
9044
9045 * search.c (Fword_search_regexp, Fword_search_backward)
9046 (Fword_search_forward, Fword_search_backward_lax)
9047 (Fword_search_forward_lax): Move functions to isearch.el
9048 (bug#10145, bug#11381).
9049
9050 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9051
9052 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9053
9054 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9055
9056 * lread.c (init_obarray): Declare Qt and Qnil as special.
9057
9058 2012-05-14 Glenn Morris <rgm@gnu.org>
9059
9060 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9061 Put "libexec" before "bin", for the sake of init_callproc_1.
9062
9063 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9064
9065 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9066
9067 * unexaix.c: Port to more-recent AIX compilers.
9068 (report_error, report_error_1, make_hdr, copy_sym)
9069 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9070 Make arguments const char *, not char *, to avoid violations of C
9071 standard and to fix some AIX warnings reported by Gilles Pion.
9072
9073 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9074
9075 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9076 already have overlays loaded.
9077 (handle_single_display_spec): Before returning without displaying
9078 fringe bitmap, synchronize the bidi iterator with the main display
9079 iterator, by calling iterate_out_of_display_property.
9080 (iterate_out_of_display_property): Detect buffer iteration by
9081 testing that it->string is a Lisp string.
9082 (get_next_display_element): When the current object is exhausted,
9083 and there's something on it->stack, call set_iterator_to_next to
9084 proceed with what's on the stack, instead of returning zero.
9085 (set_iterator_to_next): If called at the end of a Lisp string,
9086 proceed to consider_string_end without incrementing string
9087 position. Don't increment display vector index past the end of
9088 the display vector. (Bug#11417)
9089 (pos_visible_p): Don't report a position visible when move_it_to
9090 stopped at the last line of window, which happens to be scanned
9091 backwards by the bidi iteration. (Bug#11464)
9092
9093 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9094
9095 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9096 and right-margin display specs even if the spec is invalid or we
9097 are on a TTY, and thus unable to display on the fringes.
9098 That's because the text with the property will not be displayed anyway,
9099 so we need to signal to the caller that this is a "replacing"
9100 display spec. This fixes display when the spec is invalid or we
9101 are on a TTY.
9102
9103 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9104
9105 * unexaix.c (make_hdr): Fix typo in prototype.
9106 This bug broke the build on AIX. Problem reported by Gilles Pion.
9107
9108 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9109
9110 * keyboard.c (kbd_buffer_get_event): Read special events also in
9111 batch mode. (Bug#11415)
9112
9113 2012-05-12 Glenn Morris <rgm@gnu.org>
9114
9115 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9116
9117 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9118
9119 * lisp.mk (lisp): Add newcomment.elc.
9120
9121 2012-05-12 Glenn Morris <rgm@gnu.org>
9122
9123 * Makefile.in (MKDIR_P): New, set by configure.
9124 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9125
9126 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 Remove unused function hourglass_started.
9129 * dispextern.h (hourglass_started):
9130 * w32fns.c (hourglass_started):
9131 * xdisp.c (hourglass_started): Remove.
9132
9133 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9134
9135 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9136 Update dependencies.
9137
9138 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9139
9140 * xgselect.c (xg_select): Put maxfds+1 into a var.
9141 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9142
9143 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9144
9145 2012-05-10 Dave Abrahams <dave@boostpro.com>
9146
9147 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9148 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9149
9150 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9151
9152 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9153 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9154 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9155 Initialize xd_registered_buses.
9156
9157 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9158
9159 Untag more efficiently if USE_LSB_TAG.
9160 This is based on a proposal by YAMAMOTO Mitsuharu in
9161 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9162 For an admittedly artificial (nth 8000 longlist) benchmark on
9163 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9164 Emacs's overall text size by 1%.
9165 * lisp.h (XUNTAG): New macro.
9166 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9167 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9168 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9169 * eval.c (Fautoload):
9170 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9171 * frame.h (XFRAME): Use XUNTAG.
9172
9173 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9174 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9175 Remove unportable assumptions about print widths of types like
9176 dbus_uint32_t.
9177 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9178 intptr_t when converting between pointer and integer, to avoid GCC
9179 warnings about wrong width.
9180
9181 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9182
9183 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9184 stack for each reader_thread, instead of defaulting to 8MB
9185 determined by the linker. This avoids failures in creating
9186 subprocesses on Windows 7, see the discussion in this thread:
9187 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9188
9189 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9190
9191 Fix up display of the *Minibuf-0* buffer in the mini window.
9192 * keyboard.c (read_char): Don't clear the echo area if there's no
9193 message to clear.
9194 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9195 contents of *Minibuf-0*) if there's no message displayed in its stead.
9196
9197 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9198
9199 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9200 batch mode.
9201
9202 2012-05-06 Chong Yidong <cyd@gnu.org>
9203
9204 * lisp.mk (lisp): Update.
9205
9206 2012-05-05 Jim Meyering <meyering@redhat.com>
9207
9208 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9209
9210 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9211
9212 * data.c (PUT_ERROR): New macro.
9213 (syms_of_data): Use it. Add new error type `user-error'.
9214 * undo.c (user_error): New function.
9215 (Fprimitive_undo): Use it.
9216 * print.c (print_error_message): Adjust print style for `user-error'.
9217 * keyboard.c (user_error): New function.
9218 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9219
9220 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9221
9222 Do not limit current-time-string to years 1000..9999.
9223 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9224 (Fcurrent_time_string): Support any year that is supported by the
9225 underlying localtime representation. Don't use asctime, as it
9226 has undefined behavior for years outside the range -999..9999.
9227
9228 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9229
9230 Fix race conditions involving setenv, gmtime, localtime, asctime.
9231 Without this fix, interrupts could mess up code that uses these
9232 nonreentrant functions, since setting TZ invalidates existing
9233 tm_zone or tzname values, and since most of these functions return
9234 pointers to static storage.
9235 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9236 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9237 Grow the critical sections to include not just invoking
9238 localtime/gmtime, but also accessing these functions' results
9239 including their tm_zone values if any, and any related TZ setting.
9240 (format_time_string): Last arg is now struct tm *, not struct tm **,
9241 so that the struct tm is saved in the critical section.
9242 All callers changed. Simplify allocation of initial buffer, partly
9243 motivated by the fact that memory allocation needs to be outside
9244 the critical section.
9245
9246 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9247
9248 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9249 with RESET_INTERVAL.
9250
9251 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9252 Remove duplicated buffer name initialization.
9253
9254 2012-05-02 Jim Meyering <jim@meyering.net>
9255
9256 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9257
9258 * xfns.c (x_window): Use xstrdup (Bug#11375).
9259
9260 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9261
9262 * xdisp.c (pos_visible_p): If already at a newline from the
9263 display string before the 'while' loop, don't walk back the glyphs
9264 from it3.glyph_row. Solves assertion violation when the display
9265 string begins with a newline (egg.el). (Bug#11367)
9266
9267 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9268
9269 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9270 Move to simple.el.
9271
9272 2012-05-01 Glenn Morris <rgm@gnu.org>
9273
9274 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9275 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9276 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9277 All were removed before 23.1.
9278
9279 * dispnew.c: Remove HAVE_LIBNCURSES test;
9280 it is always true on relevant platforms.
9281
9282 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9283 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9284
9285 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9286
9287 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9288
9289 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9290 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9291 Remove.
9292
9293 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9294
9295 Do not avoid creating empty evaporating overlays (Bug#9642).
9296 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9297 That is, do not delete an evaporating overlay if it becomes
9298 empty after its bounds are adjusted to fit within its buffer.
9299 This fix caused other problems, and I'm reverting it until we get
9300 to the bottom of them.
9301
9302 2012-04-27 Chong Yidong <cyd@gnu.org>
9303
9304 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9305
9306 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9307
9308 * xdisp.c (pos_visible_p): If the window start position is beyond
9309 ZV, start the display from buffer beginning. Prevents assertion
9310 violation in init_iterator when the minibuffer window is scrolled
9311 via the scroll bar.
9312
9313 * window.c (window_scroll_pixel_based): Likewise.
9314
9315 2012-04-27 Chong Yidong <cyd@gnu.org>
9316
9317 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9318
9319 2012-04-27 Glenn Morris <rgm@gnu.org>
9320
9321 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9322 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9323
9324 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9325
9326 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9327 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9328
9329 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9330
9331 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9332 display element, check also the underlying string or buffer
9333 character. (Bug#11341)
9334
9335 * w32menu.c: Include w32heap.h.
9336 (add_menu_item): If the call to AppendMenuW (via
9337 unicode_append_menu) fails, disable Unicode menus only if we are
9338 running on Windows 9X/Me.
9339
9340 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9341
9342 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9343 (xgetint): Add missing shift for LSB tags.
9344
9345 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9346
9347 * keyboard.c (read_char): Don't wipe echo area for select window
9348 events: These might get delayed via `mouse-autoselect-window'
9349 (Bug#11304).
9350
9351 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9352
9353 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9354 manipulation of :loaded-from data.
9355
9356 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9357
9358 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9359 now a cons (bug#11311).
9360
9361 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9362
9363 Do not create empty overlays with the evaporate property (Bug#9642).
9364 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9365 if it becomes empty after its bounds are adjusted to fit within
9366 its buffer. Without this fix, in a nonempty buffer (let ((o
9367 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9368 yields an empty overlay that has the evaporate property, which is
9369 not supposed to happen.
9370
9371 Fix minor GTK3 problems found by static checking.
9372 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9373 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9374 (struct _EmacsFixedClass, emacs_fixed_get_type):
9375 Move decls here from emacsgtkfixed.h, since they needn't be public.
9376 (emacs_fixed_get_type): Now static.
9377 (emacs_fixed_class_init): Omit unused local.
9378 (emacs_fixed_child_type): Remove; unused.
9379 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9380 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9381 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9382 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9383 (EMACS_FIXED_GET_CLASS): Remove; unused.
9384 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9385
9386 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9387 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9388
9389 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9390
9391 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9392 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9393 (__malloc_size_t, __malloc_ptrdiff_t):
9394 Remove. All uses removed, replaced by the definiens if needed,
9395 since we can assume C89 or better now.
9396 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9397 (protect_malloc_state, align, get_contiguous_space)
9398 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9399 (malloc_atfork_handler_child, malloc_enable_thread)
9400 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9401 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9402 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9403 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9404 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9405 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9406 Define using prototypes, not old style.
9407 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9408 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9409 (align): Don't assume that signed integer overflow wraps around.
9410 Omit unused local var.
9411 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9412 (_free_internal_nolock, memalign, mallochook, reallochook):
9413 Omit no-longer-needed casts.
9414 (valloc): Use getpagesize, not __getpagesize.
9415 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9416 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9417
9418 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9419
9420 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9421
9422 Move functions from C to Lisp. Make non-blocking method calls
9423 the default. Implement further D-Bus standard interfaces.
9424
9425 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9426 (QCdbus_request_name_allow_replacement)
9427 (QCdbus_request_name_replace_existing)
9428 (QCdbus_request_name_do_not_queue)
9429 (QCdbus_request_name_reply_primary_owner)
9430 (QCdbus_request_name_reply_in_queue)
9431 (QCdbus_request_name_reply_exists)
9432 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9433 (QCdbus_registered_serial, QCdbus_registered_method)
9434 (QCdbus_registered_signal): New Lisp objects.
9435 (XD_DEBUG_MESSAGE): Use sizeof.
9436 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9437 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9438 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9439 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9440 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9441 (xd_signature, xd_append_arg): Allow float for integer types.
9442 (xd_get_connection_references): New function.
9443 (xd_get_connection_address): Rename from xd_initialize.
9444 Return cached address.
9445 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9446 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9447 level.
9448 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9449 Return number of refcounts.
9450 (Fdbus_get_unique_name): Make stronger parameter check.
9451 (Fdbus_message_internal): New defun.
9452 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9453 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9454 (Fdbus_send_signal, Fdbus_register_service)
9455 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9456 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9457 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9458 (Vdbus_compiled_version, Vdbus_runtime_version)
9459 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9460 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9461 (Vdbus_message_type_signal): New defvars.
9462 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9463 Adapt docstring.
9464
9465 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9466
9467 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9468 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9469 Do not assume ptrdiff_t is the same width as 'int'.
9470
9471 * alloc.c: Handle unusual debugging option combinations.
9472 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9473 since the two debugging options are incompatible.
9474 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9475 is defined.
9476 (mem_init, mem_insert, mem_insert_fixup):
9477 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9478 (NEED_MEM_INSERT): Remove; no longer needed.
9479
9480 2012-04-22 Leo Liu <sdl.web@gmail.com>
9481
9482 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9483
9484 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9485
9486 * sysdep.c [__FreeBSD__]: Minor cleanups.
9487 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9488 Use Emacs indenting style more consistently. Avoid some casts.
9489 Use 'double' consistently rather than mixing 'float' and 'double'.
9490
9491 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9492
9493 * sysdep.c (list_system_processes, system_process_attributes):
9494 Add implementation for FreeBSD (Bug#5243).
9495
9496 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9497
9498 * lisp.mk (lisp): Update.
9499
9500 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9501
9502 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9503 It is never used otherwise.
9504
9505 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9506
9507 * print.c (print_preprocess): Only check print_depth if print-circle
9508 is nil.
9509 (print_object): Check for cycles even when print-circle is nil and
9510 print-gensym is t, but only check print_depth if print-circle is nil.
9511
9512 2012-04-20 Chong Yidong <cyd@gnu.org>
9513
9514 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9515 set the status to "failed" and ensure that sentinel is run.
9516
9517 2012-04-20 Glenn Morris <rgm@gnu.org>
9518
9519 * process.c (Fset_process_inherit_coding_system_flag)
9520 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9521 (Fmake_network_process, Fmake_serial_process): Doc fix.
9522
9523 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9524
9525 * xdisp.c (string_buffer_position_lim): Limit starting position to
9526 BEGV.
9527 (set_cursor_from_row): If called for a mode-line or header-line
9528 row, return zero immediately.
9529 (try_cursor_movement): If inside continuation line, don't back up
9530 farther than the first row after the header line, if any.
9531 Don't consider the header-line row as "partially visible", even if
9532 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9533
9534 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9535
9536 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9537 (bug#11238).
9538
9539 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9540 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9541
9542 configure: new option --enable-gcc-warnings (Bug#11207)
9543 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9544 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9545 (ALL_CFLAGS): Use new macros rather than old.
9546 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9547 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9548 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9549 -Wunused-result, -Wunused-variable. This should go away once
9550 the Emacs and Gnulib regex code is merged.
9551 (xmalloc, xrealloc): Now static.
9552
9553 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9554
9555 * dired.c (Fsystem_groups): Remove unused local.
9556
9557 2012-04-17 Glenn Morris <rgm@gnu.org>
9558
9559 * dired.c (Fsystem_users): Doc fix.
9560
9561 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9562
9563 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9564 (syms_of_dired): Add them.
9565
9566 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9567
9568 Fix minor alloc.c problems found by static checking.
9569 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9570 New extern decls, to avoid calling undeclared functions.
9571 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9572 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9573 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9574 (NEED_MEM_INSERT): New macro.
9575 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9576 Remove one incorrect comment and fix another.
9577
9578 Fix minor ralloc.c problems found by static checking.
9579 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9580 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9581 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9582 (r_alloc_sbrk): Now static.
9583
9584 Improve ralloc.c interface checking.
9585 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9586 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9587 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9588 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9589 [REL_ALLOC]: ... to here, to check interface.
9590 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9591 Remove decls. This fixes an "It stinks!".
9592
9593 * alloc.c (which_symbols): Fix alignment issue / type clash.
9594
9595 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9596
9597 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9598 (struct Lisp_Misc_Any): Likewise.
9599 (struct Lisp_Free): Likewise.
9600 * alloc.c (union aligned_Lisp_Symbol): Define.
9601 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9602 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9603 (union aligned_Lisp_Misc): Define.
9604 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9605 aligned_Lisp_Misc instead of union Lisp_Misc.
9606 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9607
9608 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9609
9610 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9611 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9612 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9613 * s/netbsd.h, s/sol2-6.h:
9614 Remove definition of GC_MARK_STACK, since the default now works.
9615 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9616 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9617 no longer the default.
9618 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9619
9620 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9621
9622 * lread.c (lisp_file_lexically_bound_p):
9623 Fix hang at ";-*-\n" (bug#11238).
9624
9625 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9626
9627 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9628 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9629
9630 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9631
9632 * nsterm.m (constrainFrameRect): Always constrain when there is only
9633 one screen (Bug#10962).
9634
9635 2012-04-13 Ken Brown <kbrown@cornell.edu>
9636
9637 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9638
9639 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9640
9641 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9642
9643 2012-04-11 Daniel Colascione <dancol@dancol.org>
9644
9645 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9646 against is gone. It's better to use vfork now so that when Cygwin
9647 gains a new, working vfork, we use it automatically (bug#10398).
9648
9649 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9650
9651 * window.c (save_window_save): Obey window-point-insertion-type.
9652
9653 2012-04-11 Glenn Morris <rgm@gnu.org>
9654
9655 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9656
9657 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9658
9659 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9660
9661 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9662
9663 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9664 (force_quit_count): New var.
9665 (handle_interrupt): Use it.
9666
9667 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9668
9669 * w32.c (w32_delayed_load): Record the full path of the library
9670 being loaded (bug#10424).
9671
9672 2012-04-09 Glenn Morris <rgm@gnu.org>
9673
9674 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9675 not just in the obarray, before snarfing them. (Bug#11036)
9676
9677 * Makefile.in ($(leimdir)/leim-list.el):
9678 Pass EMACS rather than BUILT_EMACS.
9679
9680 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9681
9682 * process.c (make_process):
9683 * process.h: Add integer `gnutls_handshakes_tried' member to
9684 process struct.
9685
9686 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9687 Add convenience `GNUTLS_LOG2i' macro.
9688
9689 * gnutls.c (gnutls_log_function2i): Convenience log function.
9690 (emacs_gnutls_read): Use new log functions,
9691 `gnutls_handshakes_tried' process member, and
9692 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9693 attempts per process (connection).
9694
9695 2012-04-09 Chong Yidong <cyd@gnu.org>
9696
9697 * eval.c (Fuser_variable_p, user_variable_p_eh)
9698 (lisp_indirect_variable): Functions deleted.
9699 (Fdefvar): Caller changed.
9700
9701 * callint.c (Finteractive, Fcall_interactively):
9702 * minibuf.c (Fread_variable): Callers changed.
9703
9704 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9705
9706 * xdisp.c (set_cursor_from_row): If the display string appears in
9707 the buffer at position that is closer to point than the position
9708 after the display string, display the cursor on the first glyph of
9709 the display string. Fixes cursor display when a 'display' text
9710 property immediately follows invisible text. (Bug#11094)
9711
9712 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9713
9714 composite.c: use 'double' consistently
9715 * composite.c (get_composition_id): Use 'double' consistently
9716 instead of converting 'float' to 'double' and vice versa; this is
9717 easier to understand and avoids a GCC warning.
9718
9719 2012-04-09 Glenn Morris <rgm@gnu.org>
9720
9721 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9722 preparation for dumping it with emacs. (Bug#4789)
9723 (leimdir): New variable.
9724 ($(leimdir)/leim-list.el): New rule.
9725 (emacs$(EXEEXT)): Depend on leim-list.el.
9726
9727 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9728 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9729 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9730
9731 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9732
9733 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9734 proper alignment.
9735
9736 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9737
9738 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9739 Remove unused local variable.
9740
9741 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9742
9743 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9744 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9745 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9746 objects, as mark_maybe_pointer will catch them otherwise.
9747 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9748 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9749
9750 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9751
9752 Fix typo that broke non-Windows builds.
9753 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9754
9755 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9756
9757 Support building on MS-Windows with libxml2.
9758
9759 * makefile.w32-in (OBJ2): Add xml.$(O).
9760 (GLOBAL_SOURCES): Add xml.c.
9761 ($(BLD)/xml.$(O)): New dependency list.
9762
9763 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9764 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9765 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9766 [!WINDOWSNT]: New macros.
9767 (init_libxml2_functions, libxml2_loaded_p): New functions.
9768 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9769 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9770 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9771 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9772 linked in).
9773 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9774 Call init_libxml2_functions before calling libxml2 functions.
9775 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9776
9777 * emacs.c: Don't include libxml/parser.h.
9778 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9779 xmlCleanupParser directly.
9780
9781 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9782
9783 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9784
9785 * indent.c (Fvertical_motion): If there is a display string at
9786 point, use it.vpos to compute how many lines to backtrack after
9787 move_it_to point. (Bug#11133)
9788
9789 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9790
9791 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9792 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9793 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9794 macros related to unification of CJK characters. For the details,
9795 see the discussion following the message here:
9796 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9797
9798 2012-04-04 Chong Yidong <cyd@gnu.org>
9799
9800 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9801
9802 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9803
9804 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9805 instead of alloca. (Bug#11138)
9806
9807 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9808
9809 * w32menu.c (is_simple_dialog): Properly check lisp types.
9810 (Bug#11141)
9811
9812 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9813
9814 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9815 position we get to after a call to move_it_to fails the
9816 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9817 only if we wind up in a string from display property. (Bug#11063)
9818
9819 * window.c (Fdelete_other_windows_internal): Invalidate the row
9820 and column information about mouse highlight, so that redisplay
9821 restores it after reallocating the glyph matrices. (Bug#7464)
9822
9823 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9824 string comes from a `display' text property, use the buffer
9825 position of that property as if we actually saw that position in
9826 the row's glyphs.
9827 (move_it_by_lines): Remove the assertion that
9828 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9829 violated when there's a before-string at the beginning of a line.
9830 (Bug#11063)
9831
9832 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9833
9834 * xdisp.c (append_space_for_newline): If the default face was
9835 remapped, use the remapped face for the appended newline.
9836 (extend_face_to_end_of_line): Use the remapped default face for
9837 extending the face to the end of the line.
9838 (display_line): Call extend_face_to_end_of_line when the default
9839 face was remapped. (Bug#11068)
9840
9841 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9842
9843 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9844
9845 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9846
9847 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9848
9849 2012-03-27 Glenn Morris <rgm@gnu.org>
9850
9851 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9852 Doc fixes.
9853
9854 2012-03-26 Kenichi Handa <handa@m17n.org>
9855
9856 * dispextern.h (struct glyph): Fix previous change. Change the
9857 bit length of glyphless.ch to 25 (Bug#11082).
9858
9859 2012-03-26 Chong Yidong <cyd@gnu.org>
9860
9861 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9862 (command_loop_1): Use it; inhibit selection update for
9863 handle-select-window too (Bug#8996).
9864
9865 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9866
9867 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9868
9869 2012-03-25 Kenichi Handa <handa@m17n.org>
9870
9871 * dispextern.h (struct glyph): Change the bit length of
9872 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9873
9874 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9875
9876 * s/ms-w32.h (tzname): Include time.h before redirecting to
9877 _tzname. Fixes the MSVC build. (Bug#9960)
9878
9879 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9880
9881 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9882 characters.
9883
9884 * xterm.c (XTread_socket): Only modify handling_signal if
9885 !SYNC_INPUT. (Bug#11080)
9886
9887 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9888
9889 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9890 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9891 when fetching a multibyte character consumes more bytes than
9892 CHAR_BYTES returns, due to unification of CJK characters in
9893 string_char. (Bug#11073)
9894
9895 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9896
9897 * process.c (wait_reading_process_output): Handle pty disconnect
9898 by refraining from sending oneself a SIGCHLD (bug#10933).
9899
9900 2012-03-22 Chong Yidong <cyd@gnu.org>
9901
9902 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9903
9904 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9905 Mark string as coming from a prefix property.
9906 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9907 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9908
9909 2012-03-21 Chong Yidong <cyd@gnu.org>
9910
9911 * xfaces.c (Vface_remapping_alist): Doc fix.
9912
9913 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9914
9915 * w32proc.c (Fw32_set_console_codepage)
9916 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9917 Doc fixes.
9918
9919 2012-03-20 Chong Yidong <cyd@gnu.org>
9920
9921 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9922 to reflect default non-nil value of redisplay-dont-pause.
9923
9924 2012-03-19 Kenichi Handa <handa@m17n.org>
9925
9926 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9927 it fit in a valid range (Bug#11003).
9928
9929 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9930
9931 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9932 that is not from display property, accept the row as a "cursor
9933 row" if one of the string's character has a non-nil `cursor'
9934 property. Fixes cursor positioning when there are newlines in
9935 overlay strings, e.g. in icomplete.el. (Bug#11035)
9936
9937 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9938
9939 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9940
9941 2012-03-12 Chong Yidong <cyd@gnu.org>
9942
9943 * eval.c (inhibit_lisp_code): Rename from
9944 inhibit_window_configuration_change_hook; move from window.c.
9945
9946 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9947 * window.c (run_window_configuration_change_hook)
9948 (syms_of_window): Callers changed.
9949
9950 2012-03-11 Chong Yidong <cyd@gnu.org>
9951
9952 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9953
9954 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9955
9956 2012-03-10 Chong Yidong <cyd@gnu.org>
9957
9958 * frame.c (other_visible_frames): Don't assume the selected frame
9959 is visible (Bug#10955).
9960
9961 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9962
9963 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9964
9965 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9966
9967 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9968 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9969 zero (Bug#10954).
9970
9971 2012-03-03 Glenn Morris <rgm@gnu.org>
9972
9973 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9974
9975 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9976
9977 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9978 position past the first glyph_row that ends at ZV. (Bug#10902)
9979 (redisplay_window, next_element_from_string): Fix typos in
9980 comments.
9981 (redisplay_window): Pass to move_it_vertically the margin in
9982 pixels, not in screen lines.
9983
9984 2012-03-02 Glenn Morris <rgm@gnu.org>
9985
9986 * buffer.c (buffer-list-update-hook): Doc fix.
9987
9988 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9989
9990 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9991 push_it before setting up the iterator for the first overlay
9992 string, even if we have an empty string loaded.
9993 (next_overlay_string): If there's an empty string on the iterator
9994 stack, pop the stack. (Bug#10903)
9995
9996 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9997
9998 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9999 Suggested by Stefan Monnier in
10000 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10001 * alloc.c (widen_to_Lisp_Object): New static function.
10002 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10003 and widening them to Lisp_Objects. This would work even if
10004 USE_LSB_TAG is defined and wide integers are used, which might
10005 happen in a future version of Emacs.
10006
10007 2012-02-25 Chong Yidong <cyd@gnu.org>
10008
10009 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10010 Doc fix.
10011
10012 * xselect.c (Fx_selection_exists_p): Doc fix.
10013 (x_clipboard_manager_save_all): Print an informative message
10014 before saving to clipboard manager.
10015
10016 2012-02-24 Chong Yidong <cyd@gnu.org>
10017
10018 * keyboard.c (process_special_events): Handle all X selection
10019 requests in kbd_buffer, not just the next one (Bug#8869).
10020
10021 2012-02-23 Chong Yidong <cyd@gnu.org>
10022
10023 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10024 call when setting menu-bar-lines and tool-bar-lines parameters.
10025 (unwind_create_frame_1): New helper function.
10026
10027 * window.c (inhibit_window_configuration_change_hook): New var.
10028 (run_window_configuration_change_hook): Obey it.
10029 (syms_of_window): Initialize it.
10030
10031 2012-02-22 Chong Yidong <cyd@gnu.org>
10032
10033 * xterm.c (x_draw_image_relief): Add missing type check for
10034 Vtool_bar_button_margin (Bug#10743).
10035
10036 2012-02-21 Chong Yidong <cyd@gnu.org>
10037
10038 * fileio.c (Vfile_name_handler_alist): Doc fix.
10039
10040 * buffer.c (Fget_file_buffer): Protect against invalid file
10041 handler return value.
10042
10043 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10046 when computing $valmask.
10047
10048 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10049 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10050 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10051 It's useless in that case, and it can cause problems on hosts
10052 that allocate halves of EMACS_INT values separately.
10053 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10054 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10055 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10056 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10057 it avoids undefined behavior on hosts where shifting right by more
10058 than the word width has undefined behavior.
10059
10060 2012-02-19 Chong Yidong <cyd@gnu.org>
10061
10062 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10063 (Funhandled_file_name_directory, Ffile_name_as_directory)
10064 (Fdirectory_file_name, Fexpand_file_name)
10065 (Fsubstitute_in_file_name): Protect against invalid file handler
10066 return values (Bug#10845).
10067
10068 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10069
10070 * .gdbinit (pitx): Fix incorrect references to fields of the
10071 iterator stack.
10072
10073 2012-02-17 Chong Yidong <cyd@gnu.org>
10074
10075 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10076
10077 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10078
10079 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10080 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10081
10082 2012-02-15 Chong Yidong <cyd@gnu.org>
10083
10084 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10085 marked as special. Also, starting docstrings with * is obsolete.
10086
10087 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10088
10089 * gnutls.c (emacs_gnutls_write): Fix last change.
10090
10091 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10092
10093 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10094 send_process.
10095
10096 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10097
10098 * keymap.c (Fsingle_key_description): Handle char ranges.
10099
10100 2012-02-12 Chong Yidong <cyd@gnu.org>
10101
10102 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10103 as that creates a dangerous corner case.
10104
10105 * window.c (Fdelete_window_internal): Invalidate the mouse
10106 highlight (Bug#9904).
10107
10108 2012-02-12 Glenn Morris <rgm@gnu.org>
10109
10110 * xselect.c (Fx_own_selection_internal)
10111 (Fx_get_selection_internal, Fx_disown_selection_internal)
10112 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10113 * nsselect.m (Fx_own_selection_internal)
10114 (Fx_disown_selection_internal, Fx_selection_exists_p)
10115 (Fx_selection_owner_p, Fx_get_selection_internal):
10116 Sync docs and argument specs with the xselect.c versions.
10117
10118 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10119
10120 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10121
10122 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10123
10124 * w32select.c (Fx_selection_exists_p): Sync doc string and
10125 argument list with xselect.c. (Bug#10783)
10126
10127 * w16select.c (Fx_selection_exists_p): Sync doc string and
10128 argument list with xselect.c. (Bug#10783)
10129
10130 2012-02-10 Glenn Morris <rgm@gnu.org>
10131
10132 * fns.c (Fsecure_hash): Doc fix.
10133
10134 2012-02-09 Kenichi Handa <handa@m17n.org>
10135
10136 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10137
10138 2012-02-07 Chong Yidong <cyd@gnu.org>
10139
10140 * buffer.c (Fbuffer_local_variables)
10141 (buffer_lisp_local_variables): Handle unbound vars correctly;
10142 don't let Qunbound leak into Lisp.
10143
10144 2012-02-07 Glenn Morris <rgm@gnu.org>
10145
10146 * image.c (Fimagemagick_types): Doc fix.
10147
10148 * image.c (imagemagick-render-type): Change it from a lisp object
10149 to an integer. Move the doc here from the lisp manual.
10150 Treat all values not equal to 0 the same.
10151
10152 2012-02-06 Chong Yidong <cyd@gnu.org>
10153
10154 * doc.c (store_function_docstring): Avoid applying docstring of
10155 alias to base function (Bug#2603).
10156
10157 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10158
10159 * .gdbinit (pp1, pv1): Remove redundant defines.
10160 (pr): Use pp.
10161
10162 2012-02-04 Chong Yidong <cyd@gnu.org>
10163
10164 * nsterm.m: Declare a global (Bug#10694).
10165
10166 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10167
10168 * w32.c (get_emacs_configuration_options):
10169 Include --enable-checking, if specified, in the return value.
10170
10171 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10172
10173 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10174 after rounding frame sizes. (Bug#9723)
10175
10176 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10177
10178 * keyboard.c (adjust_point_for_property): Don't position point
10179 before BEGV. (Bug#10696)
10180
10181 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10182
10183 Handle overflow when computing char display width (Bug#9496).
10184 * character.c (char_width): Return EMACS_INT, not int.
10185 (char_width, c_string_width): Check for overflow when
10186 computing the width; this is possible now that individual
10187 characters can have unbounded width. Problem introduced
10188 by merge from Emacs 23 on 2012-01-19.
10189
10190 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10191
10192 * dbusbind.c (Fdbus_register_method): Mention the return value
10193 :ignore in the docstring.
10194
10195 2012-02-02 Glenn Morris <rgm@gnu.org>
10196
10197 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10198
10199 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10200 Unconditionally set to t. (Bug#10673)
10201 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10202 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10203 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10204
10205 2012-02-02 Kenichi Handa <handa@m17n.org>
10206
10207 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10208 0, do not call append_composite_glyph.
10209
10210 2012-02-02 Kenichi Handa <handa@m17n.org>
10211
10212 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10213 NULL (Bug#6988).
10214 (x_produce_glyphs): If the component of a composition is a null
10215 string, set it->pixel_width to 1 to avoid zero-width glyph.
10216
10217 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10218
10219 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10220 first 2 arguments are identical. This makes inserting large
10221 output from a subprocess an order of magnitude faster on
10222 MS-Windows, where all sbrk'ed memory is always contiguous.
10223
10224 2012-01-31 Glenn Morris <rgm@gnu.org>
10225
10226 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10227 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10228 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10229
10230 2012-01-29 Glenn Morris <rgm@gnu.org>
10231
10232 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10233
10234 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10235
10236 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10237
10238 2012-01-28 Chong Yidong <cyd@gnu.org>
10239
10240 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10241
10242 2012-01-26 Chong Yidong <cyd@gnu.org>
10243
10244 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10245
10246 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10247 repeat counts (Bug#10507).
10248
10249 2012-01-26 Glenn Morris <rgm@gnu.org>
10250
10251 * lread.c (syms_of_lread): Doc fix.
10252
10253 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10254
10255 * coding.c (encode_designation_at_bol): Change return value to
10256 EMACS_INT.
10257
10258 2012-01-25 Chong Yidong <cyd@gnu.org>
10259
10260 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10261
10262 2012-01-21 Chong Yidong <cyd@gnu.org>
10263
10264 * floatfns.c (Fcopysign): Make the second argument non-optional,
10265 since nil is not allowed anyway.
10266
10267 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10268
10269 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10270 (send_process): Likewise.
10271
10272 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10273
10274 * window.c (save_window_save, Fcurrent_window_configuration)
10275 (Vwindow_persistent_parameters): Do not use Qstate.
10276 Rewrite doc-strings.
10277
10278 2012-01-19 Kenichi Handa <handa@m17n.org>
10279
10280 * character.c (char_width): New function.
10281 (Fchar_width, c_string_width, lisp_string_width):
10282 Use char_width (Bug#9496).
10283
10284 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10285
10286 * window.c (Vwindow_persistent_parameters): New variable.
10287 (Fset_window_configuration, save_window_save): Handle persistent
10288 window parameters.
10289
10290 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10291
10292 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10293 thrashing the stack of the thread. (Bug#9087)
10294
10295 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10296
10297 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10298
10299 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10300
10301 * xdisp.c (rows_from_pos_range): Handle the case where the
10302 highlight ends on a newline. (Bug#10464)
10303 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10304 he end column for display of highlight that ends on a newline
10305 before a R2L line.
10306
10307 2012-01-11 Glenn Morris <rgm@gnu.org>
10308
10309 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10310 from load-path also when installation-directory is nil. (Bug#10208)
10311
10312 2012-01-10 Glenn Morris <rgm@gnu.org>
10313
10314 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10315
10316 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10317 Update template values to be closer to their typical values these days.
10318
10319 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10320
10321 * xdisp.c (rows_from_pos_range): Accept additional argument
10322 DISP_STRING, and accept any glyph in a row whose object is that
10323 string as eligible for mouse highlight. Fixes mouse highlight of
10324 display strings from overlays. (Bug#10464)
10325
10326 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10327
10328 emacs: fix an auto-save permissions race condition (Bug#10400)
10329 * fileio.c (auto_saving_dir_umask): New static var.
10330 (Fmake_directory_internal): Use it.
10331 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10332 creating the directory. The old code temporarily assigns
10333 too-generous permissions to the directory.
10334 (do_auto_save_eh): Clear it.
10335 (Fdo_auto_save): Catch all errors, not just file errors, so
10336 that the var is always cleared.
10337
10338 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10339
10340 * search.c (scan_buffer): Pass character positions to
10341 know_region_cache, not byte positions. (Bug#6540)
10342
10343 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10344
10345 * w32.c (sys_rename): Report EXDEV when rename of a directory
10346 fails because the target is on another logical disk. (Bug#10284)
10347
10348 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10349
10350 * xterm.c (x_embed_request_focus): New function.
10351
10352 * xterm.h: Add prototype.
10353
10354 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10355
10356 2012-01-05 Glenn Morris <rgm@gnu.org>
10357
10358 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10359
10360 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10361
10362 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10363 Load gnutls_transport_set_lowat only if GnuTLS version is below
10364 2.11.1.
10365 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10366 GnuTLS versions below 2.11.1.
10367
10368 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10369
10370 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10371 to the doc string advising against its use for altering the way
10372 windows are scrolled.
10373
10374 2011-12-28 Kenichi Handa <handa@m17n.org>
10375
10376 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10377 coding-system ASCII compatible only when it does not produce BOM
10378 on encoding (Bug#10383).
10379
10380 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10381
10382 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10383 can scroll.
10384 (create_and_show_popup_menu): Always use menu_position_func for
10385 Gtk3 (Bug#10361).
10386
10387 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10388
10389 * callint.c (Fcall_interactively): Don't truncate prompt string.
10390
10391 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10392
10393 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10394 property that ends at ZV, so that the bidi iteration could be
10395 resumed from there (after widening). (Bug#10360)
10396
10397 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10398
10399 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10400
10401 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10402
10403 * nsterm.m (x_free_frame_resources):
10404 Release f->output_data.ns->miniimage.
10405 (ns_index_color): Fix indentation. Do not retain
10406 color_table->colors[i].
10407
10408 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10409 before returning.
10410
10411 * nsfns.m (x_set_background_color): Assign return value from
10412 ns_index_color to face-background instead of NSColor*.
10413 (ns_implicitly_set_icon_type): Fix indentation.
10414 Change assignment in for loop to comparison.
10415
10416 * emacs.c (ns_pool): New variable.
10417 (main): Assign ns_pool.
10418 (Fkill_emacs): Call ns_release_autorelease_pool.
10419
10420 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10421 autorelease fdesc, release fdAttrs and tdict.
10422 (ns_get_covering_families): Release charset.
10423 (ns_findfonts): Release NSFontDescriptor created with new.
10424 (ns_uni_to_glyphs): Fix indentation.
10425 (setString): Release attrStr before assigning new value.
10426
10427 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10428
10429 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10430 and NS_IMPL_COCOA.
10431 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10432 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10433
10434 2011-12-18 David Reitter <reitter@cmu.edu>
10435
10436 * nsterm.m (ns_term_init): Subscribe for notifications
10437 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10438 to method trackingNotification in EmacsMenu.
10439
10440 * nsmenu.m (trackingMenu): New variable.
10441 (trackingNotification): New method (from Aquamacs).
10442 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10443 from Aquamacs (Bug#7030).
10444
10445 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10446
10447 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10448 (symbol_to_nsstring): Fix indentation.
10449 (ns_symbol_to_pb): New function.
10450 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10451 (Fns_rotate_cut_buffers_internal): Remove.
10452 (Fns_store_selection_internal): Rename from
10453 Fns_store_cut_buffer_internal.
10454 (ns_get_foreign_selection, Fx_own_selection_internal)
10455 (Fx_disown_selection_internal, Fx_selection_exists_p)
10456 (Fns_get_selection_internal, Fns_store_selection_internal):
10457 Use ns_symbol_to_pb and check if return value is nil.
10458 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10459 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10460 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10461 renamed to Sns_store_selection_internal.
10462 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10463 and remove this function.
10464 (ns_handle_selection_clear): Remove, never used.
10465 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10466 here.
10467
10468 2011-12-17 Ken Brown <kbrown@cornell.edu>
10469
10470 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10471 GID is unknown (Bug#10257).
10472
10473 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10474
10475 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10476 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10477 which caused a build failure on GNU/Linux IA-64. This problem was
10478 introduced by my 2011-10-07 patch.
10479
10480 2011-12-15 Juri Linkov <juri@jurta.org>
10481
10482 * image.c (imagemagick_error): New function. (Bug#10112)
10483 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10484 Use `imagemagick_error' where ImageMagick functions return
10485 `MagickFalse'.
10486 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10487 proper order.
10488
10489 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10490
10491 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10492 fill background (Bug#8992).
10493
10494 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10495
10496 * window.c (Vwindow_combination_resize)
10497 (Vwindow_combination_limit): Use t instead of non-nil in
10498 doc-strings.
10499 (Vrecenter_redisplay): Add first sentence of doc-string on
10500 separate line.
10501 (Frecenter): Fix doc-string typo.
10502
10503 2011-12-11 Kenichi Handa <handa@m17n.org>
10504
10505 * coding.c (Funencodable_char_position): Pay attention to the
10506 buffer text relocation (Bug#9389).
10507
10508 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10509
10510 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10511 gtk_init (Bug#10100).
10512
10513 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10514
10515 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10516 IT->string is nil. (Bug#10263)
10517
10518 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10519
10520 * nsterm.h (x_free_frame_resources): Declare.
10521
10522 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10523 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10524
10525 * nsterm.h (ns_get_defaults_value): Declare.
10526
10527 * nsterm.m (ns_default): Call ns_get_defaults_value.
10528
10529 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10530
10531 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10532 (Bug#10170)
10533
10534 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10535
10536 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10537 that where the value of an _OBJC_* symbol points to is in the .bss
10538 section (Bug#10240).
10539
10540 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10541
10542 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10543 after the loop to call ccl_driver at least once (Bug#8619).
10544
10545 2011-12-08 Kenichi Handa <handa@m17n.org>
10546
10547 * ftfont.c (get_adstyle_property): Fix previous change
10548 (Bug#10233).
10549
10550 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10551
10552 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10553 dirs from the default value of EMACSLOADPATH (bug#10208).
10554
10555 2011-12-07 Glenn Morris <rgm@gnu.org>
10556
10557 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10558 installation and source directories as well. (Bug#10208)
10559
10560 2011-12-06 Chong Yidong <cyd@gnu.org>
10561
10562 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10563
10564 2011-12-06 Glenn Morris <rgm@gnu.org>
10565
10566 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10567 as an error, not just -1. (Bug#10217)
10568
10569 2011-12-05 Chong Yidong <cyd@gnu.org>
10570
10571 * keyboard.c (process_special_events): New function.
10572 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10573
10574 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10575
10576 * coding.c (encode_designation_at_bol): Don't use uninitialized
10577 local variable (Bug#9318).
10578
10579 2011-12-05 Kenichi Handa <handa@m17n.org>
10580
10581 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10582 return Qnil (Bug#8046, Bug#10193).
10583
10584 2011-12-05 Kenichi Handa <handa@m17n.org>
10585
10586 * coding.c (encode_designation_at_bol): New args charbuf_end and
10587 dst. Return the number of produced bytes. Callers changed.
10588 (coding_set_source): Return how many bytes coding->source was
10589 relocated.
10590 (coding_set_destination): Return how many bytes
10591 coding->destination was relocated.
10592 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10593 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10594
10595 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10596
10597 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10598 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10599 macro (Bug#9318).
10600
10601 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10602
10603 The following changes are to fix Bug#9318.
10604
10605 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10606 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10607 (encode_coding_iso_2022, encode_coding_sjis)
10608 (encode_coding_big5, encode_coding_charset): Use the above macros.
10609
10610 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10611
10612 * lisp.h (process_quit_flag): Fix external declaration.
10613
10614 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10615
10616 Don't macro-inline non-performance-critical code.
10617 * eval.c (process_quit_flag): New function.
10618 * lisp.h (QUIT): Use it.
10619
10620 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10621
10622 * nsfns.m (get_geometry_from_preferences): New function.
10623 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10624
10625 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10626
10627 * emacs.c (Qkill_emacs): Define.
10628 (syms_of_emacs): Initialize it.
10629 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10630 Qquit_flag to `kill-emacs' instead.
10631 (quit_throw_to_read_char): Add parameter `from_signal'.
10632 All callers changed. Call Fkill_emacs if requested and safe.
10633 * lisp.h (QUIT): Call Fkill_emacs if requested.
10634
10635 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10636
10637 * widget.c (update_wm_hints): Return if wmshell is null.
10638 (widget_update_wm_size_hints): New function.
10639
10640 * widget.h (widget_update_wm_size_hints): Declare.
10641
10642 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10643 widget_update_wm_size_hints (Bug#10104).
10644
10645 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10646
10647 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10648 before a newline, prepare the bidi iterator for consuming the
10649 newline, and keep the current paragraph direction. (Bug#10183)
10650 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10651
10652 2011-12-02 Juri Linkov <juri@jurta.org>
10653
10654 * search.c (Fword_search_regexp): New Lisp function created from
10655 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10656 (Fword_search_backward, Fword_search_forward)
10657 (Fword_search_backward_lax, Fword_search_forward_lax):
10658 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10659 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10660
10661 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10662
10663 * fileio.c (Finsert_file_contents): Move after-change-function call
10664 to before the "handled:" label, since all "goto handled" appear in
10665 cases where the *-change-functions have already been properly called
10666 (bug#10117).
10667
10668 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10669
10670 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10671 waiting for input. (Bug#10169)
10672
10673 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10674
10675 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10676 verifies glyph row's hash code--we have just reallocated the
10677 glyphs, so their contents can be complete garbage. (Bug#10164)
10678
10679 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10680
10681 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10682
10683 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10684
10685 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10686 attributes are tested _before_ calling verify_row_hash, to protect
10687 against GCC re-ordering of the tests. (Bug#10164)
10688
10689 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10690
10691 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10692
10693 * xterm.c (handle_one_xevent): Only set async_visible and friends
10694 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10695 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10696 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10697
10698 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10699
10700 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10701 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10702 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10703 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10704 All uses changed to use GCPRO1 etc.
10705 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10706 Revert to old implementation (i.e., before 2011-03-11).
10707
10708 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10709
10710 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10711 of scroll runs so as to avoid assigning disabled bogus rows and
10712 unnecessary graphics copy operations.
10713
10714 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10715
10716 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10717 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10718 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10719 (malloc, free, realloc, calloc): Redirect to e_* only when
10720 compiling Emacs.
10721
10722 * lisp.h (GCTYPEBITS): Move before first use.
10723 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10724 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10725 this macro definition.
10726
10727 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10728 _MSC_VER.
10729
10730 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10731
10732 * gtkutil.c (xg_create_frame_widgets):
10733 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10734 present with Gtk+ 2.0.
10735
10736 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10737
10738 * fileio.c (Finsert_file_contents): Undo previous change; see
10739 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10740
10741 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10742
10743 Rename locals to avoid shadowing.
10744 * fileio.c (Finsert_file_contents):
10745 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10746 * process.c (wait_reading_process_output):
10747 Rename inner 'proc' to 'p' to avoid shadowing.
10748 Indent for consistency with usual Emacs style.
10749
10750 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10751
10752 * xdisp.c (redisplay_window): If cursor row is not fully visible
10753 after recentering, and scroll-conservatively is set to a large
10754 number, scroll window by a few more lines to make the cursor fully
10755 visible and out of scroll-margin. (Bug#10105)
10756 (start_display): Don't move to the next line if the display should
10757 start at a newline that is part of a display vector or an overlay
10758 string. (Bug#10119)
10759
10760 2011-11-24 Juri Linkov <juri@jurta.org>
10761
10762 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10763 after the `MagickPingImage' call. (Bug#10112)
10764
10765 2011-11-23 Chong Yidong <cyd@gnu.org>
10766
10767 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10768
10769 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10770
10771 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10772 making another buffer current. (Bug#10114)
10773
10774 2011-11-23 Glenn Morris <rgm@gnu.org>
10775
10776 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10777
10778 2011-11-23 Chong Yidong <cyd@gnu.org>
10779
10780 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10781 using it (Bug#5984).
10782
10783 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10784
10785 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10786 and header-lines, as they don't have one computed for them.
10787 (Bug#10098)
10788
10789 * .gdbinit (prow): Make displayed values more self-explaining.
10790 Add row's hash code.
10791
10792 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10793
10794 * process.c (wait_reading_process_output): Fix asynchrounous
10795 GnuTLS socket handling on some versions of the GnuTLS library.
10796 (wait_reading_process_output): Add comment and URL.
10797
10798 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10799
10800 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10801
10802 2011-11-21 Chong Yidong <cyd@gnu.org>
10803
10804 * window.c (Fnext_window, Fprevious_window): Doc fix.
10805
10806 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10807
10808 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10809
10810 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10811
10812 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10813
10814 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10815
10816 * window.c (Fset_window_combination_limit): Rename argument
10817 STATUS to LIMIT.
10818 (Vwindow_combination_limit): Remove "status" from doc-string.
10819
10820 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10821
10822 * m/ibms390.h: Remove.
10823 * m/ibms390x.h: Don't include "ibms390.h".
10824
10825 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10826
10827 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10828 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10829
10830 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10831
10832 * casetab.c (Fset_case_table):
10833 * charset.c (Fcharset_after): Fix typos.
10834
10835 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10836
10837 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10838 Otherwise, valgrind does not work on some platforms.
10839 Problem reported by Andreas Schwab in
10840 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10841 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10842 is set, removing the need for VIRT_ADDRESS_VARIES.
10843 (PURE_P): Use a more-efficient implementation that needs just one
10844 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10845 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10846 to 4 (xorl, subq, cmpq, setbe).
10847 * alloc.c (pure): Always extern now, since that's the
10848 VIRT_ADDR_VARIES behavior.
10849 (PURE_POINTER_P): Use a single comparison, not two, for
10850 consistency with the new puresize.h.
10851 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10852 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10853 Remove VIRT_ADDR_VARIES no longer needed.
10854
10855 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10856
10857 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10858 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10859 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10860 behave as if the cursor position were at the window margin.
10861
10862 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10863 and the cursor position is out of bounds, behave as if the cursor
10864 position were at the window margin. (Bug#10075)
10865
10866 2011-11-18 Chong Yidong <cyd@gnu.org>
10867
10868 * window.c (Fwindow_combination_limit): Make first argument
10869 non-optional, since it is meaningless for live windows like the
10870 selected window.
10871
10872 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10873
10874 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10875
10876 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10877
10878 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10879 (graft_intervals_into_buffer): Simplify.
10880
10881 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10882
10883 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10884 hash values of the two rows.
10885 (copy_row_except_pointers): Preserve the used[] arrays and the
10886 hash values of the two rows. (Bug#10035)
10887 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10888
10889 * xdisp.c (row_hash): New function, body extracted from
10890 compute_line_metrics.
10891 (compute_line_metrics): Call row_hash, instead of computing the
10892 hash code inline.
10893
10894 * dispnew.c (verify_row_hash): Call row_hash for computing the
10895 hash code of a row, instead of duplicating code from xdisp.c.
10896
10897 * dispextern.h (row_hash): Add prototype.
10898
10899 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10900
10901 * frame.c (delete_frame): Don't delete the terminal when the last
10902 X frame is closed if emacs is built with GTK toolkit.
10903
10904 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10905
10906 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10907
10908 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10909
10910 * window.c (Vwindow_splits): Rename to
10911 Vwindow_combination_resize. Suggested by Juri Linkov.
10912 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10913 of Vwindow_splits.
10914
10915 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10916
10917 * nsfns.m (Fns_font_name):
10918 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10919
10920 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10921
10922 * window.h (window): Rename slot "nest" to "combination_limit".
10923 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10924 (Fset_window_nest): Rename to Fset_window_combination_limit.
10925 (Vwindow_nest): Rename to Vwindow_combination_limit.
10926 (recombine_windows, make_parent_window, make_window)
10927 (Fsplit_window_internal, saved_window)
10928 (Fset_window_configuration, save_window_save): Rename all
10929 occurrences of window_nest to window_combination_limit.
10930
10931 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10932
10933 * image.c (imagemagick_load_image): Fix typo.
10934
10935 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10936
10937 * xdisp.c (display_line): Move the call to
10938 highlight_trailing_whitespace before the call to
10939 compute_line_metrics, since the latter needs to see the final
10940 faces of all the glyphs to compute ROW's hash value.
10941 Fixes assertion violations in row_equal_p. (Bug#10035)
10942
10943 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10944
10945 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10946 just return (bug#10044).
10947
10948 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10949
10950 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10951 with user-defined heap size. Bump the default size of the temacs
10952 heap to 27MB, to avoid memory warning when running temacs.
10953 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10954
10955 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10956 current_matrix and desired_matrix. (Bug#9990)
10957 (verify_row_hash) [XASSERTS]: New function.
10958 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10959 that the hash value of glyph rows is correct.
10960
10961 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10962
10963 * window.h (window): Remove splits slot.
10964 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10965 (Fdelete_other_windows_internal, make_parent_window)
10966 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10967 (Fset_window_configuration, save_window_save): Don't deal with
10968 split status of windows.
10969 (saved_window): Remove splits slot.
10970 (Vwindow_splits): Rewrite doc-string.
10971
10972 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10973
10974 * xfns.c (unwind_create_frame):
10975 * nsfns.m (unwind_create_frame):
10976 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10977 Vframe_list (Bug#9999).
10978
10979 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10980
10981 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10982
10983 2011-11-11 Kenichi Handa <handa@m17n.org>
10984
10985 * callproc.c (Fcall_process): Set the member dst_multibyte of
10986 process_coding.
10987
10988 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10989
10990 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10991 avoid a crash (bug#9496).
10992
10993 2011-11-09 Chong Yidong <cyd@gnu.org>
10994
10995 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10996 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10997
10998 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10999
11000 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11001
11002 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11003
11004 Avoid some portability problems by eschewing 'extern inline' functions.
11005 The trivial performance wins aren't worth the portability hassles; see
11006 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11007 et seq.
11008 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11009 (window_box_width, window_box_left, window_box_left_offset)
11010 (window_box_right, window_box_right_offset): Undo previous change,
11011 by removing the "extern"s.
11012 * intervals.c (adjust_intervals_for_insertion)
11013 (adjust_intervals_for_deletion): Undo previous change,
11014 making these static again.
11015 (offset_intervals, temp_set_point_both, temp_set_point)
11016 (copy_intervals_to_string): No longer inline.
11017 * xdisp.c (window_text_bottom_y, window_box_width)
11018 (window_box_height, window_box_left_offset)
11019 (window_box_right_offset, window_box_left, window_box_right)
11020 (window_box): No longer inline.
11021
11022 2011-11-08 Chong Yidong <cyd@gnu.org>
11023
11024 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11025 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11026 Signal an error if not a live window.
11027 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11028 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11029
11030 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11031
11032 * lisp.h (syms_of_abbrev): Remove declaration.
11033 Reported by CHENG Gao <chenggao@royau.me>.
11034
11035 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11036
11037 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11038 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11039 of temacs in GUI mode.
11040
11041 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11042
11043 * window.h: Declare delete_all_child_windows instead of
11044 delete_all_subwindows.
11045 * window.c (Fwindow_nest, Fset_window_nest)
11046 (Fset_window_new_total, Fset_window_new_normal)
11047 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11048 (delete_all_subwindows): Rename to delete_all_child_windows.
11049 (Fdelete_other_windows_internal, Fset_window_configuration):
11050 Call delete_all_child_windows instead of delete_all_subwindows.
11051 * frame.c (delete_frame): Call delete_all_child_windows instead
11052 of delete_all_subwindows.
11053
11054 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11055
11056 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11057 This is also needed for porting to any host where GC_MARK_STACK is
11058 not GC_MAKE_GCPROS_NOOPS.
11059 (which_symbols): Use it.
11060
11061 2011-11-07 Kenichi Handa <handa@m17n.org>
11062
11063 * coding.c (coding_set_destination): Check coding->src_pos only
11064 when coding->src_object is a buffer (bug#9910).
11065
11066 * process.c (send_process): Set the member src_multibyte of coding
11067 to 0 (bug#9911) when sending a unibyte text.
11068
11069 * callproc.c (Fcall_process): Set the member src_multibyte of
11070 process_coding to 0 (bug#9912).
11071
11072 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11073
11074 * xmenu.c (cleanup_widget_value_tree): New function.
11075 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11076 calling free_menubar_widget_value_tree directly (Bug#9830).
11077
11078 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11079
11080 Fix some portability problems with 'inline'.
11081 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11082 (window_box_width, window_box_left, window_box_left_offset)
11083 (window_box_right, window_box_right_offset): Declare extern.
11084 Otherwise, these inline functions do not conform to C99 and
11085 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11086 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11087 * intervals.c (adjust_intervals_for_insertion)
11088 (adjust_intervals_for_deletion): Now extern, because otherwise the
11089 extern inline functions 'offset_intervals' couldn't refer to it.
11090 (static_offset_intervals): Remove.
11091 (offset_intervals): Rewrite using the old contents of
11092 static_offset_intervals. The old version didn't conform to C99
11093 because an extern inline function contained a reference to an
11094 identifier with static linkage.
11095
11096 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11097
11098 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11099 GC.
11100
11101 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11102
11103 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11104 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11105 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11106 return Qleft_to_right.
11107
11108 2011-11-06 Chong Yidong <cyd@gnu.org>
11109
11110 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11111 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11112 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11113 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11114 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11115 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11116 (Fwindow_vscroll): Doc fix.
11117 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11118 argument, since it makes no sense to pass a live window and for
11119 consistency with window-child.
11120
11121 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11122
11123 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11124 support MSVC.
11125
11126 2011-11-05 Jason Rumney <jasonr@gnu.org>
11127
11128 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11129 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11130 fonts (Bug#6029).
11131 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11132 bitwise arithmetic preventing use of unicode-sip and non-truetype
11133 opentype fonts.
11134
11135 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11136
11137 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11138 "emacs"-only part.
11139
11140 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11141 initialization code to keep similarity to xfns.c after changes
11142 from 2011-11-05.
11143
11144 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11145
11146 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11147 (unwind_create_frame): New function (Bug#9943).
11148 (Fx_create_frame): Restructure code to be more similar to the one in
11149 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11150 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11151 Move terminal->reference_count++ just before making the frame official
11152 (Bug#9943).
11153
11154 * nsterm.m (x_free_frame_resources): New function.
11155 (x_destroy_window): Move code to x_free_frame_resources.
11156
11157 * xfns.c (unwind_create_frame): Fix comment.
11158 (Fx_create_frame, x_create_tip_frame):
11159 Move terminal->reference_count++ just before making the frame
11160 official. Move initialization of image_cache_refcount and
11161 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11162
11163 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11164
11165 Support MSVC build with newer versions of Visual Studio.
11166 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11167 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11168 nt/gmake.defs.
11169
11170 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11171 which are not supported by MSVC.
11172 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11173 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11174 bitfields.
11175 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11176 types in bitfields.
11177 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11178
11179 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11180
11181 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11182
11183 Support MSVC build with newer versions of Visual Studio.
11184 * w32.c: Don't include w32api.h for MSVC.
11185 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11186
11187 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11188 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11189 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11190 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11191 e_* cousins.
11192 (alloca) [_MSC_VER]: Define to _alloca.
11193
11194 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11195
11196 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11197
11198 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11199
11200 * xdisp.c (note_mouse_highlight): If either of
11201 previous/next-single-property-change returns nil, treat that as
11202 the beginning or the end of the buffer. (Bug#9955)
11203
11204 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11205
11206 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11207 label is not null (Bug#9951).
11208 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11209 may be NULL.
11210
11211 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11212
11213 * window.c (Fwindow_body_size): Mention in the doc string that the
11214 return value is in frame's canonical units. (Bug#9949)
11215
11216 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11217
11218 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11219
11220 * w32fns.c (unwind_create_frame): If needed, free the glyph
11221 matrices of the partially constructed frame. (Bug#9943)
11222 * xfns.c (unwind_create_frame): Likewise.
11223
11224 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11225
11226 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11227 Don't stop backward scan on the continuation glyph, even though
11228 its CHARPOS is positive.
11229 (mouse_face_from_buffer_pos, note_mouse_highlight):
11230 Rename cover_string to disp_string.
11231
11232 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11233
11234 * window.c (temp_output_buffer_show): Don't use
11235 Vtemp_buffer_show_specifiers.
11236 (Vtemp_buffer_show_specifiers): Remove unused variable.
11237
11238 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11239
11240 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11241 past the beginning of the current glyph matrix.
11242
11243 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11244
11245 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11246 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11247 HAVE_GTK3 (Bug#9869).
11248
11249 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11250 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11251
11252 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11253
11254 * xterm.c: Declare x_handle_net_wm_state to return int.
11255 (handle_one_xevent): Check if we are iconified but don't have
11256 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11257 (get_current_wm_state): Return non-zero if not hidden,
11258 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11259 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11260 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11261 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11262
11263 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11264
11265 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11266 so that this new function doesn't get optimized away by a
11267 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11268
11269 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11270
11271 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11272
11273 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11274
11275 Fix the `xbytecode' command.
11276 * .gdbinit (xprintbytestr): New command.
11277 (xwhichsymbols): Rename from `which'; all callers changed.
11278 (xbytecode): Print the byte-code string as well.
11279
11280 2011-10-29 Kim Storm <storm@cua.dk>
11281
11282 * alloc.c (which_symbols): New function.
11283
11284 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11285
11286 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11287 line. (Bug#9903)
11288
11289 2011-10-29 Glenn Morris <rgm@gnu.org>
11290
11291 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11292 Not clear what it was for, and it causes various bugs. (Bug#9839)
11293
11294 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11295
11296 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11297 possible random value that matches one of those tested as
11298 condition to clear the mouse face.
11299
11300 2011-10-28 Chong Yidong <cyd@gnu.org>
11301
11302 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11303
11304 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11305
11306 * window.c (make_window): Initialize phys_cursor_on_p.
11307
11308 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11309
11310 * lisp.h (struct Lisp_Symbol): Update comments.
11311
11312 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11313
11314 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11315
11316 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11317
11318 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11319 <oslsachem@gmail.com> for helping to debug this.
11320
11321 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11322 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11323 (g_b_init_get_glyph_outline_w): New static variables.
11324 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11325 (GetGlyphOutlineW_Proc): New typedefs.
11326 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11327 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11328 New functions.
11329 (w32font_open_internal, compute_metrics):
11330 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11331 instead of calling the "wide" APIs directly.
11332
11333 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11334
11335 * w32.h (syms_of_w32font): Add prototype.
11336
11337 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11338
11339 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11340 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11341 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11342 (Fmove_to_window_line): Doc fix.
11343
11344 2011-10-27 Chong Yidong <cyd@gnu.org>
11345
11346 * process.c (make_process): Set gnutls_state to NULL.
11347
11348 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11349 non-NULL, regardless of GNUTLS_INITSTAGE.
11350 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11351 an error. Set process slots as soon as we allocate them.
11352
11353 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11354
11355 2011-10-27 Chong Yidong <cyd@gnu.org>
11356
11357 * gnutls.c (emacs_gnutls_deinit): New function.
11358 Deallocate credentials structures as well as calling gnutls_deinit.
11359 (Fgnutls_deinit, Fgnutls_boot): Use it.
11360
11361 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11362 (deactivate_process): Call emacs_gnutls_deinit.
11363
11364 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11365
11366 * image.c (x_create_x_image_and_pixmap):
11367 * w32.c (sys_rename, w32_delayed_load):
11368 * w32font.c (fill_in_logfont):
11369 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11370
11371 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11372
11373 * w32fns.c (w32_default_color_map): New function,
11374 extracted from Fw32_default_color_map.
11375 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11376
11377 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11378
11379 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11380
11381 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11382
11383 * keyboard.c (test_undefined): New function (bug#9751).
11384 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11385
11386 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11387
11388 * sysdep.c (init_sys_modes): Fix the check for the controlling
11389 terminal (Bug#6649).
11390
11391 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11392
11393 * dispextern.h (struct bidi_it): New member next_en_type.
11394
11395 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11396 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11397 current character, check also for next_en_type being WEAK_EN.
11398 (bidi_resolve_weak): Don't enter the expensive loop if the current
11399 position is before next_en_pos. Record the bidi type of the first
11400 non-ET, non-BN character we find, in addition to its position.
11401 (bidi_level_of_next_char): Invalidate next_en_type when
11402 next_en_pos is over-stepped.
11403
11404 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11405
11406 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11407 * editfns.c: Rewrite current-time-zone so that it invokes
11408 the equivalent of (format-time-string "%Z") to get the time zone name.
11409 This fixes a bug when the time zone name contains characters that
11410 need converting from the system time locale to Emacs internal format.
11411 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11412 that patch fixed format-time-string to do the conversion, but
11413 I forgot to fix current-time-zone.
11414 (format_time_string): New function, containing most of
11415 what Fformat_time_string used to contain.
11416 (Fformat_time_string): Rewrite in terms of format_time_string.
11417 This doesn't change this function's behavior.
11418 (current-time-zone): Rewrite to use format_time_string.
11419 This fixes the bug reported by Michael Schierl in
11420 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11421 Jason Rumney's 2007-06-07 change worked around this bug, but
11422 didn't fix it.
11423 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11424
11425 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11426
11427 * xdisp.c (start_display): If the character at POS is displayed
11428 via a display vector, reset IT->current.dpvec_index to zero.
11429 (try_window_reusing_current_matrix): If a line ends in a display
11430 vector or the next line starts in a display vector, continue
11431 redrawing the window even though the character position of
11432 start_row was reached.
11433 (Bug#9771, part 2)
11434
11435 2011-10-18 Chong Yidong <cyd@gnu.org>
11436
11437 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11438 with nobreak-char-display too.
11439
11440 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11441
11442 Fix part 3 of bug#9771.
11443 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11444 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11445 non-neutral characters if the current character is a paragraph
11446 separator (a.k.a. Newline). This avoids running the same
11447 expensive loop twice, once when we consume the preceding newline
11448 and the other time when the line actually needs to be displayed.
11449 Avoid the loop when we see neutrals on the base embedding level
11450 following a character whose directionality is the same as the
11451 paragraph's. This avoids running the expensive loop when a line
11452 ends in a long sequence of neutrals, like control characters.
11453 Add assertion against STRONG_AL type. Slightly rearrange code
11454 that determines the type of a neutral given the first non-neutral
11455 that follows it.
11456 (bidi_level_of_next_char): Set next_en_pos to zero when
11457 invalidating its info.
11458
11459 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11460
11461 * xdisp.c (push_display_prop): Determine whether to record string
11462 or buffer position by IT->string, not by IT->method. Allow
11463 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11464 (move_it_vertically_backward): Don't look for character position
11465 immediately after the newline when in a continuation line.
11466 (Bug#9771, part 1)
11467
11468 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11469
11470 * window.c (coordinates_in_window): Rewrite and delabelize
11471 vertical border check. (Bug#5357) (Bug#9618)
11472
11473 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11474
11475 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11476 errors in XSetWindowBorder (bug#9310).
11477
11478 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11479
11480 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11481 avoid crash when xmalloc overrun checking is enabled.
11482
11483 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11484
11485 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11486 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11487 cursor motion with <left> and <right> arrow keys.
11488
11489 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11490 some callers set that themselves.
11491
11492 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11493
11494 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11495 display string and the previous row comes from the same string and
11496 is empty. (Bug#9739) (Bug#9738)
11497
11498 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11499
11500 * doc.c (get_doc_string): Encode file name (bug#9735).
11501
11502 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11503
11504 * bidi.c (bidi_level_of_next_char):
11505 * xdisp.c (get_visually_first_element): Remove old incorrect
11506 comments regarding the Unicode Line Separator character.
11507
11508 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11509
11510 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11511
11512 * alloc.c (Fgc_status): Do not access beyond zombies array
11513 boundary if nzombies > MAX_ZOMBIES.
11514 * alloc.c (dump_zombies): Add missing format specifier.
11515
11516 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11517
11518 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11519 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11520
11521 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11522 Some packages use them to denote characters with modifiers.
11523
11524 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11525
11526 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11527 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11528 matching a pp-number. Rename parameter var to var1.
11529
11530 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11531
11532 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11533
11534 2011-10-08 Glenn Morris <rgm@gnu.org>
11535
11536 * callint.c (Fcall_interactively): Give a more explicit error for the
11537 'c' case with a non-character input. (Bug#8479)
11538
11539 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11540
11541 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11542 lines.
11543 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11544 lines that are hscrolled on the left.
11545
11546 * dispnew.c (buffer_posn_from_coords): Account for a possible
11547 presence of header-line. (Bug#4426)
11548
11549 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11550
11551 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11552 Don't advertise functionality which we discourage or doesn't work.
11553
11554 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11555
11556 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11557 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11558 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11559 this makes Emacs dump core during garbage collection on rare
11560 occasions. sizeof is obviously inferior to offsetof here, so
11561 stick with offsetof.
11562 (GC_POINTER_ALIGNMENT): New macro.
11563 (mark_memory): Omit 3rd (offset) arg; caller changed.
11564 Don't assume EMACS_INT alignment is the same as pointer alignment.
11565
11566 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11567
11568 * keyboard.c (read_key_sequence_remapped): New var.
11569 (read_key_sequence): Compute remapping in the right buffer.
11570 (command_loop_1): Use read_key_sequence's remapping directly.
11571
11572 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11573
11574 * dired.c (file_name_completion): Don't expand file name.
11575 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11576 before checking file name handler.
11577
11578 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11579 they've been requested explicitly (bug#9591).
11580
11581 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11582
11583 * keymap.c (Fsingle_key_description): Use make_specified_string
11584 instead of build_string to build string from push_key_description.
11585 (Bug#5193)
11586
11587 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11588
11589 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11590 This fixes a Y2038 bug on 64-bit hosts.
11591 * buffer.c (reset_buffer):
11592 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11593 (Fclear_buffer_auto_save_failure):
11594 Use 0, not -1, to represent an unset failure time, since time_t
11595 might not be signed.
11596
11597 Remove dependency on glibc malloc internals.
11598 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11599 Move back here from lisp.h, but with their new implementations.
11600 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11601 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11602 * charset.c (charset_table_init): New static var.
11603 (syms_of_charset): Use it instead of xmalloc. This removes a
11604 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11605 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11606 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11607 Move back to alloc.c.
11608 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11609 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11610
11611 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11612
11613 * nsterm.m (windowDidResize): Call x_set_window_size only when
11614 ns_in_resize is true. Otherwise set pixelwidth/height and
11615 call change_frame_size (Bug#9628).
11616
11617 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11618
11619 Port --enable-checking=all to Fedora 14 x86-64.
11620 * charset.c (syms_of_charset): Also account for glibc malloc's
11621 internal overhead when calculating the initial malloc maximum.
11622
11623 Port --enable-checking=all to Fedora 14 x86.
11624 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11625 Move to lisp.h.
11626 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11627 (overrun_check_realloc, overrun_check_free):
11628 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11629 That way, xmalloc returns a properly-aligned pointer even if
11630 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11631 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11632 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11633 into account when calculating the initial malloc maximum.
11634 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11635 Move here from alloc.c, so that charset.c can use it too.
11636 Properly align; the old code wasn't right for common 32-bit hosts
11637 when configured with --enable-checking=all.
11638 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11639 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11640
11641 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11642
11643 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11644 use EDOM.
11645
11646 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11647
11648 * xdisp.c (compute_display_string_end): If there's no display
11649 string at CHARPOS, return -1.
11650
11651 * bidi.c (bidi_fetch_char): When compute_display_string_end
11652 returns a negative value, treat the character as a normal
11653 character not covered by a display string. (Bug#9624)
11654
11655 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11656
11657 * lread.c (Fread_from_string): Fix typo in docstring.
11658
11659 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11660
11661 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11662 newline, reseat the iterator instead of bidi-iterating there one
11663 character at a time. (Bug#9610)
11664 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11665 TO_CHARPOS if the bidi iterator is at base embedding level.
11666
11667 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11668
11669 * lread.c (readevalloop): Use correct code for NBSP.
11670 (read1): Likewise. (Bug#9608)
11671
11672 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11673
11674 * dbusbind.c (Fdbus_register_signal): When service is not
11675 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11676
11677 2011-09-25 Glenn Morris <rgm@gnu.org>
11678
11679 * buffer.c (truncate-lines): Doc fix.
11680
11681 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11682
11683 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11684 (Fset_window_next_buffers): Doc fix.
11685
11686 2011-09-24 Glenn Morris <rgm@gnu.org>
11687
11688 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11689
11690 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11691
11692 Fix minor problems found by static checking.
11693 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11694 * indent.c (Fvertical_motion): Fix == vs = typo.
11695
11696 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11697
11698 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11699 Default value is now t. Doc fix.
11700
11701 * indent.c (Fvertical_motion): Compute and apply the overshoot
11702 logic when moving up, not only when moving down. Fix the
11703 confusing name and values of the it_overshoot_expected variable;
11704 logic changes accordingly. (Bug#9254) (Bug#9549)
11705
11706 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11707 CHARPOS is covered by a display string which includes newlines.
11708 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11709 is covered by a display string with embedded newlines.
11710
11711 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11712
11713 * dbusbind.c (Fdbus_register_signal): Add match rule to
11714 Vdbus_registered_objects_table. (Bug#9581)
11715 (Fdbus_register_method, Vdbus_registered_objects_table):
11716 Fix docstring.
11717
11718 2011-09-24 Jim Meyering <meyering@redhat.com>
11719
11720 do not ignore write error for any output size
11721 The previous change was incomplete.
11722 While it makes emacs --batch detect the vast majority of stdout
11723 write failures, errors were still ignored whenever the output size is
11724 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11725 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11726 && echo FAIL: ignored write error
11727 FAIL: ignored write error
11728 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11729 && echo FAIL: ignored write error
11730 FAIL: ignored write error
11731 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11732
11733 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11734
11735 * emacs.c (Fkill_emacs): In noninteractive mode exit
11736 non-successfully if a write error occurred on stdout. (Bug#9574)
11737
11738 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11739
11740 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11741 the xassert test.
11742
11743 * dispextern.h (struct it): Update the comment documenting what
11744 can it->OBJECT be.
11745
11746 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11747
11748 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11749 a display string, extend search for cursor position to end of row.
11750 (find_row_edges): If the row ends in a newline from a display
11751 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11752 Handle the case of a display string with multiple newlines.
11753 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11754 non-empty line. Fixes confusing cursor motion with arrow keys at
11755 the beginning of a line that starts with whitespace.
11756
11757 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11758
11759 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11760 (bug#9493).
11761
11762 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11763
11764 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11765 boolean (Bug#9154).
11766
11767 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11768
11769 * xdisp.c (display_line): Record maximum and minimum buffer
11770 positions even if no glyphs were produced (e.g., by a zero-width
11771 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11772 buffer positions that will be removed from the glyph row because
11773 they don't fit.
11774 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11775 column is beyond frame width: don't subtract 1 "pixel" when
11776 computing width of the stretch.
11777 (reseat_at_next_visible_line_start): Undo the change made on
11778 2011-09-17 that saved paragraph information and restored it after
11779 the call to `reseat'. (Bug#9545)
11780
11781 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11782
11783 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11784 and turn window cursor on if cleared (Bug#9415).
11785
11786 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11787
11788 * search.c (boyer_moore): Take unibyte characters from pattern
11789 literally. (Bug#9458)
11790
11791 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11792
11793 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11794
11795 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11796
11797 Fix minor problem found by static checking.
11798 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11799 initialized, to pacify gcc -Wuninitialized.
11800
11801 * fileio.c: Report proper errno when syscall falls.
11802 (Finsert_file_contents): Save and restore errno,
11803 so that report_file_error outputs the correct diagnostic.
11804 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11805
11806 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11807
11808 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11809
11810 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11811
11812 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11813 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11814
11815 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11816
11817 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11818 about the current paragraph and restore it after the call to reseat.
11819
11820 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11821 (bidi_find_paragraph_start): Search back for paragraph beginning
11822 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11823 (bidi_move_to_visually_next): Only trigger paragraph-related
11824 computations when the last character is a newline or at EOB, not
11825 just any NEUTRAL_B. (Bug#9470)
11826
11827 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11828 truncated lines if point is covered by a display string. (Bug#9524)
11829
11830 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11831
11832 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11833 (cons_to_x_long): New function.
11834 (lisp_data_to_selection_data): Use it. Correct the test for
11835 short-versus-long data; it was negated. Break out of vector
11836 loop, for efficiency, when a long datum is discovered.
11837
11838 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11839
11840 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11841
11842 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11843
11844 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11845 GCC PR/17406) by declaring this function with external scope.
11846
11847 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11848
11849 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11850 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11851
11852 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11853
11854 * editfns.c (Fformat): Correctly handle text properties on "%%".
11855
11856 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11857
11858 * xterm.c (x_draw_composite_glyph_string_foreground):
11859 * w32term.c (x_draw_composite_glyph_string_foreground):
11860 * term.c (encode_terminal_code):
11861 * composite.c (composition_update_it, get_composition_id):
11862 * xdisp.c (get_next_display_element)
11863 (fill_composite_glyph_string): Add comments about special meaning
11864 of TAB characters in a composition.
11865
11866 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11867
11868 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11869 This occurs when processing a multibyte format.
11870 Problem reported by Wolfgang Jenker.
11871
11872 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11873
11874 * xdisp.c (try_cursor_movement): Only check for exact match if
11875 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11876
11877 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11878
11879 Remove unused external symbols.
11880 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11881 * xdisp.c (calc_pixel_width_or_height): Now static.
11882 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11883 * indent.c (check_display_width):
11884 * w32term.c: Fix comment to match code.
11885 * xterm.c, xterm.h (x_catching_errors): Remove.
11886
11887 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11888
11889 * xselect.c: Use signed conversions more consistently (Bug#9498).
11890 (selection_data_to_lisp_data): Assume incoming selection data are
11891 signed integers, not unsigned. This is to be consistent with
11892 outgoing selection data, which was modified to use signed integers
11893 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11894 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11895 expects long, not unsigned long.
11896
11897 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11898
11899 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11900 computation of loop end. Reported by Johan Bockgård
11901 <bojohan@gnu.org>.
11902
11903 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11904
11905 * frame.c (Fother_visible_frames_p): Function deleted.
11906
11907 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11908
11909 * indent.c (compute_motion): Process display vector front to back
11910 rather than the other way around. (Bug#2496)
11911
11912 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11913
11914 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11915
11916 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11917
11918 * minibuf.c (Fread_from_minibuffer): Doc fix.
11919
11920 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11921
11922 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11923 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11924
11925 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11926
11927 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11928 value for non-existent files.
11929
11930 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11931
11932 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11933 set its "size" to -1. This will set the modtime_size field of
11934 the corresponding buffer to -1, which is what
11935 verify-visited-file-modtime expects for files that do not exist.
11936 (Bug#9139)
11937
11938 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11939
11940 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11941 here ...
11942 * lisp.h: ... from here. push_key_description is no longer
11943 defined in keyboard.c, so its declaration should not be in
11944 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11945 logically belongs with push_key_description.
11946
11947 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11948
11949 * buffer.h: Include <sys/types.h> instead of <time.h>.
11950 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11951 Problem reported by Herbert J. Skuhra.
11952
11953 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11954
11955 * xml.c (parse_region): Make the parsing work for
11956 non-comment-starting XML files again (bug#9144).
11957
11958 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11959
11960 * image.c (gif_load): Fix calculation of bottom and right corner.
11961 (Bug#9468)
11962
11963 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11964
11965 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11966 redisplay in small windows.
11967
11968 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11969
11970 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11971
11972 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11973
11974 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11975 Operate on live windows only.
11976
11977 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11978
11979 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11980
11981 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11982
11983 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11984 only under bidi iteration.
11985
11986 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11987
11988 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11989
11990 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11991
11992 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11993 Without this fix, the command to link temacs failed due to an
11994 undefined symbol __builtin_isnan. This is because
11995 /usr/include/iso/math_c99.h #defines isnan(x) to
11996 __builtin_isnan(x), but the bundled gcc, which identifies itself
11997 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11998 a __builtin_isnan.
11999 * floatfns.c (isnan): #undef, and then #define to a clone of
12000 what's in data.c.
12001 (Fisnan): Always define, since it's always available now.
12002 (syms_of_floatfns): Always define isnan at the Lisp level.
12003
12004 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12005
12006 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12007
12008 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12009
12010 * fileio.c: Fix bugs with large file offsets (Bug#9428).
12011 The previous code assumed that file offsets (off_t values) fit in
12012 EMACS_INT variables, which is not true on typical 32-bit hosts.
12013 The code messed up by falsely reporting buffer overflow in cases
12014 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12015 when "big" contains more than 2**29 bytes, even though this
12016 inserts just one byte and does not overflow the buffer.
12017 (Finsert_file_contents): Store file offsets as off_t
12018 values, not as EMACS_INT values. Check for overflow when
12019 converting between EMACS_INT and off_t. When checking for
12020 buffer overflow or for overlap, take the offsets into account.
12021 Don't use EMACS_INT for small values where int suffices.
12022 When checking for overlap, fix a typo: ZV was used where
12023 ZV_BYTE was intended.
12024 (Fwrite_region): Don't assume off_t fits into 'long'.
12025 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12026
12027 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12028
12029 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12030
12031 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12032
12033 sprintf-related integer and memory overflow issues (Bug#9412).
12034
12035 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12036 (esprintf, exprintf, evxprintf): New functions.
12037 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12038 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12039 (modify_event_symbol): Do not assume that the length of
12040 name_alist_or_stem is safe to alloca and fits in int.
12041 (Fexecute_extended_command): Likewise for function name and binding.
12042 (Frecursion_depth): Wrap around reliably on integer overflow.
12043 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12044 since some callers pass EMACS_INT values.
12045 (Fsingle_key_description): Don't crash if symbol name contains more
12046 than MAX_ALLOCA bytes.
12047 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12048 (get_minibuffer): Arg is now EMACS_INT, not int.
12049 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12050 (esprintf, exprintf, evxprintf): New decls.
12051 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12052
12053 * dbusbind.c (signature_cat): New function.
12054 (xd_signature, Fdbus_register_signal):
12055 Do not overrun buffer; instead, report string overflow.
12056
12057 * dispnew.c (add_window_display_history): Don't overrun buffer.
12058 Truncate instead; this is OK since it's just a log.
12059
12060 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12061 even if the time zone offset is outlandishly large.
12062 Don't mishandle offset == INT_MIN.
12063
12064 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12065 when creating daemon; the previous buffer-overflow check was incorrect.
12066
12067 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12068 which has the guts of the old verror function.
12069
12070 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12071 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12072
12073 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12074 (font_unparse_xlfd): Don't blindly alloca long strings.
12075 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12076 fits in int, when using sprintf. Use single snprintf to count
12077 length of string rather than counting it via multiple sprintfs;
12078 that's simpler and more reliable.
12079 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12080 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12081 sprintf, in case result does not fit in int.
12082
12083 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12084 (fontset_from_font): Print it.
12085
12086 * frame.c (tty_frame_count): Now printmax_t, not int.
12087 (make_terminal_frame, set_term_frame_name): Print it.
12088 (x_report_frame_params): In X, window IDs are unsigned long,
12089 not signed long, so print them as unsigned.
12090 (validate_x_resource_name): Check for implausibly long names,
12091 and don't assume name length fits in 'int'.
12092 (x_get_resource_string): Don't blindly alloca invocation name;
12093 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12094 not fit in int.
12095
12096 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12097 (xg_check_special_colors, xg_set_geometry):
12098 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12099
12100 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12101 Use esprintf, not sprintf, in case result does not fit in int.
12102
12103 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12104 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12105 it as a large positive number.
12106 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12107 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12108
12109 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12110 in case result does not fit in int.
12111
12112 * print.c (float_to_string): Detect width overflow more reliably.
12113 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12114 buffer overrun. Don't assume list length fits in 'int'. Treat
12115 print length of 0 as 0, not as infinity; to be consistent with other
12116 uses of print length in this function. Don't overflow print length
12117 index. Don't assume hash table size fits in 'long', or that
12118 vectorlike size fits in 'unsigned long'.
12119
12120 * process.c (make_process): Use printmax_t, not int, to format
12121 process-name gensyms.
12122
12123 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12124
12125 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12126 to avoid potential buffer overrun.
12127
12128 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12129 if X resource line is longer than 512 bytes.
12130
12131 * xfns.c (x_window): Make sprintf buffer a bit bigger
12132 to avoid potential buffer overrun.
12133
12134 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12135
12136 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12137
12138 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12139
12140 Integer overflow fixes for scrolling, etc.
12141 Without these, Emacs silently mishandles large integers sometimes.
12142 For example, "C-u 4294967297 M-x recenter" was treated as if
12143 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12144
12145 * xdisp.c (try_window_id): Check Emacs fixnum range before
12146 converting to 'int'.
12147
12148 * window.c (window_scroll_line_based, Frecenter):
12149 Check that an Emacs fixnum is in range before assigning it to 'int'.
12150 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12151 values converted from Emacs fixnums.
12152 (Frecenter): Don't wrap around a line count if it is out of 'int'
12153 range; instead, treat it as an extreme value.
12154 (Fset_window_configuration, compare_window_configurations):
12155 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12156
12157 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12158 that can exceed INT_MAX. Check that EMACS_INT value is in range
12159 before assigning it to the (possibly-narrower) index.
12160 (match_limit): Don't assume that a fixnum can fit in 'int'.
12161
12162 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12163 exceed INT_MAX.
12164
12165 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12166 (Fvertical_motion): Don't wrap around LINES values that don't fit
12167 in 'int'. Instead, treat them as extreme values. This is good
12168 enough for windows, which can't have more than INT_MAX lines anyway.
12169
12170 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12171
12172 * Require libxml/parser.h to avoid compilation warning.
12173
12174 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12175
12176 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12177 since this reportedly can destroy thread storage.
12178
12179 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12180
12181 * syntax.c (find_defun_start): Update all cache variables if
12182 exiting early (Bug#9401).
12183
12184 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12185
12186 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12187
12188 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12189 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12190 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12191
12192 * term.c (tty_append_glyph): New function.
12193 (produce_stretch_glyph): Static function and its prototype deleted.
12194
12195 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12196 Add prototypes.
12197
12198 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12199
12200 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12201 when checking :margin (Bug#9390).
12202 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12203 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12204 so that the name doesn't mislead. All uses changed.
12205
12206 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12207
12208 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12209 set_tty_hooks.
12210
12211 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12212
12213 * xdisp.c (move_it_to): Don't bail out early when reaching
12214 position beyond to_charpos, if we are scanning backwards.
12215 (move_it_vertically_backward): When DY == 0, make sure we get to
12216 the first character in the line after the newline.
12217
12218 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12219
12220 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12221 (ccl_driver): Do not generate an out-of-range pointer.
12222 (Fccl_execute_on_string): Remove unnecessary check for
12223 integer overflow, noted by Stefan Monnier in
12224 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12225 Remove a FIXME that didn't need fixing.
12226 Simplify the newly-introduced buffer reallocation code.
12227
12228 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12229
12230 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12231
12232 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12233
12234 Integer and memory overflow issues (Bug#9196).
12235
12236 * doc.c (get_doc_string): Rework so that
12237 get_doc_string_buffer_size is the actual buffer size, rather than
12238 being 1 less than the actual buffer size; this makes xpalloc more
12239 convenient.
12240
12241 * image.c (x_allocate_bitmap_record, cache_image):
12242 * xselect.c (Fx_register_dnd_atom):
12243 Simplify previous changes by using xpalloc.
12244
12245 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12246 since either will do and ptrdiff_t is convenient with xpalloc.
12247
12248 * charset.c (charset_table_size)
12249 (struct charset_sort_data.priority): Now ptrdiff_t.
12250 (charset_compare): Don't overflow if priorities differ greatly.
12251 (Fsort_charsets): Don't assume list length fits in int.
12252 Check for size-calculation overflow when allocating sort data.
12253 (syms_of_charset): Allocate an initial charset table that is
12254 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12255
12256 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12257
12258 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12259 The actual value is always <= INT_MAX, and leaving it unsigned made
12260 overflow checking harder.
12261
12262 * dispextern.h (struct glyph_matrix.rows_allocated)
12263 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12264 with xpalloc. The values are still always <= INT_MAX.
12265
12266 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12267
12268 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12269 (SAFE_NALLOCA): New macro.
12270
12271 * region-cache.c (struct boundary.pos, find_cache_boundary)
12272 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12273 (set_cache_region, invalidate_region_cache)
12274 (revalidate_region_cache, know_region_cache, region_cache_forward)
12275 (region_cache_backward, pp_cache):
12276 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12277 so that ptrdiff_t * can be passed to xpalloc.
12278 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12279 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12280 (pp_cache): Don't assume cache_len fits in int.
12281 * region-cache.h: Adjust extern decls to match.
12282
12283 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12284 EMACS_INT, since either will do, for xpalloc.
12285
12286 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12287 (xnmalloc, xnrealloc, xpalloc): New functions.
12288
12289 * bidi.c (bidi_shelve_header_size): New constant.
12290 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12291 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12292
12293 * bidi.c (bidi_cache_shrink):
12294 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12295 (overlay_strings):
12296 Don't update size of array until after memory allocation succeeds,
12297 because xmalloc/xrealloc may not return.
12298 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12299 now that we have proper integer overflow checking.
12300 (record_overlay_string, overlay_strings): Catch overflows when
12301 calculating size of overlay_str_buf.
12302
12303 * callproc.c (Fcall_process): Check for size overflow when
12304 calculating size of args2.
12305 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12306 Normally we prefer signed values, but sticking with ptrdiff_t would
12307 require adding more-complicated checks.
12308
12309 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12310 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12311 Redo buffer-overflow calculations to avoid integer overflow.
12312 Add a FIXME comment where memory seems to be over-allocated.
12313
12314 * character.c (Fstring): Check for size-calculation overflow.
12315
12316 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12317 unnecessary integer overflow. Check for size overflow.
12318 (encode_coding_object): Don't update size until xmalloc succeeds.
12319
12320 * composite.c (get_composition_id): Check for overflow in glyph
12321 length calculations.
12322
12323 Integer and memory overflow fixes for display code.
12324 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12325 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12326 (scrolling_window): Check for overflow in size calculations.
12327 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12328 Don't assume glyph table len fits in int.
12329 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12330 (row_table_size): Now ptrdiff_t, not int.
12331 (scrolling_window): Avoid overflow in size calculations.
12332 Don't update size until allocation succeeds.
12333 * fns.c (concat): Check for overflow in size calculations.
12334 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12335 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12336 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12337
12338 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12339 (get_doc_string): Check for size calculation overflow.
12340 Don't update size until allocation succeeds.
12341 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12342 EMACS_INT, where ptrdiff_t will do.
12343 (Fsubstitute_command_keys): Check for string overflow.
12344
12345 * editfns.c (set_time_zone_rule): Don't assume environment length
12346 fits in int.
12347 (message_length): Now ptrdiff_t, not int.
12348 (Fmessage_box): Don't update size until allocation succeeds.
12349 Don't assume message length fits in int.
12350 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12351
12352 * emacs.c (main): Do not reallocate argv, since there is a null at
12353 the end that can be overwritten, and this way there's no need to
12354 worry about size-calculation overflow.
12355 (sort_args): Check for size-calculation overflow.
12356
12357 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12358 alloc succeeds.
12359 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12360
12361 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12362 (x_set_scroll_bar_width, x_figure_window_size):
12363 Check for integer overflow.
12364 (x_set_alpha): Do not assume XINT fits in int.
12365
12366 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12367 This is for the members text_lines, text_cols, total_lines, total_cols,
12368 where the system imposes an 'int' limit.
12369
12370 * fringe.c (Fdefine_fringe_bitmap):
12371 Don't update size until alloc works.
12372
12373 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12374 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12375
12376 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12377 Check for size-calculation overflow.
12378 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12379 do, as we prefer signed integers.
12380 (id_to_widget.max_size, id_to_widget.used)
12381 (xg_store_widget_in_map, xg_remove_widget_from_map)
12382 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12383 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12384 Use and return ptrdiff_t, not int.
12385 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12386 * gtkutil.h: Change prototypes to match the above.
12387
12388 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12389 are duplicate now that they've been promoted to lisp.h.
12390 (x_allocate_bitmap_record, x_alloc_image_color)
12391 (make_image_cache, cache_image, xpm_load):
12392 Don't update size until alloc is done.
12393 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12394 (x_detect_edges):
12395 Check for size calculation overflow.
12396 (ct_colors_allocated_max): New constant.
12397 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12398 overflow.
12399
12400 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12401 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12402 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12403 Use ptrdiff_t, not int, to count maps.
12404 (read_char_minibuf_menu_prompt): Check for overflow in size
12405 calculations. Don't update size until allocation succeeds.
12406 Redo calculations to avoid overflow.
12407 * keyboard.h: Change prototypes to match the above.
12408
12409 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12410 to count maps.
12411 (current_minor_maps): Check for size calculation overflow.
12412 * keymap.h: Change prototypes to match the above.
12413
12414 * lread.c (read1, init_obarray): Don't update size until alloc done.
12415
12416 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12417 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12418
12419 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12420 Now ptrdiff_t, not int.
12421 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12422 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12423
12424 * process.c (Fnetwork_interface_list): Check for overflow
12425 in size calculation.
12426
12427 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12428
12429 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12430 overflow. Don't bother calling xmalloc when xrealloc will do.
12431
12432 * search.c (Freplace_match): Check for size calculation overflow.
12433 (Fset_match_data): Don't assume list lengths fit in 'int'.
12434
12435 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12436 for command line length. Do not attempt to address one before the
12437 beginning of an array, as that's not portable.
12438
12439 * term.c (max_frame_lines): Remove; unused.
12440 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12441 not int.
12442 (encode_terminal_code, calculate_costs): Check for size
12443 calculation overflow.
12444 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12445 table lengths and related sizes. Don't update size until alloc
12446 done. Redo calculations to avoid overflow.
12447 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12448
12449 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12450 subtracting pointers.
12451 (gobble_line): Check for overflow more carefully. Don't update size
12452 until alloc done.
12453
12454 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12455 Don't update size until alloc done.
12456 Redo size calculations to avoid overflow.
12457 Check for size calculation overflow.
12458 (main) [DEBUG]: Fix typo in invoking tparam1.
12459
12460 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12461 Use ptrdiff_t, not int, for sizes.
12462 (store_mode_line_noprop_char): Don't update size until alloc done.
12463
12464 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12465 Use ptrdiff_t, not int, for sizes.
12466 (Finternal_make_lisp_face, cache_face):
12467 Check for size calculation overflow.
12468 (cache_face): Treat size calculation overflows as if they were
12469 memory exhaustion (the usual treatment), rather than aborting.
12470
12471 * xfns.c (x_encode_text, x_set_name_internal)
12472 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12473 sizes, since they can exceed INT_MAX in size. Check for size
12474 calculation overflow.
12475
12476 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12477 (xg_select): Check for size calculation overflow.
12478 Don't update size until alloc done.
12479
12480 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12481 as sprintf is limited to int lengths.
12482
12483 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12484 (X_LONG_MIN): New macros.
12485 Use them to make the following changes clearer.
12486 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12487 This change doesn't affect the value now, but it may help remind
12488 future maintainers not to raise the value too much later.
12489 (SELECTION_QUANTUM): Remove, replacing with ...
12490 (selection_quantum): ... new function, which avoids overflow.
12491 All uses changed.
12492 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12493 assumption that selection length fits in 'int'.
12494 (x_reply_selection_request, x_handle_selection_request)
12495 (x_get_window_property, receive_incremental_selection)
12496 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12497 (lisp_data_to_selection_data, clean_local_selection_data):
12498 Use ptrdiff_t, not int, to record length of selection.
12499 (x_reply_selection_request, x_get_window_property)
12500 (receive_incremental_selection, x_property_data_to_lisp):
12501 Redo calculations to avoid overflow.
12502 (x_reply_selection_request): When sending hint, ceiling it at
12503 X_LONG_MAX rather than relying on wraparound overflow to send
12504 something.
12505 (x_get_window_property, receive_incremental_selection)
12506 (lisp_data_to_selection_data, x_property_data_to_lisp):
12507 Check for size-calculation overflow.
12508 (x_get_window_property, receive_incremental_selection)
12509 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12510 Don't store size until memory allocation succeeds.
12511 (x_get_window_property): Plug memory leak on memory exhaustion.
12512 Don't double-block input; malloc is safe here. Don't assume 2**34
12513 - 4 fits in unsigned long. Add an xassert to check
12514 XGetWindowProperty overflow. Be more careful about overflow
12515 calculations, and distinguish size from memory overflow better.
12516 (receive_incremental_selection): When tracing, don't assume
12517 unsigned int is less than INT_MAX.
12518 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12519 harmful) conversions of unsigned short to int.
12520 (lisp_data_to_selection_data): Don't assume that integers
12521 in the range -65535 through -1 fit in an X unsigned short.
12522 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12523 result parameters unless successful. Rely on cons_to_unsigned
12524 to report problems with elements; the old code wasn't right anyway.
12525 (x_check_property_data): Check for int overflow; we cannot use
12526 a wider type due to X limits.
12527 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12528
12529 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12530
12531 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12532 (x_term_init): Check for size calculation overflow.
12533 (x_color_cells): Don't store size until memory allocation succeeds.
12534 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12535 Don't assume alloca size is less than MAX_ALLOCA.
12536 (x_term_init): Don't assume length fits in int (sprintf is limited
12537 to int size).
12538
12539 Use ptrdiff_t for composition IDs.
12540 * character.c (lisp_string_width):
12541 * composite.c (composition_table_size, n_compositions)
12542 (get_composition_id, composition_gstring_from_id):
12543 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12544 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12545 * window.c (Frecenter):
12546 Use ptrdiff_t, not int, for composition IDs.
12547 * composite.c (get_composition_id): Check for integer overflow.
12548 * composite.h: Adjust prototypes to match the above changes.
12549
12550 Use ptrdiff_t for hash table indexes.
12551 * category.c (hash_get_category_set):
12552 * ccl.c (ccl_driver):
12553 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12554 * coding.c (coding_system_charset_list, detect_coding_system):
12555 * coding.h (struct coding_system.id):
12556 * composite.c (get_composition_id, gstring_lookup_cache):
12557 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12558 * image.c (xpm_get_color_table_h):
12559 * lisp.h (hash_lookup, hash_put):
12560 * minibuf.c (Ftest_completion):
12561 Use ptrdiff_t for hash table indexes, not int (which is too
12562 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12563 32-bit --with-wide-int hosts).
12564
12565 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12566 Add a FIXME comment about memory leaks.
12567 (syms_of_charset): Don't assume xmalloc returns.
12568
12569 Don't assume that stated character widths fit in int.
12570 * character.c (Fchar_width, c_string_width, lisp_string_width):
12571 * character.h (CHAR_WIDTH):
12572 * indent.c (MULTIBYTE_BYTES_WIDTH):
12573 Use sanitize_char_width to avoid undefined and/or bad behavior
12574 with outlandish widths.
12575 * character.h (sanitize_tab_width): Rename from sanitize_width,
12576 now that we have two such functions. All uses changed.
12577 (sanitize_char_width): New inline function.
12578
12579 Don't assume that tab-width fits in int.
12580 * character.h (sanitize_width): New inline function.
12581 (SANE_TAB_WIDTH): New macro.
12582 (ASCII_CHAR_WIDTH): Use it.
12583 * indent.c (sane_tab_width): Remove. All uses replaced by
12584 SANE_TAB_WIDTH (current_buffer).
12585 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12586
12587 * fileio.c: Integer overflow issues with file modes.
12588 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12589
12590 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12591 Remove unreachable code.
12592 (read_hex, load_charset_map_from_file): Check for integer overflow.
12593
12594 * xterm.c: Don't go over XClientMessageEvent limit.
12595 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12596 (x_send_scroll_bar_event): Likewise. Check that the size does not
12597 exceed limits imposed by XClientMessageEvent, as well as the usual
12598 ptrdiff_t and size_t limits.
12599
12600 * keyboard.c: Overflow, signedness and related fixes.
12601 (make_lispy_movement): Use same integer type in forward decl
12602 that is used in the definition.
12603 (read_key_sequence, keyremap_step):
12604 Change bufsize argument back to int, undoing my 2011-03-30 change.
12605 We prefer signed types, and int is wide enough here.
12606 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12607 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12608 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12609 length, not size_t. Use ptrdiff_t for index, not int.
12610 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12611 possibility of integer overflow.
12612
12613 Overflow, signedness and related fixes for images.
12614
12615 * dispextern.h (struct it.stack[0].u.image.image_id)
12616 (struct_it.image_id, struct image.id, struct image_cache.size)
12617 (struct image_cache.used, struct image_cache.ref_count):
12618 * gtkutil.c (update_frame_tool_bar):
12619 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12620 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12621 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12622 * nsmenu.m (update_frame_tool_bar):
12623 * xdisp.c (calc_pixel_width_or_height):
12624 * xfns.c (image_cache_refcount):
12625 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12626 on typical 64-bit hosts.
12627
12628 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12629 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12630 Omit unnecessary casts to int.
12631 (parse_image_spec): Check that integers fall into 'int' range
12632 when the callers expect that.
12633 (image_ascent): Redo ascent calculation to avoid int overflow.
12634 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12635 (lookup_image): Remove unnecessary tests.
12636 (xbm_image_p): Locals are now of int, not EMACS_INT,
12637 since parse_image_check makes sure they fit into int.
12638 (png_load, gif_load, svg_load_image):
12639 Prefer int to unsigned where either will do.
12640 (tiff_handler): New function, combining the cores of the
12641 old tiff_error_handler and tiff_warning_handler.
12642 This function is rewritten to use vsnprintf and thereby avoid
12643 stack buffer overflows. It uses only the features of vsnprintf
12644 that are common to both POSIX and native Microsoft.
12645 (tiff_error_handler, tiff_warning_handler): Use it.
12646 (tiff_load, gif_load, imagemagick_load_image):
12647 Don't assume :index value fits in 'int'.
12648 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12649 (imagemagick_load_image): Check that crop parameters fit into
12650 the integer types that MagickCropImage accepts. Don't assume
12651 Vimagemagick_render_type has a nonnegative value. Don't assume
12652 size_t fits in 'long'.
12653 (gs_load): Use printmax_t to print the widest integers possible.
12654 Check for integer overflow when computing image height and width.
12655
12656 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12657
12658 * xdisp.c (redisplay_window): Don't force window start if point
12659 will be invisible in the resulting window. (Bug#9324)
12660
12661 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12662
12663 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12664 the display spec is of the form `(space ...)'.
12665 (handle_display_spec): Return the value returned by
12666 handle_single_display_spec, not just 1 or zero.
12667 (handle_single_display_spec): If the display spec is of the form
12668 `(space ...)', and specifies display in the text area, return 2
12669 rather than 1.
12670 (try_cursor_movement): Check for the need to scroll more
12671 accurately, and prefer exact match for point under bidi.
12672 Don't advance `row' beyond the last row of the window.
12673
12674 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12675 into disp_prop; all users changed.
12676
12677 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12678 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12679 for the text covered by the display property.
12680
12681 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12682
12683 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12684 Change return value to nil.
12685 (Frecord_buffer): Delete unused function.
12686
12687 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12688
12689 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12690 buffers, return left-to-right.
12691 (set_cursor_from_row): Consider candidate row a win if its glyph
12692 represents a newline and point is on that newline. Fixes cursor
12693 positioning on the newline at EOL of R2L text within L2R
12694 paragraph, and vice versa.
12695 (try_cursor_movement): Check continued rows, in addition to
12696 continuation rows. Fixes unwarranted scroll when point enters a
12697 continued line of R2L text within an L2R paragraph, or vice versa.
12698 (cursor_row_p): Consider the case of point being equal to
12699 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12700 from the end of a short line to the beginning of a continued line
12701 of R2L text within L2R paragraph.
12702 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12703 composed characters.
12704
12705 * bidi.c (bidi_check_type): Use xassert.
12706 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12707 members.
12708
12709 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12710
12711 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12712 a character.
12713
12714 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12715
12716 * nsfont.m (ns_otf_to_script): Fix typo.
12717
12718 2011-08-22 Kenichi Handa <handa@m17n.org>
12719
12720 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12721 extra slot even if the purpose is char-code-property-table.
12722
12723 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12724
12725 * xdisp.c (redisplay_window): When computing centering_position,
12726 account for the height of the header line. (Bug#8874)
12727
12728 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12729 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12730 candidate is selected by the mouse, and that candidate has a
12731 composed character under the mouse.
12732
12733 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12734 coordinates reported by pos-visible-in-window-p for a composed
12735 character in column zero.
12736
12737 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12738
12739 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12740
12741 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12742
12743 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12744 consider it a hit if to_charpos is anywhere in the range of the
12745 composed buffer positions.
12746
12747 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12748
12749 * image.c (gif_load): Don't assume that each subimage has the same
12750 dimensions as the base image. Handle disposal method that is
12751 "undefined" by the gif spec (Bug#9335).
12752
12753 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12754
12755 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12756 (Fcondition_case): Document `debug' symbol in error handler.
12757
12758 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12759
12760 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12761 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12762 from an Org mode buffer to a Speedbar frame.
12763
12764 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12765 a composition, take its buffer position from IT->cmp_it.charpos.
12766 Fixes cursor positioning at the beginning of a line that begins
12767 with a composed character.
12768
12769 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12770
12771 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12772 character bidirectional type, use STRONG_L instead. Fixes crashes
12773 in a buffer produced by `describe-categories'.
12774
12775 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12776 members before the level stack, so they would be saved and
12777 restored when copying iterator state. Fixes incorrect reordering
12778 around TABs covered by display properties.
12779
12780 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12781
12782 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12783
12784 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12785
12786 * eval.c (internal_condition_case, internal_condition_case_1)
12787 (internal_condition_case_2, internal_condition_case_n):
12788 Remove unnecessary aborts (Bug#9081).
12789
12790 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12791
12792 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12793 has no `load' handler, try opening the file locally. (Bug#9311)
12794
12795 2011-08-16 Ken Brown <kbrown@cornell.edu>
12796
12797 * gmalloc.c: Expand comment.
12798
12799 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12800
12801 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12802 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12803
12804 2011-08-16 Ken Brown <kbrown@cornell.edu>
12805
12806 Fix memory allocation problems in Cygwin build (Bug#9273).
12807
12808 * unexcw.c ( __malloc_initialized): Declare external variable.
12809 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12810
12811 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12812 New variables.
12813 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12814 dumped emacs.
12815 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12816 in the static heap.
12817 [CYGWIN] (special_realloc): New function.
12818 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12819 requests to realloc storage in the static heap.
12820
12821 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12822
12823 * bidi.c (bidi_initialize): Remove unused local.
12824
12825 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12826
12827 * bidimirror.h:
12828 * biditype.h: Remove file.
12829 * makefile.w32-in ($(BLD)/bidi.$(O)):
12830 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12831
12832 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12833
12834 * chartab.c: Improve commentary for the uniprop_table API.
12835
12836 * bidi.c (bidi_paragraph_init): Support zero value of
12837 bidi_ignore_explicit_marks_for_paragraph_level.
12838 (bidi_initialize): Use uniprop_table instead of including
12839 biditype.h and bidimirror.h.
12840
12841 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12842 coordinates of the iterator when restoring from ppos_it.
12843 (Bug#9296)
12844
12845 2011-08-14 Kenichi Handa <handa@m17n.org>
12846
12847 * process.c (create_process): Call setup_process_coding_systems
12848 after the pid of the process is set to -1 (Bug#8162).
12849
12850 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12851
12852 * xdisp.c (move_it_in_display_line_to): Don't invoke
12853 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12854 ppos_it. Fixes vertical cursor motion when line beginning is
12855 covered by an image. (Bug#9296)
12856
12857 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12858
12859 * nsterm.h (ns_run_ascript): Declare.
12860 (NSAPP_DATA2_RUNASSCRIPT): Define.
12861
12862 * nsfns.m (as_script, as_result, as_status): New static variables.
12863 (ns_run_ascript): New function.
12864 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12865 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12866 the event loop. Get status from as_status (Bug#7276).
12867
12868 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12869 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12870 the event loop (Bug#7276).
12871
12872 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12873
12874 * gnutls.c (QCgnutls_bootprop_priority)
12875 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12876 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12877 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12878 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12879 (QCgnutls_bootprop_verify_hostname_error)
12880 (QCgnutls_bootprop_callbacks_verify): Rename from
12881 Qgnutls_bootprop_..., all uses changed.
12882
12883 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12884 uses changed.
12885
12886 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12887
12888 * xfaces.c (Qframe_set_background_mode): Now static.
12889 * dispextern.h (Qframe_set_background_mode): Remove decl.
12890
12891 * process.c (Fnetwork_interface_info): Declare local only if needed.
12892
12893 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12894
12895 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12896 (Fnetwork_interface_list): Allocate in increments of bytes instead
12897 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12898 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12899 sockaddr.
12900 (struct ifflag_def): notrailers is smart on OSX.
12901 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12902 Get hardware address with getifaddrs if available.
12903
12904 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12905
12906 * xdisp.c (iterate_out_of_display_property): xassert that
12907 IT->position is set to within IT->object's boundaries. Break from
12908 the loop as soon as EOB is reached; avoids infloops in redisplay
12909 when IT->position is set up wrongly due to some bug.
12910 Set IT->current to match the bidi iterator unconditionally.
12911 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12912 entry. Force push_it to save on the stack the current
12913 buffer/string position, to be restored by pop_it. Fix flags in
12914 the iterator structure wrt the object coming from a display
12915 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12916 properties. (Bug#9284)
12917
12918 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12919
12920 * fontset.c (fontset_get_font_group): Add proper type checks.
12921 (Bug#9172)
12922
12923 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12924
12925 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12926 and LC_VERSION_MIN_MACOSX.
12927 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12928 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12929
12930 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12931
12932 * xdisp.c (forward_to_next_line_start): Allow to use the
12933 no-display-properties-and-no-overlays under bidi display.
12934 Set disp_pos in the bidi iterator to avoid searches for display
12935 properties and overlays.
12936
12937 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12938
12939 * editfns.c (Fset_time_zone_rule): Document relationship with the
12940 setenv function.
12941
12942 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12943 the font entity extracted from the cache (Bug#8109).
12944
12945 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12946
12947 * composite.c (autocmp_chars): Don't reset point. That is done by
12948 restore_point_unwind (Bug#5984).
12949
12950 2011-08-07 Juri Linkov <juri@jurta.org>
12951
12952 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12953 to show the arg `TIME' instead of `TIMEVAL'.
12954
12955 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12956
12957 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12958 display property strides EOL and includes a newline, as in
12959 longlines-mode. (Bug#9254)
12960 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12961 word-wrap under bidirectional display. (Bug#9224)
12962
12963 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12964 is non-zero, even if the data buffer is NULL. Fixes a crash in
12965 vertical-motion with longlines-mode. (Bug#9254)
12966
12967 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12968
12969 * bidi.c <bidi_cache_total_alloc>: Now static.
12970 (bidi_initialize): Initialize bidi_cache_total_alloc.
12971
12972 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12973 cache. (Bug#9221)
12974
12975 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12976 amount allocated this far in `bidi_cache_total_alloc'.
12977 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12978 non-zero, only free the data buffer without restoring the cache
12979 contents. All callers changed.
12980
12981 * dispextern.h (bidi_unshelve_cache): Update prototype.
12982
12983 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12984 (move_it_in_display_line, move_it_to)
12985 (move_it_vertically_backward, move_it_by_lines): Replace the call
12986 to xfree to an equivalent call to bidi_unshelve_cache.
12987 (move_it_in_display_line_to): Fix logic of returning
12988 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12989
12990 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12991
12992 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12993 came from a string character with a `cursor' property. (Bug#9229)
12994
12995 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12996
12997 * Makefile.in (LIB_PTHREAD): New variable.
12998 (LIBES): Add LIB_PTHREAD (Bug#9216).
12999
13000 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13001 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13002
13003 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13004
13005 * regex.c (re_iswctype): Remove some redundant boolean conversions.
13006
13007 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13008
13009 * xterm.c (x_find_topmost_parent): New function.
13010 (x_set_frame_alpha): Find topmost parent window with
13011 x_find_topmost_parent and set the property there also (bug#9181).
13012 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13013
13014 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13015
13016 * callproc.c (Fcall_process): Avoid vfork clobbering
13017 the local vars buffer, coding_systems, current_dir.
13018
13019 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13020
13021 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13022
13023 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13024
13025 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13026 so that it is not optimized away.
13027
13028 * xdisp.c (compute_display_string_pos): Remove unused local.
13029
13030 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13031
13032 Fix slow cursor motion and scrolling in large buffers with
13033 selective display, like Org Mode buffers. (Bug#9218)
13034
13035 * dispextern.h (struct bidi_it): New member disp_prop_p.
13036
13037 * xdisp.c: Remove one-slot cache of display string positions.
13038 (compute_display_string_pos): Accept an additional argument
13039 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13040 for a display string or property. If found, set DISP_PROP_P
13041 non-zero.
13042
13043 * bidi.c (bidi_fetch_char): Accept an additional argument
13044 DISP_PROP_P, and pass it to compute_display_string_pos.
13045 Only handle text covered by a display string if DISP_PROP_P is returned
13046 non-zero. All callers of bidi_fetch_char changed.
13047
13048 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13049
13050 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13051
13052 2010-12-03 Don March <don@ohspite.net>
13053
13054 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13055 last character M-[char] is translated to ESC [char] (bug#7541).
13056
13057 2011-08-02 Kenichi Handa <handa@m17n.org>
13058
13059 * lisp.h (uniprop_table): Extern it.
13060
13061 * chartab.c (uniprop_table): Make it non-static.
13062
13063 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13064
13065 * xdisp.c (forward_to_next_line_start): Accept additional argument
13066 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13067 on the newline.
13068 (reseat_at_next_visible_line_start): Use the bidi iterator state
13069 returned by forward_to_next_line_start to restore the state of
13070 it->bidi_it after backing up to previous newline. (Bug#9212)
13071
13072 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13073
13074 * regex.c (re_comp): Protoize.
13075 (re_exec): Fix return type.
13076 (regexec): Fix type of `ret'. (Bug#9203)
13077
13078 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13079
13080 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13081 This is needed if max-image-size is a floating-point number.
13082
13083 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13084
13085 * print.c (print_object): Print empty symbol as ##.
13086
13087 * lread.c (read1): Read ## as empty symbol.
13088
13089 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13090
13091 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13092 setting frame foreground color (Bug#9175).
13093 (x_set_background_color): Likewise.
13094
13095 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13096 contents (Bug#9176).
13097 (EmacsTooltip -init): Remove bezels and add shadows to
13098 tooltip windows.
13099
13100 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13101 or scroll bar (Bug#8470).
13102
13103 * nsfont.m (nsfont_open): Remove assignment to voffset and
13104 unnecessary vars hshink, expand, hd, full_height, min_height.
13105 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13106
13107 * nsterm.h (nsfont_info): Remove voffset field.
13108
13109 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13110
13111 Implement strike-through and overline on NextStep (Bug#8863).
13112
13113 * nsfont.m (nsfont_open): Use underline position provided by font,
13114 instead of hard-coded value of 2.
13115 (nsfont_draw): Call ns_draw_text_decoration instead.
13116
13117 * nsterm.h: Add declaration for ns_draw_text_decoration.
13118
13119 * nsterm.m (ns_draw_text_decoration): New function for drawing
13120 underline, overline, and strike-through.
13121 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13122 ns_draw_text_decoration. Change treatment of cursor drawing to
13123 accommodate underlining, etc.
13124
13125 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13126
13127 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13128 default.
13129
13130 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13131
13132 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13133 Without this fix, if a signal arrives just after memory fills up,
13134 'malloc' might be invoked reentrantly.
13135
13136 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13137 In other words, assume that every image size is allowed, on non-X
13138 hosts. This assumption is probably wrong, but it lets Emacs compile.
13139
13140 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13141
13142 * regex.c (re_iswctype): Convert return values to boolean.
13143
13144 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13145
13146 * xdisp.c (compute_display_string_pos): Don't use cached display
13147 string position if the buffer had its restriction changed.
13148 (Bug#9184)
13149
13150 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13151
13152 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13153
13154 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13155
13156 Integer signedness and overflow and related fixes. (Bug#9079)
13157
13158 * bidi.c: Integer size and overflow fixes.
13159 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13160 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13161 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13162 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13163 (bidi_find_other_level_edge):
13164 Use ptrdiff_t instead of EMACS_INT where either will do.
13165 This works better on 32-bit hosts configured --with-wide-int.
13166 (bidi_cache_ensure_space): Check for size-calculation overflow.
13167 Use % rather than repeated addition, for better worst-case speed.
13168 Don't set bidi_cache_size until after xrealloc returns, because it
13169 might not return.
13170 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13171 (bidi_cache_ensure_space): Also check that the bidi cache size
13172 does not exceed that of the largest Lisp string or buffer. See Eli
13173 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13174
13175 * alloc.c (__malloc_size_t): Remove.
13176 All uses replaced by size_t. See Andreas Schwab's note
13177 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13178
13179 * image.c: Improve checking for integer overflow.
13180 (check_image_size): Assume that f is nonnull, since
13181 it is always nonnull in practice. This is one less thing to
13182 worry about when checking for integer overflow later.
13183 (x_check_image_size): New function, which checks for integer
13184 overflow issues inside X.
13185 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13186 This removes the need for a memory_full check.
13187 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13188 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13189 (xbm_read_bitmap_data): Change locals back to 'int', since
13190 their values must fit in 'int'.
13191 (xpm_load_image, png_load, tiff_load):
13192 Invoke x_create_x_image_and_pixmap earlier,
13193 to avoid much needless work if the image is too large.
13194 (tiff_load): Treat overly large images as if
13195 x_create_x_image_and_pixmap failed, not as malloc failures.
13196 (gs_load): Use x_check_image_size.
13197
13198 * gtkutil.c: Omit integer casts.
13199 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13200 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13201
13202 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13203
13204 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13205 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13206 would wrongly return t on a 64-bit host.
13207
13208 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13209 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13210 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13211 and therefore cause GCC to emit a bogus diagnostic in some cases.
13212
13213 * image.c: Integer signedness and overflow and related fixes.
13214 This is not an exhaustive set of fixes, but it's time to
13215 record what I've got.
13216 (lookup_pixel_color, check_image_size): Remove redundant decls.
13217 (check_image_size): Don't assume that arbitrary EMACS_INT values
13218 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13219 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13220 (tiff_load, imagemagick_load_image):
13221 Check for overflow in size calculations.
13222 (x_create_x_image_and_pixmap): Remove unnecessary test for
13223 xmalloc returning NULL; that can't happen.
13224 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13225 (xpm_color_bucket): Use better integer hashing function.
13226 (xpm_cache_color): Don't possibly over-allocate memory.
13227 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13228 (gif_memory_source):
13229 Use ptrdiff_t, not int or size_t, to record sizes.
13230 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13231 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13232 either works, as we prefer signed integers.
13233 (tiff_read_from_memory, tiff_write_from_memory):
13234 Return tsize_t, not size_t, since that's what the TIFF API wants.
13235 (tiff_read_from_memory): Don't fail simply because the read would
13236 go past EOF; instead, return a short read.
13237 (tiff_load): Omit no-longer-needed casts.
13238 (Fimagemagick_types): Don't assume size fits into 'int'.
13239
13240 Improve hashing quality when configured --with-wide-int.
13241 * fns.c (hash_string): New function, taken from sxhash_string.
13242 Do not discard information about ASCII character case; this
13243 discarding is no longer needed.
13244 (sxhash-string): Use it. Change sig to match it. Caller changed.
13245 * lisp.h: Declare it.
13246 * lread.c (hash_string): Remove, since we now use fns.c's version.
13247 The fns.c version returns a wider integer if --with-wide-int is
13248 specified, so this should help the quality of the hashing a bit.
13249
13250 * emacs.c: Integer overflow minor fix.
13251 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13252 Define only if GNU_LINUX.
13253 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13254
13255 * dispnew.c: Integer signedness and overflow fixes.
13256 Remove unnecessary forward decls, that were a maintenance hassle.
13257 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13258 All uses changed.
13259 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13260 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13261 (prepare_desired_row, line_draw_cost):
13262 Use int, not unsigned, where either works.
13263 (save_current_matrix, restore_current_matrix):
13264 Use ptrdiff_t, not size_t, where either works.
13265 (init_display): Check for overflow more accurately, and without
13266 relying on undefined behavior.
13267
13268 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13269 Remove, replacing with the new symbols in lisp.h. All uses changed.
13270 * fileio.c (make_temp_name):
13271 * filelock.c (lock_file_1, lock_file):
13272 * xdisp.c (message_dolog):
13273 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13274 Use pMd etc. instead.
13275 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13276 replacing the pWIDE etc. symbols removed from editfns.c.
13277
13278 * keyboard.h (num_input_events): Now uintmax_t.
13279 This is (very slightly) less likely to mess up due to wraparound.
13280 All uses changed.
13281
13282 * buffer.c: Integer signedness fixes.
13283 (alloc_buffer_text, enlarge_buffer_text):
13284 Use ptrdiff_t rather than size_t when either will do, as we prefer
13285 signed integers.
13286
13287 * alloc.c: Integer signedness and overflow fixes.
13288 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13289 (__malloc_size_t): Default to size_t, not to int.
13290 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13291 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13292 Prefer ptrdiff_t to size_t when either would do, as we prefer
13293 signed integers.
13294 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13295 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13296 Now const. Initialize with values that are in range even if char
13297 is signed.
13298 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13299 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13300 These functions do the right thing with sizes > 2**32.
13301 (check_depth): Now ptrdiff_t, not int.
13302 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13303 Adjust to new way of storing sizes. Check for size overflow bugs
13304 in rest of code.
13305 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13306 slightly wrong anyway, as it missed one instance of
13307 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13308 (refill_memory_reserve): Omit needless cast to size_t.
13309 (mark_object_loop_halt): Mark as externally visible.
13310
13311 * xselect.c: Integer signedness and overflow fixes.
13312 (Fx_register_dnd_atom, x_handle_dnd_message):
13313 Use ptrdiff_t, not size_t, since we prefer signed.
13314 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13315 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13316 x_dnd_atoms_size and x_dnd_atoms_length.
13317
13318 * doprnt.c: Prefer signed to unsigned when either works.
13319 * eval.c (verror):
13320 * doprnt.c (doprnt):
13321 * lisp.h (doprnt):
13322 * xdisp.c (vmessage):
13323 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13324 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13325 prefer signed arithmetic to avoid comparison confusion.
13326 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13327 but is a bit tricky.
13328
13329 Assume freestanding C89 headers, string.h, stdlib.h.
13330 * data.c, doprnt.c, floatfns.c, print.c:
13331 Include float.h unconditionally.
13332 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13333 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13334 * regex.c: Likewise for stddef.h, string.h.
13335 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13336 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13337 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13338 (STDC_HEADERS): Remove obsolete defines.
13339 * sysdep.c: Include limits.h unconditionally.
13340
13341 Assume support for memcmp, memcpy, memmove, memset.
13342 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13343 * regex.c (memcmp, memcpy):
13344 Remove; we assume C89 now.
13345
13346 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13347 (__malloc_safe_bcopy): Remove; no longer needed.
13348
13349 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13350 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13351 well either way, and we prefer signed to unsigned.
13352
13353 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13354
13355 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13356 closes the connection while we're reading (bug#9182).
13357
13358 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13359
13360 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13361 are specified (Bug#9168).
13362
13363 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13364
13365 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13366 Found by GCC static checking and --with-wide-int on a 32-bit host.
13367
13368 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13369
13370 * xdisp.c (compute_display_string_pos): Fix logic of caching
13371 previous display string position. Initialize cached_prev_pos to
13372 -1. Fixes slow-down at the beginning of a buffer.
13373
13374 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13375
13376 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13377 for attrs[LFACE_FONTSET_INDEX].
13378
13379 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13380
13381 * xml.c (parse_region): Remove unused local
13382 that was recently introduced.
13383
13384 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13385
13386 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13387 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13388
13389 * xdisp.c (move_it_in_display_line_to): Record the best matching
13390 position for TO_CHARPOS while scanning the line, and restore it on
13391 exit if none of the characters scanned was an exact match.
13392 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13393 when exact match is impossible due to invisible text, and the
13394 lines are truncated.
13395
13396 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13397
13398 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13399 for OSX >= 10.7.
13400
13401 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13402
13403 Fix a significant slow-down of cursor motion with C-n, C-p,
13404 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13405 auto-repeat under bidi redisplay in fontified buffers.
13406 * xdisp.c (compute_stop_pos_backwards): New function.
13407 (next_element_from_buffer): Call compute_stop_pos_backwards to
13408 find a suitable prev_stop when we find ourselves before
13409 base_level_stop.
13410 (reseat): Don't look for prev_stop, as that could mean a very long
13411 run.
13412 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13413 <cached_disp_overlay_modiff>: Cache for last found display string
13414 position.
13415 (compute_display_string_pos): Return the cached position if asked
13416 about the same buffer in the same area of character positions, and
13417 the buffer wasn't changed since the time the display string
13418 position was cached.
13419
13420 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13421
13422 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13423 is an integer, which is important for empty lines. (Bug#9149)
13424
13425 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13426
13427 * frame.c (Fmodify_frame_parameters): In tty case, update the
13428 default face if necessary (Bug#4238).
13429
13430 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13431
13432 * editfns.c (Fstring_to_char): No need to explain what a character
13433 is in the docstring (Bug#6576).
13434
13435 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13436
13437 * xml.c (parse_region): Make sure we always return a tree.
13438
13439 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13440
13441 * xml.c (parse_region): If a document contains only comments,
13442 return that, too.
13443
13444 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13445
13446 * xml.c (make_dom): Return comments, too.
13447
13448 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13449
13450 Port to OpenBSD.
13451 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13452 and the surrounding thread.
13453 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13454 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13455 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13456 timer goes off.
13457 * s/openbsd.h (BROKEN_SIGIO): Define.
13458 * unexelf.c (unexec) [__OpenBSD__]:
13459 Don't update the .mdebug section of the Alpha COFF symbol table.
13460
13461 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13462
13463 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13464 (bug#8460).
13465
13466 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13467
13468 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13469 This fixes some race conditions on the permissions of any newly
13470 created file.
13471
13472 * alloc.c (valid_pointer_p): Use pipe, not open.
13473 This fixes some permissions issues when debugging.
13474
13475 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13476 If fchown fails to set both uid and gid, try to set just gid,
13477 as that is sometimes allowed. Adjust the file's mode to eliminate
13478 setuid or setgid bits that are inappropriate if fchown fails.
13479
13480 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13481
13482 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13483 to compare Lisp_Objects.
13484 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13485 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13486 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13487
13488 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13489
13490 * lread.c (read_integer): Unread even EOF character.
13491 (read1): Likewise. Properly record start position of symbol.
13492
13493 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13494 symbol character follows.
13495
13496 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13497
13498 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13499 This works around a problem with the previous change to Fcopy_file.
13500 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13501 and without this change, GCC might complain about discarding
13502 fchown's return value.
13503
13504 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13505
13506 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13507
13508 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13509
13510 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13511
13512 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13513
13514 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13515 it's used from the C level.
13516
13517 * process.c: Use the same condition for POLL_FOR_INPUT in both
13518 keyboard.c and process.c (bug#1858).
13519
13520 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13521
13522 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13523 (Fgnutls_boot): Use it.
13524
13525 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13526
13527 * doc.c (Fsubstitute_command_keys): Revert last change.
13528
13529 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13530
13531 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13532 quotes the next character, and doesn't affect other longer
13533 sequences (bug#8935).
13534
13535 * lread.c (syms_of_lread): Clarify that is isn't only
13536 `eval-buffer' and `eval-defun' that's affected by
13537 `lexical-binding' (bug#8460).
13538
13539 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13540
13541 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13542 bidi redisplay when a line includes both an image and is truncated.
13543
13544 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13545
13546 Fix minor problems found by static checking.
13547 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13548 (elsz): Now a signed constant, not a size_t var. We prefer signed
13549 types to unsigned, to avoid integer comparison confusion. Without
13550 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13551 "cannot optimize loop, the loop counter may overflow", a symptom
13552 of the confusion.
13553 * indent.c (Fvertical_motion): Mark locals as initialized.
13554 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13555
13556 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13557
13558 * search.c (Fre_search_backward): Mention `case-fold-search' in
13559 all the re_search_* functions (bug#8138).
13560
13561 * keyboard.c (Fopen_dribble_file): Document when the file is
13562 closed (bug#8056).
13563
13564 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13565
13566 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13567 bidi_cache_idx.
13568
13569 Support bidi reordering of display and overlay strings.
13570 * xdisp.c (compute_display_string_pos)
13571 (compute_display_string_end): Accept additional argument STRING.
13572 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13573 (reseat_to_string): Initialize bidi_it->string.s and
13574 bidi_it->string.schars.
13575 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13576 NULL (avoids a crash in bidi_paragraph_init).
13577 Initialize itb.string.lstring.
13578 (init_iterator): Call bidi_init_it only of a valid
13579 buffer position was specified. Initialize paragraph_embedding to
13580 L2R.
13581 (reseat_to_string): Initialize the bidi iterator.
13582 (display_string): If we need to ignore text properties of
13583 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13584 original value of -1 will not work with bidi.)
13585 (compute_display_string_pos): First arg is now struct
13586 `text_pos *'; all callers changed. Support display properties on
13587 Lisp strings.
13588 (compute_display_string_end): Support display properties on Lisp
13589 strings.
13590 (init_iterator, reseat_1, reseat_to_string): Initialize the
13591 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13592 when iterating on a string not from display properties).
13593 (compute_display_string_pos, compute_display_string_end):
13594 Fix calculation of the object to scan. Fixes an error when using
13595 arrow keys.
13596 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13597 base_level_stop; instead, set base_level_stop to BEGV.
13598 Fixes crashes in vertical-motion.
13599 (next_element_from_buffer): Improve commentary for when
13600 the iterator is before prev_stop.
13601 (init_iterator): Initialize bidi_p from the default value of
13602 bidi-display-reordering, not from buffer-local value. Use the
13603 buffer-local value only if initializing for buffer iteration.
13604 (handle_invisible_prop): Support invisible properties on strings
13605 that are being bidi-reordered.
13606 (set_iterator_to_next): Support bidi reordering of C strings and
13607 Lisp strings.
13608 (next_element_from_string): Support bidi reordering of Lisp
13609 strings.
13610 (handle_stop_backwards): Support Lisp strings as well.
13611 (display_string): Support display of R2L glyph rows.
13612 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13613 (init_iterator): Don't initialize it->bidi_p for strings
13614 here.
13615 (reseat_to_string): Initialize it->bidi_p for strings here.
13616 (next_element_from_string, next_element_from_c_string)
13617 (next_element_from_buffer): Add xassert's for correspondence
13618 between IT's object being iterated and it->bidi_it.string
13619 structure.
13620 (face_before_or_after_it_pos): Support bidi iteration.
13621 (next_element_from_c_string): Handle the case of the first string
13622 character that is not the first one in the visual order.
13623 (get_visually_first_element): New function, refactored from common
13624 parts of next_element_from_buffer, next_element_from_string, and
13625 next_element_from_c_string.
13626 (tool_bar_lines_needed, redisplay_tool_bar)
13627 (display_menu_bar): Force left-to-right direction. Add a FIXME
13628 comment for making that be controlled by a user option.
13629 (push_it, pop_it): Save and restore the state of the
13630 bidi iterator. Save and restore the bidi_p flag.
13631 (pop_it): Iterate out of display property for string iteration as
13632 well.
13633 (iterate_out_of_display_property): Support iteration over strings.
13634 (handle_single_display_spec): Set up it->bidi_it for iteration
13635 over a display string, and call bidi_init_it.
13636 (handle_single_display_spec, next_overlay_string)
13637 (get_overlay_strings_1, push_display_prop): Set up the bidi
13638 iterator for displaying display or overlay strings.
13639 (forward_to_next_line_start): Don't use the shortcut if
13640 bidi-iterating.
13641 (back_to_previous_visible_line_start): If handle_display_prop
13642 pushed the iterator stack, restore the internal state of the bidi
13643 iterator by calling bidi_pop_it same number of times.
13644 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13645 and we are bidi-iterating, don't decrement the iterator position;
13646 instead, set the first_elt flag in the bidi iterator, to produce
13647 the same effect.
13648 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13649 (push_display_prop): xassert that we are iterating a buffer.
13650 (push_it, pop_it): Save and restore paragraph_embedding member.
13651 (handle_single_display_spec, next_overlay_string)
13652 (get_overlay_strings_1, reseat_1, reseat_to_string)
13653 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13654 correctly. Don't assume unibyte strings are not bidi-reordered.
13655 (compute_display_string_pos)
13656 (compute_display_string_end): Fix handling the case of C string.
13657 (push_it, pop_it): Save and restore from_disp_prop_p.
13658 (handle_single_display_spec, push_display_prop): Set the
13659 from_disp_prop_p flag.
13660 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13661 (pop_it): Call iterate_out_of_display_property only if we are
13662 popping after iteration over a string that came from a display
13663 property. Fix a typo in popping stretch info. Add an assertion
13664 for verifying that the iterator position is in sync with the bidi
13665 iterator.
13666 (handle_single_display_spec, get_overlay_strings_1)
13667 (push_display_prop): Fix initialization of paragraph direction for
13668 string when that of the parent object is not yet determined.
13669 (reseat_1): Call bidi_init_it to resync the bidi
13670 iterator with IT's position. (Bug#7616)
13671 (find_row_edges): If ROW->start.pos gives position
13672 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13673 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13674 Reset the from_disp_prop_p flag.
13675 (SAVE_IT, RESTORE_IT): New macros.
13676 (pos_visible_p, face_before_or_after_it_pos)
13677 (back_to_previous_visible_line_start)
13678 (move_it_in_display_line_to, move_it_in_display_line)
13679 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13680 (try_scrolling, redisplay_window, display_line): Use them when
13681 saving a temporary copy of the iterator and restoring it back.
13682 (back_to_previous_visible_line_start, reseat_1)
13683 (init_iterator): Empty the bidi cache "stack".
13684 (move_it_in_display_line_to): If iterator ended up at
13685 EOL, but we never saw any buffer positions smaller than
13686 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13687 motion in bidi-reordered lines.
13688 (move_it_in_display_line_to): Record prev_method and prev_pos
13689 immediately before the call to set_iterator_to_next. Fixes cursor
13690 motion in bidi-reordered lines with stretch glyphs and strings
13691 displayed in margins. (Bug#8133) (Bug#8867)
13692 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13693 TO_CHARPOS.
13694 (pos_visible_p): Support positions in bidi-reordered lines.
13695 Save and restore bidi cache.
13696
13697 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13698 (bidi_paragraph_info): Delete unused struct.
13699 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13700 (bidi_cache_start): New variable.
13701 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13702 to zero.
13703 (bidi_cache_fetch_state, bidi_cache_search)
13704 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13705 (bidi_cache_find, bidi_peek_at_next_level)
13706 (bidi_level_of_next_char, bidi_find_other_level_edge)
13707 (bidi_move_to_visually_next): Compare cache index with
13708 bidi_cache_start rather than with zero.
13709 (bidi_fetch_char): Accept new argument STRING; all callers
13710 changed. Support iteration over a string. Support strings with
13711 display properties. Support unibyte strings. Fix the type of
13712 `len' according to what STRING_CHAR_AND_LENGTH expects.
13713 (bidi_paragraph_init, bidi_resolve_explicit_1)
13714 (bidi_resolve_explicit, bidi_resolve_weak)
13715 (bidi_level_of_next_char, bidi_move_to_visually_next):
13716 Support iteration over a string.
13717 (bidi_set_sor_type, bidi_resolve_explicit_1)
13718 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13719 can now be zero (for strings); special values 0 and -1 were
13720 changed to -1 and -2, respectively.
13721 (bidi_char_at_pos): New function.
13722 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13723 Call it instead of FETCH_MULTIBYTE_CHAR.
13724 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13725 initialized to valid values.
13726 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13727 values.
13728 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13729 the test for valid cached positions. Fix the logic for looking up
13730 the sentinel state in the cache. GCPRO the Lisp string we are
13731 iterating.
13732 (bidi_push_it, bidi_pop_it): New functions.
13733 (bidi_initialize): Initialize the bidi cache start stack pointer.
13734 (bidi_cache_ensure_space): New function, refactored from part of
13735 bidi_cache_iterator_state. Don't assume the required size is just
13736 one BIDI_CACHE_CHUNK away.
13737 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13738 (bidi_count_bytes, bidi_char_at_pos): New functions.
13739 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13740 always valid if bidi_cache_idx is valid.
13741 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13742 is valid if it's going to be used.
13743 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13744 (bidi_cache_fetch_state, bidi_cache_search)
13745 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13746 (bidi_cache_iterator_state, bidi_cache_find)
13747 (bidi_find_other_level_edge, bidi_cache_start_stack):
13748 All variables related to cache indices are now EMACS_INT.
13749
13750 * dispextern.h (struct bidi_string_data): New structure.
13751 (struct bidi_it): New member `string'. Make flag members be 1-bit
13752 fields, and put them last in the struct.
13753 (compute_display_string_pos, compute_display_string_end):
13754 Update prototypes.
13755 (bidi_push_it, bidi_pop_it): Add prototypes.
13756 (struct iterator_stack_entry): New members bidi_p,
13757 paragraph_embedding, and from_disp_prop_p.
13758 (struct it): Member bidi_p is now a bit field 1 bit wide.
13759 (bidi_shelve_cache, bidi_unshelve_cache):
13760 Declare prototypes.
13761
13762 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13763 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13764 and vector-like objects.
13765
13766 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13767 cache around display iteration.
13768
13769 * window.c (Fwindow_end, window_scroll_pixel_based)
13770 (displayed_window_lines, Frecenter): Save and restore the bidi
13771 cache around display iteration.
13772
13773 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13774
13775 * editfns.c (Fdelete_region): Clarify the use of the named
13776 parameters (bug#6788).
13777
13778 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13779
13780 * indent.c (Fvertical_motion): Set and restore w->pointm when
13781 saving and restoring the window's buffer (Bug#9006).
13782
13783 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13784
13785 * editfns.c (Fstring_to_char): Clarify just what is returned
13786 (bug#6576). Text by Eli Zaretskii.
13787
13788 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13789
13790 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13791
13792 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13793
13794 * buffer.c (mmap_find): Fix a typo.
13795
13796 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13797
13798 Fix execution of x selection hooks.
13799 * xselect.c (Qx_lost_selection_functions)
13800 (Qx_sent_selection_functions): New vars.
13801 (syms_of_xselect): DEFSYM them.
13802 (x_handle_selection_request): Pass Qx_sent_selection_functions
13803 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13804 (x_handle_selection_clear,x_clear_frame_selections):
13805 Pass Qx_lost_selection_functions rather than
13806 Vx_lost_selection_functions to Frun_hook_with_args.
13807
13808 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13809
13810 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13811 The old code sometimes used this field without initializing it.
13812
13813 * alloc.c (gc_sweep): Don't read past end of array.
13814 In theory, the old code could also have corrupted Emacs internals,
13815 though it'd be very unlikely.
13816
13817 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13818
13819 * character.c (Fcharacterp): Don't advertise optional ignored
13820 argument. (Bug#4026)
13821
13822 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13823
13824 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13825 key" (bug#4257).
13826
13827 * window.c (Fset_window_start): Doc fix (bug#4199).
13828 (Fset_window_hscroll): Ditto.
13829
13830 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13831
13832 Fix minor new problems caught by GCC 4.6.1.
13833 * term.c (init_tty): Remove unused local.
13834 * xsettings.c (store_monospaced_changed): Define this function only
13835 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13836 not used otherwise.
13837
13838 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13839
13840 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13841
13842 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13843
13844 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13845 are the mini-buffer and the echo area (bug#3320).
13846
13847 * term.c (init_tty): Remove support for supdup, c10 and perq
13848 terminals, which are no longer supported (bug#1482).
13849
13850 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13851
13852 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13853
13854 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13855
13856 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13857 for non-popups (Bug#3642).
13858
13859 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13860
13861 * alloc.c (reset_malloc_hooks): Protoize.
13862 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13863 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13864 * cm.c (losecursor): Likewise.
13865 * data.c (fmod): Likewise.
13866 * dispnew.c (swap_glyphs_in_rows): Likewise.
13867 * emacs.c (memory_warning_signal): Likewise.
13868 * floatfns.c (float_error): Likewise.
13869 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13870 (otf_open, font_otf_capability, generate_otf_features)
13871 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13872 Likewise.
13873 * image.c (pbm_read_file): Likewise.
13874 * indent.c (string_display_width): Likewise.
13875 * intervals.c (check_for_interval, search_for_interval)
13876 (inc_interval_count, count_intervals, root_interval)
13877 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13878 * lread.c (defalias): Likewise.
13879 * ralloc.c (r_alloc_check): Likewise.
13880 * regex.c (set_image_of_range_1, set_image_of_range)
13881 (regex_grow_registers): Likewise.
13882 * sysdep.c (strerror): Likewise.
13883 * termcap.c (valid_filename_p, tprint, main): Likewise.
13884 * tparam.c (main): Likewise.
13885 * unexhp9k800.c (run_time_remap, save_data_space)
13886 (update_file_ptrs, read_header, write_header, calculate_checksum)
13887 (copy_file, copy_rest, display_header): Likewise.
13888 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13889 Likewise.
13890 * xdisp.c (check_it): Likewise.
13891 * xfaces.c (register_color, unregister_color, unregister_colors):
13892 Likewise.
13893 * xfns.c (print_fontset_result): Likewise.
13894 * xrdb.c (member, fatal, main): Likewise.
13895
13896 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13897
13898 Fix minor problems found by static checking (Bug#9031).
13899 * chartab.c (char_table_set_range, map_sub_char_table):
13900 Remove unused locals.
13901 (uniprop_table): Now static.
13902 * composite.c (_work_char): Remove unused static var.
13903
13904 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13905
13906 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13907
13908 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13909
13910 * gtkutil.c (qttip_cb): Remove code without function.
13911
13912 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13913
13914 * w32.c (pthread_sigmask): New stub.
13915
13916 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13917
13918 Use pthread_sigmask, not sigprocmask (Bug#9010).
13919 sigprocmask is portable only for single-threaded applications, and
13920 Emacs can be multi-threaded when it uses GTK.
13921 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13922 (LIBES): Use it.
13923 * callproc.c (Fcall_process):
13924 * process.c (create_process):
13925 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13926 Use pthread_sigmask, not sigprocmask.
13927
13928 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13929
13930 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13931 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13932 wrong (Bug#8591).
13933
13934 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13935
13936 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13937 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13938 (xg_hide_tooltip): Fix comment.
13939
13940 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13941 in registerServicesMenuSendTypes.
13942 (validRequestorForSendType): Don't check ns_return_types.
13943
13944 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13945 ns_return_type.
13946
13947 2011-07-08 Jason Rumney <jasonr@gnu.org>
13948
13949 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13950 SH_SHOW for hidden windows (Bug#5482).
13951
13952 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13953 frame struct members of non-existent frames (Bug#6284).
13954
13955 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13956
13957 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13958 variable firstTime not needed on OSX >= 10.6.
13959 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13960 >= 10.5. Use setKnobProportion, setDoubleValue.
13961
13962 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13963 (MAC_OS_X_VERSION_10_5): Define if not defined.
13964 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13965 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13966 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13967
13968 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13969 cString and lossyCString on OSX >= 10.4.
13970
13971 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13972 sizeToFit on OSX >= 10.2.
13973
13974 * nsimage.m (allocInitFromFile): Don't use deprecated method
13975 bestRepresentationForDevice on OSX >= 10.6.
13976
13977 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13978 to avoid warning.
13979
13980 * emacs.c: Declare unexec_init_emacs_zone.
13981
13982 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13983
13984 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13985
13986 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13987 on svcsMenu (Bug#8842).
13988
13989 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13990 ns_return_types.
13991 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13992
13993 * nsterm.m (QUTF8_STRING): Declare.
13994 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13995 (validRequestorForSendType): Return type is (id).
13996 Change indexOfObjectIdenticalTo to indexOfObject.
13997 Check if we have local selection before returning self (Bug#8842).
13998 (writeSelectionToPasteboard): Put local selection into paste board
13999 if we have a local selection (Bug#8842).
14000 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14001
14002 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14003 (ns_get_local_selection): Declare.
14004
14005 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14006
14007 * keymap.c (describe_map_tree): Don't insert a double newline at
14008 the end of the buffer (bug#1169) and return whether we inserted
14009 something.
14010
14011 * callint.c (Fcall_interactively): Change "reading args" to
14012 "providing args" to try to clarify what it does (bug#1010).
14013
14014 2011-07-07 Kenichi Handa <handa@m17n.org>
14015
14016 * composite.c (composition_compute_stop_pos): Ignore a static
14017 composition starting before CHARPOS (Bug#8915).
14018
14019 * xdisp.c (handle_composition_prop): Likewise.
14020
14021 2011-07-07 Eli Zaretskii <eliz@gnu.org>
14022
14023 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14024 (Bug#9015)
14025
14026 2011-07-07 Kenichi Handa <handa@m17n.org>
14027
14028 * character.h (unicode_category_t): New enum type.
14029
14030 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14031 (Qchar_code_property_table): New variable.
14032 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14033 (UNIPROP_COMPRESSED_FORM_P): New macros.
14034 (char_table_ascii): Uncompress the compressed values.
14035 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14036 Uncompress the compressed values.
14037 (sub_char_table_ref_and_range): Likewise.
14038 (char_table_ref_and_range): Uncompress the compressed values.
14039 (sub_char_table_set): New arg is_uniprop. Callers changed.
14040 Uncompress the compressed values.
14041 (sub_char_table_set_range): Args changed. Callers changed.
14042 (char_table_set_range): Adjuted for the above change.
14043 (map_sub_char_table): Delete args default_val and parent. Add arg
14044 top. Give decoded values to a Lisp function.
14045 (map_char_table): Adjust for the above change. Give decoded
14046 values to a Lisp function. Gcpro more variables.
14047 (uniprop_table_uncompress)
14048 (uniprop_decode_value_run_length): New functions.
14049 (uniprop_decoder, uniprop_decoder_count): New variables.
14050 (uniprop_get_decoder, uniprop_encode_value_character)
14051 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14052 New functions.
14053 (uniprop_encoder, uniprop_encoder_count): New variables.
14054 (uniprop_get_encoder, uniprop_table)
14055 (Funicode_property_table_internal, Fget_unicode_property_internal)
14056 (Fput_unicode_property_internal): New functions.
14057 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14058 Sunicode_property_table_internal, Sget_unicode_property_internal,
14059 and Sput_unicode_property_internal. Defvar_lisp
14060 char-code-property-alist.
14061
14062 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14063 Vunicode_category_table.
14064
14065 * font.c (font_range): Adjust for the change of
14066 Vunicode_category_table.
14067
14068 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14069
14070 * m/iris4d.h: Remove file, move contents ...
14071 * s/irix6-5.h: ... here.
14072
14073 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14074
14075 Remove unportable assumption about struct layout (Bug#8884).
14076 * alloc.c (mark_buffer):
14077 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14078 (clone_per_buffer_values): Don't assume that
14079 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14080 This isn't true in general, and it's particularly not true
14081 if Emacs is configured with --with-wide-int.
14082 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14083 New macros, used in the buffer.c change.
14084
14085 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14086
14087 * xsettings.c: Use both GConf and GSettings if both are available.
14088 (store_config_changed_event): Add comment.
14089 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14090 (store_tool_bar_style_changed): New functions.
14091 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14092 (struct xsettings): Move font inside HAVE_XFT.
14093 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14094 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14095 Move inside HAVE_XFT.
14096 (something_changed_gsettingsCB): Rename from something_changedCB.
14097 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14098 also.
14099 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14100 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14101 (something_changed_gconfCB): Rename from something_changedCB.
14102 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14103 (parse_settings): Move check for font inside HAVE_XFT.
14104 (read_settings, apply_xft_settings): Add comment.
14105 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14106 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14107 call store_font_name_changed.
14108 (xft_settings_event): Add comment.
14109 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14110 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14111 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14112 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14113 (xsettings_initialize): Call init_gsettings last.
14114 (xsettings_get_system_font, xsettings_get_system_normal_font):
14115 Add comment.
14116
14117 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14118
14119 Random fixes. E.g., (random) never returned negative values.
14120 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14121 subseconds part to the entropy, as that's a bit more random.
14122 Prefer signed to unsigned, since the signedness doesn't matter and
14123 in general we prefer signed. When given a limit, use a
14124 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14125 latter isn't right if USE_2_TAGS_FOR_INTS.
14126 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14127 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14128
14129 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14130
14131 * textprop.c (text_property_stickiness):
14132 Obey Vtext_property_default_nonsticky.
14133 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14134 * w32fns.c (syms_of_w32fns):
14135 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14136
14137 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14138
14139 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14140 This is more efficient than Ffile_directory_p and avoids a minor race.
14141
14142 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14143
14144 * buffer.c (Foverlay_put): Say what the return value is
14145 (bug#7835).
14146
14147 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14148 is a directory before asking whether to use the file name
14149 (bug#7564).
14150 (barf_or_query_if_file_exists): Make the "File is a directory"
14151 error be more correct.
14152
14153 * fns.c (Frequire): Remove the mention of the .gz files, since
14154 that's installation-specific, but keep the mention of
14155 `get-load-suffixes'.
14156
14157 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14158
14159 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14160 Report string overflow if the output is too long.
14161
14162 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14163
14164 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14165 (syms_of_gnutls): Remove duplicate DEFSYM for
14166 Qgnutls_bootprop_verify_hostname_error, an error for
14167 Qgnutls_bootprop_verify_error (which is no longer used).
14168
14169 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14170 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14171 Also (re)move comments that are misplaced or no longer relevant.
14172
14173 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14174
14175 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14176
14177 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14178
14179 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14180 and background color parameters if they have been changed.
14181
14182 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14183
14184 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14185
14186 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14187
14188 * xsettings.c (SYSTEM_FONT): Define only when used.
14189 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14190
14191 * keymap.c (access_keymap_1): Now static.
14192
14193 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14194
14195 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14196 leave any prefix arg for the up event (Bug#1586).
14197
14198 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14199
14200 * lread.c (syms_of_lread): Mention single symbols defined by
14201 `defvar' or `defconst' (bug#7154).
14202
14203 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14204 (Frequire): Mention get-load-suffixes.
14205
14206 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14207
14208 * window.h (window): Remove clone_number slot.
14209 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14210 Remove.
14211 (make_parent_window, make_window, saved_window)
14212 (Fset_window_configuration, save_window_save): Don't deal with
14213 clone numbers.
14214 * buffer.c (Qclone_number): Remove declaration.
14215 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14216
14217 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14218
14219 Add multiple inheritance to keymaps.
14220 * keymap.c (Fmake_composed_keymap): New function.
14221 (Fset_keymap_parent): Simplify.
14222 (fix_submap_inheritance): Remove.
14223 (access_keymap_1): New function extracted from access_keymap to handle
14224 embedded parents and handle lists of maps.
14225 (access_keymap): Use it.
14226 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14227 (Fcopy_keymap): Handle embedded parents.
14228 (Fcommand_remapping, define_as_prefix): Simplify.
14229 (Fkey_binding): Simplify.
14230 (syms_of_keymap): Move minibuffer-local-completion-map,
14231 minibuffer-local-filename-completion-map,
14232 minibuffer-local-must-match-map, and
14233 minibuffer-local-filename-must-match-map to Elisp.
14234 (syms_of_keymap): Defsubr make-composed-keymap.
14235 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14236 (parse_menu_item): Trivial simplification.
14237
14238 2011-07-01 Glenn Morris <rgm@gnu.org>
14239
14240 * Makefile.in (SETTINGS_LIBS): Fix typo.
14241
14242 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14243
14244 * coding.c (Fencode_coding_string): Record the last coding system
14245 used, as the function doc string says (bug#8738).
14246
14247 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14248
14249 * xsettings.c (store_monospaced_changed): Take new font as arg and
14250 check for change against current_mono_font.
14251 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14252 (emacs_settings_constructor, emacs_settings_get_property)
14253 (emacs_settings_set_property, emacs_settings_class_init)
14254 (emacs_settings_init, gsettings_obj): Remove.
14255 (something_changedCB): New function for HAVE_GSETTINGS.
14256 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14257 with value as argument.
14258 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14259 g_settings_new (Bug#8967). Do not create gsettings_obj.
14260 Remove calls to g_settings_bind. Connect something_changedCB to
14261 "changed".
14262
14263 * xgselect.c: Add defined (HAVE_GSETTINGS).
14264 (xgselect_initialize): Ditto.
14265
14266 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14267 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14268 xg_select.
14269
14270 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14271
14272 * eval.c (struct backtrace): Simplify and port the data structure.
14273 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14274 signed bit field, as this assumption is not portable and it makes
14275 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14276 "char debug_on_exit : 1" as this is not portable either; instead,
14277 use the portable "unsigned int debug_on_exit : 1". Remove unused
14278 member evalargs. Remove obsolete comments about cc bombing out.
14279
14280 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14281
14282 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14283 Let HAVE_GSETTINGS override HAVE_GCONF.
14284 (store_monospaced_changed): New function.
14285 (EMACS_SETTINGS): A new type derived from GObject to handle
14286 GSettings notifications.
14287 (emacs_settings_constructor, emacs_settings_get_property)
14288 (emacs_settings_set_property, emacs_settings_class_init):
14289 New functions.
14290 (gsettings_client, gsettings_obj): New variables.
14291 (GSETTINGS_SCHEMA): New define.
14292 (something_changedCB): Call store_monospaced_changed.
14293 (init_gsettings): New function.
14294 (xsettings_initialize): Call init_gsettings.
14295 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14296 to NULL.
14297
14298 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14299 GCONF_CFLAGS/LIBS.
14300
14301 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14302
14303 * window.c (resize_root_window, grow_mini_window)
14304 (shrink_mini_window): Rename Qresize_root_window to
14305 Qwindow_resize_root_window and Qresize_root_window_vertically to
14306 Qwindow_resize_root_window_vertically.
14307
14308 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14309
14310 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14311
14312 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14313
14314 * makefile.w32-in: Redesign dependencies so they reflect more
14315 clearly which files are directly included by each source file,
14316 and not through other includes.
14317
14318 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14319
14320 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14321 (sort_overlays, overlay_strings): When an overlay's clone number
14322 matches the window's clone number process the overlay even if
14323 the overlay's window property doesn't match the current window.
14324
14325 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14326 (Fwindow_hchild): Rename to Fwindow_left_child.
14327 (Fwindow_next): Rename to Fwindow_next_sibling.
14328 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14329 (resize_window_check): Rename to window_resize_check.
14330 (resize_window_apply): Rename to window_resize_apply.
14331 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14332 (Fdelete_other_windows_internal, resize_frame_windows)
14333 (Fsplit_window_internal, Fdelete_window_internal)
14334 (grow_mini_window, shrink_mini_window)
14335 (Fresize_mini_window_internal): Fix callers accordingly.
14336
14337 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14338
14339 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14340 (emacs_fixed_set_min_size): Remove.
14341 (emacs_fixed_new): Take frame as argument.
14342
14343 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14344 (_EmacsFixedPrivate): Remove minwidth/height.
14345 Add struct frame *f.
14346 (emacs_fixed_init): Initialize priv->f.
14347 (get_parent_class, emacs_fixed_set_min_size): Remove.
14348 (emacs_fixed_new): Set priv->f to argument.
14349 (emacs_fixed_get_preferred_width)
14350 (emacs_fixed_get_preferred_height): Use min_width/height from
14351 frames size_hint to set minimum and natural (Bug#8919).
14352 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14353 and use min_width/height from frames size_hint to set
14354 min_width/height (Bug#8919).
14355
14356 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14357 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14358 Fix indentation.
14359
14360 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14361
14362 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14363 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14364 called at ZV.
14365
14366 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14367
14368 * process.c (wait_reading_process_output): Bypass select if
14369 waiting for a cell while ignoring keyboard input, and input is
14370 pending. Suggested by Jan Djärv (Bug#8869).
14371
14372 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14373
14374 Use gnulib's dup2 module instead of rolling our own.
14375 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14376
14377 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14378
14379 * dispnew.c (scrolling_window): Before scrolling, turn off a
14380 mouse-highlight in the window being scrolled.
14381
14382 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14383
14384 Move DEFSYM to lisp.h and use everywhere.
14385
14386 * character.h (DEFSYM): Move declaration...
14387 * lisp.h (DEFSYM): ...here.
14388
14389 * gnutls.c:
14390 * minibuf.c:
14391 * w32menu.c:
14392 * w32proc.c:
14393 * w32select.c: Don't include character.h.
14394
14395 * alloc.c (syms_of_alloc):
14396 * buffer.c (syms_of_buffer):
14397 * bytecode.c (syms_of_bytecode):
14398 * callint.c (syms_of_callint):
14399 * casefiddle.c (syms_of_casefiddle):
14400 * casetab.c (init_casetab_once):
14401 * category.c (init_category_once, syms_of_category):
14402 * ccl.c (syms_of_ccl):
14403 * cmds.c (syms_of_cmds):
14404 * composite.c (syms_of_composite):
14405 * dbusbind.c (syms_of_dbusbind):
14406 * dired.c (syms_of_dired):
14407 * dispnew.c (syms_of_display):
14408 * doc.c (syms_of_doc):
14409 * editfns.c (syms_of_editfns):
14410 * emacs.c (syms_of_emacs):
14411 * eval.c (syms_of_eval):
14412 * fileio.c (syms_of_fileio):
14413 * fns.c (syms_of_fns):
14414 * frame.c (syms_of_frame):
14415 * fringe.c (syms_of_fringe):
14416 * insdel.c (syms_of_insdel):
14417 * keymap.c (syms_of_keymap):
14418 * lread.c (init_obarray, syms_of_lread):
14419 * macros.c (syms_of_macros):
14420 * msdos.c (syms_of_msdos):
14421 * print.c (syms_of_print):
14422 * process.c (syms_of_process):
14423 * search.c (syms_of_search):
14424 * sound.c (syms_of_sound):
14425 * syntax.c (init_syntax_once, syms_of_syntax):
14426 * terminal.c (syms_of_terminal):
14427 * textprop.c (syms_of_textprop):
14428 * undo.c (syms_of_undo):
14429 * w32.c (globals_of_w32):
14430 * window.c (syms_of_window):
14431 * xdisp.c (syms_of_xdisp):
14432 * xfaces.c (syms_of_xfaces):
14433 * xfns.c (syms_of_xfns):
14434 * xmenu.c (syms_of_xmenu):
14435 * xsettings.c (syms_of_xsettings):
14436 * xterm.c (syms_of_xterm): Use DEFSYM.
14437
14438 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14439
14440 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14441
14442 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14443
14444 Integer and buffer overflow fixes (Bug#8873).
14445
14446 * print.c (printchar, strout): Check for string overflow.
14447 (PRINTPREPARE, printchar, strout):
14448 Don't set size unless allocation succeeds.
14449
14450 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14451 for sizes. Check for string overflow more accurately.
14452 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14453
14454 * macros.c: Integer and buffer overflow fixes.
14455 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14456 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14457 Use ptrdiff_t, not int, for sizes.
14458 Don't increment bufsize until after realloc succeeds.
14459 Check for size-calculation overflow.
14460 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14461
14462 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14463
14464 * lread.c: Integer overflow fixes.
14465 (read_integer): Radix is now EMACS_INT, not int,
14466 to improve quality of diagnostics for out-of-range radices.
14467 Calculate buffer size correctly for out-of-range radices.
14468 (read1): Check for integer overflow in radices, and in
14469 read-circle numbers.
14470 (read_escape): Avoid int overflow.
14471 (Fload, openp, read_buffer_size, read1)
14472 (substitute_object_recurse, read_vector, read_list, map_obarray):
14473 Use ptrdiff_t, not int, for sizes.
14474 (read1): Use EMACS_INT, not int, for sizes.
14475 Check for size overflow.
14476
14477 * image.c (cache_image): Check for size arithmetic overflow.
14478
14479 * lread.c: Integer overflow issues.
14480 (saved_doc_string_size, saved_doc_string_length)
14481 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14482 Now ptrdiff_t, not int.
14483 (read1): Don't assume doc string length fits in int. Check for
14484 out-of-range doc string lengths.
14485 (read_list): Don't assume file position fits in int.
14486 (read_escape): Check for hex character overflow.
14487
14488 2011-06-22 Leo Liu <sdl.web@gmail.com>
14489
14490 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14491 Move to minibuffer.el.
14492
14493 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14496 The following patches are for when GLYPH_DEBUG && !XASSERT.
14497 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14498 * dispnew.c (flush_stdout):
14499 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14500 Mark as externally visible.
14501 * dispnew.c (check_window_matrix_pointers): Now static.
14502 * dispnew.c (window_to_frame_vpos):
14503 * xfns.c (unwind_create_frame):
14504 * xterm.c (x_check_font): Remove unused local.
14505 * scroll.c (CHECK_BOUNDS):
14506 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14507 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14508 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14509 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14510 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14511 Now static.
14512 (debug_method_add): Use va_list and vsprintf rather than relying
14513 on undefined behavior with wrong number of arguments.
14514 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14515 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14516 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14517 since we're not interested in debugging glyphs with old libraries.
14518 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14519 GCC 4.6.0's static checking.
14520
14521 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14522
14523 Integer overflow and signedness fixes (Bug#8873).
14524 A few related buffer overrun fixes, too.
14525
14526 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14527
14528 * dispextern.h (struct face.stipple):
14529 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14530 (x_bitmap_mask, x_allocate_bitmap_record)
14531 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14532 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14533 (x_create_bitmap_from_xpm_data):
14534 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14535 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14536 (.bitmaps_last):
14537 * xfaces.c (load_pixmap):
14538 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14539 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14540 (.bitmaps_last, struct x_output.icon_bitmap):
14541 Use ptrdiff_t, not int, for bitmap indexes.
14542 (x_allocate_bitmap_record): Check for size overflow.
14543 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14544
14545 Use ptrdiff_t, not int, for overlay counts.
14546 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14547 * editfns.c (overlays_around, get_pos_property):
14548 * textprop.c (get_char_property_and_overlay):
14549 * xdisp.c (next_overlay_change, note_mouse_highlight):
14550 * xfaces.c (face_at_buffer_position):
14551 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14552 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14553 (Fnext_overlay_change, Fprevious_overlay_change)
14554 (mouse_face_overlay_overlaps, Foverlays_in):
14555 Use ptrdiff_t, not int, for sizes.
14556 (overlays_at, overlays_in): Check for size-calculation overflow.
14557
14558 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14559
14560 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14561 (x_session_initialize): Do not assume string length fits in int.
14562
14563 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14564 This is unlikely, but can occur if DPI is outlandish.
14565
14566 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14567 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14568
14569 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14570 * xrdb.c (magic_file_p, search_magic_path):
14571 Omit last arg SUFFIX; it was always 0. All callers changed.
14572 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14573
14574 * xfont.c (xfont_match): Avoid need for strlen.
14575
14576 * xfns.c: Don't assume strlen fits in int.
14577 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14578
14579 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14580 not unsigned long, as we prefer signed integers. All callers changed.
14581 Detect integer overflow in repeat count.
14582 (message_dolog): Don't assume print length fits in 39 bytes.
14583 (display_mode_element): Don't assume strlen fits in int.
14584
14585 * termcap.c: Don't assume sizes fit in int and never overflow.
14586 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14587 (gobble_line): Check for size-calculation overflow.
14588
14589 * minibuf.c (Fread_buffer):
14590 * lread.c (intern, intern_c_string):
14591 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14592 Don't assume string length fits in int.
14593
14594 * keyboard.c (parse_tool_bar_item):
14595 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14596
14597 * font.c: Don't assume string length fits in int.
14598 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14599 Use ptrdiff_t, not int.
14600 (font_intern_prop): Don't assume string length fits in int.
14601 Don't assume integer property fits in fixnum.
14602 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14603
14604 * filelock.c: Fix some buffer overrun and integer overflow issues.
14605 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14606 Reformulate so as not to need the command string.
14607 Invoke gzip -cd rather than gunzip, as it's more portable.
14608 (lock_info_type, lock_file_1, lock_file):
14609 Don't assume pid_t and time_t fit in unsigned long.
14610 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14611 (current_lock_owner): Prefer signed type for sizes.
14612 Use memcpy, not strncpy, where memcpy is what is really wanted.
14613 Don't assume (via atoi) that time_t and pid_t fit in int.
14614 Check for time_t and/or pid_t out of range, e.g., via a network share.
14615 Don't alloca where an auto var works fine.
14616
14617 * fileio.c: Fix some integer overflow issues.
14618 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14619 Don't assume string length fits in int.
14620 (directory_file_name): Don't assume string length fits in long.
14621 (make_temp_name): Don't assume pid fits in int, or that its print
14622 length is less than 20.
14623
14624 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14625
14626 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14627
14628 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14629
14630 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14631 We prefer signed integers, even for size calculations.
14632
14633 * emacs.c: Don't assume string length fits in 'int'.
14634 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14635 (main): Don't invoke strlen when not needed.
14636
14637 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14638 (XD_DEBUG_MESSAGE): Don't waste a byte.
14639
14640 * callproc.c (getenv_internal_1, getenv_internal)
14641 (Fgetenv_internal):
14642 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14643
14644 * lread.c (invalid_syntax): Omit length argument.
14645 All uses changed. This doesn't fix a bug, but it simplifies the
14646 code away from its former Hollerith-constant appearance, and it's
14647 one less 'int' to worry about when looking at integer-overflow issues.
14648 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14649
14650 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14651 This didn't break anything, but it didn't help either.
14652 It's confusing to put a bogus integer in a place where the actual
14653 value does not matter.
14654 (LIST_END_P): Remove unused macro and its bogus comment.
14655 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14656
14657 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14658 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14659 implementation.
14660 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14661 We prefer signed types, and the value cannot exceed the EMACS_INT
14662 range anyway (because otherwise the length would not be representable).
14663 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14664 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14665 This avoids a GCC warning when WIDE_EMACS_INT.
14666
14667 * indent.c (sane_tab_width): New function.
14668 (current_column, scan_for_column, Findent_to, position_indentation)
14669 (compute_motion): Use it. This is just for clarity.
14670 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14671
14672 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14673
14674 * lisp.h (lint_assume): New macro.
14675 * composite.c (composition_gstring_put_cache):
14676 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14677
14678 * editfns.c, insdel.c:
14679 Omit unnecessary forward decls, to simplify future changes.
14680
14681 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14682
14683 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14684
14685 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14686 Use much-faster test for byte-length change.
14687 Don't assume string byte-length fits in 'int'.
14688 Check that character arg fits in 'int'.
14689 (mapcar1): Declare byte as byte, for clarity.
14690
14691 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14692
14693 * fns.c (concat): Catch string overflow earlier.
14694 Do not rely on integer wraparound.
14695
14696 * dispextern.h (struct it.overlay_strings_charpos)
14697 (struct it.selective): Now EMACS_INT, not int.
14698 * xdisp.c (forward_to_next_line_start)
14699 (back_to_previous_visible_line_start)
14700 (reseat_at_next_visible_line_start, next_element_from_buffer):
14701 Don't arbitrarily truncate the value of 'selective' to int.
14702
14703 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14704
14705 * composite.c: Don't truncate sizes to 'int'.
14706 (composition_gstring_p, composition_reseat_it)
14707 (composition_adjust_point): Use EMACS_INT, not int.
14708 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14709 not EMACS_UINT, for indexes.
14710
14711 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14712
14713 * buffer.c: Include <verify.h>.
14714 (struct sortvec.priority, struct sortstr.priority):
14715 Now EMACS_INT, not int.
14716 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14717 (struct sortstr.size, record_overlay_string)
14718 (struct sortstrlist.size, struct sortlist.used):
14719 Don't truncate size to int.
14720 (record_overlay_string): Check for size-calculation overflow.
14721 (init_buffer_once): Check at compile-time, not run-time.
14722
14723 2011-06-22 Jim Meyering <meyering@redhat.com>
14724
14725 Don't leak an XBM-image-sized buffer
14726 * image.c (xbm_load): Free the image buffer after using it.
14727
14728 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14729
14730 Port to Sun C.
14731 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14732 that Sun C diagnosed.
14733 * fns.c (secure_hash): Fix pointer signedness issue.
14734 * intervals.c (static_offset_intervals): New function.
14735 (offset_intervals): Use it.
14736
14737 2011-06-21 Leo Liu <sdl.web@gmail.com>
14738
14739 * deps.mk (fns.o):
14740 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14741 sha512.h.
14742
14743 * fns.c (secure_hash): Rename from crypto_hash_function and change
14744 the first arg to accept symbols.
14745 (Fsecure_hash): New primitive.
14746 (syms_of_fns): New symbols.
14747
14748 2011-06-20 Deniz Dogan <deniz@dogan.se>
14749
14750 * process.c (Fset_process_buffer): Clarify return value in
14751 docstring.
14752
14753 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14754
14755 * dispnew.c (add_window_display_history): Use BVAR.
14756
14757 * xdisp.c (debug_method_add): Use BVAR.
14758 (check_window_end, dump_glyph_matrix, dump_glyph)
14759 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14760
14761 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14762 Likewise.
14763
14764 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14765 check till after the cache is created in init_frame_faces.
14766
14767 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14768
14769 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14770
14771 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14772
14773 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14774 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14775 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14776
14777 Improve buffer-overflow checking (Bug#8873).
14778 * fileio.c (Finsert_file_contents):
14779 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14780 Remove the old (too-loose) buffer overflow checks.
14781 They weren't needed, since make_gap checks for buffer overflow.
14782 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14783 The old code merely checked for Emacs fixnum overflow, and relied
14784 on undefined (wraparound) behavior. The new code avoids undefined
14785 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14786
14787 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14788 Tune. Don't use wider integers than needed. Don't use alloca.
14789 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14790
14791 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14792
14793 * insdel.c, lisp.h (buffer_overflow): New function.
14794 (insert_from_buffer_1, replace_range, replace_range_2):
14795 * insdel.c (make_gap_larger):
14796 * editfns.c (Finsert_char):
14797 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14798
14799 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14800
14801 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14802
14803 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14804
14805 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14806 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14807
14808 * fileio.c: Don't assume EMACS_INT fits in off_t.
14809 (emacs_lseek): New static function.
14810 (Finsert_file_contents, Fwrite_region): Use it.
14811 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14812
14813 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14814
14815 * fns.c: Don't overflow int when computing a list length.
14816 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14817 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14818 truncation on 64-bit hosts. Check for QUIT every
14819 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14820 faster and is responsive enough.
14821 (Flength): Report an error instead of overflowing an integer.
14822 (Fsafe_length): Return a float if the value is not representable
14823 as a fixnum. This shouldn't happen except in contrived situations.
14824 (Fnthcdr, Fsort): Don't assume list length fits in int.
14825 (Fcopy_sequence): Don't assume vector length fits in int.
14826
14827 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14828 (header_size, word_size): New constants.
14829 (allocate_vectorlike): Don't check size overflow here.
14830 (allocate_vector): Check it here instead, since this is the only
14831 caller of allocate_vectorlike that could cause overflow.
14832 Check that the new vector's length is representable as a fixnum.
14833
14834 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14835 The previous code was bogus. For example, next_almost_prime (32)
14836 returned 39, which is undesirable as it is a multiple of 3; and
14837 next_almost_prime (24) returned 25, which is a multiple of 5 so
14838 why was the code bothering to check for multiples of 7?
14839
14840 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14841
14842 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14843
14844 Variadic C functions now count arguments with ptrdiff_t.
14845 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14846 Back then I didn't know that the Emacs coding style prefers signed int.
14847 Also, in the meantime I found a few more instances where arguments
14848 were being counted with int, which may truncate counts on 64-bit
14849 machines, or EMACS_INT, which may be unnecessarily wide.
14850 * lisp.h (struct Lisp_Subr.function.aMANY)
14851 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14852 Arg counts are now ptrdiff_t, not size_t.
14853 All variadic functions and their callers changed accordingly.
14854 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14855 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14856 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14857 * callint.c (Fcall_interactively): Check arg count for overflow,
14858 to avoid potential buffer overrun. Use signed char, not 'int',
14859 for 'varies' array, so that we needn't bother to check its size
14860 calculation for overflow.
14861 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14862 * eval.c (apply_lambda):
14863 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14864 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14865 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14866
14867 * callint.c (Fcall_interactively): Don't use index var as event count.
14868
14869 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14870 * mem-limits.h (SIZE): Remove; no longer used.
14871
14872 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14873
14874 Remove unnecessary casts.
14875 * xterm.c (x_term_init):
14876 * xfns.c (x_set_border_pixel):
14877 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14878 These aren't needed now that we assume ANSI C.
14879
14880 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14881 It's more likely to cause problems (due to unsigned overflow)
14882 than to cure them.
14883
14884 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14885
14886 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14887
14888 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14889
14890 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14891
14892 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14893
14894 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14895
14896 GLYPH_CODE_FACE returns EMACS_INT, not int.
14897 * dispextern.h (merge_faces):
14898 * xfaces.c (merge_faces):
14899 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14900 Don't assume EMACS_INT fits in int.
14901
14902 * character.h (CHAR_VALID_P): Remove unused parameter.
14903 * fontset.c, lisp.h, xdisp.c: All uses changed.
14904
14905 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14906
14907 * fns.c (concat): Minor tuning based on overflow analysis.
14908 This doesn't fix any bugs. Use int to hold character, instead
14909 of constantly refetching from Emacs object. Use XFASTINT, not
14910 XINT, for value known to be a character. Don't bother comparing
14911 a single byte to 0400, as it's always less.
14912
14913 * floatfns.c (Fexpt):
14914 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14915
14916 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14917 for characters.
14918
14919 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14920
14921 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14922 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14923 incorrectly succeed when S was a string, because 4294967386 was
14924 truncated before it was used.
14925
14926 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14927 Otherwise, an out-of-range integer could cause undefined behavior
14928 on a 64-bit host.
14929
14930 * composite.c: Use int, not EMACS_INT, for characters.
14931 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14932 EMACS_INT, for values that are known to be in character range.
14933 This doesn't fix any bugs but is the usual style inside Emacs and
14934 may generate better code on 32-bit machines.
14935
14936 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14937 This is for reasons similar to the recent CHAR_STRING fix.
14938 * charset.c (Fencode_char): Check that character arg is actually
14939 a character. Pass an int to ENCODE_CHAR.
14940 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14941 wider than 'int', as a compile-time check to prevent future regressions
14942 in this area.
14943
14944 * character.c (char_string): Remove unnecessary casts.
14945
14946 Make sure a 64-bit char is never passed to CHAR_STRING.
14947 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14948 by silently ignoring the top 32 bits, allowing some values
14949 that were far too large to be valid characters.
14950 * character.h: Include <verify.h>.
14951 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14952 arguments are no wider than unsigned, as a compile-time check
14953 to prevent future regressions in this area.
14954 * data.c (Faset):
14955 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14956 (Fsubst_char_in_region):
14957 * fns.c (concat):
14958 * xdisp.c (decode_mode_spec_coding):
14959 Adjust to CHAR_STRING's new requirement.
14960 * editfns.c (Finsert_char, Fsubst_char_in_region):
14961 * fns.c (concat): Check that character args are actually
14962 characters. Without this test, these functions did the wrong
14963 thing with wildly out-of-range values on 64-bit hosts.
14964
14965 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14966 These casts should not be needed on 32-bit hosts, either.
14967 * keyboard.c (read_char):
14968 * lread.c (Fload): Remove casts to unsigned.
14969
14970 * lisp.h (UNSIGNED_CMP): New macro.
14971 This fixes comparison bugs on 64-bit hosts.
14972 (ASCII_CHAR_P): Use it.
14973 * casefiddle.c (casify_object):
14974 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14975 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14976 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14977 * dispextern.h (FACE_FROM_ID):
14978 * keyboard.c (read_char): Use UNSIGNED_CMP.
14979
14980 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14981 not to EMACS_INT, to avoid GCC warning.
14982
14983 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14984
14985 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14986 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14987 isn't needed on 32-bit machines.
14988
14989 * buffer.c (Fgenerate_new_buffer_name):
14990 Use EMACS_INT for count, not int.
14991 (advance_to_char_boundary): Return EMACS_INT, not int.
14992
14993 * data.c (Qcompiled_function): Now static.
14994
14995 * window.c (window_body_lines): Now static.
14996
14997 * image.c (gif_load): Rename local to avoid shadowing.
14998
14999 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15000 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15001 * alloc.c (make_save_value): Integer argument is now of type
15002 ptrdiff_t, not int.
15003 (mark_object): Use ptrdiff_t, not int.
15004 * lisp.h (pD): New macro.
15005 * print.c (print_object): Use it.
15006
15007 * alloc.c: Use EMACS_INT, not int, to count objects.
15008 (total_conses, total_markers, total_symbols, total_vector_size)
15009 (total_free_conses, total_free_markers, total_free_symbols)
15010 (total_free_floats, total_floats, total_free_intervals)
15011 (total_intervals, total_strings, total_free_strings):
15012 Now EMACS_INT, not int. All uses changed.
15013 (Fgarbage_collect): Compute overall total using a double, so that
15014 integer overflow is less likely to be a problem. Check for overflow
15015 when converting back to an integer.
15016 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15017 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15018 These were 'int' variables that could overflow on 64-bit hosts;
15019 they were never used, so remove them instead of repairing them.
15020 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
15021 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15022 Previously, this ceilinged at INT_MAX, but that doesn't work on
15023 64-bit machines.
15024 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15025
15026 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15027 (allocate_vectorlike): Check for ptrdiff_t overflow.
15028 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15029 when a (possibly-narrower) signed value would do just as well.
15030 We prefer using signed arithmetic, to avoid comparison confusion.
15031
15032 * alloc.c: Catch some string size overflows that we were missing.
15033 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15034 for convenience in STRING_BYTES_MAX.
15035 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15036 The definition here is exact; the one in lisp.h was approximate.
15037 (allocate_string_data): Check for string overflow. This catches
15038 some instances we weren't catching before. Also, it catches
15039 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15040 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15041 and ptrdiff_t and EMACS_INT are both 64 bits.
15042
15043 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15044 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15045 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15046
15047 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15048
15049 * alloc.c (Fmake_string): Check for out-of-range init.
15050
15051 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15052
15053 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15054
15055 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15056
15057 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15058 xg_get_default_scrollbar_width.
15059
15060 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15061 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15062 (style_changed_cb): Call update_theme_scrollbar_width and call
15063 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15064 all frames (Bug#8505).
15065 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15066 Call gtk_window_set_resizable if HAVE_GTK3.
15067 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15068 and height if HAVE_GTK3 (Bug#8505).
15069 (scroll_bar_width_for_theme): New variable.
15070 (update_theme_scrollbar_width): New function.
15071 (xg_get_default_scrollbar_width): Move code to
15072 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15073 (xg_initialize): Call update_theme_scrollbar_width.
15074
15075 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15076
15077 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15078
15079 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15080
15081 * frame.c (make_frame): Call other_buffer_safely instead of
15082 other_buffer.
15083
15084 * window.c (temp_output_buffer_show): Call display_buffer with
15085 second argument Vtemp_buffer_show_specifiers and reset latter
15086 immediately after the call.
15087 (Vtemp_buffer_show_specifiers): New variable.
15088 (auto_window_vscroll_p, next_screen_context_lines)
15089 (Vscroll_preserve_screen_position): Remove leading asterisks from
15090 doc-strings.
15091
15092 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15093
15094 Fix minor problems found by GCC 4.6.0 static checking.
15095 * buffer.c (Qclone_number): Remove for now, as it's unused.
15096 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15097 (record_buffer): Remove unused local.
15098 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15099 (set_frame_buffer_list): Remove; unused.
15100 * frame.h (other_visible_frames): Remove decl.
15101 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15102 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15103 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15104 if HAVE_GPM.
15105 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15106 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15107 Define only if HAVE_GPM.
15108 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15109 (update_hints_inhibit): Remove; never set. All uses removed.
15110 * widgetprv.h (emacsFrameClassRec): Remove decl.
15111 * window.c (delete_deletable_window): Now returns void, since it
15112 wasn't returning anything.
15113 (compare_window_configurations): Remove unused locals.
15114 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15115 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15116 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15117 the same widths as pointers. This follows up on the 2011-05-06 patch.
15118 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15119 * xterm.h: Likewise.
15120 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15121
15122 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15123
15124 * makefile.w32-in: Update dependencies.
15125 (LISP_H): Add lib/intprops.h.
15126
15127 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15128
15129 * image.c (gif_load): Add animation frame delay to the metadata.
15130 (syms_of_image): Use DEFSYM. New symbol `delay'.
15131
15132 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15133
15134 * window.c (delete_deletable_window): Re-add.
15135 (Fset_window_configuration): Rewrite to handle dead buffers and
15136 consequently deletable windows.
15137 (window_tree, Fwindow_tree): Remove. Supply functionality in
15138 window.el.
15139 (compare_window_configurations): Simplify code.
15140
15141 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15142
15143 * image.c (imagemagick_load_image): Fix type mismatch.
15144 (Fimagemagick_types): Likewise.
15145
15146 * window.h (replace_buffer_in_windows): Declare.
15147
15148 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15149
15150 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15151 Qclone_number. Remove external declaration of Qdelete_window.
15152 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15153 code.
15154 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15155 Run Qbuffer_list_update_hook if allowed.
15156 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15157 buffer list implementation.
15158 (other_buffer_safely): New function.
15159 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15160 calls to replace_buffer_in_windows and
15161 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15162 if allowed.
15163 (record_buffer): Inhibit quitting and rewrite using quittable
15164 functions. Run Qbuffer_list_update_hook if allowed.
15165 (Frecord_buffer, Funrecord_buffer): New functions.
15166 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15167 Move switch-to-buffer to window.el.
15168 (bury-buffer): Move to window.el.
15169 (Vbuffer_list_update_hook): New variable.
15170
15171 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15172 section.
15173
15174 * window.h (resize_frame_windows): Move up in code.
15175 (Fwindow_frame): Remove EXFUN.
15176 (replace_buffer_in_all_windows): Remove prototype.
15177 (replace_buffer_in_windows_safely): Add prototype.
15178
15179 * window.c: Declare Qdelete_window static again. Move down
15180 declaration of select_count.
15181 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15182 (Fother_window): Move to window.el.
15183 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15184 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15185 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15186 window.el.
15187 (replace_buffer_in_windows): Implement by calling
15188 Qreplace_buffer_in_windows.
15189 (replace_buffer_in_all_windows): Remove with some functionality
15190 moved into replace_buffer_in_windows_safely.
15191 (replace_buffer_in_windows_safely): New function.
15192 (select_window_norecord, select_frame_norecord): Move in front
15193 of run_window_configuration_change_hook. Remove now obsolete
15194 declarations.
15195 (Fset_window_buffer): Rewrite doc-string.
15196 Call Qrecord_window_buffer.
15197 (keys_of_window): Move binding for other-window to window.el.
15198
15199 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15200
15201 * dispextern.h (struct image): Replace data member, whose int_val
15202 and ptr_val fields were not used by anything, with a single
15203 lisp_val object.
15204
15205 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15206 (gif_clear_image, gif_load, imagemagick_load_image)
15207 (gs_clear_image, gs_load): Callers changed.
15208
15209 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15210
15211 * buffer.h: Include <time.h>, for time_t.
15212 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15213
15214 Fix minor problems found by static checking.
15215
15216 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15217
15218 Make identifiers static if they are not used in other modules.
15219 * data.c (Qcompiled_function, Qframe, Qvector):
15220 * image.c (QimageMagick, Qsvg):
15221 * minibuf.c (Qmetadata):
15222 * window.c (resize_window_check, resize_root_window): Now static.
15223 * window.h (resize_window_check, resize_root_window): Remove decls.
15224
15225 * window.c (window_deletion_count, delete_deletable_window):
15226 Remove; unused.
15227 (window_body_lines): Now static.
15228 (Fdelete_other_windows_internal): Mark vars as initialized.
15229 Make sure 'resize_failed' is initialized.
15230 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15231 (resize_window_apply): Remove unused local.
15232 * window.h (delete_deletable_window): Remove decl.
15233
15234 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15235 (imagemagick_load_image): Fix pointer signedness problem by changing
15236 last arg from unsigned char * to char *. All uses changed.
15237 Also, fix a local for similar reasons.
15238 Remove unused locals. Remove locals to avoid shadowing.
15239 (fn_rsvg_handle_free): Remove; unused.
15240 (svg_load, svg_load_image): Fix pointer signedness problem.
15241 (imagemagick_load_image): Don't use garbage pointer image_wand.
15242
15243 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15244
15245 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15246
15247 * image.c (gif_load): Fix omitted cast error introduced by
15248 2011-06-06 change.
15249
15250 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15251
15252 * window.h (resize_proportionally, orig_total_lines)
15253 (orig_top_line): Remove from window structure.
15254 (set_window_height, set_window_width, change_window_heights)
15255 (Fdelete_window): Remove prototypes.
15256 (resize_frame_windows): Remove duplicate declaration.
15257
15258 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15259
15260 * window.h (resize_frame_windows, resize_window_check)
15261 (delete_deletable_window, resize_root_window)
15262 (resize_frame_windows): Declare prototypes.
15263
15264 * window.c (resize_window_apply): Make definition be "static" to
15265 match the prototype.
15266
15267 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15268
15269 * window.c: Remove declarations of Qwindow_size_fixed,
15270 window_min_size_1, window_min_size_2, window_min_size,
15271 size_window, window_fixed_size_p, enlarge_window, delete_window.
15272 Remove static from declaration of Qdelete_window, it's
15273 temporarily needed by Fbury_buffer.
15274 (replace_window): Don't assign orig_top_line and
15275 orig_total_lines.
15276 (Fdelete_window, delete_window): Remove. Window deletion is
15277 handled by window.el.
15278 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15279 Replace Fdelete_window calls with calls to Qdelete_window.
15280 (Fdelete_other_windows): Remove. Deleting other windows is
15281 handled by window.el.
15282 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15283 handled in window.el.
15284 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15285 Window minimum sizes are handled in window.el.
15286 (shrink_windows, size_window, set_window_height)
15287 (set_window_width, change_window_heights, window_height)
15288 (window_width, CURBEG, CURSIZE, enlarge_window)
15289 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15290 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15291 handled in window.el.
15292 (make_dummy_parent): Rename to make_parent_window and give it a
15293 second argument horflag.
15294 (make_window): Don't set resize_proportionally any more.
15295 (Fsplit_window): Remove. Windows are split in window.el.
15296 (save_restore_action, save_restore_orig_size)
15297 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15298 Resize mini windows in window.el.
15299 (grow_mini_window, shrink_mini_window): Implement by calling
15300 Qresize_root_window_vertically, resize_window_check and
15301 resize_window_apply.
15302 (saved_window, Fset_window_configuration, save_window_save):
15303 Do not handle orig_top_line, orig_total_lines, and
15304 resize_proportionally.
15305 (window_min_height, window_min_width): Move to window.el.
15306 (keys_of_window): Move bindings for delete-other-windows,
15307 split-window, delete-window and enlarge-window to window.el.
15308
15309 * buffer.c: Temporarily extern Qdelete_window.
15310 (Fbury_buffer): Temporarily call Qdelete_window instead of
15311 Fdelete_window (Fbury_buffer will move to window.el soon).
15312
15313 * frame.c (set_menu_bar_lines_1): Remove code handling
15314 orig_top_line and orig_total_lines.
15315
15316 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15317 set_window_height but set heights directly.
15318 (change_frame_size_1): Use resize_frame_windows.
15319
15320 * xdisp.c (init_xdisp): Don't use set_window_height but set
15321 heights directly.
15322
15323 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15324 Use resize_frame_windows instead of change_window_heights and run
15325 run_window_configuration_change_hook.
15326
15327 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15328 instead of change_window_heights and run
15329 run_window_configuration_change_hook.
15330
15331 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15332
15333 * window.c (replace_window): Rename second argument REPLACEMENT to
15334 NEW. New third argument SETFLAG. Rewrite.
15335 (delete_window, make_dummy_parent): Call replace_window with
15336 third argument 1.
15337 (window_list_1): Move down in code.
15338 (run_window_configuration_change_hook): Move set_buffer part
15339 before select_frame_norecord part in order to unwind correctly.
15340 Rename count1 to count.
15341 (recombine_windows, delete_deletable_window, resize_root_window)
15342 (Fdelete_other_windows_internal)
15343 (Frun_window_configuration_change_hook, make_parent_window)
15344 (resize_window_check, resize_window_apply, Fresize_window_apply)
15345 (resize_frame_windows, Fsplit_window_internal)
15346 (Fdelete_window_internal, Fresize_mini_window_internal):
15347 New functions.
15348 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15349
15350 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15351
15352 * window.h (window): Add some new members to window structure -
15353 normal_lines, normal_cols, new_total, new_normal, clone_number,
15354 splits, nest, prev_buffers, next_buffers.
15355 (WINDOW_TOTAL_SIZE): Move here from window.c.
15356 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15357
15358 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15359 Remove.
15360 (make_dummy_parent): Set new members of windows structure.
15361 (make_window): Move down in code. Handle new members of window
15362 structure.
15363 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15364 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15365 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15366 (Fset_window_prev_buffers, Fwindow_next_buffers)
15367 (Fset_window_next_buffers, Fset_window_clone_number):
15368 New functions.
15369 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15370 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15371 Doc-string fixes.
15372 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15373 Argument WINDOW can be now internal window too.
15374 (Fwindow_use_time): Move up in code.
15375 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15376 Rewrite doc-string.
15377 (Fset_window_configuration, saved_window)
15378 (Fcurrent_window_configuration, save_window_save): Handle new
15379 members of window structure.
15380 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15381 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15382 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15383 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15384 Qget_mru_window, Qresize_root_window,
15385 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15386 Qauto_buffer_name; staticpro them.
15387
15388 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15389
15390 * window.c (Fwindow_total_size, Fwindow_left_column)
15391 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15392 (Fwindow_list_1): New functions.
15393 (window_box_text_cols): Replace with window_body_cols.
15394 (Fwindow_width, Fscroll_left, Fscroll_right):
15395 Use window_body_cols instead of window_box_text_cols.
15396 (delete_window, Fset_window_configuration):
15397 Call delete_all_subwindows with window as argument.
15398 (delete_all_subwindows): Take a window as argument and not a
15399 structure. Rewrite.
15400 (window_loop): Remove handling of GET_LRU_WINDOW and
15401 GET_LARGEST_WINDOW.
15402 (Fget_lru_window, Fget_largest_window): Move to window.el.
15403
15404 * window.h: Extern window_body_cols instead of
15405 window_box_text_cols. delete_all_subwindows now takes a
15406 Lisp_Object as argument.
15407
15408 * indent.c (compute_motion, Fcompute_motion):
15409 Use window_body_cols instead of window_box_text_cols.
15410
15411 * frame.c (delete_frame): Call delete_all_subwindows with root
15412 window as argument.
15413
15414 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15415
15416 * fns.c (Fputhash): Document return value.
15417
15418 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15419
15420 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15421
15422 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15423
15424 Cons<->int and similar integer overflow fixes (Bug#8794).
15425
15426 Check for overflow when converting integer to cons and back.
15427 * charset.c (Fdefine_charset_internal, Fdecode_char):
15428 Use cons_to_unsigned to catch overflow.
15429 (Fencode_char): Use INTEGER_TO_CONS.
15430 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15431 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15432 * data.c (long_to_cons, cons_to_long): Remove.
15433 (cons_to_unsigned, cons_to_signed): New functions.
15434 These signal an error for invalid or out-of-range values.
15435 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15436 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15437 * font.c (Ffont_variation_glyphs):
15438 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15439 * lisp.h: Include <intprops.h>.
15440 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15441 (cons_to_signed, cons_to_unsigned): New decls.
15442 (long_to_cons, cons_to_long): Remove decls.
15443 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15444 (Fprimitive_undo): Use CONS_TO_INTEGER.
15445 * xfns.c (Fx_window_property): Likewise.
15446 * xselect.c: Include <limits.h>.
15447 (x_own_selection, selection_data_to_lisp_data):
15448 Use INTEGER_TO_CONS.
15449 (x_handle_selection_request, x_handle_selection_clear)
15450 (x_get_foreign_selection, Fx_disown_selection_internal)
15451 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15452 (lisp_data_to_selection_data): Use cons_to_unsigned.
15453 (x_fill_property_data): Use cons_to_signed.
15454 Report values out of range.
15455
15456 Check for buffer and string overflow more precisely.
15457 * buffer.h (BUF_BYTES_MAX): New macro.
15458 * lisp.h (STRING_BYTES_MAX): New macro.
15459 * alloc.c (Fmake_string):
15460 * character.c (string_escape_byte8):
15461 * coding.c (coding_alloc_by_realloc):
15462 * doprnt.c (doprnt):
15463 * editfns.c (Fformat):
15464 * eval.c (verror):
15465 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15466 since they may not be the same number.
15467 * editfns.c (Finsert_char):
15468 * fileio.c (Finsert_file_contents):
15469 Likewise for BUF_BYTES_MAX.
15470
15471 * image.c: Use ptrdiff_t, not int, for sizes.
15472 (slurp_file): Switch from int to ptrdiff_t.
15473 All uses changed.
15474 (slurp_file): Check that file size fits in both size_t (for
15475 malloc) and ptrdiff_t (for sanity and safety).
15476
15477 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15478 if b->modtime has its maximal value.
15479
15480 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15481
15482 Don't assume time_t can fit into int.
15483 * buffer.h (struct buffer.modtime): Now time_t, not int.
15484 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15485 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15486
15487 Minor fixes for signed vs unsigned integers.
15488 * character.h (MAYBE_UNIFY_CHAR):
15489 * charset.c (maybe_unify_char):
15490 * keyboard.c (read_char, reorder_modifiers):
15491 XINT -> XFASTINT, since the integer must be nonnegative.
15492 * ftfont.c (ftfont_spec_pattern):
15493 * keymap.c (access_keymap, silly_event_symbol_error):
15494 XUINT -> XFASTINT, since the integer must be nonnegative.
15495 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15496 since it makes no difference and we prefer signed.
15497 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15498 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15499 nonnegative.
15500
15501 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15502
15503 * window.h (Fwindow_frame): Declare.
15504
15505 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15506
15507 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15508 (SPARE_MEMORY): Always define.
15509 (LARGE_REQUEST): Remove.
15510 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15511
15512 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15513
15514 * lisp.h: Move EXFUNS for Fframe_root_window,
15515 Fframe_first_window and Fset_frame_selected_window to window.h.
15516
15517 * window.h: Move EXFUNS for Fframe_root_window,
15518 Fframe_first_window and Fset_frame_selected_window here from
15519 lisp.h.
15520
15521 * frame.c (Fwindow_frame, Fframe_first_window)
15522 (Fframe_root_window, Fframe_selected_window)
15523 (Fset_frame_selected_window): Move to window.c.
15524 (Factive_minibuffer_window): Move to minibuf.c.
15525 (Fother_visible_frames_p): New function.
15526
15527 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15528
15529 * window.c (decode_window, decode_any_window): Move up in code.
15530 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15531 (inhibit_frame_unsplittable): Remove unused variable.
15532 (Fwindow_buffer): Move up and rewrite doc-string.
15533 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15534 (Fwindow_prev): New functions.
15535 (Fwindow_frame): Move here from frame.c. Accept any window as
15536 argument.
15537 (Fframe_root_window, Fframe_first_window)
15538 (Fframe_selected_window): Move here from frame.c. Accept frame
15539 or arbitrary window as argument. Update doc-strings.
15540 (Fminibuffer_window): Move up in code.
15541 (Fwindow_minibuffer_p): Move up in code and simplify.
15542 (Fset_frame_selected_window): Move here from frame.c.
15543 Marginal rewrite.
15544 (Fselected_window, select_window, Fselect_window): Move up in
15545 code. Minor doc-string fixes.
15546
15547 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15548
15549 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15550 Do not assume that spare memory exists; that assumption is valid
15551 only if SYSTEM_MALLOC.
15552 (LARGE_REQUEST): New macro, so that the issue of large requests
15553 is separated from the issue of spare memory.
15554
15555 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15556
15557 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15558 format. (Bug#8806)
15559
15560 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15561
15562 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15563 before statements.
15564
15565 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15566
15567 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15568
15569 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15570
15571 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15572 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15573
15574 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15575
15576 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15577
15578 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15579
15580 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15581 (x_clipboard_manager_save): Add return value.
15582 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15583 New error handlers.
15584 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15585 Obey Vx_select_enable_clipboard_manager. Catch errors in
15586 x_clipboard_manager_save (Bug#8779).
15587 (Vx_select_enable_clipboard_manager): New variable.
15588 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15589
15590 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15591
15592 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15593
15594 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15595
15596 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15597 in the current matrix if keep_current_p is non-zero.
15598
15599 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15600
15601 * bidi.c (bidi_level_of_next_char): Fix last change.
15602
15603 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15604
15605 Support bidi reordering of text covered by display properties.
15606
15607 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15608 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15609 (bidi_cache_search, bidi_cache_iterator_state)
15610 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15611 (bidi_level_of_next_char, bidi_move_to_visually_next):
15612 Support character positions inside a run of characters covered by a
15613 display string.
15614 (bidi_paragraph_init, bidi_resolve_explicit_1)
15615 (bidi_level_of_next_char): Call bidi_fetch_char and
15616 bidi_fetch_char_advance instead of FETCH_CHAR and
15617 FETCH_CHAR_ADVANCE.
15618 (bidi_init_it): Initialize new members.
15619 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15620 definitions.
15621 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15622 instead of using explicit *_CHAR codes.
15623 (bidi_resolve_explicit, bidi_resolve_weak):
15624 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15625 bidirectional text is supported only in multibyte buffers.
15626 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15627 it to initialize the frame_window_p member of struct bidi_it.
15628 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15629 (bidi_resolve_explicit, bidi_resolve_weak)
15630 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15631 bidi_it->nchars is non-positive.
15632 (bidi_level_of_next_char): Don't try to lookup the cache for the
15633 next/previous character if nothing is cached there yet, or if we
15634 were just reseat()'ed to a new position.
15635
15636 * xdisp.c (set_cursor_from_row): Set start and stop points
15637 according to the row's direction when priming the loop that looks
15638 for the glyph on which to display cursor.
15639 (single_display_spec_intangible_p): Function deleted.
15640 (display_prop_intangible_p): Reimplement to call
15641 handle_display_spec instead of single_display_spec_intangible_p.
15642 Accept 3 additional arguments needed by handle_display_spec.
15643 This fixes incorrect cursor motion across display property with complex
15644 values: lists, `(when COND...)' forms, etc.
15645 (single_display_spec_string_p): Support property values that are
15646 lists with the argument STRING its top-level element.
15647 (display_prop_string_p): Fix the condition for processing a
15648 property that is a list to be consistent with handle_display_spec.
15649 (handle_display_spec): New function, refactored from the
15650 last portion of handle_display_prop.
15651 (compute_display_string_pos): Accept additional argument
15652 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15653 value of a `display' property is a "replacing spec".
15654 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15655 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15656 the display property, but just return a value indicating whether
15657 the display property will replace the characters it covers.
15658 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15659 frame_window_p members of struct bidi_it.
15660 (compute_display_string_pos, compute_display_string_end):
15661 New functions.
15662 (push_it): Accept second argument POSITION, where pop_it should
15663 jump to continue iteration.
15664 (reseat_1): Initialize bidi_it.disp_pos.
15665
15666 * keyboard.c (adjust_point_for_property): Adjust the call to
15667 display_prop_intangible_p to its new signature.
15668
15669 * dispextern.h (struct bidi_it): New member frame_window_p.
15670 (bidi_init_it): Update prototypes.
15671 (display_prop_intangible_p): Update prototype.
15672 (compute_display_string_pos, compute_display_string_end):
15673 Declare prototypes.
15674 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15675 EMACS_INT.
15676
15677 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15678
15679 Malloc failure behavior now depends on size of allocation.
15680 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15681 * lisp.h: Change signatures accordingly.
15682 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15683 All callers changed. (Bug#8762)
15684
15685 * gnutls.c: Use Emacs's memory allocators.
15686 Without this change, the gnutls library would invoke malloc etc.
15687 directly, which causes problems on non-SYNC_INPUT hosts, and which
15688 runs afoul of improving memory_full behavior. (Bug#8761)
15689 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15690 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15691 xfree instead of the default malloc, realloc, free.
15692 (Fgnutls_boot): No need to check for memory allocation failure,
15693 since xmalloc does that for us.
15694
15695 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15696 * category.c (hash_get_category_set):
15697 * ccl.c (ccl_driver):
15698 * charset.c (Fdefine_charset_internal):
15699 * charset.h (struct charset.hash_index):
15700 * composite.c (get_composition_id, gstring_lookup_cache)
15701 (composition_gstring_put_cache):
15702 * composite.h (struct composition.hash_index):
15703 * dispextern.h (struct image.hash):
15704 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15705 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15706 (hashfn_equal, hashfn_user_defined, make_hash_table)
15707 (maybe_resize_hash_table, hash_lookup, hash_put)
15708 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15709 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15710 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15711 * image.c (make_image, search_image_cache, lookup_image)
15712 (xpm_put_color_table_h):
15713 * lisp.h (struct Lisp_Hash_Table):
15714 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15715 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15716 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15717 * alloc.c (allocate_vectorlike):
15718 Check for overflow in vector size calculations.
15719 * ccl.c (ccl_driver):
15720 Check for overflow when converting EMACS_INT to int.
15721 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15722 need to be updated by these changes.
15723 * fns.c (make_hash_table, maybe_resize_hash_table):
15724 Check for integer overflow with large hash tables.
15725 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15726 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15727 (SXHASH_REDUCE): New macro.
15728 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15729 Use it instead of discarding useful hash info with large hash values.
15730 (sxhash_float): New function.
15731 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15732 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15733 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15734 Rewrite to use FIXNUM_BITS, as this simplifies things.
15735 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15736 Adjust signatures to match updated version of code.
15737 (consing_since_gc): Now EMACS_INT, since a single hash table can
15738 use more than INT_MAX bytes.
15739
15740 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15741
15742 Make it possible to build with GCC-4.6+ -O2 -flto.
15743
15744 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15745
15746 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15747
15748 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15749 Call minibuffer-inactive-mode.
15750
15751 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15752
15753 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15754 Update dependencies.
15755
15756 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15757
15758 * data.c (init_data): Remove code for UTS, this system is not
15759 supported anymore.
15760
15761 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15762
15763 Don't force ./temacs to start in terminal mode.
15764
15765 * frame.c (make_initial_frame): Initialize faces in all cases, not
15766 only when CANNOT_DUMP is defined.
15767 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15768
15769 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15770
15771 * dispnew.c (add_window_display_history): Use const for the string
15772 pointer. Remove declaration, not needed.
15773
15774 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15775
15776 Use 'inline', not 'INLINE'.
15777 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15778 * alloc.c, fontset.c (INLINE): Remove.
15779 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15780 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15781 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15782 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15783 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15784
15785 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15786
15787 Make it possible to run ./temacs.
15788
15789 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15790 syms_of_callproc does the same thing. Remove test for
15791 "initialized", do it in the caller.
15792 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15793
15794 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15795
15796 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15797 (read_minibuf): Use get_minibuffer.
15798 (syms_of_minibuf): Use DEFSYM.
15799 (Qmetadata): New var.
15800 * data.c (Qbuffer): Don't make it static.
15801 (syms_of_data): Use DEFSYM.
15802
15803 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15804
15805 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15806 (CCL_CODE_MIN): New macro.
15807
15808 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15809
15810 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15811
15812 * eval.c (Qdebug): Now static.
15813 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15814 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15815 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15816
15817 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15818
15819 * image.c: Various fixes to ImageMagick code comments.
15820 (Fimagemagick_types): Doc fix.
15821
15822 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15823
15824 Minor fixes prompted by GCC 4.6.0 warnings.
15825
15826 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15827
15828 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15829 (x_clipboard_manager_save_all): Move extern decl to ...
15830 * xterm.h: ... here, so that it can be checked for consistency.
15831
15832 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15833
15834 * xselect.c (x_clipboard_manager_save_frame)
15835 (x_clipboard_manager_save_all): New functions.
15836 (Fx_clipboard_manager_save): Lisp function deleted.
15837
15838 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15839 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15840
15841 * xterm.h: Update prototype.
15842
15843 2011-05-28 William Xu <william.xwl@gmail.com>
15844
15845 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15846 exiting (Bug#8239).
15847
15848 2011-05-28 Jim Meyering <meyering@redhat.com>
15849
15850 Avoid a sign-extension bug in crypto_hash_function.
15851 * fns.c (to_uchar): Define.
15852 (crypto_hash_function): Use it to convert some newly-signed
15853 variables to unsigned, to avoid sign-extension bugs. For example,
15854 without this change, (md5 "truc") would evaluate to
15855 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15856 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15857 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15858
15859 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15860
15861 Integer overflow fixes.
15862
15863 * dbusbind.c: Serial number integer overflow fixes.
15864 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15865 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15866 to hold a serial number that is too large for a fixnum.
15867 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15868 Check for serial numbers out of range. Decode any serial number
15869 that was so large that it became a float. (Bug#8722)
15870
15871 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15872 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15873 Use XFASTINT rather than XUINT when numbers are nonnegative.
15874 (xd_append_arg, Fdbus_method_return_internal):
15875 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15876 arguments, check that Lisp number is nonnegative, rather than
15877 silently wrapping negative numbers around. (Bug#8722)
15878 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15879 (Bug#8722)
15880
15881 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15882
15883 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15884
15885 ccl: Add integer overflow checks.
15886 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15887 (IN_INT_RANGE): New macros.
15888 (ccl_driver): Use them to check for integer overflow when
15889 decoding a CCL program. Many of the new checks are whether XINT (x)
15890 fits in int; it doesn't always, on 64-bit hosts. The new version
15891 doesn't catch all possible integer overflows, but it's an
15892 improvement. (Bug#8719)
15893
15894 * alloc.c (make_event_array): Use XINT, not XUINT.
15895 There's no need for unsigned here.
15896
15897 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15898 This follows up to the 2011-05-06 change that substituted uintptr_t
15899 for EMACS_INT. This case wasn't caught back then.
15900
15901 Rework Fformat to avoid integer overflow issues.
15902 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15903 now (part of C89). Include <verify.h>.
15904 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15905 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15906 (Fformat): Avoid the prepass trying to compute sizes; it was only
15907 approximate and thus did not catch overflow reliably. Instead, walk
15908 through the format just once, formatting and computing sizes as we go,
15909 checking for integer overflow at every step, and allocating a larger
15910 buffer as needed. Keep track separately whether the format is
15911 multibyte. Keep only the most-recently calculated precision, rather
15912 than them all. Record whether each argument has been converted to
15913 string. Use EMACS_INT, not int, for byte and char and arg counts.
15914 Support field widths and precisions larger than INT_MAX. Avoid
15915 sprintf's undefined behavior with conversion specifications such as %#d
15916 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15917 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15918 formatting out-of-range floating point numbers with int
15919 formats. (Bug#8668)
15920
15921 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15922
15923 * data.c: Avoid integer truncation in expressions involving floats.
15924 * data.c: Include <intprops.h>.
15925 (arith_driver): When there's an integer overflow in an expression
15926 involving floating point, convert the integers to floating point
15927 so that the resulting value does not suffer from catastrophic
15928 integer truncation. For example, on a 64-bit host (* 4
15929 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15930 Do not rely on undefined behavior after integer overflow.
15931
15932 merge count_size_as_multibyte, parse_str_to_multibyte
15933 * character.c, character.h (count_size_as_multibyte):
15934 Rename from parse_str_to_multibyte; all uses changed.
15935 Check for integer overflow.
15936 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15937 since it's now a duplicate of the other. This is more of
15938 a character than a buffer op, so better that it's in character.c.
15939 * fns.c, print.c: Adjust to above changes.
15940
15941 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15942
15943 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15944
15945 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15946
15947 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15948 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15949 (x_clipboard_manager_save): Now static.
15950 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15951
15952 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15953 (crypto_hash_function): Now static.
15954 Fix pointer signedness problems. Avoid unnecessary initializations.
15955
15956 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15957
15958 * termhooks.h (Vselection_alist): Make it terminal-local.
15959
15960 * terminal.c (create_terminal): Initialize it.
15961
15962 * xselect.c: Support for clipboard managers.
15963 (Vselection_alist): Move to termhooks.h as terminal-local var.
15964 (LOCAL_SELECTION): New macro.
15965 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15966 (symbol_to_x_atom): Remove gratuitous arg.
15967 (x_handle_selection_request, lisp_data_to_selection_data)
15968 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15969 (x_own_selection, x_get_local_selection, x_convert_selection):
15970 New arg, specifying work frame. Use terminal-local Vselection_alist.
15971 (some_frame_on_display): Delete unused function.
15972 (Fx_own_selection_internal, Fx_get_selection_internal)
15973 (Fx_disown_selection_internal, Fx_selection_owner_p)
15974 (Fx_selection_exists_p): New optional frame arg.
15975 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15976 (x_handle_selection_clear): Don't treat other terminals with the
15977 same keyboard specially. Use the terminal-local Vselection_alist.
15978 (x_clear_frame_selections): Use Frun_hook_with_args.
15979
15980 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15981
15982 * xterm.h: Add support for those atoms.
15983
15984 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15985
15986 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15987 (converted_selections, conversion_fail_tag): New global variables.
15988 (x_selection_request_lisp_error): Free the above.
15989 (x_get_local_selection): Remove unnecessary code.
15990 (x_reply_selection_request): Args changed; handle arbitrary array
15991 of converted selections stored in converted_selections.
15992 Separate the XChangeProperty and SelectionNotify steps.
15993 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15994 (x_convert_selection): New function.
15995 (x_handle_selection_event): Simplify.
15996 (x_get_foreign_selection): Don't ignore incoming requests while
15997 waiting for an answer; this will fail when we implement
15998 SAVE_TARGETS, and seems unnecessary anyway.
15999 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16000 (Vx_sent_selection_functions): Doc fix.
16001
16002 2011-05-26 Leo Liu <sdl.web@gmail.com>
16003
16004 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16005
16006 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16007
16008 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16009
16010 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16011 for fringe update if it has periodic bitmap.
16012 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
16013 and fringe_bitmap_periodic_p.
16014
16015 * fringe.c (get_fringe_bitmap_data): New function.
16016 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16017 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16018 row. Mark glyph row for fringe update if periodicity changed.
16019
16020 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16021 for fringe update unless it has periodic bitmap.
16022
16023 2011-05-25 Kenichi Handa <handa@m17n.org>
16024
16025 * xdisp.c (get_next_display_element): Set correct it->face_id for
16026 a static composition.
16027
16028 2011-05-24 Leo Liu <sdl.web@gmail.com>
16029
16030 * deps.mk (fns.o):
16031 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16032
16033 * fns.c (crypto_hash_function, Fsha1): New function.
16034 (Fmd5): Use crypto_hash_function.
16035 (syms_of_fns): Add Ssha1.
16036
16037 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16038
16039 * gnutls.c: Remove unused macros.
16040 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16041 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16042 Remove macros that are defined and never used.
16043 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16044
16045 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16046
16047 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16048 (Fx_get_selection_internal): Minor cleanup.
16049 (Fx_own_selection_internal): Rename arguments for consistency with
16050 select.el.
16051
16052 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16053
16054 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16055
16056 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16057
16058 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16059
16060 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16061
16062 * dispnew.c (scrolling_window): Don't exclude the case that the
16063 last enabled row in the desired matrix touches the bottom boundary.
16064
16065 2011-05-21 Glenn Morris <rgm@gnu.org>
16066
16067 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16068 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16069 and add some more files.
16070
16071 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16072
16073 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16074 report_file_error introduced by the change from 2011-05-07.
16075
16076 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16077
16078 * systime.h (Time): Define only if emacs is defined.
16079 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16080 where the include path doesn't have X11/X.h by default. See
16081 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16082
16083 2011-05-20 Kenichi Handa <handa@m17n.org>
16084
16085 * composite.c (find_automatic_composition): Fix previous change.
16086
16087 2011-05-20 Glenn Morris <rgm@gnu.org>
16088
16089 * lisp.mk: New file, split from Makefile.in.
16090 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16091 (shortlisp): Remove.
16092 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16093
16094 2011-05-19 Glenn Morris <rgm@gnu.org>
16095
16096 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16097 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16098 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16099 (lisp): Set the order to that of loadup.el.
16100 (shortlisp): Make it a copy of $lisp.
16101 (SOME_MACHINE_LISP): Remove.
16102 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16103 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16104
16105 2011-05-18 Kenichi Handa <handa@m17n.org>
16106
16107 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16108 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16109 (find_automatic_composition): Mostly rewrite for efficiency.
16110
16111 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16112
16113 * makefile.w32-in: Update dependencies.
16114
16115 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16116
16117 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16118 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16119
16120 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16121
16122 Fix some integer overflow issues, such as string length overflow.
16123
16124 * insdel.c (count_size_as_multibyte): Check for string overflow.
16125
16126 * character.c (lisp_string_width): Check for string overflow.
16127 Use EMACS_INT, not int, for string indexes and lengths; in
16128 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16129 the resulting string length overflows an EMACS_INT; instead,
16130 report a string overflow if no precision given. When checking for
16131 precision exhaustion, use a check that cannot possibly have
16132 integer overflow. (Bug#8675)
16133 * character.h (lisp_string_width): Adjust to new signature.
16134
16135 * alloc.c (string_overflow): New function.
16136 (Fmake_string): Use it. This doesn't change behavior, but saves
16137 a few bytes and will simplify future changes.
16138 * character.c (string_escape_byte8): Likewise.
16139 * lisp.h (string_overflow): New decl.
16140
16141 Fixups, following up to the user-interface timestamp change.
16142 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16143 for UI timestamps, instead of unsigned long.
16144 * msdos.c (mouse_get_pos): Likewise.
16145 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16146 * w32gui.h (Time): Define by including "systime.h" rather than by
16147 declaring it ourselves. (Bug#8664)
16148
16149 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16150 * image.c (clear_image_cache): Likewise.
16151
16152 * term.c (term_mouse_position): Don't assume time_t wraparound.
16153
16154 Be more systematic about user-interface timestamps.
16155 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16156 and sometimes 'EMACS_UINT', to represent these timestamps.
16157 This change causes it to use 'Time' uniformly, as that's what X uses.
16158 This makes the code easier to follow, and makes it easier to catch
16159 integer overflow bugs such as Bug#8664.
16160 * frame.c (Fmouse_position, Fmouse_pixel_position):
16161 Use Time, not unsigned long, for user-interface timestamps.
16162 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16163 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16164 * keyboard.h (last_event_timestamp): Likewise.
16165 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16166 * menu.h (xmenu_show): Likewise.
16167 * term.c (term_mouse_position): Likewise.
16168 * termhooks.h (struct input_event.timestamp): Likewise.
16169 (struct terminal.mouse_position_hook): Likewise.
16170 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16171 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16172 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16173 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16174 what it was before.
16175 * menu.h, termhooks.h: Include "systime.h", for Time.
16176
16177 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16178 Don't assume that the difference between two unsigned long values
16179 can fit into an integer. At this point, we know button_down_time
16180 <= event->timestamp, so the difference must be nonnegative, so
16181 there's no need to cast the result if double-click-time is
16182 nonnegative, as it should be; check that it's nonnegative, just in
16183 case. This bug is triggered when events are more than 2**31 ms
16184 apart (about 25 days). (Bug#8664)
16185
16186 * xselect.c (last_event_timestamp): Remove duplicate decl.
16187 (x_own_selection): Remove needless cast to unsigned long.
16188
16189 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16190 that always fit in int. Use a sentinel instead of a counter, to
16191 avoid a temp and to allay GCC's concerns about possible int overflow.
16192 * frame.h (struct frame): Use int for menu_bar_items_used
16193 instead of EMACS_INT, since it always fits in int.
16194
16195 * menu.c (grow_menu_items): Check for int overflow.
16196
16197 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16198
16199 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16200 Before, the code was not consistent. These values cannot exceed
16201 2**31 - 1 so there's no need to make them unsigned.
16202 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16203 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16204 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16205 as modifiers.
16206 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16207
16208 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16209 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16210 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16211 presumably because the widths might not match.
16212
16213 * window.c (size_window): Avoid needless test at loop start.
16214
16215 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16216
16217 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16218
16219 2011-05-12 Drew Adams <drew.adams@oracle.com>
16220
16221 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16222
16223 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16224
16225 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16226 `width' to `bar_area_x' and `bar_area_width', respectively.
16227 (x_scroll_run): Take account of fringe background extension.
16228
16229 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16230 Rename local vars `left' and `width' to `bar_area_x' and
16231 `bar_area_width', respectively.
16232 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16233 background extension.
16234
16235 2011-05-10 Jim Meyering <meyering@redhat.com>
16236
16237 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16238
16239 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16240
16241 * image.c (Finit_image_library): Return t for built-in image types,
16242 like pbm and xbm. (Bug#8640)
16243
16244 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16245
16246 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16247
16248 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16249
16250 * w32console.c (Fset_screen_color): Doc fix.
16251 (Fget_screen_color): New function.
16252 (syms_of_ntterm): Defsubr it.
16253
16254 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16255 unlink the temporary file if Fcall_process didn't create it in the
16256 first place.
16257 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16258 child process will be redirected to a file specified with `:file'.
16259 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16260 cue to call_process_cleanup not to close that handle.
16261
16262 2011-05-07 Ben Key <bkey76@gmail.com>
16263
16264 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16265 one of two shell specific rules, either bootstrap-temacs-CMD or
16266 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16267 to the previous implementation of the bootstrap-temacs rule.
16268 The bootstrap-temacs-CMD rule is similar to the previous
16269 implementation of the bootstrap-temacs rule except that it
16270 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16271 variable.
16272
16273 These changes, along with some changes to nt/configure.bat,
16274 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16275 earlier fix to add support for --cflags and --ldflags options
16276 that include quotes so that it works whether make uses cmd or
16277 sh as the shell.
16278
16279 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16280
16281 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16282 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16283 is a constant.
16284 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16285 a string. Handle both cases.
16286 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16287 (Fdbus_register_method): Use Qinvalid_function.
16288
16289 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16290
16291 * makefile.w32-in: Update dependencies.
16292 (LISP_H): Add inttypes.h and stdin.h.
16293 (PROCESS_H): Add unistd.h.
16294
16295 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16296
16297 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16298 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16299
16300 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16301
16302 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16303
16304 * term.c (vfatal): Remove stray call to va_end.
16305 It's not needed and the C Standard doesn't allow it here anyway.
16306
16307 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16308 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16309
16310 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16311 bytes.
16312
16313 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16314
16315 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16316
16317 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16318
16319 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16320
16321 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16322
16323 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16324 * charset.c (Fdefine_charset_internal): Don't initialize
16325 charset.code_space[15]. The value was garbage, on hosts with
16326 32-bit int (Bug#8600).
16327
16328 * lread.c (read_integer): Be more consistent with string-to-number.
16329 Use string_to_number to do the actual conversion; this avoids
16330 rounding errors and fixes some other screwups. Without this fix,
16331 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16332 (digit_to_number): Move earlier, for benefit of read_integer.
16333 Return -1 if the digit is out of range for the base, -2 if it is
16334 not a digit in any supported base. (Bug#8602)
16335
16336 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16337
16338 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16339 to match comment at start of function. This also removes a
16340 GCC warning about overflow in a 32+64-bit port.
16341
16342 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16343
16344 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16345 Reported by Stefan Monnier in
16346 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16347 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16348 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16349
16350 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16351 (EMACS_UINTPTR): Likewise, with uintptr_t.
16352
16353 * lisp.h: Prefer 64-bit EMACS_INT if available.
16354 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16355 on 32-bit hosts that have 64-bit int, so that they can access
16356 large files.
16357 However, temporarily disable this change unless the temporary
16358 symbol WIDE_EMACS_INT is defined.
16359
16360 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16361
16362 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16363 This removes an assumption that EMACS_INT and long are the same
16364 width as pointers. The assumption is true for Emacs porting targets
16365 now, but we want to make other targets possible.
16366 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16367 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16368 In the rest of the code, change types of integers that hold casted
16369 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16370 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16371 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16372 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16373 No need to cast type when ORing.
16374 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16375 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16376 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16377 assume EMACS_INT is the same width as char *.
16378 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16379 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16380 Remove no-longer-needed casts.
16381 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16382 (xg_tool_bar_help_callback, xg_make_tool_item):
16383 Use EMACS_INTPTR to hold an integer
16384 that will be cast to void *; this can avoid a GCC warning
16385 if EMACS_INT is not the same width as void *.
16386 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16387 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16388 (current_message_1, set_message_1):
16389 Use a local to convert to proper width without a cast.
16390 * xmenu.c (dialog_selection_callback): Likewise.
16391
16392 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16393 Also, don't assume VALBITS / RAND_BITS is less than 5,
16394 and don't rely on undefined behavior when shifting a 1 left into
16395 the sign bit.
16396 * lisp.h (get_random): Change signature to match.
16397
16398 * lread.c (hash_string): Use size_t, not int, for hash computation.
16399 Normally we prefer signed values; but hashing is special, because
16400 it's better to use unsigned division on hash table sizes so that
16401 the remainder is nonnegative. Also, size_t is the natural width
16402 for hashing into memory. The previous code used 'int', which doesn't
16403 retain enough info to hash well into very large tables.
16404 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16405
16406 * dbusbind.c: Don't possibly lose pointer info when converting.
16407 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16408 Use XPNTR rather than XHASH, so that the high-order bits of
16409 the pointer aren't lost when converting through void *.
16410
16411 * eval.c (Fautoload): Don't double-shift a pointer.
16412
16413 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16414
16415 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16416
16417 * gnutls.c (DEF_GNUTLS_FN):
16418 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16419
16420 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16421
16422 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16423 marker. (Bug#8610)
16424
16425 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16426
16427 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16428 New version that can reserve upto 2GB of heap space.
16429
16430 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16431
16432 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16433
16434 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16435
16436 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16437 `gnutls_certificate_set_x509_key_file'.
16438
16439 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16440
16441 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16442 Update dependencies.
16443
16444 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16445
16446 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16447 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16448 Remove unused parameter `fildes'.
16449 * process.c (read_process_output, send_process): Don't pass it.
16450
16451 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16452
16453 Fix previous change: the library cache is defined in w32.c.
16454 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16455 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16456
16457 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16458
16459 Implement dynamic loading of GnuTLS on Windows.
16460
16461 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16462 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16463 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16464 Declare.
16465
16466 * gnutls.c (Qgnutls_dll): Define.
16467 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16468 (gnutls_*): Declare function pointers.
16469 (init_gnutls_functions): New function to initialize function pointers.
16470 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16471 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16472 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16473 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16474 (emacs_gnutls_write, emacs_gnutls_read)
16475 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16476 (Fgnutls_available_p): New function.
16477 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16478 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16479 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16480
16481 * image.c: Include w32.h.
16482 (Vimage_type_cache): Delete.
16483 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16484 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16485 (w32_delayed_load): Move to w32.c.
16486
16487 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16488
16489 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16490 (w32_delayed_load): Move from image.c. When loading a library, record
16491 its filename in the :loaded-from property of the library id.
16492 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16493 Initialize and staticpro them.
16494 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16495
16496 * process.c: Include lisp.h before w32.h, not after.
16497 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16498 instead of gnutls_record_check_pending.
16499
16500 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16501
16502 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16503
16504 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16505 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16506 as passed in.
16507
16508 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16509
16510 * xterm.c (x_set_frame_alpha): Do not set property on anything
16511 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16512
16513 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16514
16515 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16516
16517 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16518
16519 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16520 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16521 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16522 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16523 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16524 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16525 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16526 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16527 (Qgnutls_bootprop_callbacks_verify): Make static.
16528
16529 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16530
16531 * callproc.c: Indentation fixup.
16532
16533 * sysdep.c (wait_for_termination_1): Make static.
16534 (wait_for_termination, interruptible_wait_for_termination):
16535 Move after wait_for_termination_1.
16536
16537 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16538
16539 * sysdep.c (interruptible_wait_for_termination): New function
16540 which is like wait_for_termination, but allows keyboard
16541 interruptions.
16542
16543 * callproc.c (Fcall_process): Add (:file "file") as an option for
16544 the STDOUT buffer.
16545 (Fcall_process_region): Ditto.
16546
16547 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16548
16549 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16550 rather than `XVECTOR (FOO)->size'.
16551
16552 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16553 inttypes.h, as a gnulib replacement is used if it not available in
16554 system headers.
16555
16556 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16557
16558 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16559 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16560 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16561
16562 * coding.c (coding_alloc_by_realloc): Error out if destination
16563 will grow beyond MOST_POSITIVE_FIXNUM.
16564 (decode_coding_emacs_mule): Abort if there isn't enough place in
16565 charbuf for the composition carryover bytes. Reserve an extra
16566 space for up to 2 characters produced in a loop.
16567 (decode_coding_iso_2022): Abort if there isn't enough place in
16568 charbuf for the composition carryover bytes.
16569
16570 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16571
16572 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16573 aborting when %lld or %lll format is passed.
16574 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16575 %llo or %llx format is passed. (Bug#8545)
16576
16577 * window.c (window_scroll_line_based): Use a marker instead of
16578 simple variables to record original value of point. (Bug#7952)
16579
16580 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16581 produced by %s or %c overflows available buffer space. (Bug#8545)
16582
16583 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16584
16585 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16586 (SIZE_MAX): Move defn after all includes, as they might #define it.
16587
16588 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16589
16590 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16591
16592 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16593
16594 * keyboard.c (Qdelayed_warnings_hook): Define.
16595 (command_loop_1): Run `delayed-warnings-hook'
16596 if Vdelayed_warnings_list is non-nil.
16597 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16598 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16599
16600 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16601
16602 * doprnt.c (doprnt): Don't return value smaller than the buffer
16603 size if the message was truncated. (Bug#8545).
16604
16605 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16606
16607 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16608 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16609
16610 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16611
16612 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16613
16614 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16615
16616 * makefile.w32-in: Update dependencies.
16617
16618 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16619
16620 Improve `doprnt' and its usage. (Bug#8545)
16621 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16622 `format_end'. Remove support for %l as a conversion specifier.
16623 Don't use xrealloc. Improve diagnostics when the %l size modifier
16624 is used. Update the commentary.
16625
16626 * eval.c (verror): Simplify calculation of size_t.
16627
16628 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16629 messages.
16630
16631 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16632
16633 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16634 change.
16635
16636 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16637
16638 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16639 This makes this file independent of the recent pseudovector change.
16640
16641 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16642
16643 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16644
16645 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16646 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16647 Remove unused local.
16648 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16649
16650 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16651 GCC 4.6.0 optimizes based on type-based alias analysis.
16652 For example, if b is of type struct buffer * and v of type struct
16653 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16654 != &v->size, and therefore "v->size = 1; b->size = 2; return
16655 v->size;" must therefore return 1. This assumption is incorrect
16656 for Emacs, since it type-puns struct Lisp_Vector * with many other
16657 types. To fix this problem, this patch adds a new type struct
16658 vectorlike_header that documents the constraints on layout of vectors
16659 and pseudovectors, and helps optimizing compilers not get fooled
16660 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16661 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16662 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16663 the size member.
16664 (XSETPVECTYPE): Rewrite in terms of new macro.
16665 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16666 This is a bit clearer, and further avoids the possibility of
16667 undesirable aliasing.
16668 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16669 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16670 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16671 since Lisp_Subr is a special case (no "next" field).
16672 (ASIZE): Now uses header.size rather than size.
16673 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16674 to avoid the hassle of writing XVECTOR (foo)->header.size.
16675 (struct vectorlike_header): New type.
16676 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16677 object, to help avoid aliasing.
16678 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16679 (SUBRP): Likewise, since Lisp_Subr is a special case.
16680 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16681 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16682 (struct Lisp_Hash_Table): Combine first two members into a single
16683 struct vectorlike_header member. All uses of "size" and "next" members
16684 changed to be "header.size" and "header.next".
16685 * buffer.h (struct buffer): Likewise.
16686 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16687 * frame.h (struct frame): Likewise.
16688 * process.h (struct Lisp_Process): Likewise.
16689 * termhooks.h (struct terminal): Likewise.
16690 * window.c (struct save_window_data, struct saved_window): Likewise.
16691 * window.h (struct window): Likewise.
16692 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16693 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16694 * buffer.c (init_buffer_once): Likewise.
16695 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16696 special case.
16697 * process.c (Fformat_network_address): Use local var for size,
16698 for brevity.
16699
16700 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16701
16702 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16703 * data.c (atof): Remove decl; no longer used or needed.
16704 (digit_to_number): Move to lread.c.
16705 (Fstring_to_number): Use new string_to_number function, to be
16706 consistent with how the Lisp reader treats infinities and NaNs.
16707 Do not assume that floating-point numbers represent EMACS_INT
16708 without losing information; this is not true on most 64-bit hosts.
16709 Avoid double-rounding errors, by insisting on integers when
16710 parsing non-base-10 numbers, as the documentation specifies.
16711 * lisp.h (string_to_number): New decl, replacing ...
16712 (isfloat_string): Remove.
16713 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16714 (read1): Do not accept +. and -. as integers; this
16715 appears to have been a coding error. Similarly, do not accept
16716 strings like +-1e0 as floating point numbers. Do not report
16717 overflow for integer overflows unless the base is not 10 which
16718 means we have no simple and reliable way to continue.
16719 Break out the floating-point parsing into a new
16720 function string_to_number, so that Fstring_to_number parses
16721 floating point numbers consistently with the Lisp reader.
16722 (digit_to_number): Move here from data.c. Make it static inline.
16723 (E_CHAR, EXP_INT): Remove, replacing with ...
16724 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16725 (string_to_number): New function, replacing isfloat_string.
16726 This function checks for valid syntax and produces the resulting
16727 Lisp float number too. Rework it so that string-to-number
16728 no longer mishandles examples like "1.0e+". Use strtoumax,
16729 so that overflow for non-base-10 numbers is reported only when
16730 there's no portable and simple way to convert to floating point.
16731
16732 * textprop.c (set_text_properties_1): Rewrite for clarity,
16733 and to avoid GCC warning about integer overflow.
16734
16735 * intervals.h (struct interval): Use EMACS_INT for members
16736 where EMACS_UINT might cause problems. See
16737 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16738 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16739 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16740 All uses changed.
16741 (offset_intervals): Tell GCC not to worry about length overflow
16742 when negating a negative length.
16743
16744 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16745 (overrun_check_free): Likewise.
16746
16747 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16748 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16749 word size.
16750
16751 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16752 (gnutls_make_error): Rename local to avoid shadowing.
16753 (gnutls_emacs_global_deinit): ifdef out; not used.
16754 (Fgnutls_boot): Use const for pointer to readonly storage.
16755 Comment out unused local. Fix pointer signedness problems.
16756
16757 * lread.c (openp): Don't stuff size_t into an 'int'.
16758 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16759 about possible signed overflow.
16760
16761 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16762 (GDK_KEY_g): Don't define if already defined.
16763 (xg_prepare_tooltip): Avoid pointer signedness problem.
16764 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16765
16766 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16767 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16768
16769 * xfns.c (Fx_window_property): Simplify a bit,
16770 to make a bit faster and to avoid GCC 4.6.0 warning.
16771 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16772
16773 * fns.c (internal_equal): Don't assume size_t fits in int.
16774
16775 * alloc.c (compact_small_strings): Tighten assertion a little.
16776
16777 Replace pEd with more-general pI, and fix some printf arg casts.
16778 * lisp.h (pI): New macro, generalizing old pEd macro to other
16779 conversion specifiers. For example, use "...%"pI"d..." rather
16780 than "...%"pEd"...".
16781 (pEd): Remove. All uses replaced with similar uses of pI.
16782 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16783 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16784 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16785 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16786 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16787 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16788 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16789 64-bit hosts.
16790 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16791 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16792 * print.c (safe_debug_print, print_object): Likewise.
16793 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16794 to int.
16795 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16796 avoiding the 0 flag, which is not portable.
16797 * process.c (Fmake_network_process): Use pI to avoid cast.
16798 * region-cache.c (pp_cache): Likewise.
16799 * xdisp.c (decode_mode_spec): Likewise.
16800 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16801 behavior on 64-bit hosts with printf arg.
16802 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16803 (x_stop_queuing_selection_requests): Likewise.
16804 (x_get_window_property): Don't truncate byte count to an 'int'
16805 when tracing.
16806
16807 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16808 here, since it parses constructs like leading '-' and spaces,
16809 which are not wanted; and it overflows with large numbers.
16810 Instead, simply match F[0-9]+, which is what is wanted anyway.
16811
16812 * alloc.c: Remove unportable assumptions about struct layout.
16813 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16814 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16815 (allocate_vectorlike, make_pure_vector): Use the new macros,
16816 plus offsetof, to remove unportable assumptions about struct layout.
16817 These assumptions hold on all porting targets that I know of, but
16818 they are not guaranteed, they're easy to remove, and removing them
16819 makes further changes easier.
16820
16821 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16822 This doesn't fix a bug but makes the code clearer.
16823 (string_overrun_cookie): Now const. Use initializers that
16824 don't formally overflow signed char, to avoid warnings.
16825 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16826 can cause Emacs to crash when string overrun checking is enabled.
16827 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16828 multiple of sizeof (EMACS_INT); it need not be, if
16829 alignof(EMACS_INT) < sizeof (EMACS_INT).
16830 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16831
16832 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16833
16834 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16835
16836 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16837
16838 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16839 supposed to be handshaking. (Bug#8556)
16840 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16841
16842 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16843
16844 * lisp.h (Qdebug): List symbol.
16845 * eval.c (Qdebug): Restore global linkage.
16846 * keyboard.c (debug-on-event): New variable.
16847 (handle_user_signal): Break into debugger when debug-on-event
16848 matches the current signal symbol.
16849
16850 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16851
16852 * alloc.c (check_sblock, check_string_bytes)
16853 (check_string_free_list): Convert to standard C.
16854
16855 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16856
16857 * w32.c (emacs_gnutls_push): Fix typo.
16858
16859 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16860
16861 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16862 "cast to pointer from integer of different size".
16863
16864 Improve doprnt and its use in verror. (Bug#8545)
16865 * doprnt.c (doprnt): Document the set of format control sequences
16866 supported by the function. Use SAFE_ALLOCA instead of always
16867 using `alloca'.
16868
16869 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16870 is one byte too soon. Don't use xrealloc; instead xfree and
16871 xmalloc anew.
16872
16873 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16874
16875 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16876 callbacks stage.
16877
16878 * gnutls.c: Renamed global_initialized to
16879 gnutls_global_initialized. Added internals for the
16880 :verify-hostname-error, :verify-error, and :verify-flags
16881 parameters of `gnutls-boot' and documented those parameters in the
16882 docstring. Start callback support.
16883 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16884 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16885 on error. Return error code.
16886 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16887 (emacs_gnutls_read): Likewise.
16888 (Fgnutls_boot): Return handshake error code.
16889 (emacs_gnutls_handle_error): New function.
16890 (wsaerror_to_errno): Likewise.
16891
16892 * w32.h (emacs_gnutls_pull): Add prototype.
16893 (emacs_gnutls_push): Likewise.
16894
16895 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16896 (emacs_gnutls_push): Likewise.
16897
16898 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16899
16900 * process.c (wait_reading_process_output): Check if GnuTLS
16901 buffered some data internally if no FDs are set for TLS
16902 connections.
16903
16904 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16905 (LIBS): Link to USER_LIBS.
16906 ($(BLD)/gnutls.$(0)): New target.
16907
16908 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16909
16910 * xdisp.c (handle_single_display_spec): Rename the
16911 display_replaced_before_p argument into display_replaced_p, to
16912 make it consistent with the commentary. Fix typos in the
16913 commentary.
16914
16915 * textprop.c (syms_of_textprop): Remove dead code.
16916 (copy_text_properties): Delete obsolete commentary about an
16917 interface that was deleted long ago. Fix typos in the description
16918 of arguments.
16919
16920 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16921 to changes in oldXMenu/XMenu.h from 2011-04-16.
16922 <menu_help_message, prev_menu_help_message>: Constify.
16923 (IT_menu_make_room): menu->help_text is now `const char **';
16924 adjust.
16925
16926 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16927 to changes in oldXMenu/XMenu.h from 2011-04-16.
16928 (struct XMenu): Declare `help_text' `const char **'.
16929
16930 * xfaces.c <Qunspecified>: Make extern again.
16931
16932 * syntax.c: Include sys/types.h before including regex.h, as
16933 required by POSIX.
16934
16935 * doc.c (get_doc_string): Improve the format passed to `error'.
16936
16937 * doprnt.c (doprnt): Improve commentary.
16938
16939 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16940
16941 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16942 them with etags.
16943
16944 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16945 changes in globals.h immediately force recompilation.
16946 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16947 $(CURDIR)/s/ms-w32.h.
16948 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16949
16950 * character.c (Fchar_direction): Function deleted.
16951 (syms_of_character): Don't defsubr it.
16952 <char-direction-table>: Deleted.
16953
16954 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16955
16956 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16957 * doprnt.c: Include limits.h.
16958 (SIZE_MAX): New macro.
16959 (doprnt): Return a size_t value. 2nd arg is now size_t.
16960 Many local variables are now size_t instead of int or unsigned.
16961 Improve overflow protection. Support `l' modifier for integer
16962 conversions. Support %l conversion. Don't assume an EMACS_INT
16963 argument for integer conversions and for %c.
16964
16965 * lisp.h (doprnt): Restore prototype.
16966
16967 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16968 $(SRC)/character.h.
16969
16970 * Makefile.in (base_obj): Add back doprnt.o.
16971
16972 * deps.mk (doprnt.o): Add back prerequisites.
16973 (callint.o): Depend on character.h.
16974
16975 * eval.c (internal_lisp_condition_case): Include the handler
16976 representation in the error message.
16977 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16978 when breaking from the loop.
16979
16980 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16981
16982 * callint.c (Fcall_interactively): When displaying error message
16983 about invalid control letter, pass the character's codepoint, not
16984 a pointer to its multibyte form. Improve display of the character
16985 in octal and display also its hex code.
16986
16987 * character.c (char_string): Use %x to display the (unsigned)
16988 codepoint of an invalid character, to avoid displaying a bogus
16989 negative value.
16990
16991 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16992 `error', not SYMBOL_NAME itself.
16993
16994 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16995 character arguments to `error'.
16996
16997 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16998 to `error' in error message about FINAL_CHAR argument. Make sure
16999 FINAL_CHAR is a character, and use %c when it is passed as
17000 argument to `error'.
17001
17002 2011-04-23 Eli Zaretskii <eliz@gnu.org>
17003
17004 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17005
17006 * w32.c: Include <time.h>.
17007 (sys_localtime): New function.
17008
17009 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
17010
17011 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17012
17013 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
17014
17015 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
17016
17017 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17018 zombies (Bug#8467).
17019
17020 2011-04-19 Eli Zaretskii <eliz@gnu.org>
17021
17022 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17023 gl_state.e_property when gl_state.object is Qt.
17024
17025 * insdel.c (make_gap_larger): Remove limitation of buffer size
17026 to <= INT_MAX.
17027
17028 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17029
17030 * xdisp.c (lookup_glyphless_char_display)
17031 (produce_glyphless_glyph): Handle cons cell entry in
17032 glyphless-char-display.
17033 (Vglyphless_char_display): Document it.
17034
17035 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17036 glyphless-char-display.
17037
17038 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17039
17040 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17041
17042 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17043
17044 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17045 definition for no-X builds.
17046
17047 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17048
17049 Static checks with GCC 4.6.0 and non-default toolkits.
17050
17051 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17052
17053 * process.c (keyboard_bit_set): Define only if SIGIO.
17054 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17055 (send_process): Repair possible setjmp clobbering.
17056
17057 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17058
17059 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17060
17061 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17062
17063 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17064 Define only if needed.
17065
17066 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17067 by pacifying GCC about it. Maybe it's time to retire it?
17068 * xfaces.c (USG, __TIMEVAL__): Likewise.
17069
17070 * dispextern.h (struct redisplay_interface): Rename param
17071 to avoid shadowing.
17072 * termhooks.h (struct terminal): Likewise.
17073 * xterm.c (xembed_send_message): Likewise.
17074
17075 * insdel.c (make_gap_smaller): Define only if
17076 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17077
17078 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17079 it.
17080
17081 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17082 so that we aren't warned about unused symbols.
17083
17084 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17085
17086 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17087
17088 * xfns.c (x_real_positions): Mark locals as initialized.
17089
17090 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17091
17092 * xterm.c: Fix problems found by static analysis with other toolkits.
17093 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17094 (x_dispatch_event): Declare static if USE_GTK, and
17095 define if USE_GTK || USE_X_TOOLKIT.
17096 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17097 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17098 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17099 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17100
17101 * xmenu.c (menu_help_callback): Pointer type fixes.
17102 Use const pointers when pointing at readonly data. Avoid pointer
17103 signedness clashes.
17104 (FALSE): Remove unused macro.
17105 (update_frame_menubar): Remove unused decl.
17106
17107 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17108
17109 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17110 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17111 (single_menu_item): Rename local to avoid shadowing.
17112
17113 * keyboard.c (make_lispy_event): Remove unused local var.
17114
17115 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17116 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17117
17118 * bitmaps: Change bitmaps from unsigned char back to the X11
17119 compatible char. Avoid the old compiler warnings about
17120 out-of-range initializers by using, for example, '\xab' rather
17121 than 0xab.
17122
17123 * xgselect.c (xgselect_initialize): Check vs interface
17124 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17125
17126 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17127
17128 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17129 to read-only memory.
17130
17131 * fns.c (vector): Remove; this old hack is no longer needed.
17132
17133 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17134 Remove unused var.
17135 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17136
17137 * xrdb.c (x_load_resources): Omit unused local.
17138
17139 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17140 (x_window): Rename locals to avoid shadowing.
17141 (USG): Use the kludged USG macro, to pacify gcc.
17142
17143 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17144 (x_term_init): Remove local to avoid shadowing.
17145
17146 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17147
17148 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17149 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17150
17151 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17152
17153 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17154
17155 Fix regex.c, syntax.c and friends for buffers > 2GB.
17156 * syntax.h (struct gl_state_s): Declare character position members
17157 EMACS_INT.
17158
17159 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17160
17161 * textprop.c (verify_interval_modification, interval_of):
17162 Declare arguments EMACS_INT.
17163
17164 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17165 EMACS_INT.
17166
17167 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17168
17169 * indent.c (Fvertical_motion): Local variable it_start is now
17170 EMACS_INT.
17171
17172 * regex.c (re_match, re_match_2, re_match_2_internal)
17173 (bcmp_translate, regcomp, regexec, print_double_string)
17174 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17175 (re_compile_pattern, re_exec): Declare arguments and local
17176 variables `size_t' and `ssize_t' and return values `regoff_t', as
17177 appropriate.
17178 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17179 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17180 <compile_stack_type>: `size' and `avail' are now `size_t'.
17181
17182 * regex.h <regoff_t>: Use ssize_t, not int.
17183 (re_search, re_search_2, re_match, re_match_2): Arguments that
17184 specify buffer/string position and length are now ssize_t and
17185 size_t. Return type is regoff_t.
17186
17187 2011-04-16 Ben Key <bkey76@gmail.com>
17188
17189 * nsfont.m: Fixed bugs in ns_get_family and
17190 ns_descriptor_to_entity that were caused by using free to
17191 deallocate memory blocks that were allocated by xmalloc (via
17192 xstrdup). This caused Emacs to crash when compiled with
17193 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17194 --enable-checking=xmallocoverrun). xfree is now used to
17195 deallocate these memory blocks.
17196
17197 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17198
17199 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17200
17201 emacs_write: Accept and return EMACS_INT for sizes.
17202 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17203 et seq.
17204 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17205 Accept and return EMACS_INT.
17206 (emacs_gnutls_write): Return the number of bytes written on
17207 partial writes.
17208 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17209 (emacs_read, emacs_write): Remove check for negative size, as the
17210 Emacs source code has been audited now.
17211 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17212 (emacs_read, emacs_write): Use it.
17213 * process.c (send_process): Adjust to the new signatures of
17214 emacs_write and emacs_gnutls_write. Do not attempt to store
17215 a byte offset into an 'int'; it might overflow.
17216 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17217
17218 * sound.c: Don't assume sizes fit in 'int'.
17219 (struct sound_device.period_size, alsa_period_size):
17220 Return EMACS_INT, not int.
17221 (struct sound_device.write, vox_write, alsa_write):
17222 Accept EMACS_INT, not int.
17223 (wav_play, au_play): Use EMACS_INT to store sizes and to
17224 record read return values.
17225
17226 2011-04-15 Ben Key <bkey76@gmail.com>
17227
17228 * keyboard.c (Qundefined): Don't declare static since it is used
17229 in nsfns.m.
17230 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17231 static since they are used in nsfont.m.
17232
17233 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17234
17235 * process.c (Qprocessp): Don't declare static.
17236 * lisp.h (Qprocessp): Declare again.
17237
17238 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17239
17240 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17241
17242 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17243
17244 Improve C-level modularity by making more things 'static'.
17245
17246 Don't publish debugger-only interfaces to other modules.
17247 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17248 (verify_bytepos, count_markers): Move decls to the only modules
17249 that need them.
17250 * region-cache.h (pp_cache): Likewise.
17251 * window.h (check_all_windows): Likewise.
17252 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17253
17254 * sysdep.c (croak): Now static, if
17255 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17256 * syssignal.h (croak): Declare only if not static.
17257
17258 * alloc.c (refill_memory_reserve): Now static if
17259 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17260 * lisp.h (refill_memory_reserve): Declare only if not static.
17261
17262 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17263 Define only if USE_LUCID.
17264
17265 * xrdb.c (x_customization_string, x_rm_string): Now static.
17266
17267 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17268 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17269
17270 * xdisp.c (draw_row_with_mouse_face): Now static.
17271 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17272
17273 * window.h (check_all_windows): Mark externally visible.
17274
17275 * window.c (window_deletion_count): Now static.
17276
17277 * undo.c: Make symbols static if they're not exported.
17278 (last_undo_buffer, last_boundary_position, pending_boundary):
17279 Now static.
17280
17281 * textprop.c (interval_insert_behind_hooks): Now static.
17282 (interval_insert_in_front_hooks): Likewise.
17283
17284 * term.c: Make symbols static if they're not exported.
17285 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17286 (max_frame_lines, tty_set_terminal_modes):
17287 (tty_reset_terminal_modes, tty_turn_off_highlight):
17288 (get_tty_terminal): Now static.
17289 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17290 * termhooks.h (term_mouse_moveto): Do not declare if
17291 HAVE_WINDOW_SYSTEM.
17292 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17293 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17294
17295 * sysdep.c: Make symbols static if they're not exported.
17296 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17297 Now static.
17298 (sigprocmask_set, full_mask): Remove; unused.
17299 (wait_debugging): Mark as visible.
17300 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17301 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17302
17303 * syntax.c (syntax_temp): Define only if !__GNUC__.
17304
17305 * sound.c (current_sound_device, current_sound): Now static.
17306
17307 * search.c (searchbufs, searchbuf_head): Now static.
17308
17309 * scroll.c (scroll_cost): Remove; unused.
17310 * dispextern.h (scroll_cost): Remove decl.
17311
17312 * region-cache.h (pp_cache): Mark as externally visible.
17313
17314 * process.c: Make symbols static if they're not exported.
17315 (process_tick, update_tick, create_process, chan_process):
17316 (Vprocess_alist, proc_buffered_char, datagram_access):
17317 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17318 (deactivate_process): Mark defn as static, as well as decl.
17319 * lisp.h (create_process): Remove decl.
17320 * process.h (chan_process, Vprocess_alist): Remove decls.
17321
17322 * print.c: Make symbols static if they're not exported.
17323 (print_depth, new_backquote_output, being_printed, print_buffer):
17324 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17325 (print_interval, print_number_index, initial_stderr_stream):
17326 Now static.
17327 * lisp.h (Fprinc): Remove decl.
17328 (debug_output_compilation_hack): Mark as externally visible.
17329
17330 * sysdep.c (croak): Move decl from here to syssignal.h.
17331 * syssignal.h (croak): Put it here, so the API can be checked when
17332 'croak' is called from dissociate_if_controlling_tty.
17333
17334 * minibuf.c: Make symbols static if they're not exported.
17335 (minibuf_save_list, choose_minibuf_frame): Now static.
17336 * lisp.h (choose_minibuf_frame): Remove decl.
17337
17338 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17339
17340 * lread.c: Make symbols static if they're not exported.
17341 (read_objects, initial_obarray, oblookup_last_bucket_number):
17342 Now static.
17343 (make_symbol): Remove; unused.
17344 * lisp.h (initial_obarray, make_symbol): Remove decls.
17345
17346 * keyboard.c: Make symbols static if they're not exported.
17347 (single_kboard, recent_keys_index, total_keys, recent_keys):
17348 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17349 (this_single_command_key_start, echoing, last_auto_save):
17350 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17351 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17352 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17353 (Vlispy_mouse_stem, double_click_count):
17354 Now static.
17355 (force_auto_save_soon): Define only if SIGDANGER.
17356 (ignore_mouse_drag_p): Now static if
17357 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17358 (print_help): Remove; unused.
17359 (stop_character, last_timer_event): Mark as externally visible.
17360 * keyboard.h (ignore_mouse_drag_p): Declare only if
17361 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17362 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17363 * lisp.h (echoing): Remove decl.
17364 (force_auto_save_soon): Declare only if SIGDANGER.
17365 * xdisp.c (redisplay_window): Simplify code, to make it more
17366 obvious that ignore_mouse_drag_p is not accessed if !defined
17367 USE_GTK && !defined HAVE_NS.
17368
17369 * intervals.c: Make symbols static if they're not exported.
17370 (merge_properties_sticky, merge_interval_right, delete_interval):
17371 Now static.
17372 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17373
17374 * insdel.c: Make symbols static if they're not exported.
17375 However, leave prepare_to_modify_buffer alone. It's never
17376 called from outside this function, but that appears to be a bug.
17377 (combine_after_change_list, combine_after_change_buffer):
17378 (adjust_after_replace, signal_before_change): Now static.
17379 (adjust_after_replace_noundo): Remove; unused.
17380 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17381 (signal_before_change): Remove decls.
17382
17383 * indent.c (val_compute_motion, val_vmotion): Now static.
17384
17385 * image.c: Make symbols static if they're not exported.
17386 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17387 if USE_GTK.
17388 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17389 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17390
17391 * fringe.c (standard_bitmaps): Now static.
17392 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17393
17394 * frame.c: Make symbols static if they're not exported.
17395 (x_report_frame_params, make_terminal_frame): Now static.
17396 (get_frame_param): Now static, unless HAVE_NS.
17397 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17398 (x_get_resource_string): Remove; not used.
17399 * frame.h (make_terminal_frame, x_report_frame_params):
17400 (x_get_resource_string); Remove decls.
17401 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17402 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17403
17404 * font.c, fontset.c: Make symbols static if they're not exported.
17405 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17406 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17407 * font.c (font_close_object): Now static.
17408 * font.h (font_close_object): Remove.
17409 * fontset.c (FONTSET_OBJLIST): Remove.
17410 (free_realized_fontset) #if-0 the body, which does nothing.
17411 (face_suitable_for_char_p): #if-0, as it's never called.
17412 * fontset.h (face_suitable_for_char_p): Remove decl.
17413 * xfaces.c (face_at_string_position):
17414 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17415 since 0 is always ASCII.
17416
17417 * fns.c (weak_hash_tables): Now static.
17418
17419 * fileio.c: Make symbols static if they're not exported.
17420 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17421 (Vwrite_region_annotation_buffers): Now static.
17422
17423 * eval.c: Make symbols static if they're not exported.
17424 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17425 * lisp.h (backtrace_list): Remove decl.
17426
17427 * emacs.c: Make symbols static if they're not exported.
17428 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17429 (fatal_error_code, fatal_error_signal_hook, standard_args):
17430 Now static.
17431 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17432 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17433 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17434 * lisp.h (fatal_error_signal_hook): Remove decl.
17435 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17436
17437 * editfns.c: Move a (normally-unused) function to its only use.
17438 * editfns.c, lisp.h (get_operating_system_release): Remove.
17439 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17440 worth the hassle of breaking this out.
17441
17442 * xterm.c: Make symbols static if they're not exported.
17443 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17444 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17445 (x_destroy_window, x_delete_display):
17446 Now static.
17447 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17448 (x_mouse_leave): Remove; unused.
17449 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17450 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17451 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17452 Remove decls.
17453 (x_mouse_leave): Declare only if WINDOWSNT.
17454 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17455 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17456 USE_X_TOOLKIT.
17457
17458 * ftxfont.c: Make symbols static if they're not exported.
17459 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17460 HAVE_FREETYPE.
17461 * font.h (ftxfont_driver): Likewise.
17462
17463 * xfns.c: Make symbols static if they're not exported.
17464 (x_last_font_name, x_display_info_for_name):
17465 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17466 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17467 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17468 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17469 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17470 (last_show_tip_args): Now static.
17471 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17472 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17473 (x_screen_planes): Remove; unused.
17474 * dispextern.h (x_screen_planes): Remove decl.
17475
17476 * dispnew.c: Make symbols static if they're not exported.
17477 * dispextern.h (redraw_garbaged_frames, scrolling):
17478 (increment_row_positions): Remove.
17479 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17480 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17481 Now static.
17482 (redraw_garbaged_frames): Remove; unused.
17483
17484 * xfaces.c: Make symbols static if they're not exported.
17485 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17486 Remove decls.
17487 * xterm.h (defined_color): Remove decls.
17488 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17489 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17490 (menu_face_changed_default, defined_color, free_realized_face):
17491 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17492 (ascii_face_of_lisp_face): Remove; unused.
17493
17494 * xdisp.c: Make symbols static if they're not exported.
17495 * dispextern.h (scratch_glyph_row, window_box_edges):
17496 (glyph_to_pixel_coords, set_cursor_from_row):
17497 (get_next_display_element, set_iterator_to_next):
17498 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17499 (show_mouse_face): Remove decls
17500 * frame.h (message_buf_print): Likewise.
17501 * lisp.h (pop_message, set_message, check_point_in_composition):
17502 Likewise.
17503 * xterm.h (set_vertical_scroll_bar): Likewise.
17504 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17505 (message_buf_print, scratch_glyph_row, displayed_buffer):
17506 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17507 (get_next_display_element, show_mouse_face, window_box_edges):
17508 (frame_to_window_pixel_xy, check_point_in_composition):
17509 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17510 (glyph_to_pixel_coords): Remove; unused.
17511
17512 * dired.c (file_name_completion): Now static.
17513
17514 * dbusbind.c (xd_in_read_queued_messages): Now static.
17515
17516 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17517 * data.c (circular_list_error): Remove.
17518
17519 * commands.h (last_point_position, last_point_position_buffer):
17520 (last_point_position_window): Remove decls.
17521 * keyboard.c: Make these variables static.
17522
17523 * coding.h (coding, code_convert_region, encode_coding_gap):
17524 Remove decls.
17525 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17526 (iso_code_class, detect_coding, code_convert_region): Now static.
17527 (encode_coding_gap): Remove; unused.
17528
17529 * chartab.c (chartab_chars, chartab_bits): Now static.
17530
17531 * charset.h (charset_iso_8859_1): Remove decl.
17532 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17533 Now static.
17534
17535 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17536 * ccl.c (Vccl_program_table): Now static.
17537 (check_ccl_update): Remove; unused.
17538
17539 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17540 * category.h: ... from here.
17541 * category.c (check_category_table, set_category_set): Now static.
17542
17543 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17544 * lisp.h: Remove these decls.
17545
17546 * buffer.c (buffer_count): Remove unused var.
17547
17548 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17549 so that it's not optimized away.
17550 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17551 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17552 exported only to the debugger.
17553
17554 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17555 * atimer.h (run_all_atimers): Remove; not exported.
17556
17557 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17558 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17559 was inaccessible from Lisp.
17560 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17561 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17562
17563 alloc.c: Import and export fewer symbols, and remove unused items.
17564 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17565 is defined.
17566 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17567 it's not optimized away by whole-program optimization.
17568 (message_enable_multibyte, free_misc): Remove.
17569 (catchlist, handlerlist, mark_backtrace):
17570 Declare only if BYTE_MARK_STACK.
17571 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17572 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17573 (message_enable_multibyte): Remove decl.
17574 (free_misc, interval_free_list, float_block, float_block_index):
17575 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17576 (cons_free_list, last_marked_index):
17577 Now static.
17578 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17579 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17580 (mark_backtrace): Define only if BYTE_MARK_STACK.
17581 * xdisp.c (message_enable_multibyte): Now static.
17582
17583 Declare Lisp_Object Q* variables to be 'static' if not exported.
17584 This makes it easier for human readers (and static analyzers)
17585 to see whether these variables are used from other modules.
17586 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17587 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17588 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17589 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17590 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17591 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17592 * xmenu.c, xselect.c:
17593 Declare Q* vars static if they are not used in other modules.
17594 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17595 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17596 Remove decls of unexported vars.
17597 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17598
17599 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17600
17601 Make Emacs functions such as Fatom 'static' by default.
17602 This makes it easier for human readers (and static analyzers)
17603 to see whether these functions can be called from other modules.
17604 DEFUN now defines a static function. To make the function external
17605 so that it can be used in other C modules, use the new macro DEFUE.
17606 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17607 (Finit_image_library):
17608 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17609 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17610 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17611 Remove decls, since these functions are now static.
17612 (Funintern, Fget_internal_run_time): New decls, since these functions
17613 were already external.
17614
17615 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17616 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17617 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17618 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17619 * keyboard.c, keymap.c, lread.c:
17620 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17621 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17622 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17623 Mark functions with DEFUE instead of DEFUN,
17624 if they are used in other modules.
17625 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17626 decls for now-static functions.
17627 * buffer.h (Fdelete_overlay): Remove decl.
17628 * callproc.c (Fgetenv_internal): Mark as internal.
17629 * composite.c (Fremove_list_of_text_properties): Remove decl.
17630 (Fcomposition_get_gstring): New forward static decl.
17631 * composite.h (Fcomposite_get_gstring): Remove decl.
17632 * dired.c (Ffile_attributes): New forward static decl.
17633 * doc.c (Fdocumntation_property): New forward static decl.
17634 * eval.c (Ffetch_bytecode): New forward static decl.
17635 (Funintern): Remove extern decl; now in .h file where it belongs.
17636 * fileio.c (Fmake_symbolic_link): New forward static decl.
17637 * image.c (Finit_image_library): New forward static decl.
17638 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17639 * intervals.h (Fprevious_property_change):
17640 (Fremove_list_of_text_properties): Remove decls.
17641 * keyboard.c (Fthis_command_keys): Remove decl.
17642 (Fcommand_execute): New forward static decl.
17643 * keymap.c (Flookup_key): New forward static decl.
17644 (Fcopy_keymap): Now static.
17645 * keymap.h (Flookup_key): Remove decl.
17646 * process.c (Fget_process): New forward static decl.
17647 (Fprocess_datagram_address): Mark as internal.
17648 * syntax.c (Fsyntax_table_p): New forward static decl.
17649 (skip_chars): Remove duplicate decl.
17650 * textprop.c (Fprevious_property_change): New forward static decl.
17651 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17652 Now internal.
17653 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17654 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17655
17656 * editfns.c (Fformat): Remove unreachable code.
17657
17658 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17659
17660 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17661 change. (Bug#8496)
17662
17663 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17664
17665 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17666 when at ZV. (Bug#8487)
17667
17668 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17669
17670 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17671 (Bug#8437)
17672 * keyboard.c (parse_tool_bar_item): Likewise.
17673 * sound.c (sound_cleanup, alsa_close): Likewise.
17674 * termcap.c (tgetent): Likewise.
17675 * xfns.c (x_default_font_parameter): Likewise.
17676 * xsettings.c (read_and_apply_settings): Likewise.
17677
17678 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17679 (overrun_check_free): Protoize.
17680
17681 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17682
17683 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17684 since callers should never pass a negative size.
17685 Change the signature to match that of plain 'read' and 'write'; see
17686 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17687 * lisp.h: Update prototypes of emacs_write and emacs_read.
17688
17689 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17690
17691 * xdisp.c (redisplay_window): Don't try to determine the character
17692 position of the scroll margin if the window start point w->startp
17693 is outside the buffer's accessible region. (Bug#8468)
17694
17695 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17696
17697 Fix write-region and its subroutines for buffers > 2GB.
17698 * fileio.c (a_write, e_write): Modify declaration of arguments and
17699 local variables to support buffers larger than 2GB.
17700 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17701
17702 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17703 argument, local variables, and return value.
17704
17705 * lisp.h: Update prototypes of emacs_write and emacs_read.
17706
17707 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17708
17709 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17710
17711 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17712
17713 Fix more problems found by GCC 4.6.0's static checks.
17714
17715 * xdisp.c (vmessage): Use a better test for character truncation.
17716
17717 * charset.c (load_charset_map): <, not <=, for optimization,
17718 and to avoid potential problems with integer overflow.
17719 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17720 * casetab.c (set_identity, shuffle): Likewise.
17721 * editfns.c (Fformat): Likewise.
17722 * syntax.c (skip_chars): Likewise.
17723
17724 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17725 This also lets GCC 4.6.0 generate slightly better loop code.
17726
17727 * callint.c (Fcall_interactively): <, not <=, for optimization.
17728 (Fcall_interactively): Count the number of arguments produced,
17729 not the number of arguments given. This is simpler and lets GCC
17730 4.6.0 generate slightly better code.
17731
17732 * ftfont.c: Distingish more carefully between FcChar8 and char.
17733 The previous code passed unsigned char * to a functions like
17734 strlen and xstrcasecmp that expect char *, which does not
17735 conform to the C standard.
17736 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17737 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17738 char * when the C standard requires it.
17739
17740 * keyboard.c (read_char): Remove unused var.
17741
17742 * eval.c: Port to Windows vsnprintf (Bug#8435).
17743 Include <limits.h>.
17744 (SIZE_MAX): Define if the headers do not.
17745 (verror): Do not give up if vsnprintf returns a negative count.
17746 Instead, grow the buffer. This ports to Windows vsnprintf, which
17747 does not conform to C99. Problem reported by Eli Zaretskii.
17748 Also, simplify the allocation scheme, by avoiding the need for
17749 calling realloc, and removing the ALLOCATED variable.
17750
17751 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17752
17753 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17754 But keep the doprint source code for now, as we might revamp it
17755 and use it again (Bug#8435).
17756 * lisp.h (doprnt): Remove.
17757 * Makefile.in (base_obj): Remove doprnt.o.
17758 * deps.mk (doprnt.o): Remove.
17759
17760 error: Print 32- and 64-bit integers portably (Bug#8435).
17761 Without this change, on typical 64-bit hosts error ("...%d...", N)
17762 was used to print both 32- and 64-bit integers N, which relied on
17763 undefined behavior.
17764 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17765 * lisp.h (error, verror): Mark as printf-like functions.
17766 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17767 Report overflow in size calculations when allocating printf buffer.
17768 Do not truncate output string at its first null byte.
17769 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17770 Truncate the output at a character boundary, since vsnprintf does not
17771 do that.
17772 * charset.c (check_iso_charset_parameter): Convert internal
17773 character to string before calling 'error', since %c now has the
17774 printf meaning.
17775 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17776 overflow when computing char to be passed to 'error'. Do not
17777 pass Lisp_Object to 'error'; pass the integer instead.
17778 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17779 formatted with plain %d.
17780
17781 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17782
17783 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17784
17785 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17786
17787 * xterm.c (x_catch_errors): Remove duplicate declaration.
17788
17789 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17790
17791 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17792
17793 2011-04-10 Jim Meyering <meyering@redhat.com>
17794
17795 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17796 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17797 return ssize_t not "int", and use size_t as the buffer length.
17798 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17799 * gnutls.h: Update declarations.
17800 * process.c (read_process_output): Use ssize_t, to match.
17801 (send_process): Likewise.
17802
17803 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17804
17805 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17806
17807 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17808
17809 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17810 Use unsigned char, to match FcChar8 type definition.
17811
17812 * xterm.c (handle_one_xevent):
17813 * xmenu.c (create_and_show_popup_menu):
17814 * xselect.c (x_decline_selection_request)
17815 (x_reply_selection_request): Avoid type-punned deref of X events.
17816
17817 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17818
17819 Fix some uses of `int' instead of EMACS_INT.
17820 * search.c (string_match_1, fast_string_match)
17821 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17822 (scan_buffer, find_next_newline_no_quit)
17823 (find_before_next_newline, search_command, Freplace_match)
17824 (Fmatch_data): Make some `int' variables be EMACS_INT.
17825
17826 * xdisp.c (display_count_lines): 3rd argument and return value now
17827 EMACS_INT. All callers changed.
17828 (pint2hrstr): Last argument is now EMACS_INT.
17829
17830 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17831 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17832 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17833 (decode_coding_utf_16, decode_coding_emacs_mule)
17834 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17835 (decode_coding_ccl, decode_coding_charset)
17836 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17837 (decode_coding_iso_2022, decode_coding_emacs_mule)
17838 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17839 <char_offset, last_offset>: Declare EMACS_INT.
17840 (encode_coding_utf_8, encode_coding_utf_16)
17841 (encode_coding_emacs_mule, encode_invocation_designation)
17842 (encode_designation_at_bol, encode_coding_iso_2022)
17843 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17844 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17845 Declare EMACS_INT.
17846 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17847 (encode_invocation_designation): Last argument P_NCHARS is now
17848 EMACS_INT.
17849 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17850 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17851
17852 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17853 All users changed.
17854
17855 * ccl.c (Fccl_execute_on_string): Declare some variables
17856 EMACS_INT.
17857
17858 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17859
17860 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17861
17862 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17863
17864 * process.c (Fformat_network_address): Doc fix.
17865
17866 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17867
17868 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17869
17870 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17871
17872 * keyboard.c (read_char): Call Lisp function help-form-show,
17873 instead of using internal_with_output_to_temp_buffer.
17874 (Qhelp_form_show): New var.
17875 (syms_of_keyboard): Use DEFSYM macro.
17876
17877 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17878
17879 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17880
17881 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17882
17883 * process.c (Flist_processes): Remove to Lisp.
17884 (list_processes_1): Delete.
17885
17886 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17887
17888 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17889
17890 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17891
17892 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17893
17894 Fix more problems found by GCC 4.6.0's static checks.
17895
17896 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17897
17898 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17899
17900 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17901
17902 * xdisp.c (vmessage): Mark as a printf-like function.
17903
17904 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17905
17906 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17907
17908 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17909 printf-like functions.
17910 (tiff_load): Add casts to remove these marks before passing them
17911 to system-supplied API.
17912
17913 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17914
17915 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17916 This avoids several warnings with gcc -Wstrict-overflow.
17917 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17918 directly, rather than having caller test rule sign. This avoids
17919 some unnecessary tests.
17920 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17921 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17922 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17923
17924 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17925 (xfont_open): Avoid unnecessary tests.
17926
17927 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17928
17929 * composite.h, composite.c (composition_gstring_put_cache):
17930 Use EMACS_INT, not int, for length.
17931
17932 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17933 breaking out part of COMPOSITION_DECODE_RULE.
17934 (COMPOSITION_DECODE_RULE): Use it.
17935 * composite.c (get_composition_id): Remove unused local vars,
17936 by using the new macro.
17937
17938 * textprop.c (set_text_properties_1): Change while to do-while,
17939 since the condition is always true at first.
17940
17941 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17942 (interval_deletion_adjustment): Return unsigned value.
17943 All uses changed.
17944
17945 * process.c (list_processes_1, create_pty, read_process_output):
17946 (exec_sentinel): Remove vars that were set but not used.
17947 (create_pty): Remove unnecessary "volatile"s.
17948 (Fnetwork_interface_info): Avoid possibility of int overflow.
17949 (read_process_output): Do adaptive read buffering even if carryover.
17950 (read_process_output): Simplify nbytes computation if buffered.
17951
17952 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17953
17954 * syntax.c (scan_words): Remove var that was set but not used.
17955 (update_syntax_table): Use unsigned instead of int.
17956
17957 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17958 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17959 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17960
17961 * print.c (print_error_message): Avoid int overflow.
17962
17963 * font.c (font_list_entities): Redo for clarity,
17964 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17965
17966 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17967 (font_score): Avoid potential overflow in diff calculation.
17968
17969 * fns.c (substring_both): Remove var that is set but not used.
17970 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17971
17972 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17973
17974 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17975 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17976 can always succeed if overflow has undefined behavior.
17977
17978 * search.c (boyer_moore, wordify): Remove vars set but not used.
17979 (wordify): Omit three unnecessary tests.
17980
17981 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17982 All callers changed. This avoids the need for an unused var.
17983
17984 * casefiddle.c (casify_region): Remove var that is set but not used.
17985
17986 * dired.c (file_name_completion): Remove var that is set but not used.
17987
17988 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17989
17990 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17991 (Finsert_file_contents): Remove unnecessary code checking fd.
17992
17993 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17994 Check for integer overflow on size calculations.
17995
17996 * buffer.c (Fprevious_overlay_change): Remove var that is set
17997 but not used.
17998
17999 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18000 Remove vars that are set but not used.
18001 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
18002 (timer_check_2): Mark vars as initialized.
18003
18004 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18005
18006 * image.c (lookup_image): Remove var that is set but not used.
18007 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
18008
18009 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18010 that are set but not used.
18011
18012 * xfns.c (make_invisible_cursor): Don't return garbage
18013 if XCreateBitmapFromData fails (Bug#8410).
18014
18015 * xselect.c (x_get_local_selection, x_handle_property_notify):
18016 Remove vars that are set but not used.
18017
18018 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
18019 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
18020
18021 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18022 Remove var that is set but not used.
18023 (scroll_bar_windows_size): Now size_t, not int.
18024 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18025 Check for overflow.
18026
18027 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18028 (map_tty_color) [!defined MSDOS]: Likewise.
18029
18030 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18031
18032 * coding.c: Remove vars that are set but not used.
18033 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18034 All callers changed.
18035 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18036 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18037 (decode_coding_charset): Remove vars that are set but not used.
18038
18039 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18040 that is set but not used.
18041
18042 * print.c (print_object): Remove var that is set but not used.
18043
18044 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18045 The gnulib version avoids calling malloc in the usual case,
18046 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18047 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18048 * filelock.c (current_lock_owner): Likewise.
18049 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18050 * sysdep.c: Include allocator.h, careadlinkat.h.
18051 (emacs_no_realloc_allocator): New static constant.
18052 (emacs_readlink): New function.
18053 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18054 ../lib/careadlinkat.h.
18055
18056 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18057
18058 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18059 first non-nil return value).
18060
18061 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18062
18063 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18064 if not defined (Bug#8403).
18065
18066 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18067
18068 * xdisp.c (display_count_lines): Remove parameter `start',
18069 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18070 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18071 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18072 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18073 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18074 and thereabouts. All callers changed.
18075 (get_per_char_metric): Remove parameter `f', unused since
18076 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18077
18078 2011-04-02 Jim Meyering <meyering@redhat.com>
18079
18080 do not dereference NULL upon failed strdup
18081 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18082 (ns_get_family): Likewise.
18083
18084 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18085
18086 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18087
18088 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18089
18090 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18091 later (Bug#8403).
18092
18093 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18094
18095 Add lexical binding.
18096
18097 * window.c (Ftemp_output_buffer_show): New fun.
18098 (Fsave_window_excursion):
18099 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18100
18101 * lread.c (lisp_file_lexically_bound_p): New function.
18102 (Fload): Bind Qlexical_binding.
18103 (readevalloop): Remove `evalfun' arg.
18104 Bind Qinternal_interpreter_environment.
18105 (Feval_buffer): Bind Qlexical_binding.
18106 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18107 Mark as dynamic.
18108 (syms_of_lread): Declare `lexical-binding'.
18109
18110 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18111
18112 * keyboard.c (eval_dyn): New fun.
18113 (menu_item_eval_property): Use it.
18114
18115 * image.c (parse_image_spec): Use Ffunctionp.
18116
18117 * fns.c (concat, mapcar1): Accept byte-code-functions.
18118
18119 * eval.c (Fsetq): Handle lexical vars.
18120 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18121 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18122 (FletX, Flet): Obey lexical binding.
18123 (Fcommandp): Handle closures.
18124 (Feval): New `lexical' arg.
18125 (eval_sub): New function extracted from Feval. Use it almost
18126 everywhere where Feval was used. Look up vars in lexical env.
18127 Handle closures.
18128 (Ffunctionp): Move from subr.el.
18129 (Ffuncall): Handle closures.
18130 (apply_lambda): Remove `eval_flags'.
18131 (funcall_lambda): Handle closures and new byte-code-functions.
18132 (Fspecial_variable_p): New function.
18133 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18134 but without exporting it to Lisp.
18135
18136 * doc.c (Fdocumentation, store_function_docstring):
18137 * data.c (Finteractive_form): Handle closures.
18138
18139 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18140 interactive spec.
18141
18142 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18143 New byte-codes.
18144 (exec_byte_code): New function extracted from Fbyte_code to handle new
18145 calling convention for byte-code-functions. Add new byte-codes.
18146
18147 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18148
18149 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18150
18151 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18152
18153 * xdisp.c (redisplay_internal): Fix prototype.
18154
18155 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18156
18157 * xdisp.c (SCROLL_LIMIT): New macro.
18158 (try_scrolling): Use it when setting scroll_limit.
18159 Limit scrolling to 100 screen lines.
18160 (redisplay_window): Even when falling back on "recentering",
18161 position point in the window according to scroll-conservatively,
18162 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18163
18164 (try_scrolling): When point is above the window, allow searching
18165 as far as scroll_max, or one screenful, to compute vertical
18166 distance from PT to the scroll margin position. This prevents
18167 try_scrolling from unnecessarily failing when
18168 scroll-conservatively is set to a value slightly larger than the
18169 window height. Clean up the case of PT below the margin at bottom
18170 of window: scroll_max can no longer be INT_MAX. When aggressive
18171 scrolling is in use, don't let point enter the opposite scroll
18172 margin as result of the scroll.
18173 (syms_of_xdisp) <scroll-conservatively>: Document the
18174 threshold of 100 lines for never-recentering scrolling.
18175
18176 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18177
18178 * dispextern.h (move_it_by_lines):
18179 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18180 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18181 (message_log_check_duplicate): Remove parameters `prev_bol' and
18182 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18183 (redisplay_internal): Remove parameter `preserve_echo_area',
18184 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18185
18186 * indent.c (Fvertical_motion):
18187 * window.c (window_scroll_pixel_based, Frecenter):
18188 Don't pass `need_y_p' to `move_it_by_lines'.
18189
18190 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18191
18192 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18193 steal a few bits to be more compact.
18194 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18195 Remove unneeded casts.
18196
18197 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18198
18199 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18200
18201 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18202 binding" message (bug#7967).
18203
18204 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18205
18206 Fix more problems found by GCC 4.6.0's static checks.
18207
18208 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18209 Remove unused local var.
18210
18211 * editfns.c (Fmessage_box): Remove unused local var.
18212
18213 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18214 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18215 Omit unused local vars.
18216 * window.c (shrink_windows): Omit unused local var.
18217 * menu.c (digest_single_submenu): Omit unused local var.
18218 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18219 Omit unused local var.
18220
18221 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18222 Don't assume string length fits in int.
18223 (keyremap_step, read_key_sequence): Use size_t for sizes.
18224 (read_key_sequence): Don't check last_real_key_start redundantly.
18225
18226 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18227 instead of alloca (Bug#8344).
18228
18229 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18230 (Fbacktrace_frame): Don't assume nframes fits in int.
18231
18232 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18233
18234 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18235 concerns.
18236
18237 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18238
18239 * cm.c (calccost): Turn while-do into do-while, for clarity.
18240
18241 * keyboard.c (syms_of_keyboard): Use the same style as later
18242 in this function when indexing through an array. This also
18243 works around GCC bug 48267.
18244
18245 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18246
18247 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18248
18249 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18250 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18251
18252 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18253 This avoids undefined behavior on integer overflow, and is a bit
18254 more convenient anyway since it is compared to a size_t variable.
18255
18256 Variadic C functions now count arguments with size_t, not int.
18257 This avoids an unnecessary limitation on 64-bit machines, which
18258 caused (substring ...) to crash on large vectors (Bug#8344).
18259 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18260 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18261 All variadic functions and their callers changed accordingly.
18262 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18263 * data.c (arith_driver, float_arith_driver): Likewise.
18264 * editfns.c (general_insert_function): Likewise.
18265 * eval.c (struct backtrace.nargs, interactive_p)
18266 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18267 (funcall_lambda, mark_backtrace): Likewise.
18268 * fns.c (concat): Likewise.
18269 * frame.c (x_set_frame_parameters): Likewise.
18270 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18271 0 if not found, not -1. All callers changed.
18272
18273 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18274 (stack_copy_size): Now size_t, not int.
18275 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18276
18277 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18278
18279 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18280 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18281 All callers changed.
18282
18283 * lisp.h (multibyte_char_to_unibyte):
18284 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18285 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18286 * character.h (CHAR_TO_BYTE8):
18287 * cmds.c (internal_self_insert):
18288 * editfns.c (general_insert_function):
18289 * keymap.c (push_key_description):
18290 * search.c (Freplace_match):
18291 * xdisp.c (message_dolog, set_message_1): All callers changed.
18292
18293 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18294
18295 * keyboard.c (safe_run_hook_funcall): New function.
18296 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18297 don't set the hook to nil, but remove the offending function instead.
18298 (Qcommand_hook_internal): Remove, unused.
18299 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18300 Vcommand_hook_internal.
18301
18302 * eval.c (enum run_hooks_condition): Remove.
18303 (funcall_nil, funcall_not): New functions.
18304 (run_hook_with_args): Call each function through a `funcall' argument.
18305 Remove `cond' argument, now redundant.
18306 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18307 (Frun_hook_with_args_until_failure): Adjust accordingly.
18308 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18309
18310 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18311
18312 * dispextern.h (string_buffer_position): Remove declaration.
18313
18314 * print.c (strout): Remove parameter `multibyte', unused since
18315 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18316
18317 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18318 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18319 All callers changed.
18320
18321 * w32.c (_wsa_errlist): Use braces for struct initializers.
18322
18323 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18324 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18325 All callers changed.
18326 (string_buffer_position): Likewise. Also, make static (it's never
18327 used outside xdisp.c).
18328 (cursor_row_p): Remove parameter `w', unused since
18329 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18330 (decode_mode_spec): Remove parameter `precision', introduced during
18331 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18332 All callers changed.
18333
18334 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18335
18336 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18337
18338 2011-03-27 Anders Lindgren <andlind@gmail.com>
18339
18340 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18341 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18342 (ns_update_auto_hide_menu_bar): New functions.
18343 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18344 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18345 ns_constrain_all_frames.
18346 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18347 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18348
18349 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18350
18351 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18352
18353 2011-03-27 Glenn Morris <rgm@gnu.org>
18354
18355 * syssignal.h: Replace RETSIGTYPE with void.
18356 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18357 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18358 Replace SIGTYPE with void everywhere.
18359 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18360 * s/template.h (SIGTYPE): Remove commented out definition.
18361
18362 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18363
18364 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18365 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18366
18367 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18368
18369 * w32.c (read_unc_volume): Use parameter `henum', instead of
18370 global variable `wget_enum_handle'.
18371
18372 * keymap.c (describe_vector): Remove parameters `indices' and
18373 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18374 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18375
18376 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18377
18378 * keyboard.c (timer_check): Remove parameter `do_it_now',
18379 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18380 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18381 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18382
18383 * keyboard.c (read_char):
18384 * w32menu.c (w32_menu_display_help):
18385 * xmenu.c (show_help_event, menu_help_callback):
18386 Adjust calls to `show_help_echo'.
18387
18388 * gtkutil.c (xg_maybe_add_timer):
18389 * keyboard.c (readable_events):
18390 * process.c (wait_reading_process_output):
18391 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18392
18393 * insdel.c (adjust_markers_gap_motion):
18394 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18395 (gap_left, gap_right): Don't call it.
18396
18397 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18398
18399 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18400 incurred during fontification.
18401
18402 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18403
18404 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18405 (DEFVAR_PER_BUFFER): Don't pass it.
18406
18407 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18408 (scrolling_window): Don't pass it.
18409
18410 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18411
18412 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18413
18414 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18415 and `suffix'.
18416 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18417 of variables specific to SELinux and computation of `encoded_absname'.
18418
18419 * image.c (XPutPixel): Remove unused variable `height'.
18420
18421 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18422
18423 * unexw32.c (get_section_info): Remove unused variable `section'.
18424
18425 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18426 (system_process_attributes): Remove unused variable `sess'.
18427 (sys_read): Remove unused variable `err'.
18428
18429 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18430 (w32_wnd_proc): Remove unused variable `isdead'.
18431 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18432 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18433 (x_create_tip_frame): Remove unused variable `tem'.
18434
18435 * w32inevt.c (w32_console_read_socket):
18436 Remove unused variable `no_events'.
18437
18438 * w32term.c (x_draw_composite_glyph_string_foreground):
18439 Remove unused variable `width'.
18440
18441 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18442
18443 * w32term.c (x_set_glyph_string_clipping):
18444 Don't pass uninitialized region to CombineRgn.
18445
18446 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18447
18448 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18449 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18450 (Fx_close_connection): Remove unused variable `i'.
18451
18452 * w32font.c (w32font_draw): Return number of glyphs.
18453 (w32font_open_internal): Remove unused variable `i'.
18454 (w32font_driver): Add missing initializer.
18455
18456 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18457 (fill_in_menu): Remove unused variable `items_added'.
18458
18459 * w32term.c (last_mouse_press_frame): Remove static global variable.
18460 (w32_clip_to_row): Remove unused variable `f'.
18461 (x_delete_terminal): Remove unused variable `i'.
18462
18463 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18464 (NOTHING): Remove unused static global variable.
18465 (uniscribe_check_otf): Remove unused variable `table'.
18466 (uniscribe_font_driver): Add missing initializers.
18467
18468 2011-03-23 Julien Danjou <julien@danjou.info>
18469
18470 * term.c (Fsuspend_tty, Fresume_tty):
18471 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18472 * window.c (temp_output_buffer_show):
18473 * insdel.c (signal_before_change):
18474 * frame.c (Fhandle_switch_frame):
18475 * fileio.c (Fdo_auto_save):
18476 * emacs.c (Fkill_emacs):
18477 * editfns.c (save_excursion_restore):
18478 * cmds.c (internal_self_insert):
18479 * callint.c (Fcall_interactively):
18480 * buffer.c (Fkill_all_local_variables):
18481 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18482 Use Frun_hooks.
18483 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18484 unconditionally since it does the check itself.
18485
18486 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18487
18488 Fix more problems found by GCC 4.5.2's static checks.
18489
18490 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18491 the first time through the loop, since we know p0 < p1 then.
18492 This also avoids a gcc -Wstrict-overflow warning.
18493
18494 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18495 leading to a memory leak, possible in functions like
18496 load_charset_map_from_file that can allocate an unbounded number
18497 of objects (Bug#8318).
18498
18499 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18500 that could (at least in theory) be that large.
18501
18502 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18503 This is less likely to overflow, and avoids undefined behavior if
18504 overflow does occur. All callers changed. Use strtoul to scan
18505 for the unsigned long integer.
18506 (pint2hrstr): Simplify and tune code slightly.
18507 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18508
18509 * scroll.c (do_scrolling): Work around GCC bug 48228.
18510 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18511
18512 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18513 This also avoids a warning with gcc -Wstrict-overflow.
18514 (validate_x_resource_name): Simplify count usage.
18515 This also avoids a warning with gcc -Wstrict-overflow.
18516
18517 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18518 fail (Bug#8306).
18519
18520 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18521
18522 * process.c (Fmake_network_process): Use socklen_t, not int,
18523 where POSIX says socklen_t is required in portable programs.
18524 This fixes a porting bug on hosts like 64-bit HP-UX, where
18525 socklen_t is wider than int (Bug#8277).
18526 (Fmake_network_process, server_accept_connection):
18527 (wait_reading_process_output, read_process_output):
18528 Likewise.
18529
18530 * process.c: Rename or move locals to avoid shadowing.
18531 (list_processes_1, Fmake_network_process):
18532 (read_process_output_error_handler, exec_sentinel_error_handler):
18533 Rename or move locals.
18534 (Fmake_network_process): Define label "retry_connect" only if needed.
18535 (Fnetwork_interface_info): Fix pointer signedness.
18536 (process_send_signal): Add cast to avoid pointer signedness problem.
18537 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18538 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18539
18540 Make tparam.h and terminfo.c consistent.
18541 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18542 Include tparam.h instead, since it declares them.
18543 * cm.h (PC): Remove extern decl; tparam.h now does this.
18544 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18545 * terminfo.c: Include tparam.h, to check interfaces.
18546 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18547 (tparam): Adjust signature to match interface in tparam.h;
18548 this removes some undefined behavior. Check that outstring and len
18549 are zero, which they always are with Emacs.
18550 * tparam.h (PC, BC, UP): New extern decls.
18551
18552 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18553 (xftfont_open): Rename locals to avoid shadowing.
18554
18555 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18556 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18557 (OTF_TAG_SYM): Omit macro if not needed.
18558 (ftfont_list): Remove unused local.
18559 (get_adstyle_property, ftfont_pattern_entity):
18560 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18561 Rename locals to avoid shadowing.
18562
18563 * xfont.c (xfont_list_family): Mark var as initialized.
18564
18565 * xml.c (make_dom): Now static.
18566
18567 * composite.c (composition_compute_stop_pos): Rename local to
18568 avoid shadowing.
18569 (composition_reseat_it): Remove unused locals.
18570 (find_automatic_composition, composition_adjust_point): Likewise.
18571 (composition_update_it): Mark var as initialized.
18572 (find_automatic_composition): Mark vars as initialized,
18573 with a FIXME (Bug#8290).
18574
18575 character.h: Rename locals to avoid shadowing.
18576 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18577 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18578 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18579 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18580 to avoid shadowing.
18581
18582 * textprop.c (property_change_between_p): Remove; unused.
18583
18584 * intervals.c (interval_start_pos): Now static.
18585
18586 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18587
18588 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18589 Rename locals to avoid shadowing.
18590
18591 * sound.c (wav_play, au_play, Fplay_sound_internal):
18592 Fix pointer signedness.
18593 (alsa_choose_format): Remove unused local var.
18594 (wav_play): Initialize a variable to 0, to prevent undefined
18595 behavior (Bug#8278).
18596
18597 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18598
18599 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18600
18601 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18602 clobbering (Bug#8298).
18603 * sysdep.c (sys_subshell): Likewise.
18604 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18605
18606 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18607 This should get cleaned up, so that child_setup has the
18608 same signature on all platforms.
18609
18610 * callproc.c (call_process_cleanup): Now static.
18611 (relocate_fd): Rename locals to avoid shadowing.
18612
18613 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18614
18615 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18616 not to be necessary, and produces flickering.
18617
18618 2011-03-20 Glenn Morris <rgm@gnu.org>
18619
18620 * config.in: Remove file.
18621
18622 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18623
18624 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18625 are now in src/globals.h.
18626 (syms_of_minibuf): Remove spurious & from previous change.
18627
18628 2011-03-20 Leo Liu <sdl.web@gmail.com>
18629
18630 * minibuf.c (completing-read-function): New variable.
18631 (completing-read-default): Rename from completing-read.
18632 (completing-read): Call completing-read-function.
18633
18634 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18635
18636 * xfaces.c (Fx_load_color_file):
18637 Read color file from absolute filename (bug#8250).
18638
18639 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18640
18641 * makefile.w32-in: Update dependencies.
18642
18643 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18644
18645 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18646
18647 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18648
18649 Fix more problems found by GCC 4.5.2's static checks.
18650
18651 * process.c (make_serial_process_unwind, send_process_trap):
18652 (sigchld_handler): Now static.
18653
18654 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18655 That way, the code declares only the vars that it needs.
18656 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18657 * s/cygwin.h (PTY_ITERATION): Likewise.
18658 * s/darwin.h (PTY_ITERATION): Likewise.
18659 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18660
18661 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18662 * process.c (allocate_pty): Don't declare stb unless it's needed.
18663
18664 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18665 (CONSTANTLIM): Remove; unused.
18666 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18667 Define only if needed.
18668
18669 * unexelf.c (unexec): Name an expression,
18670 to avoid gcc -Wbad-function-cast warning.
18671 Use a different way to cause a compilation error if anyone uses
18672 n rather than nn, a way that does not involve shadowing.
18673 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18674
18675 * deps.mk (unexalpha.o): Remove; unused.
18676
18677 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18678 * unexec.h: New file.
18679 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18680 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18681 Depend on unexec.h.
18682 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18683 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18684 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18685 Change as necessary to match prototype in unexec.h.
18686
18687 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18688 shadowing.
18689 (back_comment, skip_chars): Mark vars as initialized.
18690
18691 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18692 Rename locals to avoid shadowing.
18693
18694 * lread.c (read1): Rewrite so as not to use empty "else".
18695 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18696
18697 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18698
18699 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18700 warning when compiling print.c.
18701
18702 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18703 instead of using an uninitialized var.
18704 (font_sort_entities): Mark var as initialized.
18705
18706 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18707
18708 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18709 pointers to constants.
18710 (font_parse_fcname): Remove unused vars.
18711 (font_delete_unmatched): Now static.
18712 (font_get_spec): Remove; unused.
18713 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18714 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18715 Rename or move locals to avoid shadowing.
18716
18717 * fns.c (require_nesting_list, require_unwind): Now static.
18718 (Ffillarray): Rename locals to avoid shadowing.
18719
18720 * floatfns.c (domain_error2): Define only if needed.
18721 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18722
18723 * alloc.c (mark_backtrace): Move decl from here ...
18724 * lisp.h: ... to here, so that it can be checked.
18725
18726 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18727 (Fdefvar): Rewrite so as not to use empty "else".
18728 (lisp_indirect_variable): Name an expression,
18729 to avoid gcc -Wbad-function-cast warning.
18730 (Fdefvar): Rename locals to avoid shadowing.
18731
18732 * callint.c (quotify_arg, quotify_args): Now static.
18733 (Fcall_interactively): Rename locals to avoid shadowing.
18734 Use const pointer when appropriate.
18735
18736 * lisp.h (get_system_name, get_operating_system_release):
18737 Move decls here, to check interfaces.
18738 * process.c (get_operating_system_release): Move decl to lisp.h.
18739 * xrdb.c (get_system_name): Likewise.
18740 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18741 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18742 some of which prompt warnings from gcc -Wbad-function-cast.
18743 (Fformat_time_string, Fencode_time, Finsert_char):
18744 (Ftranslate_region_internal, Fformat):
18745 Rename or remove local vars to avoid shadowing.
18746 (Ftranslate_region_internal): Mark var as initialized.
18747
18748 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18749 avoid shadowing.
18750
18751 * lisp.h (eassert): Check that the argument compiles, even if
18752 ENABLE_CHECKING is not defined.
18753
18754 * data.c (Findirect_variable): Name an expression, to avoid
18755 gcc -Wbad-function-cast warning.
18756 (default_value, arithcompare, arith_driver, arith_error): Now static.
18757 (store_symval_forwarding): Rename local to avoid shadowing.
18758 (Fmake_variable_buffer_local, Fmake_local_variable):
18759 Mark variables as initialized.
18760 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18761
18762 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18763 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18764 Rename locals to avoid shadowing.
18765 (mark_stack): Move local variables into the #ifdef region where
18766 they're used.
18767 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18768 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18769 needed otherwise.
18770 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18771 (GC_STRING_CHARS): Remove; not used.
18772 (Fmemory_limit): Cast sbrk's returned value to char *.
18773
18774 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18775 avoids undefined behavior in theory.
18776
18777 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18778
18779 Use functions, not macros, for up- and down-casing (Bug#8254).
18780 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18781 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18782 to use the following functions instead of these macros.
18783 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18784 EMACS_INT, since callers assume the returned value fits in int.
18785 (upcase1): Likewise, for UPCASE_TABLE.
18786 (uppercasep, lowercasep, upcase): New static inline functions.
18787 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18788 the race-condition problem in the old DOWNCASE.
18789
18790 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18791 Rename locals to avoid shadowing.
18792 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18793 (regex_compile, re_search_2, re_match_2_internal):
18794 Remove unused local vars.
18795 (FREE_VAR): Rewrite so as not to use empty "else",
18796 which gcc can warn about.
18797 (regex_compile, re_match_2_internal): Mark locals as initialized.
18798 (RETALLOC_IF): Define only if needed.
18799 (WORDCHAR_P): Likewise. This one is never needed, but is used
18800 only in a comment talking about a compiler bug, so put inside
18801 the #if 0 of that comment.
18802 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18803 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18804 Remove; unused.
18805
18806 * search.c (boyer_moore): Rename locals to avoid shadowing.
18807 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18808 (PREV_CHAR_BOUNDARY): Likewise.
18809
18810 * search.c (simple_search): Remove unused var.
18811
18812 * dired.c (compile_pattern): Move decl from here ...
18813 * lisp.h: ... to here, so that it can be checked.
18814 (struct re_registers): New forward decl.
18815
18816 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18817
18818 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18819 All uses changed.
18820 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18821 Rename locals to avoid shadowing.
18822 (Fvertical_motion): Mark locals as initialized.
18823
18824 * casefiddle.c (casify_object, casify_region): Now static.
18825 (casify_region): Mark local as initialized.
18826
18827 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18828
18829 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18830 New macros, so that the caller can use some names other than
18831 gcpro1, gcpro2, etc.
18832 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18833 of the new macros.
18834 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18835 argument, for consistency with GCPRO2_VAR, etc: it is now the
18836 prefix of the variable, not the variable itself. All uses
18837 changed.
18838 * dired.c (directory_files_internal, file_name_completion):
18839 Rename locals to avoid shadowing.
18840
18841 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18842 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18843 dired.c's scmp function, had undefined behavior.
18844 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18845 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18846 * buffer.h: ... to here, because these macros use current_buffer,
18847 and the new implementation with inline functions needs to have
18848 current_buffer in scope now, rather than later when the macros
18849 are used.
18850 (downcase, upcase1): New static inline functions.
18851 (DOWNCASE, UPCASE1): Reimplement using these functions.
18852 This avoids undefined behavior in expressions like
18853 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18854 from race conditions in accessing the global variables
18855 case_temp1 and case_temp2.
18856 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18857 * lisp.h (case_temp1, case_temp2): Remove their decls.
18858 * character.h (ASCII_CHAR_P): Move from here ...
18859 * lisp.h: ... to here, so that the inline functions mentioned
18860 above can use them.
18861
18862 * dired.c (directory_files_internal_unwind): Now static.
18863
18864 * fileio.c (file_name_as_directory, directory_file_name):
18865 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18866 Now static.
18867 (file_name_as_directory): Use const pointers when appropriate.
18868 (Fexpand_file_name): Likewise. In particular, newdir might
18869 point at constant storage, so make it a const pointer.
18870 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18871 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18872 signedness issues.
18873 (Fset_file_times, Finsert_file_contents, auto_save_error):
18874 Rename locals to avoid shadowing.
18875
18876 * minibuf.c (choose_minibuf_frame_1): Now static.
18877 (Ftry_completion, Fall_completions): Rename or remove locals
18878 to avoid shadowing.
18879
18880 * marker.c (bytepos_to_charpos): Remove; unused.
18881
18882 * lisp.h (verify_bytepos, count_markers): New decls,
18883 so that gcc does not warn that these functions aren't declared.
18884
18885 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18886 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18887 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18888 (copy_text): Remove unused local var.
18889
18890 * filelock.c (within_one_second): Now static.
18891 (lock_file_1): Rename local to avoid shadowing.
18892
18893 * buffer.c (fix_overlays_before): Mark locals as initialized.
18894 (fix_start_end_in_overlays): Likewise. This function should be
18895 simplified by using pointers-to-pointers, but that's a different
18896 matter.
18897 (switch_to_buffer_1): Now static.
18898 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18899 (report_overlay_modification): Rename locals to avoid shadowing.
18900
18901 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18902 Fix pointer signedness issue.
18903 (sys_subshell): Mark local as volatile if checking for lint,
18904 to suppress a gcc -Wclobbered warning that does not seem to be right.
18905 (MAXPATHLEN): Define only if needed.
18906
18907 * process.c (serial_open, serial_configure): Move decls from here ...
18908 * systty.h: ... to here, so that they can be checked.
18909
18910 * fns.c (get_random, seed_random): Move extern decls from here ...
18911 * lisp.h: ... to here, so that they can be checked.
18912
18913 * sysdep.c (reset_io): Now static.
18914 (wait_for_termination_signal): Remove; unused.
18915
18916 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18917 (copy_keymap_item, append_key, push_text_char_description):
18918 Now static.
18919 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18920 (DENSE_TABLE_SIZE): Remove; unused.
18921 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18922 (describe_map_tree):
18923 Rename locals to avoid shadowing.
18924
18925 * keyboard.c: Declare functions static if they are not used elsewhere.
18926 (echo_char, echo_dash, cmd_error, top_level_2):
18927 (poll_for_input, handle_async_input): Now static.
18928 (read_char, kbd_buffer_get_event, make_lispy_position):
18929 (make_lispy_event, make_lispy_movement, apply_modifiers):
18930 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18931 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18932 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18933 (read_key_sequence, read_char): Mark locals as initialized.
18934 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18935
18936 * keyboard.h (make_ctrl_char): New decl.
18937 (mark_kboards): Move decl here ...
18938 * alloc.c (mark_kboards): ... from here.
18939
18940 * lisp.h (force_auto_save_soon): New decl.
18941
18942 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18943 (DEFINE_DUMMY_FUNCTION): New macro.
18944 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18945 Use it.
18946 (main): Add casts to avoid warnings
18947 if GCC considers string literals to be constants.
18948
18949 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18950
18951 * dbusbind.c: Pointer signedness fixes.
18952 (xd_signature, xd_append_arg, xd_initialize):
18953 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18954 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18955 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18956 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18957
18958 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18959 if GCC considers string literals to be constants.
18960 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18961
18962 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18963
18964 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18965 (print_preprocess, print_object): New macro to fix last change.
18966
18967 * print.c (print_preprocess): Don't forget font objects.
18968
18969 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18970
18971 * emacs.c (USAGE3): Doc fixes.
18972
18973 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18974
18975 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18976 structure.
18977
18978 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18979
18980 * lisp.h (VWindow_system, Qfile_name_history):
18981 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18982 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18983 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18984
18985 * w32select.c: Don't #include "keyboard.h".
18986 (run_protected): Add extern declaration for waiting_for_input.
18987
18988 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18989 * w32console.c (detect_input_pending, read_input_pending)
18990 (encode_terminal_code):
18991 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18992 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18993 (w32_system_caret_y, Qfile_name_history):
18994 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18995 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18996 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18997 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18998 * w32proc.c (Qlocal, report_file_error):
18999 * w32term.c (Vwindow_system, updating_frame):
19000 * w32uniscribe.c (initialized, uniscribe_font_driver):
19001 Remove unneeded extern declarations.
19002
19003 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
19004
19005 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
19006
19007 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
19008
19009 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19010 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19011 These macros can no longer be used for assignment.
19012
19013 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19014 Assign struct members directly, instead of using BUF_BEGV etc.
19015 (record_buffer_markers, fetch_buffer_markers): New functions for
19016 recording and fetching special buffer markers.
19017 (set_buffer_internal_1, set_buffer_temp): Use them.
19018
19019 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19020
19021 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19022
19023 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19024 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19025
19026 * xdisp.c (hscroll_window_tree):
19027 (reconsider_clip_changes): Use PT instead of BUF_PT.
19028
19029 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19030
19031 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19032 $(EMACS_ROOT)/lib/intprops.h.
19033
19034 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19035
19036 Fix more problems found by GCC 4.5.2's static checks.
19037
19038 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19039 to unsigned char * to avoid compiler diagnostic.
19040 (xg_free_frame_widgets): Make it clear that a local variable is
19041 needed only if USE_GTK_TOOLTIP.
19042 (gdk_window_get_screen): Make it clear that this macro is needed
19043 only if USE_GTK_TOOLTIP.
19044 (int_gtk_range_get_value): New function, which avoids a diagnostic
19045 from gcc -Wbad-function-cast.
19046 (xg_set_toolkit_scroll_bar_thumb): Use it.
19047 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19048 diagnostic from gcc -Wbad-function-cast.
19049 (get_utf8_string, xg_get_file_with_chooser):
19050 Rename locals to avoid shadowing.
19051 (create_dialog): Move locals to avoid shadowing.
19052
19053 * xgselect.c (xg_select): Remove unused var.
19054
19055 * image.c (four_corners_best): Mark locals as initialized.
19056 (gif_load): Initialize transparent_p to zero (Bug#8238).
19057 Mark another local as initialized.
19058 (my_png_error, my_error_exit): Mark with NO_RETURN.
19059
19060 * image.c (clear_image_cache): Now static.
19061 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19062 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19063 (x_edge_detection): Remove unnecessary cast that
19064 gcc -Wbad-function-cast diagnoses.
19065 (gif_load): Fix pointer signedness.
19066 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19067 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19068
19069 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19070
19071 Improve quality of tests for time stamp overflow.
19072 For example, without this patch (encode-time 0 0 0 1 1
19073 1152921504606846976) returns the obviously-bogus value (-948597
19074 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19075 reports time overflow. See
19076 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19077 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19078 * editfns.c: Include limits.h and intprops.h.
19079 (TIME_T_MIN, TIME_T_MAX): New macros.
19080 (time_overflow): Move earlier, to before first use.
19081 (hi_time, lo_time): New functions, for an accurate test for
19082 out-of-range times.
19083 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19084 (Fget_internal_run_time): Don't assume time_t fits in int.
19085 (make_time): Use list2 instead of Fcons twice.
19086 (Fdecode_time): More accurate test for out-of-range times.
19087 (check_tm_member): New function.
19088 (Fencode_time): Use it, to test for out-of-range times.
19089 (lisp_time_argument): Don't rely on undefined left-shift and
19090 right-shift behavior when checking for time stamp overflow.
19091
19092 * editfns.c (time_overflow): New function, refactoring common code.
19093 (Fformat_time_string, Fdecode_time, Fencode_time):
19094 (Fcurrent_time_string): Use it.
19095
19096 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19097 * dired.c (make_time): Move to ...
19098 * editfns.c (make_time): ... here.
19099 * systime.h: Note the move.
19100
19101 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19102
19103 * fringe.c (update_window_fringes): Remove unused variables.
19104
19105 * unexmacosx.c (copy_data_segment): Also copy __got section.
19106 (Bug#8223)
19107
19108 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19109
19110 * termcap.c [MSDOS]: Include "msdos.h".
19111 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19112 Constify `char *' arguments and their references according to
19113 prototypes in tparam.h.
19114
19115 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19116
19117 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19118 Adapt all references accordingly.
19119
19120 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19121
19122 2011-03-11 Tom Tromey <tromey@redhat.com>
19123
19124 * buffer.c (syms_of_buffer): Remove obsolete comment.
19125
19126 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19127
19128 * termhooks.h (encode_terminal_code): Declare prototype.
19129
19130 * msdos.c (encode_terminal_code): Don't declare prototype.
19131
19132 * term.c (encode_terminal_code): Now external again, used by
19133 w32console.c and msdos.c.
19134
19135 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19136 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19137
19138 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19139
19140 Fix some minor problems found by GCC 4.5.2's static checks.
19141
19142 * fringe.c (update_window_fringes): Mark locals as initialized
19143 (Bug#8227).
19144 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19145
19146 * alloc.c (mark_fringe_data): Move decl from here ...
19147 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19148 to check its interface.
19149 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19150
19151 * fontset.c (free_realized_fontset): Now static.
19152 (Fset_fontset_font): Rename local to avoid shadowing.
19153 (fontset_font): Mark local as initialized.
19154 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19155
19156 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19157
19158 * xselect.c (x_disown_buffer_selections): Remove; not used.
19159 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19160 (x_own_selection, Fx_disown_selection_internal): Rename locals
19161 to avoid shadowing.
19162 (x_handle_dnd_message): Remove local to avoid shadowing.
19163
19164 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19165 so that the caller can use some name other than gcpro1.
19166 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19167 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19168 (Fx_backspace_delete_keys_p):
19169 Use them to avoid shadowing, and rename vars to avoid shadowing.
19170 (x_decode_color, x_set_name, x_window): Now static.
19171 (Fx_create_frame): Add braces to silence GCC warning.
19172 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19173 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19174 Remove unused locals.
19175 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19176 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19177 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19178 macros.
19179
19180 * xterm.h (x_mouse_leave): New decl.
19181
19182 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19183 Remove unused functions.
19184 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19185 (x_calc_absolute_position): Now static.
19186 (XTread_socket): Don't define label "out" unless it's used.
19187 Don't declare local "event" unless it's used.
19188 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19189 unless they are used.
19190 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19191 (x_fatal_error_signal): Remove; not used.
19192 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19193 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19194 (x_error_catcher, x_connection_closed, x_error_handler):
19195 (x_error_quitter, xembed_send_message, x_iconify_frame):
19196 (my_log_handler): Rename locals to avoid shadowing.
19197 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19198 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19199
19200 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19201 Rename or move locals to avoid shadowing.
19202 (tty_defined_color, merge_face_heights): Now static.
19203 (free_realized_faces_for_fontset): Remove; not used.
19204 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19205 does not deduce is never used uninitialized.
19206 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19207 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19208
19209 * terminal.c (store_terminal_param): Now static.
19210
19211 * xmenu.c (menu_highlight_callback): Now static.
19212 (set_frame_menubar): Remove unused local.
19213 (xmenu_show): Rename parameter to avoid shadowing.
19214 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19215 since they might point to immutable storage.
19216 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19217 since it's unused otherwise.
19218
19219 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19220 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19221 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19222 avoids a gcc -Wuninitialized diagnostic.
19223 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19224 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19225 does not deduce are never used uninitialized.
19226
19227 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19228
19229 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19230 * window.c (window_loop, size_window):
19231 (run_window_configuration_change_hook, enlarge_window): Likewise.
19232
19233 * window.c (display_buffer): Now static.
19234 (size_window): Mark variables that gcc -Wuninitialized
19235 does not deduce are never used uninitialized.
19236 * window.h (check_all_windows): New decl, to forestall
19237 gcc -Wmissing-prototypes diagnostic.
19238 * dispextern.h (bidi_dump_cached_states): Likewise.
19239
19240 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19241 shadowing.
19242 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19243 Include <limits.h>.
19244 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19245 and to avoid gcc -Wuninitialized warning.
19246 (load_charset_map): Mark variables that gcc -Wuninitialized
19247 does not deduce are never used uninitialized.
19248 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19249
19250 * coding.c (coding_set_source, coding_set_destination):
19251 Use "else { /* comment */ }" rather than "else /* comment */;"
19252 for clarity, and to avoid gcc -Wempty-body warning.
19253 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19254 a block, when the outer 'i' will do.
19255 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19256 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19257 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19258 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19259 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19260 Rename locals to avoid shadowing.
19261 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19262 * coding.c (emacs_mule_char, encode_invocation_designation):
19263 Now static, since they're not used elsewhere.
19264 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19265 (decode_coding_object, encode_coding_object, detect_coding_system):
19266 (decode_coding_emacs_mule): Mark variables that gcc
19267 -Wuninitialized does not deduce are never used uninitialized.
19268 (detect_coding_iso_2022): Initialize a local variable that might
19269 be used uninitialized. Leave a FIXME because it's not clear that
19270 this initialization is needed. (Bug#8211)
19271 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19272 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19273 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19274 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19275 Remove unused macros.
19276
19277 * category.c (hash_get_category_set): Remove unused local var.
19278 (copy_category_table): Now static, since it's not used elsewhere.
19279 * character.c (string_count_byte8): Likewise.
19280
19281 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19282 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19283
19284 * chartab.c (copy_sub_char_table): Now static, since it's not used
19285 elsewhere.
19286 (sub_char_table_ref_and_range, char_table_ref_and_range):
19287 Rename locals to avoid shadowing.
19288 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19289
19290 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19291 (BIDI_BOB): Remove unused macro.
19292
19293 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19294 deduce are never used uninitialized.
19295 * term.c (encode_terminal_code): Likewise.
19296
19297 * term.c (encode_terminal_code): Now static. Remove unused local.
19298
19299 * tparam.h: New file.
19300 * term.c, tparam.h: Include it.
19301 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19302 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19303 Move these decls to tparam.h, and make them agree with what
19304 is actually in tparam.c. The previous trick of using incompatible
19305 decls in different modules does not conform to the C standard.
19306 All callers of tparam changed to use tparam's actual API.
19307 * tparam.c (tparam1, tparam, tgoto):
19308 Use const pointers where appropriate.
19309
19310 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19311 * cm.h (struct cm): Likewise.
19312 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19313 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19314 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19315 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19316 (turn_on_face, init_tty): Likewise.
19317 * termchar.h (struct tty_display_info): Likewise.
19318
19319 * term.c (term_mouse_position): Rename local to avoid shadowing.
19320
19321 * alloc.c (mark_ttys): Move decl from here ...
19322 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19323
19324 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19325
19326 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19327
19328 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19329
19330 * search.c (compile_pattern_1): Remove argument regp, unused since
19331 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19332 (compile_pattern): Don't pass it.
19333
19334 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19335
19336 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19337 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19338 for ! HAVE_GTK3.
19339 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19340
19341 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19342
19343 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19344 gdk_window_get_screen, gdk_window_get_geometry,
19345 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19346 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19347 (xg_get_pixbuf_from_pixmap): New function.
19348 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19349 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19350 Call xg_get_pixbuf_from_pixmap instead of
19351 gdk_pixbuf_get_from_drawable.
19352 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19353 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19354 (xg_check_special_colors): Use GtkStyleContext and its functions
19355 for HAVE_GTK3.
19356 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19357 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19358 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19359 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19360 Call gtk_widget_get_preferred_size.
19361 (xg_frame_resized): gdk_window_get_geometry only takes 5
19362 parameters.
19363 (xg_win_to_widget, xg_event_is_for_menubar):
19364 Call gdk_x11_window_lookup_for_display.
19365 (xg_set_widget_bg): New function.
19366 (delete_cb): New function.
19367 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19368 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19369 (xg_set_background_color): Call xg_set_widget_bg.
19370 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19371 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19372 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19373 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19374 if ! HAVE_GTK3.
19375 (update_frame_tool_bar): Call gtk_widget_hide.
19376 (xg_initialize): Use GDK_KEY_g.
19377
19378 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19379 if ! HAVE_GTK3
19380 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19381
19382 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19383 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19384 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19385
19386 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19387
19388 * w32xfns.c (select_palette): Check success of RealizePalette against
19389 GDI_ERROR, not zero.
19390
19391 See ChangeLog.11 for earlier changes.
19392
19393 ;; Local Variables:
19394 ;; coding: utf-8
19395 ;; End:
19396
19397 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19398
19399 This file is part of GNU Emacs.
19400
19401 GNU Emacs is free software: you can redistribute it and/or modify
19402 it under the terms of the GNU General Public License as published by
19403 the Free Software Foundation, either version 3 of the License, or
19404 (at your option) any later version.
19405
19406 GNU Emacs is distributed in the hope that it will be useful,
19407 but WITHOUT ANY WARRANTY; without even the implied warranty of
19408 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19409 GNU General Public License for more details.
19410
19411 You should have received a copy of the GNU General Public License
19412 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.