]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix bug #12867 with crashes due to large field width in mode-line format.
[gnu-emacs] / src / ChangeLog
1 2012-11-12 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4 passed to pint2str and pint2hrstr to be at most the size of the
5 frame's decode_mode_spec_buffer. This avoids crashes with very
6 large values of FIELD_WIDTH argument to decode_mode_spec.
7 (Bug#12867)
8
9 2012-11-07 Martin Rudalics <rudalics@gmx.at>
10
11 * window.c (Fsplit_window_internal): Set combination limit of
12 new parent window to t iff Vwindow_combination_limit is t;
13 fixing a regression introduced with the change from 2012-09-22.
14 (Fwindow_combination_limit, Fset_window_combination_limit): Fix
15 doc-strings.
16
17 2012-11-06 Eli Zaretskii <eliz@gnu.org>
18
19 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
20 amount when the scroll margins are too large. When scrolling
21 backwards in the buffer, give up if cannot reach point or the
22 scroll margin within a reasonable number of screen lines. Fixes
23 point position in window under scroll-up/down-aggressively when
24 point is positioned many lines beyond the window top/bottom.
25 (Bug#12811)
26
27 2012-11-05 Eli Zaretskii <eliz@gnu.org>
28
29 * ralloc.c (relinquish): If real_morecore fails to return memory
30 to the system, don't crash; instead, leave the last heap
31 unchanged and return. (Bug#12774)
32
33 2012-11-03 Eli Zaretskii <eliz@gnu.org>
34
35 * lisp.mk: Adjust comments to the fact that term/internal is now
36 loaded from loadup.el.
37
38 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
39 (msdos_fatal_signal): New function.
40 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
41 its argument list.
42
43 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
44 for GCC versions before 4.
45 (emacs_raise): Define to call msdos_fatal_signal.
46
47 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
48 iterator when starting in the middle of a display or overlay
49 string. (Bug#12745)
50
51 2012-11-03 Jan Djärv <jan.h.d@swipnet.se>
52
53 * widget.c (resize_cb): New function.
54 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
55 (EmacsFrameResize): Check if all is up to date before changing frame
56 size.
57
58 2012-11-01 Eli Zaretskii <eliz@gnu.org>
59
60 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
61
62 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
63
64 Fix crash when using Emacs as commit editor for git (Bug#12697).
65 * callproc.c (setpgrp): Remove macro, as we now use setpgid
66 and it is configured in conf_post.h.
67 (Fcall_process): Don't invoke both setsid and setpgid; the former
68 is enough, if it exists.
69 * callproc.c (Fcall_process, child_setup):
70 * process.c (create_process): Use setpgid.
71 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
72 for the real thing.
73 * dispnew.c (init_display): Initialize the foreground group
74 if we are running a tty display.
75 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
76 * lisp.h (init_foreground_group): New decl.
77 * sysdep.c (inherited_pgroup): New static var.
78 (init_foreground_group, tcsetpgrp_without_stopping)
79 (narrow_foreground_group, widen_foreground_group): New functions.
80 (init_sys_modes): Narrow foreground group.
81 (reset_sys_modes): Widen foreground group.
82
83 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
84
85 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
86
87 2012-10-31 Martin Rudalics <rudalics@gmx.at>
88
89 * minibuf.c (read_minibuf): Restore current buffer since
90 choose_minibuf_frame calling Fset_frame_selected_window may
91 change it (Bug#12766).
92
93 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
94
95 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
96
97 2012-10-30 Kenichi Handa <handa@gnu.org>
98
99 * font.c (Ffont_at): If WINDOW is specified and it is not
100 displaying the current buffer, signal an error.
101
102 2012-10-29 Daniel Colascione <dancol@dancol.org>
103
104 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
105 preparation for fixing bug#12739, move these functions from
106 here...
107
108 * coding.h, coding.c: ... to here, and compile them only when
109 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
110 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
111
112 2012-10-28 Eli Zaretskii <eliz@gnu.org>
113
114 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
115 (timer_loop, getitimer, setitimer): Use it instead of
116 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
117 'clock'.
118 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
119 literal 10000.
120
121 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
122
123 * nsterm.m (NO_APPDEFINED_DATA): New define.
124 (last_appdefined_event_data): New variable
125 (last_appdefined_event): Remove.
126 (ns_select): Initialize t from last_appdefined_event_data instead
127 of [last_appdefined_event data1].
128 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
129 remove last_appdefined_event (Bug#12698).
130
131 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
132
133 * frame.c (x_set_font): Catch internal error.
134
135 2012-10-27 Eli Zaretskii <eliz@gnu.org>
136
137 Avoid overflow in w32 implementation of interval timers.
138 When possible, for ITIMER_PROF count only times the main thread
139 actually executes.
140 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
141 'volatile ULONGLONG' types. All the other data which was
142 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
143 (GetThreadTimes_Proc): New typedef.
144 (w32_get_timer_time): New function, returns a suitable time value
145 for the timer.
146 (timer_loop): Enter critical section when accessing ULONGLONG
147 values of the itimer_data struct, as these accesses are no longer
148 atomic. Call 'w32_get_timer_time' instead of 'clock'.
149 Remove unused variable.
150 (init_timers): Initialize s_pfn_Get_Thread_Times.
151 (start_timer_thread): Don't assign itimer->caller_thread here.
152 (getitimer): Assign itimer->caller_thread here.
153 (setitimer): Always call getitimer to get the value of ticks_now.
154 (sys_spawnve): Avoid compiler warning about format mismatch.
155
156 2012-10-26 Eli Zaretskii <eliz@gnu.org>
157
158 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
159 mouse movement events if the menu bar is active. This avoids
160 producing a busy "hour-glass" cursor by Windows if the mouse
161 pointer is positioned over a tooltip shown for some menu item.
162
163 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
164
165 Don't assume process IDs fit in int.
166 * emacs.c (shut_down_emacs) [!DOS_NT]:
167 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
168 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
169 Use pid_t, not int, to store process IDs, as 'int'
170 is not wide enough on a few platforms (e.g., AIX and IRIX).
171
172 2012-10-23 Kenichi Handa <handa@gnu.org>
173
174 The following change is to make face-font-rescale-alist work
175 correctly for non-ASCII fonts.
176
177 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
178 (font_open_for_lface): Handle Vface_font_rescale_alist.
179
180 2012-10-23 Chong Yidong <cyd@gnu.org>
181
182 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
183
184 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
185
186 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
187 for screen font.
188 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
189
190 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
191 event (Bug#12681).
192
193 2012-10-21 Glenn Morris <rgm@gnu.org>
194
195 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
196
197 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
198
199 Port to OpenBSD 5.1.
200 * frame.c (Fmouse_position, Fmouse_pixel_position):
201 * xdisp.c (produce_stretch_glyph):
202 Declare local vars only when they're needed.
203 This is clearer and avoids a warning on OpenBSD about unused vars.
204 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
205 This is safer, and avoids OpenBSD warnings about unused vars.
206 * keyboard.c (record_menu_key): Remove unnecessary decl.
207 (poll_timer): Define only if POLL_FOR_INPUT is defined.
208 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
209 as our definition clashes with OpenBSD's.
210 * xfaces.c (load_face_colors, check_lface_attrs)
211 (get_lface_attributes_no_remap, get_lface_attributes)
212 (lface_fully_specified_p, x_supports_face_attributes_p)
213 (tty_supports_face_attributes_p, face_fontset, realize_face)
214 (realize_x_face, realize_tty_face):
215 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
216 merely Lisp_Object *. This is more informative and avoids
217 a warning on OpenBSD about accessing beyond an object's size.
218
219 2012-10-20 Chong Yidong <cyd@gnu.org>
220
221 * lread.c (Fload): Doc fix (Bug#12592).
222
223 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
224
225 * font.c (Ffont_at): Fix previous change.
226
227 2012-10-19 Eli Zaretskii <eliz@gnu.org>
228
229 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
230 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
231 for the reasons.
232
233 * alloc.c (NSTATICS): Decrease to 0x800.
234
235 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
236
237 * fns.c (Fnreverse): Include the problem element when signalling an
238 error (bug#12677).
239
240 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
241
242 * nsterm.m (ns_select): Check writefds before call to
243 FD_ISSET (Bug#12668).
244
245 2012-10-18 Daniel Colascione <dancol@dancol.org>
246
247 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
248 (staticpro): If we run out of staticpro slots, die with an
249 informative error instead of just calling emacs_abort.
250
251 2012-10-18 Martin Rudalics <rudalics@gmx.at>
252
253 Fix two flaws reported by Dmitry Antipov.
254 * window.c (Ftemp_output_buffer_show): Remove.
255 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
256 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
257
258 2012-10-17 Eli Zaretskii <eliz@gnu.org>
259
260 * makefile.w32-in ($(BLD)/w32.$(O)):
261 ($(BLD)/vm-limit.$(O)):
262 ($(BLD)/term.$(O)):
263 ($(BLD)/unexw32.$(O)):
264 ($(BLD)/fileio.$(O)):
265 ($(BLD)/dispnew.$(O)): Update dependencies.
266
267 * w32term.h (w32_initialize_display_info, initialize_w32_display):
268 Add prototypes.
269
270 * w32proc.c: Include ctype.h.
271
272 * w32.h (init_environment, check_windows_init_file)
273 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
274 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
275 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
276 (sys_link): Add prototypes.
277
278 * w32.c: Include w32select.h.
279 (sys_access, e_malloc, sys_select): Add prototypes.
280 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
281
282 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
283
284 * unexw32.c: Include lisp.h and w32.h.
285
286 * term.c [WINDOWSNT]: Include w32term.h.
287
288 * process.c [WINDOWSNT]: Add prototype of sys_select.
289
290 * fileio.c [WINDOWSNT]: Include w32.h.
291
292 * dispnew.c [WINDOWSNT]: Include w32.h.
293
294 * cygw32.c (Fcygwin_convert_path_to_windows)
295 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
296 Lisp_Object values. (Bug#12661)
297
298 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
299 to Lisp_Object. (Bug#12661)
300
301 2012-10-17 Kenichi Handa <handa@gnu.org>
302
303 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
304 invalidate.
305
306 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
307
308 * buffer.c (Fkill_buffer): When unchaining the marker,
309 reset its buffer pointer to NULL (Bug#12652).
310
311 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
312
313 Do not verify indirection counters of killed buffers (Bug#12579).
314 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
315 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
316
317 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
318
319 * alloc.c (Fmake_byte_code): Fix typo in comment.
320 * print.c (print_interval): Define as static to match prototype.
321 * indent.c (disptab_matches_widthtab, recompute_width_table):
322 Convert to eassert.
323
324 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
325
326 * editfns.c (get_system_name): Remove.
327 * lisp.h (get_system_name): Remove prototype.
328 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
329 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
330
331 2012-10-15 Daniel Colascione <dancol@dancol.org>
332
333 * dbusbind.c: Add comment explaining reason for previous change.
334
335 2012-10-15 Martin Rudalics <rudalics@gmx.at>
336
337 * window.c (Fwindow_end): Rewrite check whether cached position
338 can be used (Bug#12600).
339 (resize_frame_windows, grow_mini_window, shrink_mini_window):
340 Set windows_or_buffers_changed.
341
342 2012-10-15 Daniel Colascione <dancol@dancol.org>
343
344 * dbusbind.c: Fix cygw32 build break when compiling with dbus
345 enabled by undefining the symbol "interface", which the platform
346 headers define to something incompatible.
347
348 2012-10-14 Daniel Colascione <dancol@dancol.org>
349
350 * image.c (init_tiff_functions, init_imagemagick_functions)
351 (init_svg_functions): Fix cygw32 build break by using these
352 functions only when WINDOWSNT _and_ HAVE_NTGUI.
353
354 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
355
356 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
357
358 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
359
360 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
361
362 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
363
364 * coding.c (detect_coding): Set coding->id before calling
365 this->detector.
366
367 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
368
369 * fileio.c: Formatting fixes.
370
371 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
372
373 Fix some stat-related races.
374 * fileio.c (Fwrite_region): Avoid race condition if a file is
375 removed or renamed by some other process immediately after Emacs
376 writes it but before Emacs stats it. Do not assume that stat (or
377 fstat) succeeds.
378 * image.c (slurp_file): Resolve the file name with fopen + fstat
379 rather than stat + fopen.
380 (pbm_read_file) [0]: Remove unused code with stat race.
381 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
382 Remove ineffective code with stat race.
383
384 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
385
386 * doc.c (get_doc_string): Don't signal an error if the file is missing.
387
388 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
389
390 * nsterm.m (hold_event_q): New static variable.
391 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
392 ! q_event_ptr.
393 (hold_event): New function.
394 (ns_read_socket): If hold_event_q have events, store them and
395 return (Bug#12384).
396 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
397 is zero (Bug#12384).
398
399 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
400
401 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
402
403 2012-10-12 Eli Zaretskii <eliz@gnu.org>
404
405 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
406
407 * fileio.c (check_existing): New function.
408 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
409 instead of calling 'stat', when what's needed is to check whether
410 a file exists. This avoids expensive system calls on MS-Windows.
411 (Bug#12587)
412
413 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
414
415 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
416 determine whether a file exists and is not a directory.
417
418 * lisp.h (check_existing): Add prototype.
419
420 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
421
422 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
423
424 2012-10-12 Glenn Morris <rgm@gnu.org>
425
426 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
427
428 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
429
430 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
431
432 * eval.c (Fautoload): Remember previous autoload status in load-history.
433
434 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
435
436 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
437 * lread.c (load_each_byte, new_backquote_flag, readchar)
438 (read_filtered_event, lisp_file_lexically_bound_p)
439 (safe_to_load_version, Fload, complete_filename_p, openp)
440 (build_load_history, readevalloop, read_escape, read1)
441 (string_to_number, read_vector, read_list):
442 * macros.c (Fstart_kbd_macro):
443 * marker.c (CONSIDER):
444 * menu.c (parse_single_submenu, digest_single_submenu)
445 (find_and_return_menu_selection, Fx_popup_menu):
446 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
447 (Ftry_completion):
448 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
449 (ns_menu_show):
450 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
451 (xmenu_show, xdialog_show):
452 Use bool for booleans.
453 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
454 as it's not a predicate. All uses changed. Omit unnecessary
455 buffer termination.
456
457 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
458
459 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
460 (save_excursion_restore): Do not restore mark if it was not saved.
461
462 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
463
464 * marker.c (cached_modiff): EMACS_INT, not int.
465
466 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
467 instead of having a wrong decl.
468 * nsmenu.m (waiting_for_input): Remove wrong decl.
469
470 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
471
472 keyboard.c, keymap.c: Use bool for booleans.
473 * dispnew.c (sit_for): Distinguish between 3-way display_option
474 and boolean do_display.
475 * keyboard.c (single_kboard, this_command_key_count_reset)
476 (waiting_for_input, echoing, immediate_quit, input_pending)
477 (interrupt_input, interrupts_deferred, pop_kboard)
478 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
479 (command_loop_1, adjust_point_for_property)
480 (safe_run_hooks_error, input_polling_used, read_char):
481 (help_char_p, readable_events, kbd_buffer_events_waiting)
482 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
483 (lucid_event_type_list_p, get_input_pending):
484 (gobble_input, menu_separator_name_p, menu_bar_item)
485 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
486 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
487 (keyremap_step, test_undefined, read_key_sequence)
488 (detect_input_pending, detect_input_pending_ignore_squeezables)
489 (detect_input_pending_run_timers, requeued_events_pending_p)
490 (quit_throw_to_read_char, Fset_input_interrupt_mode):
491 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
492 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
493 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
494 (accessible_keymaps_1, Fkey_description, push_key_description):
495 (shadow_lookup, struct where_is_internal_data)
496 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
497 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
498 (describe_map, describe_vector):
499 * menu.c (single_menu_item):
500 * nsmenu.m (ns_update_menubar):
501 * process.c (wait_reading_process_output):
502 * search.c (scan_buffer, scan_newline):
503 Use bool for boolean.
504 * keyboard.c (timers_run, swallow_events)
505 (detect_input_pending_run_timers):
506 * process.c (wait_reading_process_output):
507 Use unsigned for counter where wraparound-on-overflow is desired,
508 since unsigned is guaranteed to have that behavior and signed is not.
509 (read_char): Use ptrdiff_t for string length.
510 (get_input_pending): Remove first argument, since it was always
511 the same pointer-to-int (now pointer-to-boolean) &input_pending,
512 and behave as if it had that value. Return new value of
513 input_pending. All callers changed.
514 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
515 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
516 a string length.
517 * keymap.c (push_key_description): Omit last arg, which was always 1.
518 All callers changed.
519
520 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
521
522 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
523
524 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
525 ($(BLD)/term.$(O)): Update dependencies.
526
527 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
528
529 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
530 * lisp.h (enum pvec_type): Adjust comments and omit explicit
531 initializer for PVEC_NORMAL_VECTOR.
532
533 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
534
535 Clean out old termopts cruft.
536 * termopts.h (flow_control, meta_key): Remove unused decls.
537 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
538 Don't include termopts.h.
539
540 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
541
542 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
543
544 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
545
546 * commands.h (immediate_quit): Remove duplicate decl.
547
548 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
549
550 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
551 caching.
552 (nsfont_open): Remove setting of Vfonts_in_cache.
553 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
554
555 2012-10-09 Eli Zaretskii <eliz@gnu.org>
556
557 * w32fns.c (w32_last_error): Change the return value to DWORD, to
558 match what GetLastError returns. Explain why the function is
559 needed.
560
561 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
562 'is_tooltip_frame', to avoid confusion with its global namesake.
563
564 2012-10-08 Daniel Colascione <dancol@dancol.org>
565
566 * xdisp.c (start_hourglass): Call w32_note_current_window when
567 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
568 build that caused Emacs to display the hourglass cursor forever.
569
570 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
571 which is broken under remote desktop, calculate the number of
572 colors available for a display based on the display's number of
573 planes and number of bits per pixel per plane. (bug#10397).
574
575 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
576
577 * nsfont.m (Vfonts_in_cache): New variable.
578 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
579 are used. Add cached fonts to Vfonts_in_cache.
580 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
581
582 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
583
584 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
585 in nt/config.nt.
586 (FONT_H): Define after FRAME_H.
587 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
588 Update dependencies.
589
590 * w32term.c: Remove leftover declaration of keyboard_codepage.
591
592 2012-10-08 Eli Zaretskii <eliz@gnu.org>
593
594 * makefile.w32-in (FONT_H): Add $(FRAME_H).
595 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
596 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
597 (GLOBAL_SOURCES): Add cygw32.c.
598 ($(BLD)/unexw32.$(O)):
599 ($(BLD)/w32.$(O)):
600 ($(BLD)/w32console.$(O)):
601 ($(BLD)/w32fns.$(O)):
602 ($(BLD)/w32heap.$(O)):
603 ($(BLD)/w32menu.$(O)):
604 ($(BLD)/w32proc.$(O)): Add w32common.h.
605
606 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
607 'const char *'.
608 (x_to_w32_color): Don't modify the argument, modify a copy instead.
609
610 2012-10-08 Daniel Colascione <dancol@dancol.org>
611
612 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
613 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
614 accidental message numbering hole. Change other messages to
615 match.
616
617 * w32select.h (HAVE_W32SELECT): Remove.
618
619 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
620 w32common.h instead of w32heap.h.
621
622 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
623 (get_allocation_unit, get_processor_type, get_w32_major_version)
624 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
625 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
626 (OS_NT, os_subtype, cache_system_info): Move declarations to
627 w32common.
628
629 * w32heap.c: Include w32common.h.
630 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
631 (w32_minor_version, w32_build_number, w32_subtype):
632 Remove duplicate definitions.
633
634 * w32fns.c: Include w32common.h; include w32heap.h only in
635 WINDOWSNT.
636
637 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
638 Use `report_file_error' instead of `error' in order to better
639 inform users of what went wrong. Increase NTGUI_UNICODE file
640 dialog box file name length to 32k, the maximum allowed by the NT
641 kernel.
642
643 * w32common.h: New file.
644 (ROUND_UP, ROUND_DOWN, get_page_size)
645 (get_allocation_unit, get_processor_type, get_w32_major_version)
646 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
647 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
648 (OS_NT, os_subtype, cache_system_info): Move here.
649
650 * unexw32.c, unexcw.c: Include w32common.h.
651
652 * emacs.c (main): Use (defined (WINDOWSNT) || defined
653 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
654 to call syms_of_w32select.
655
656 * cygw32.h: Remove obsolete EXFUN declarations.
657
658 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
659
660 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
661 of w32inevt.o from SOME_MACHINE_OBJECTS.
662
663 2012-10-08 Daniel Colascione <dancol@dancol.org>
664
665 * image.c: Permanent fix for JPEG compilation issue --- limit
666 jpeglib `boolean' redefinition to Cygwin builds.
667
668 2012-10-08 Eli Zaretskii <eliz@gnu.org>
669
670 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
671
672 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
673 Cygwin.
674
675 2012-10-08 Daniel Colascione <dancol@dancol.org>
676
677 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
678 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
679 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
680 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
681 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
682 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
683 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
684 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
685 now a supported configuration.
686
687 * Makefile.in: consolidate image variables into LIBIMAGE; add
688 W32_OBJ and W32_LIBS. Compile new files.
689
690 * conf_post.h:
691 (_DebPrint) declare tracing facility for W32 debugging. We need
692 to unify tracing later.
693
694 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
695 unconditional use of W32 Unicode functions. Cygwin runs only on
696 100% Unicode operating systems.
697
698 * cygw32.c: New file. Define Cygwin-specific facilities.
699 (Fcygwin_convert_path_to_windows)
700 (Fcygwin_convert_path_from_windows): New user functions for
701 accessing Cygwin path-munging routines.
702
703 * cygw32.h: New file.
704 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
705 UTF-16LE strings temporarily inside non-Lisp-visible string
706 objects.
707
708 (w32_strerror): Just what it says on the tin.
709
710 * emacs.c: Make the NS fork-then-exec code for daemon-launching
711 also run for Cygwin; both systems have the same problem with using
712 GUI facilities in a forked child. Also call syms_of_cygw32,
713 syms_of_w32select in correct places.
714
715 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
716 needs fork-then-exec for daemon launching.
717
718 * font.h: Include frame.h.
719
720 * image.c: Use the image library cache machinery only when we're
721 compiling for native WINDOWSNT; Cygwin can use shared libraries
722 like any other Unixlike system.
723
724 * keyboard.c: Clarify a comment regarding the input loop.
725
726 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
727 functions directly instead of trying to detect at runtime that our
728 host operating system supports them. We make this change for two
729 reasons: Cygwin lacks support for the multibyte character
730 conversion functions used by the legacy menu code, and Cygwin
731 never needs to rely on non-Unicode APIs.
732
733 * unexw32.c (hinst): Declare extern.
734
735 * w32.c: Change header order;
736 (w32_strerror): Move to w32fns.c because we need it for
737 non-WINDOWSNT builds.
738
739 * w32.h: Add #error macro to make sure we don't include w32.h for
740 Cygwin builds. Remove w32select declarations.
741
742 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
743 w32fns.c. w32console.c is WINDOWSNT-only.
744
745 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
746 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
747 POSIXy alternative.
748 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
749 (w32_major_version, w32_minor_version, w32_build_number)
750 (os_subtype, sound_type): Define here
751 (w32_defined_color): Make color parameter const for consistency
752 with other _defined_color functions.
753 (w32_createwindow): Unconditionally call w32_init_class instead of
754 doing so only when hprevinst is non-NULL. Plumbing hprevinst
755 through the code is complex and unnecessary because class
756 registration is practically free.
757 (w32_name_of_message): New EMACSDEBUG-only function.
758 (Fset_message_beep): Move here
759 (Fx_open_connection): Require that the display name for Windows be
760 "w32" for consistency, emacsclient disambiguation, and maybe, one
761 day, multi-window-system support.
762 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
763 Cygwin files for W32 GUI facilities, since these clearly don't
764 expect Cygwin names.
765 (_DebPrint): Define.
766 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
767 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
768 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
769 (w32_last_error): Remove.
770
771 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
772
773 * w32heap.c (syspage_mask): Declare here.
774 (cache_system_info): Remove.
775
776 * w32inevt.c (faked_key): Define globally, not statically.
777 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
778 (w32_console_toggle_lock_key): Move to w32fns.c.
779
780 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
781
782 * w32proc.c (_DebPrint): Move to w32fns.c.
783 * w32select.c: Include string.h, stdio.h for Cygwin.
784 * w32select.h: New File.
785
786 * w32term.c: Include io.h for non-CYGWIN builds; needed for
787 get_osfhandle.
788 (w32_message_fd): New variable. Under Cygwin, holds the file
789 descriptor the system used to tell us about pending thread
790 messages.
791
792 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
793 that prevented compilation under non-WINDOWSNT systems.
794
795 (w32_initialize): Open /dev/windows and assign it to
796 w32_message_fd. Provide w32 feature.
797
798 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
799 (WM_EMACS_INPUT_READY): add.
800 (prepend_msg, w32_message_fd): Declare globally.
801
802 * w32xfns.c:
803 (keyboard_handle): Use only when WINDOWSNT.
804 (notify_msg_ready): New function. Posts a message to the main
805 thread's message queue under CYGWIN, which wakes up the main
806 thread from select(2) by making the /dev/windows file descriptor
807 ready. Under WINDOWSNT, it sets an event the same way the old
808 code did.
809
810 (post, prepend_msg): Actually call notify_msg_ready instead of
811 setting the input event directly.
812
813 2012-10-07 Eli Zaretskii <eliz@gnu.org>
814
815 * ralloc.c (relinquish): If a heap is ready to be relinquished,
816 but it still has blocs in it, don't return it to the system,
817 instead of aborting. (Bug#12402)
818
819 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
820
821 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
822
823 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
824 MAC_OS_X_VERSION_10_6.
825 (syms_of_nsterm): Remove comment about Panther and above for
826 ns-antialias-text.
827 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
828 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
829 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
830
831 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
832 MAC_OS_X_VERSION_10_4.
833
834 * nsmenu.m (fillWithWidgetValue:): Remove code for <
835 MAC_OS_X_VERSION_10_2.
836
837 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
838
839 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
840 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
841
842 * nsterm.m (ns_in_resize): Remove (Bug#12479).
843 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
844 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
845 Remove ns_in_resize check.
846 (ns_clear_frame_area): Remove resize handle code.
847
848 * nsfns.m (ns_in_resize): Remove.
849 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
850 Remove ns_in_resize check.
851
852 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
853
854 Improve sys_siglist detection.
855 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
856 defined as a macro, as is done in Solaris.
857 (sys_siglist_entries): New macro.
858 (save_strsignal): Use it.
859 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
860 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
861
862 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
863
864 * nsfns.m (Fx_create_frame): Call x_default_parameter with
865 fullscreen/Fullscreen.
866
867 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
868 tobar_height is new.
869
870 * nsterm.m (x_make_frame_visible): Check for fullscreen.
871 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
872 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
873 (windowDidResize:): Check for correct window if old style fullscreen.
874 Capitalize word in comment. Remove incorrect comment.
875 (initFrameFromEmacs:): tbar_height renamed tibar_height.
876 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
877 error in drawing background.
878 (toggleFullScreen:): Remove comment. Rearrange calls.
879 Set toolbar values to zero, save old height in tobar_height.
880 Restore tool bar height when leaving fullscreen.
881 (canBecomeMainWindow): New function.
882
883 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
884
885 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
886
887 2012-10-05 Eli Zaretskii <eliz@gnu.org>
888
889 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
890
891 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
892 that time stamps of directories could also be changed.
893 Don't request the too broad GENERIC_WRITE, only the more restrictive
894 FILE_WRITE_ATTRIBUTES access rights.
895
896 * fileio.c (Fset_file_times): Special-case ignoring errors for
897 directories only on MSDOS, not on MS-Windows.
898
899 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
900
901 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
902
903 2012-10-04 Eli Zaretskii <eliz@gnu.org>
904
905 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
906 see whether CreateFile failed.
907
908 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
909
910 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
911 to avoid similar races.
912 * keyboard.c (pending_signals): Now bool, not int.
913
914 Port timers to OpenBSD, plus check for timer failures.
915 OpenBSD problem reported by Han Boetes.
916 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
917 and/or setitimer.
918 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
919 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
920 like OpenBSD, which has timer_settime but does not declare it.
921 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
922 whether to use itimerspec-related primitives. All uses of
923 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
924
925 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
926
927 * profiler.c (handle_profiler_signal): Fix a malloc race
928 that caused Emacs to hang on Fedora 17 when profiling Lisp.
929
930 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
931
932 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
933
934 2012-10-02 Eli Zaretskii <eliz@gnu.org>
935
936 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
937 consistent with the change in return value of 'safe_strsignal'.
938
939 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
940
941 Prefer plain 'static' to 'static inline' (Bug#12541).
942 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
943 (bidi_set_sor_type, bidi_push_embedding_level)
944 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
945 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
946 (bidi_cache_search, bidi_cache_ensure_space)
947 (bidi_cache_iterator_state, bidi_cache_find)
948 (bidi_peek_at_next_level, bidi_set_paragraph_end)
949 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
950 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
951 Now 'static', not 'static inline'.
952
953 Count overruns when profiling; change units to ns.
954 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
955 Give extra weight to samples after overruns, to attempt to count
956 the time more accurately.
957 (setup_cpu_timer): Change sampling interval units from ms to ns, since
958 the underlying primitives nominally do ns.
959 (Fprofiler_cpu_start): Document the change. Mention that
960 the sampling intervals are only approximate.
961
962 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
963
964 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
965
966 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
967 case for the special 0 coding-system.
968
969 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
970 (Fmake_overlay): Remove redundant tests.
971 (fix_start_end_in_overlays): Remove redundant recentering.
972
973 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
974
975 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
976 Update dependencies.
977
978 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
979
980 Fix a malloc race condition involving strsignal.
981 A signal can arrive in the middle of a malloc, and Emacs's signal
982 handler can invoke strsignal, which can invoke malloc, which is
983 not portable. This race condition bug makes Emacs hang on GNU/Linux.
984 Fix it by altering the signal handler so that it does not invoke
985 strsignal.
986 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
987 * process.c (status_message): Use const pointer, in case strsignal
988 is #defined to safe_strsignal.
989 * sysdep.c (sys_siglist, init_signals): Always define and
990 initialize a substitute sys_siglist if the system does not define
991 one, even if HAVE_STRSIGNAL.
992 (safe_strsignal): Rename from strsignal. Always define,
993 using sys_siglist. Return a const pointer.
994 * syssignal.h (safe_strsignal): New decl.
995 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
996
997 2012-10-01 Eli Zaretskii <eliz@gnu.org>
998
999 * w32proc.c (timer_loop): Fix code that waits for timer
1000 expiration, to avoid high CPU usage.
1001
1002 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1003
1004 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1005 (sweep_weak_table): Remove redundant prototypes.
1006
1007 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1008
1009 * emacs.c: Move the inclusion of TERM_HEADER after including
1010 windows.h on WINDOWSNT. This avoids compilation problems with
1011 MSVC.
1012
1013 2012-10-01 Eli Zaretskii <eliz@gnu.org>
1014
1015 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1016 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1017 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1018 as the previous version used 'void *'.
1019
1020 * ralloc.c (ROUNDUP): Fix last change.
1021 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1022 'size_t'.
1023
1024 * w32proc.c <disable_itimers>: New static flag.
1025 (init_timers): Initialize it to zero, after creating the critical
1026 sections used by the timer threads.
1027 (term_timers): Set to 1 before deleting the critical sections.
1028 (getitimer, setitimer): If disable_itimers is non-zero, return an
1029 error indication without doing anything. Reported by Fabrice
1030 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
1031 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1032 return results.
1033 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1034 support timers.
1035
1036 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1037 term_ntproc after all the other bookkeeping, to get timers working
1038 as long as possible.
1039
1040 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1041
1042 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1043 Suggested by Juri Linkov in
1044 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1045
1046 Prefer plain 'static' to 'static inline' (Bug#12541).
1047 With static functions, modern compilers inline pretty well by
1048 themselves; advice from programmers often hurts as much as it helps.
1049 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1050 this change shrinks the text size of the Emacs executable by 1.1%
1051 without affecting CPU significantly in my benchmark.
1052 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1053 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1054 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1055 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1056 (bset_auto_fill_function, bset_auto_save_file_format)
1057 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1058 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1059 (bset_cache_long_line_scans, bset_case_fold_search)
1060 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1061 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1062 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1063 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1064 (bset_header_line_format, bset_indicate_buffer_boundaries)
1065 (bset_indicate_empty_lines, bset_invisibility_spec)
1066 (bset_left_fringe_width, bset_major_mode, bset_mark)
1067 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1068 (bset_name, bset_overwrite_mode, bset_pt_marker)
1069 (bset_right_fringe_width, bset_save_length)
1070 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1071 (bset_scroll_up_aggressively, bset_selective_display)
1072 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1073 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1074 (set_buffer_overlays_after):
1075 * category.c (bset_category_table):
1076 * charset.c (read_hex):
1077 * coding.c (produce_composition, produce_charset)
1078 (handle_composition_annotation, handle_charset_annotation)
1079 (char_encodable_p):
1080 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1081 (assign_row, set_frame_matrix_frame, make_current)
1082 (add_row_entry):
1083 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1084 * fns.c (maybe_resize_hash_table):
1085 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1086 * gmalloc.c (register_heapinfo):
1087 * image.c (lookup_image_type):
1088 * intervals.c (set_interval_object, set_interval_left)
1089 (set_interval_right, copy_interval_parent, rotate_right)
1090 (rotate_left, balance_possible_root_interval):
1091 * keyboard.c (kset_echo_string, kset_kbd_queue)
1092 (kset_keyboard_translate_table, kset_last_prefix_arg)
1093 (kset_last_repeatable_command, kset_local_function_key_map)
1094 (kset_overriding_terminal_local_map, kset_real_last_command)
1095 (kset_system_key_syms, clear_event, set_prop):
1096 * lread.c (digit_to_number):
1097 * marker.c (attach_marker, live_buffer, set_marker_internal):
1098 * nsterm.m (ns_compute_glyph_string_overhangs):
1099 * process.c (pset_buffer, pset_command)
1100 (pset_decode_coding_system, pset_decoding_buf)
1101 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1102 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1103 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1104 * syntax.c (bset_syntax_table, dec_bytepos):
1105 * terminal.c (tset_param_alist):
1106 * textprop.c (interval_has_some_properties)
1107 (interval_has_some_properties_list):
1108 * window.c (wset_combination_limit, wset_dedicated)
1109 (wset_display_table, wset_hchild, wset_left_fringe_width)
1110 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1111 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1112 (wset_right_fringe_width, wset_right_margin_cols)
1113 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1114 (wset_vertical_scroll_bar_type, wset_window_parameters):
1115 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1116 (wset_column_number_displayed, wset_region_showing)
1117 (window_box_edges, run_window_scroll_functions)
1118 (append_glyph_string_lists, prepend_glyph_string_lists)
1119 (append_glyph_string, set_glyph_string_background_width)
1120 (append_glyph, append_composite_glyph)
1121 (take_vertical_position_into_account):
1122 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1123 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1124 (lface_hash, lface_same_font_attributes_p, lookup_face):
1125 * xml.c (libxml2_loaded_p):
1126 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1127 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1128 Now 'static', not 'static inline'.
1129
1130 * bidi.c: Tune.
1131 (bidi_copy_it): Do the whole copy with a single memcpy.
1132 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1133
1134 Revert the FOLLOW-SYMLINKS change for file-attributes.
1135 Doing it right would require several changes to Tramp, and there's
1136 not enough time to get that tested before the freeze today.
1137 * dired.c (directory_files_internal, Ffile_attributes):
1138 Undo last change.
1139
1140 * frame.c (x_report_frame_params): Port better to wider ints.
1141 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1142 or that pointers can be printed in 15 decimal digits.
1143 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1144
1145 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1146
1147 Support x64 build on MS-Windows.
1148 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1149 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1150 compatibility with x64.
1151 (x_get_focus_frame): Add prototype.
1152
1153 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1154 defining an XRectangle structure.
1155
1156 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1157 arithmetics for compatibility with x64.
1158
1159 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1160 compatibility with x64.
1161
1162 * w32heap.h: Adjust prototypes and declarations.
1163
1164 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1165 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1166 DWORD, long, and unsigned long, for compatibility with x64.
1167 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1168 (sbrk): Argument is now of type ptrdiff_t.
1169
1170 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1171 less than 0x0500.
1172 (w32_msg_pump): Use WPARAM type for 'result'.
1173
1174 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1175 architecture.
1176 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1177 compatibility with x64.
1178
1179 * vm-limit.c (lim_data): Now size_t.
1180 (check_memory_limits): Adjust prototypes of real_morecore and
1181 __morecore to receive argument of type ptrdiff_t. Use size_t for
1182 five_percent and data_size.
1183
1184 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1185 variables, for compatibility with x64.
1186 (rva_to_section, offset_to_section, relocate_offset)
1187 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1188 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1189 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1190 for compatibility with x64.
1191
1192 * sysdep.c (STDERR_FILENO): Define if not already defined.
1193
1194 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1195 (__morecore): Argument type is now ptrdiff_t.
1196 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1197 (relinquish): Use ptrdiff_t type for 'excess'.
1198 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1199
1200 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1201 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1202 instead of a literal number.
1203
1204 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1205 (min): Define only if not already defined.
1206
1207 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1208 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1209 hosts.
1210
1211 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1212 'bitmaps' is a pointer.
1213
1214 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1215
1216 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1217
1218 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1219
1220 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1221 * dired.c (directory_files_internal, Ffile_attributes):
1222 New arg follow_symlinks. All uses changed.
1223
1224 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1225
1226 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1227
1228 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1229
1230 Support atimers and CPU profiler via profile.c on MS-Windows.
1231 * w32proc.c (sig_mask, crit_sig): New static variables.
1232 (sys_signal): Support SIGALRM and SIGPROF.
1233 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1234 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1235 sigfillset, and sigprocmask are no longer no-ops.
1236 (sigismember): New function.
1237 (struct itimer_data): New definition.
1238 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1239 (crit_prof): New static variables.
1240 (MAX_SINGLE_SLEEP): New definition.
1241 (timer_loop, stop_timer_thread, term_timers, init_timers)
1242 (start_timer_thread, getitimer, setitimer): New functions.
1243 (alarm): No longer a no-op, calls setitimer.
1244
1245 * w32.c (term_ntproc): Call term_timers.
1246 (init_ntproc): Make sure all signals are unblocked at startup, to
1247 erase any traces of dumping. Call init_timers.
1248
1249 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1250 Windows-specific code to display the hourglass mouse pointer is no
1251 longer used.
1252 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1253 to hourglass timer expiration.
1254 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1255 Remove, no longer used.
1256 (w32_note_current_window, show_hourglass, hide_hourglass):
1257 New functions, in support of hourglass cursor display similar to other
1258 window systems.
1259 (syms_of_w32fns): Don't initialize hourglass_timer.
1260
1261 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1262 WINDOWSNT as well.
1263 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1264
1265 * w32.h (init_timers, term_timers): Add prototypes.
1266
1267 2012-09-30 Kenichi Handa <handa@gnu.org>
1268
1269 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1270 to the buffer relocation which may be caused by ccl_driver.
1271
1272 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1273
1274 * xfns.c (Fx_file_dialog): Update comment.
1275
1276 * w32fns.c (Fx_file_dialog): Update comment.
1277
1278 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1279 Initialize panel name field if OSX >= 10.6.
1280
1281 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1282
1283 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1284
1285 * nsterm.m (NEW_STYLE_FS): New define.
1286 (ns_fullscreen_hook, windowWillEnterFullScreen)
1287 (windowDidEnterFullScreen, windowWillExitFullScreen)
1288 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1289 (setFSValue): New functions.
1290 (EmacsFSWindow): New implementation.
1291 (canBecomeKeyWindow): New function for EmacsFSWindow.
1292 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1293 (dealloc): Release nonfs_window if in fullscreen.
1294 (updateFrameSize:): Call windowDidMove to update top/left.
1295 (windowWillResize:toSize:): Check if frame is still maximized.
1296 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1297 next_maximized, maximized_width, maximized_height and nonfs_window.
1298 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1299 tbar_height.
1300 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1301 fullscreen. Set maximized_width/height. Act on next_maximized.
1302
1303 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1304 (EmacsView): Add variables for fullscreen.
1305 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1306 (EmacsFSWindow): New interface for fullscreen.
1307
1308 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1309
1310 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1311
1312 2012-09-30 Chong Yidong <cyd@gnu.org>
1313
1314 * fns.c (Frandom): Doc fix.
1315
1316 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1317
1318 * window.c (Vwindow_combination_limit): New default value.
1319 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1320
1321 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1322
1323 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1324 Suggested by Eli Zaretskii in
1325 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1326
1327 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1328
1329 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1330 HAVE_TIMER_SETTIME is defined.
1331
1332 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 Profiler improvements: more-accurate timers, overflow checks.
1335 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1336 signal.h, setjmp.h. Include systime.h instead.
1337 (saturated_add): New function.
1338 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1339 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1340 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1341 New static vars.
1342 (enum profiler_cpu_running): New enum.
1343 (profiler_cpu_running): Now of that enum type, not bool.
1344 All uses changed to store the new value.
1345 (handle_profiler_signal): Rename from sigprof_handler_1,
1346 for consistency with other handlers. Do not check whether
1347 cpu_log is a hash-table if garbage collecting, since it
1348 doesn't matter in that case.
1349 (deliver_profiler_signal): Rename from sigprof_handler,
1350 for consistency with other handlers.
1351 (setup_cpu_timer): New function, with much of what used to be in
1352 Fprofiler_cpu_start. Check for out-of-range argument.
1353 Prefer timer_settime if available, and prefer
1354 thread cputime clocks, then process cputime clocks, then
1355 monotonic clocks, to the old realtime clock. Use make_timeval
1356 to round more-correctly when falling back to setitimer.
1357 (Fprofiler_cpu_start): Use it.
1358 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1359 Don't assume that passing NULL as the 2nd argument of setitimer
1360 is the same as passing a pointer to all-zero storage.
1361 Ignore SIGPROF afterwards.
1362 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1363 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1364 non-fatal signal handlers. Ignore SIGPROF on startup.
1365 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1366 in profiler.c, since sysdep.c now uses it.
1367
1368 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1369 Suggested by Eli Zaretskii in
1370 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1371
1372 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1373
1374 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1375
1376 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1377
1378 * lisp.h (struct backtrace): Remove indirection for `function' field.
1379 * xdisp.c (redisplay_internal):
1380 * profiler.c (record_backtrace, sigprof_handler_1):
1381 * alloc.c (Fgarbage_collect):
1382 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1383 (Fbacktrace_frame): Adjust accordingly.
1384
1385 2012-09-28 Glenn Morris <rgm@gnu.org>
1386
1387 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1388 (Frun_hook_with_args_until_failure): Doc fixes.
1389
1390 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1391
1392 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1393 Qautomatic_redisplay and change the symbol name. All users changed.
1394
1395 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1396
1397 * profiler.c (sigprof_handler): Fix race condition.
1398
1399 2012-09-28 Glenn Morris <rgm@gnu.org>
1400
1401 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1402
1403 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1404
1405 Check more robustly for timer_settime.
1406 * Makefile.in (LIB_TIMER_TIME): New macro.
1407 (LIBES): Add it.
1408 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1409 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1410 call timer_settime.
1411
1412 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1413
1414 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1415
1416 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1417
1418 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1419
1420 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1421
1422 * character.h (MAYBE_UNIFY_CHAR): Remove.
1423 * charset.c, charset.h (maybe_unify_char): Now static.
1424 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1425 Since this stuff is now private to charset.c, there's no need for
1426 a public macro and no need to inline by hand.
1427
1428 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1429 Stefan Monnier <monnier@iro.umontreal.ca>
1430 Juanma Barranquero <lekktu@gmail.com>
1431
1432 * profiler.c: New file.
1433 * Makefile.in (base_obj): Add profiler.o.
1434 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1435 ($(BLD)/profiler.$(O)): New target.
1436 * emacs.c (main): Call syms_of_profiler.
1437 * alloc.c (Qautomatic_gc): New constant.
1438 (MALLOC_PROBE): New macro.
1439 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1440 (total_bytes_of_live_objects): New function.
1441 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1442 Call malloc_probe for the memory profiler.
1443 (syms_of_alloc): Define Qautomatic_gc.
1444 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1445 race condition.
1446 (struct backtrace): Move definition...
1447 * lisp.h (struct backtrace): ..here.
1448 (Qautomatic_gc, profiler_memory_running): Declare vars.
1449 (malloc_probe, syms_of_profiler): Declare functions.
1450 * xdisp.c (Qautomatic_redisplay): New constant.
1451 (redisplay_internal): Record itself in backtrace_list.
1452 (syms_of_xdisp): Define Qautomatic_redisplay.
1453
1454 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1455 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1456
1457 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1458
1459 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1460
1461 Prefer POSIX timers if available.
1462 They avoid a race if the timer is too close to the current time.
1463 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1464 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1465 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1466
1467 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1468
1469 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1470 CHAR_STRING_ADVANCE.
1471 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1472 STRING_CHAR_ADVANCE.
1473
1474 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1475
1476 Move Vlibrary_cache to emacs.c and reset before dumping.
1477
1478 * lisp.h (reset_image_types): Declare.
1479 [WINDOWSNT] (Vlibrary_cache): Declare.
1480
1481 * image.c (reset_image_types): New function.
1482
1483 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1484 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1485 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1486
1487 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1488 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1489
1490 * w32.h (Vlibrary_cache): Do not declare.
1491
1492 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1493
1494 * w32proc.c (sys_signal): Handle all signals defined by the
1495 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1496 handlers for signals supported by Windows. Don't override
1497 term_ntproc as the handler for SIGABRT.
1498 (sigaction): Rewrite to call sys_signal instead of duplicating its
1499 code.
1500 (sys_kill): Improve commentary.
1501
1502 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1503 consistency with a signature of a signal handler. All callers
1504 changed.
1505 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1506 install term_ntproc as a signal handler for SIGABRT, as that
1507 should be done by the dumped Emacs.
1508
1509 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1510
1511 * w32select.c (term_w32select): Protect against repeated
1512 invocation by setting clipboard_owner to NULL after calling
1513 DestroyWindow.
1514
1515 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1516 and term_ntproc to their modified signatures.
1517
1518 * character.c (char_string, string_char): Remove calls to
1519 MAYBE_UNIFY_CHAR. See the discussion starting at
1520 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1521 for the details.
1522
1523 2012-09-25 Chong Yidong <cyd@gnu.org>
1524
1525 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1526
1527 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1528
1529 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1530 when encountering an unknown bytecode.
1531
1532 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1533
1534 image.c, indent.c: Use bool for booleans.
1535 * dispextern.h (struct image_type): Members valid_p, load, init
1536 now return bool, not int. All uses changed.
1537 * image.c: Omit unnecessary static decls.
1538 (x_create_bitmap_mask, x_build_heuristic_mask):
1539 Return void, not int, since callers don't care about the return value.
1540 (x_create_bitmap_mask, define_image_type, valid_image_p)
1541 (struct image_keyword, parse_image_spec, image_spec_value)
1542 (check_image_size, image_background)
1543 (image_background_transparent, x_clear_image_1)
1544 (postprocess_image, lookup_image, x_check_image_size)
1545 (x_create_x_image_and_pixmap, xbm_image_p)
1546 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1547 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1548 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1549 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1550 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1551 (png_image_p, init_png_functions, png_load_body, png_load)
1552 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1553 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1554 (init_gif_functions, gif_load, imagemagick_image_p)
1555 (imagemagick_load_image, imagemagick_load, svg_image_p)
1556 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1557 (gs_load):
1558 * nsimage.m (ns_load_image):
1559 * nsterm.m (ns_defined_color):
1560 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1561 * xfns.c (x_defined_color):
1562 * xterm.c (x_alloc_lighter_color_for_widget)
1563 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1564 (x_alloc_lighter_color):
1565 * indent.c (disptab_matches_widthtab, current_column)
1566 (scan_for_column, string_display_width, indented_beyond_p)
1567 (compute_motion, vmotion, Fvertical_motion):
1568 Use bool for booleans.
1569
1570 2012-09-24 Chong Yidong <cyd@gnu.org>
1571
1572 * chartab.c (Fset_char_table_default): Obsolete function removed.
1573
1574 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1575
1576 Move pid_t related decls out of lisp.h.
1577 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1578 (interruptible_wait_for_termination):
1579 Move these decls from lisp.h to syswait.h, since they use pid_t.
1580 Needed on FreeBSD; see Herbert J. Skuhra in
1581 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1582 * callproc.c: Include syswait.h.
1583
1584 gnutls.c, gtkutil.c: Use bool for boolean.
1585 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1586 (emacs_gnutls_handle_error):
1587 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1588 (xg_hide_tooltip, xg_create_frame_widgets)
1589 (create_dialog, xg_uses_old_file_dialog)
1590 (xg_get_file_with_chooser, xg_get_file_with_selection)
1591 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1592 (xg_item_label_same_p, xg_update_menubar)
1593 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1594 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1595 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1596 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1597 (update_frame_tool_bar, free_frame_tool_bar):
1598 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1599 * nsmenu.m (ns_update_menubar):
1600 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1601 * xfns.c (Fx_show_tip) [USE_GTK]:
1602 Use bool for boolean.
1603 * gtkutil.c (xg_update_frame_menubar):
1604 * xmenu.c (update_frame_menubar):
1605 Return void, not int, since caller ignores return value.
1606 * gtkutil.c (xg_change_toolbar_position):
1607 Return void, not 1.
1608
1609 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1610
1611 * makefile.w32-in (BLOCKINPUT_H): Remove.
1612 (SYSSIGNAL_H): New macro.
1613 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1614 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1615 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1616 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1617 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1618 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1619 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1620 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1621 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1622 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1623 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1624 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1625 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1626 ($(BLD)/w32xfns.$(O)): Update dependencies.
1627
1628 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1629
1630 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1631 fatal_error_backtrace.
1632
1633 * w32proc.c (sys_kill): Undo last change: don't do anything when
1634 invoked to deliver SIGABRT to our own process. This is now
1635 handled by emacs_raise.
1636
1637 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1638
1639 * w32term.c (w32_read_socket): Remove leftover reference to
1640 interrupt_input_pending.
1641
1642 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1643
1644 Do not use SA_NODEFER.
1645 Problem reported by Dani Moncayo in
1646 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1647 * alloc.c (die):
1648 * sysdep.c (emacs_abort): Do not reset signal handler.
1649 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1650 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1651 wanted even on POSIXish hosts, and it doesn't work on Windows.
1652
1653 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1654
1655 * xterm.c (x_term_init): Call fixup_locale before and after calling
1656 gtk_init (Bug#12392).
1657
1658 2012-09-23 Chong Yidong <cyd@gnu.org>
1659
1660 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1661 Vdynamic_library_alist.
1662
1663 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1664 (Fgnutls_available_p): Caller changed.
1665
1666 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1667 (Flibxml_parse_xml_region): Likewise.
1668
1669 * dispextern.h (struct image_type): Remove arg from init function.
1670
1671 * image.c (Finit_image_library, lookup_image_type)
1672 (define_image_type): Remove now-unneeded second arg.
1673 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1674 (init_tiff_functions, init_gif_functions, init_svg_functions):
1675 Arglist and w32_delayed_load calling convention changed.
1676 (gs_type): Remove init_gs_functions; there is no such function.
1677 (valid_image_p, make_image): Fix caller to lookup_image_type.
1678
1679 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1680
1681 Simplify and avoid signal-handling races (Bug#12471).
1682 * alloc.c (die):
1683 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1684 Avoid recursive loop if there's a fatal error in the function itself.
1685 * atimer.c (pending_atimers):
1686 * blockinput.h: Don't include "atimer.h"; no longer needed.
1687 (interrupt_input_pending): Remove. All uses removed.
1688 pending_signals now counts both atimers and ordinary interrupts.
1689 This is less racy than having three separate pending-signal flags.
1690 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1691 (input_blocked_p):
1692 Rename from their upper-case counterparts BLOCK_INPUT,
1693 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1694 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1695 This makes it easier to access volatile variables more accurately.
1696 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1697 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1698 that's more reliable if the code is buggy and sets
1699 interrupt_input_blocked to a negative value. All uses changed.
1700 * atimer.c (deliver_alarm_signal):
1701 Remove. No need to deliver this to the parent; any thread can
1702 handle this signal now. All uses replaced by underlying handler.
1703 * atimer.c (turn_on_atimers):
1704 * dispnew.c (handle_window_change_signal):
1705 * emacs.c (handle_danger_signal):
1706 * keyboard.c (kbd_buffer_get_event):
1707 Don't reestablish signal handler; not needed with sigaction.
1708 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1709 (UNBLOCK_INPUT_TO):
1710 Rework to avoid unnecessary accesses to volatile variables.
1711 (UNBLOCK_INPUT_TO): Now a function.
1712 (totally_unblock_input, unblock_input): New decls.
1713 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1714 (init_data): Remove. Necessary stuff now done in init_signal.
1715 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1716 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1717 (fatal_error_code): Remove; no longer needed.
1718 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1719 it doesn't always backtrace. All uses changed. No need to reset
1720 signal to default, since sigaction and/or die does that for us now.
1721 Use emacs_raise (FOO), not kill (getpid (), FOO).
1722 (main): Check more-accurately whether we're dumping.
1723 Move fatal-error setup to sysdep.c
1724 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1725 * gtkutil.c (xg_get_file_name, xg_get_font):
1726 Remove no-longer-needed signal-mask manipulation.
1727 * keyboard.c, process.c (POLL_FOR_INPUT):
1728 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1729 * keyboard.c (read_avail_input): Remove.
1730 All uses replaced by gobble_input.
1731 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1732 (kbd_buffer_store_event_hold, gobble_input):
1733 (record_asynch_buffer_change) [USABLE_SIGIO]:
1734 (store_user_signal_events):
1735 No need to mess with signal mask.
1736 (gobble_input): If blocking input and there are terminals, simply
1737 set pending_signals to 1 and return. All hooks changed to not
1738 worry about whether input is blocked.
1739 (process_pending_signals): Clear pending_signals before processing
1740 them, in case a signal comes in while we're processing.
1741 By convention callers now test pending_signals before calling us.
1742 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1743 New functions, to support changes to blockinput.h.
1744 (handle_input_available_signal): Now extern.
1745 (reinvoke_input_signal): Remove. All uses replaced by
1746 handle_async_input.
1747 (quit_count): Now volatile, since a signal handler uses it.
1748 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1749 All callers changed. Block SIGINT only if not already blocked.
1750 Clear sigmask reliably, even if Fsignal returns, which it can.
1751 Omit unnecessary accesses to volatile var.
1752 (quit_throw_to_read_char): No need to restore sigmask.
1753 * keyboard.c (gobble_input, handle_user_signal):
1754 * process.c (wait_reading_process_output):
1755 Call signal-handling code rather than killing ourselves.
1756 * lisp.h: Include <float.h>, for...
1757 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1758 (pending_signals): Now volatile.
1759 (syms_of_data): Now const if IEEE floating point.
1760 (handle_input_available_signal) [USABLE_SIGIO]:
1761 (terminate_due_to_signal, record_child_status_change): New decls.
1762 * process.c (create_process): Avoid disaster if memory is exhausted
1763 while we're processing a vfork, by tightening the critical section
1764 around the vfork.
1765 (send_process_frame, process_sent_to, handle_pipe_signal)
1766 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1767 ignores SIGPIPE.
1768 (send_process): No need for setjmp/longjmp any more, since the
1769 SIGPIPE stuff is now gone. Instead, report an error if errno
1770 is EPIPE.
1771 (record_child_status_change): Now extern. PID and W are now args.
1772 Return void, not bool. All callers changed.
1773 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1774 Remove. All uses removed. This bug should be fixed now in a
1775 different way.
1776 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1777 and record the child status change directly. This avoids the
1778 need to futz with the signal mask.
1779 (process_fatal_action): Move here from emacs.c.
1780 (emacs_sigaction_flags): New function, containing
1781 much of what used to be in emacs_sigaction_init.
1782 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1783 caught by emacs, to make races less likely.
1784 (deliver_process_signal): Rename from handle_on_main_thread.
1785 All uses changed.
1786 (BACKTRACE_LIMIT_MAX): Now at top level.
1787 (thread_backtrace_buffer, threadback_backtrace_pointers):
1788 New static vars.
1789 (deliver_thread_signal, deliver_fatal_thread_signal):
1790 New functions, for more-accurate delivery of thread-specific signals.
1791 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1792 (deliver_arith_signal): Handle in this thread, not
1793 in the main thread, since it's triggered by this thread.
1794 (maybe_fatal_sig): New function.
1795 (init_signals): New arg DUMPING so that we can be more accurate
1796 about whether we're dumping. Caller changed.
1797 Treat thread-specific signals differently from process-general signals.
1798 Block all signals while handling fatal error; that's safer.
1799 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1800 on IEEE hosts.
1801 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1802 Ignore SIGPIPE unless batch.
1803 (emacs_backtrace): Output backtrace for the appropriate thread,
1804 which is not necessarily the main thread.
1805 * syssignal.h: Include <stdbool.h>.
1806 (emacs_raise): New macro.
1807 * xterm.c (x_connection_signal): Remove; no longer needed
1808 now that we use sigaction.
1809 (x_connection_closed): No need to mess with sigmask now.
1810 (x_initialize): No need to reset SIGPIPE handler here, since
1811 init_signals does this for us now.
1812
1813 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1814
1815 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1816 background rect may be larger (Bug#12245).
1817
1818 2012-09-23 Chong Yidong <cyd@gnu.org>
1819
1820 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1821
1822 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1823
1824 * .gdbinit: Just stop at fatal_error_backtrace.
1825 See Stefan Monnier's request in
1826 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1827 Remove no-longer-used query of system type.
1828
1829 2012-09-22 Chong Yidong <cyd@gnu.org>
1830
1831 * search.c (Freplace_match): Doc fix (Bug#12325).
1832
1833 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1834
1835 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1836 (Fline_end_position): Doc fix.
1837
1838 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1839
1840 2012-09-22 Chong Yidong <cyd@gnu.org>
1841
1842 * dispextern.h (struct image_type): Add new slot, storing a type
1843 initialization function.
1844
1845 * image.c (define_image_type): Call the image initializer function
1846 if it is defined. Arguments and return value changed.
1847 (valid_image_p, make_image): Callers changed.
1848 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1849 (gif_type, imagemagick_type, svg_type, gs_type):
1850 Add initialization functions.
1851 (Finit_image_library): Call lookup_image_type.
1852 (CHECK_LIB_AVAILABLE): Macro deleted.
1853 (lookup_image_type): Call define_image_type here, rather than via
1854 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1855 (syms_of_image): Move define_image_type calls for xbm_type and
1856 pbm_type to lookup_image_type.
1857
1858 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1859
1860 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1861 'idle_timers' from here ...
1862 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1863 lists, to avoid infloops when the timer does something stupid,
1864 like reinvoke itself with the same or smaller time-out.
1865 (Bug#12447)
1866
1867 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1868
1869 * window.c (Fsplit_window_internal): Handle only Qt value of
1870 Vwindow_combination_limit separately.
1871 (Qtemp_buffer_resize): New symbol.
1872 (Vwindow_combination_limit): New default value.
1873 Rewrite doc-string.
1874
1875 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1876
1877 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1878 the new overlay string. (Bug#10159)
1879
1880 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1881
1882 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1883 or that fprintf is async-signal-safe. POSIX doesn't require
1884 either assumption.
1885
1886 2012-09-22 Chong Yidong <cyd@gnu.org>
1887
1888 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1889 (Bug#8207).
1890
1891 2012-09-22 Kenichi Handa <handa@gnu.org>
1892
1893 * composite.c (composition_reseat_it): Handle the case that a
1894 grapheme cluster is not covered by a single font (Bug#12352).
1895
1896 2012-09-21 Chong Yidong <cyd@gnu.org>
1897
1898 * image.c (define_image_type): Avoid adding duplicate types to
1899 image_types (Bug#12463). Suggested by Jörg Walter.
1900
1901 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1902
1903 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1904 (print_load_command_name): Add case LC_DATA_IN_CODE.
1905 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1906
1907 2012-09-21 Glenn Morris <rgm@gnu.org>
1908
1909 * eval.c (Frun_hook_with_args_until_success)
1910 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1911
1912 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1913
1914 * fileio.c (Ffile_selinux_context): Only call freecon when
1915 lgetfilecon succeeded.
1916 (Fset_file_selinux_context): Likewise. (Bug#12444)
1917
1918 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1919
1920 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1921 reordering, locate the cursor by calling set_cursor_from_row; if
1922 that fails, clear the desired glyph matrix before returning a
1923 failure indication to the caller. Fixes leaving garbled display
1924 when fast scrolling with a down-key. (Bug#12403)
1925 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1926 scrolling through multibyte text.
1927
1928 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1929
1930 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1931 calling mark_vectorlike since that's the one that marks the window.
1932 (mark_discard_killed_buffers): Mark the final cdr.
1933 * window.h (struct window): Move prev/next_buffers to the
1934 non-standard fields.
1935 * window.c (make_window): Initialize prev/next_buffers manually.
1936
1937 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1938
1939 Omit unused arg EXPECTED from socket hooks.
1940 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1941 * nsterm.m (ns_term_init):
1942 * termhooks.h (struct terminal.read_socket_hook):
1943 * w32inevt.c (w32_console_read_socket):
1944 * w32term.c (w32_read_socket):
1945 * xterm.c (XTread_socket):
1946 Omit unused arg EXPECTED. All callers changed.
1947 (store_user_signal_events): Return void, not int, since callers no
1948 longer care about the return value. All uses changed.
1949
1950 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1951
1952 * w32gui.h (XParseGeometry): Do not declare.
1953
1954 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1955
1956 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1957 Ignore 'expected'. See Eli Zaretskii in
1958 <http://bugs.gnu.org/12471#8> (last line).
1959
1960 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1961 (XParseGeometry): Now static. Substitute extremal values for
1962 values that are out of range.
1963
1964 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1965
1966 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1967
1968 * nsfns.m (XParseGeometry): Remove.
1969 (Fx_create_frame): Call x_set_offset to correctly interpret
1970 top_pos in geometry.
1971
1972 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1973 (Fx_parse_geometry): If there is a space in string, call
1974 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1975
1976 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1977
1978 * search.c (scan_buffer): Use character positions in calls to
1979 region_cache_forward and region_cache_backward, not byte
1980 positions. (Bug#12196)
1981
1982 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1983 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1984
1985 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1986 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1987 emacs_blocked_malloc, now deleted.
1988
1989 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1990
1991 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1992 The workaround was for improving performance on Solaris 2.4, but
1993 is getting in the way now. Emacs will still work if someone is
1994 still running Solaris 2.4 in a museum somewhere; Sun dropped
1995 support for Solaris 2.4 in 2003.
1996 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1997 * process.c (create_process) [HAVE_WORKING_VFORK]:
1998 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1999 since Emacs no longer uses vfork on that platform.
2000
2001 2012-09-17 Glenn Morris <rgm@gnu.org>
2002
2003 * emacs.c: Use COPYRIGHT.
2004
2005 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2006
2007 Remove configure's --without-sync-input option (Bug#12450).
2008 When auditing signal-handling in preparation for cleaning it up,
2009 I found that SYNC_INPUT has race conditions and would be a real
2010 pain to fix. Since it's an undocumented and deprecated
2011 configure-time option, now seems like a good time to remove it.
2012 Also see <http://bugs.gnu.org/11080#16>.
2013 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2014 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2015 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2016 (malloc_hysteresis):
2017 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2018 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2019 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2020 (dont_register_blocks, bytes_used_when_reconsidered)
2021 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2022 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2023 [!SYSTEM_MALLOC && !SYNC_INPUT]:
2024 Remove. All uses removed.
2025 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2026 implementation, one that depends on whether the new macro
2027 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2028 is defined.
2029 * atimer.c (run_timers, handle_alarm_signal):
2030 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2031 (handle_async_input, process_pending_signals)
2032 (handle_input_available_signal, init_keyboard):
2033 * nsterm.m (ns_read_socket):
2034 * process.c (wait_reading_process_output):
2035 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2036 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2037 (emacs_write):
2038 * xterm.c (XTread_socket):
2039 Assume SYNC_INPUT.
2040 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2041 * eval.c (handling_signal): Remove. All uses removed.
2042 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2043 All uses replaced with the SYNC_INPUT version.
2044 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2045 Remove decls.
2046 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2047 Now static.
2048
2049 * font.c (Ffont_shape_gstring): Remove unused local.
2050
2051 2012-09-16 Glenn Morris <rgm@gnu.org>
2052
2053 * Makefile.in (clean): No longer run nextstep's clean.
2054
2055 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2056 (ns_frag): Remove.
2057 (ns-app): Move here from ns.mk, and simplify.
2058 (clean): Simplify nextstep entry.
2059 * ns.mk: Remove file.
2060
2061 2012-09-17 Kenichi Handa <handa@gnu.org>
2062
2063 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2064 not covert the last few charactes.
2065
2066 2012-09-16 Kenichi Handa <handa@gnu.org>
2067
2068 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2069 here, but just check the validity of glyphs in the glyph-string.
2070
2071 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2072
2073 * window.c (Fwindow_parameter, Fset_window_parameter):
2074 Accept any window as argument (Bug#12452).
2075
2076 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2077
2078 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2079 to ns_term_init to avoid memory leak.
2080
2081 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2082 explicit retain/release.
2083 (ns_term_init): Only allow one display. Initialize outerpool and
2084 ns_*_types.
2085
2086 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2087
2088 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2089 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2090 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2091 the Microsoft problem in a different way, by altering ../nt/config.nt.
2092
2093 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2094
2095 * w32xfns.c:
2096 * w32uniscribe.c:
2097 * w32term.c:
2098 * w32select.c:
2099 * w32reg.c:
2100 * w32proc.c:
2101 * w32menu.c:
2102 * w32inevt.c:
2103 * w32heap.c:
2104 * w32font.c:
2105 * w32fns.c:
2106 * w32console.c:
2107 * w32.c:
2108 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2109 by lisp.h. This completes removal of setjmp.h inclusion
2110 erroneously announced in the previous commit. (Bug#12446)
2111
2112 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2113 more accurate.
2114
2115 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2116 not defined as a macro. The latter happens on MS-Windows.
2117 (Bug#12446)
2118
2119 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2120
2121 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2122 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2123 Some instances of '#include <setjmp.h>' removed, if the
2124 only reason for the instance was because "lisp.h" was included.
2125 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2126 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2127 and _longjmp with the new symbols. Emacs already uses _setjmp if
2128 available, so this change affects only POSIXish hosts that have
2129 sigsetjmp but not _setjmp, such as some versions of Solaris and
2130 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2131 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2132 (png_load_body) [HAVE_PNG]:
2133 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2134 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2135 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2136 since PNG requires jmp_buf. This is the only exception to the
2137 general rule that we now use sys_setjmp and sys_longjmp.
2138 This exception is OK since this code does not change the signal
2139 mask or longjmp out of a signal handler.
2140
2141 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2142
2143 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2144 Include "syssignal.h", for 'main_thread'.
2145
2146 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2147
2148 Avoid out-of-range marker position (Bug#12426).
2149 * insdel.c (replace_range, replace_range_2):
2150 Adjust markers before overlays, as suggested by comments.
2151 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2152 Remove redundant check before calling offset_intervals.
2153
2154 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2155
2156 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2157 current buffer (Bug#12387).
2158
2159 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2160
2161 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2162
2163 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2164
2165 Use a more backwards-compatible timer format (Bug#12430).
2166 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2167 vector element, not from the 4th, since PSECS is now at the end.
2168 (Fcurrent_idle_time): Doc fix.
2169
2170 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2171
2172 Function to mark objects and remove killed buffers at once.
2173 * alloc.c (discard_killed_buffers): Rename to ...
2174 (mark_discard_killed buffers) ... new name. Add marking
2175 of remaining objects. Fix comment. Adjust users.
2176 (mark_object): Do not touch frame buffer lists here.
2177 * frame.c (delete_frame): Reset frame buffer lists here.
2178
2179 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2180
2181 Better workaround for GNOME bug when --enable-gcc-warnings.
2182 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2183 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2184 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2185
2186 Simplify SIGIO usage (Bug#12408).
2187 The code that dealt with SIGIO was crufty and confusing, e.g., it
2188 played tricks like "#undef SIGIO" but these tricks were not used
2189 consistently. Simplify mostly by not #undeffing standard symbols,
2190 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2191 or not as we please) rather than "defined SIGIO" (standard symbol
2192 that we probably shouldn't #undef).
2193 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2194 Modules that need it can include it.
2195 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2196 * dispextern.h (ignore_sigio): New decl.
2197 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2198 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2199 * emacs.c (shut_down_emacs):
2200 * keyboard.c (kbd_buffer_store_event_hold):
2201 Use ignore_sigio rather than invoking 'signal' directly.
2202 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2203 for FIONREAD.
2204 (FIONREAD, SIGIO): Do not #undef.
2205 (tty_read_avail_input): Use #error rather than a syntax error.
2206 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2207 for I_PIPE, used by SETUP_SLAVE_PTY.
2208 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2209 * sysdep.c (croak): Remove; no longer needed. This bit of
2210 temporary code, with Fred N. Fish's comment that it's temporary,
2211 has been in Emacs since at least 1992!
2212 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2213 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2214 * syssignal.h (croak): Remove decl.
2215 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2216 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2217 now that we're termios-only.
2218 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2219 * term.c (dissociate_if_controlling_tty): Use #error rather than
2220 a run-time error.
2221
2222 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2223 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2224 to work around GNOME bug 683906.
2225 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2226 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2227 This works around GCC bug 54561.
2228
2229 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2230
2231 More fixes for 'volatile' and setjmp/longjmp.
2232 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2233 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2234 (png_load_body) [HAVE_PNG]:
2235 (jpeg_load_body) [HAVE_JPEG]:
2236 New function, with most of the old parent function's body.
2237 (png_load) [HAVE_PNG]:
2238 (jpeg_load) [HAVE_JPEG]:
2239 Invoke the new function, to avoid longjmp munging our locals.
2240 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2241 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2242 longjmp is passed 2, as the C standard doesn't guarantee this.
2243 Instead, store the failure code into mgr->failure_code.
2244
2245 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2246
2247 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2248 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2249 (syms_of_keyboard): Remove support for unread-command-char.
2250
2251 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2252
2253 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2254 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2255 violation. (Bug#12426)
2256
2257 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2258
2259 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2260
2261 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2262
2263 * eval.c: Add `inhibit-debugger'.
2264 (Qinhibit_debugger): New symbol.
2265 (call_debugger): Bind it instead of Qdebug_on_error.
2266 (maybe_call_debugger): Test Vinhibit_debugger.
2267 (syms_of_eval): Define inhibit-debugger.
2268 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2269 (syms_of_xdisp): Remove inhibit-debug-on-message.
2270
2271 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2272
2273 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2274 If a nonvolatile local variable is written before a _longjmp to
2275 the frame containing the variable, and is read after the _longjmp,
2276 the value read is indeterminate. Some local variables of type
2277 'struct handler' and 'struct catchtag' are used in this way, so
2278 mark each of their slots as volatile if the slot can be set before
2279 _longjmp and read afterwards.
2280 * lisp.h (struct handler): var and chosen_clause are now volatile.
2281 (struct catchtag): val, next, and pdlcount are now volatile.
2282
2283 * bidi.c (bidi_push_it, bidi_pop_it):
2284 * fns.c (copy_hash_table):
2285 * image.c (define_image_type):
2286 * keyboard.c (kbd_buffer_store_event_hold):
2287 * process.c (Fprocess_send_eof):
2288 * xfaces.c (x_create_gc) [HAVE_NS]:
2289 * xgselect.c (xg_select):
2290 Prefer assignment to memcpy when either will do.
2291
2292 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2293 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2294 time an item is removed. No need to mark this function 'inline';
2295 the compiler knows better than we do.
2296
2297 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2298
2299 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2300 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2301 to change_frame_size (Bug#12388).
2302 (windowDidResize:): Pass YES to updateFrameSize.
2303
2304 * nsterm.h: Add delay parameter to updateFrameSize.
2305
2306 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2307
2308 Discard killed buffers from deleted window and frame objects.
2309 This reduces an amount of references to killed buffers and
2310 helps GC to reclaim them faster.
2311 * alloc.c (discard_killed_buffers): New function.
2312 (mark_object): Use it for deleted windows and frames.
2313 (mark_object): If symbol's value is set up for a killed buffer
2314 or deleted frame, restore its global binding.
2315 * data.c (swap_in_global_binding): Add GC notice.
2316 (swap_in_symval_forwarding): Use convenient set_blv_where.
2317 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2318 * window.h: ... to here.
2319
2320 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2321
2322 Convenient macro to check whether the buffer is live.
2323 * buffer.h (BUFFER_LIVE_P): New macro.
2324 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2325 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2326
2327 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2328
2329 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2330 composition cases (Bug#12364).
2331
2332 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2333 overhang of succeeding glyphs overlapping box cursor.
2334
2335 * w32term.c (x_draw_glyph_string): Likewise.
2336
2337 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2338
2339 Simplify, document, and port floating-point (Bug#12381).
2340 The porting part of this patch fixes bugs on non-IEEE platforms
2341 with frexp, ldexp, logb.
2342 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2343 Now static.
2344 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2345 support, by removing commented-out code and briefly listing the
2346 C89 functions excluded. The commented-out stuff was confusing
2347 maintenance, e.g., we thought we needed cbrt but it was commented out.
2348 (logb): Remove decl; no longer needed.
2349 (isfinite): New macro, if not already supplied.
2350 (isnan): Don't replace any existing macro.
2351 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2352 are present on all C89 platforms.
2353 (Ffrexp): Do not special-case zero, as frexp does the right thing
2354 for that case.
2355 (Flogb): Do not use logb, as it doesn't have the desired meaning
2356 on hosts that use non-base-2 floating point. Instead, stick with
2357 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2358 frexp, to avoid getting an unspecified result.
2359
2360 * xdisp.c (Qinhibit_debug_on_message): Now static.
2361
2362 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2363
2364 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2365 NSBezierPath (Bug#12131).
2366
2367 2012-09-10 Chong Yidong <cyd@gnu.org>
2368
2369 * fns.c (Fdelq, Fdelete): Doc fix.
2370
2371 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2372
2373 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2374 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2375
2376 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2377
2378 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2379 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2380 Use it.
2381
2382 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2383
2384 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2385 left fringe if the window has a left margin. This avoids leaving
2386 traces of the cursor because its leftmost pixel is not drawn over.
2387
2388 * dispnew.c (update_window_line): When the left margin area of a
2389 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2390 that screen line. (Bug#12277)
2391
2392 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2393
2394 Assume C89 or later for math functions (Bug#12381).
2395 This simplifies the code, and makes it a bit smaller and faster,
2396 and (most important) makes it easier to clean up signal handling
2397 since we can stop worring about floating-point exceptions in
2398 library code. That was a problem before C89, but the problem
2399 went away many years ago on all practical Emacs targets.
2400 * data.c, image.c, lread.c, print.c:
2401 Don't include <math.h>; no longer needed.
2402 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2403 might be autoconfigured, as that never happens.
2404 * data.c (fmod):
2405 * doprnt.c (DBL_MAX_10_EXP):
2406 * print.c (DBL_DIG):
2407 Remove. C89 or later always defines these.
2408 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2409 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2410 (arith_error, domain_error, domain_error2):
2411 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2412 no longer needed -- we simply return what C returns. All uses removed.
2413 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2414 the wrapped code.
2415 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2416 Remove. All uses expanded, as these macros are no longer used
2417 more than once and are now more trouble than they're worth.
2418 (Ftan): Use tan, not sin / cos.
2419 (Flogb): Assume C89 frexp.
2420 (fmod_float): Assume C89 fmod.
2421 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2422 (init_floatfns): Remove. All uses removed.
2423
2424 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2425
2426 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2427 compositeToPoint for OSX < 10.6 (Bug#12390).
2428
2429 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2430
2431 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2432 This produces more-accurate results.
2433
2434 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2435
2436 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2437 changes (Bug#12088).
2438
2439 2012-09-08 Chong Yidong <cyd@gnu.org>
2440
2441 * syntax.c (Fstring_to_syntax): Doc fix.
2442
2443 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2444
2445 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2446 in the internal border.
2447 (x_set_window_size): Remove static variables and their usage.
2448 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2449 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2450 Remove fringe/internal border adjustment (Bug#11052).
2451 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2452 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2453 (ns_fix_rect_ibw): Remove.
2454 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2455 (ns_dumpglyphs_box_or_relief): Ditto.
2456 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2457 adjustment.
2458 (ns_dumpglyphs_image): Ditto.
2459 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2460 border adjustment.
2461 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2462 their usage. Add fringe_extended_p and its use as in other terms.
2463 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2464 scroll bar was removed.
2465 (updateFrameSize): New function.
2466 (windowDidResize): Move code to updateFrameSize and call it.
2467
2468 * nsterm.h (EmacsView): Add updateFrameSize.
2469
2470 2012-09-07 Chong Yidong <cyd@gnu.org>
2471
2472 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2473
2474 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2475
2476 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 More signal-handler cleanup (Bug#12327).
2479 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2480 Problem introduced when merging patches. Noted by Eli Zaretskii in
2481 <http://bugs.gnu.org/12327#67>.
2482 * floatfns.c: Comment fix.
2483 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2484 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2485 and anyway the declaration is harmless even if SIGDANGER is not defined.
2486 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2487 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2488 source files not surprisingly expected syssignal.h to define, or
2489 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2490 Include <sys/ioctl.h>, for FIONREAD.
2491 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2492 This eliminates a problem whereby other files mysteriously had
2493 to include "syssignal.h" before including "systty.h" if they
2494 wanted to use "#ifdef SIGIO".
2495
2496 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2497
2498 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2499
2500 * w32.c (sigemptyset): Empty the set.
2501 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2502
2503 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2504
2505 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2506
2507 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2508 (mark_object): Likewise for frame objects.
2509
2510 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2511
2512 * syssignal.h (handle_on_main_thread): Always declare,
2513 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2514 This ports to platforms without HAVE_PTHREAD.
2515
2516 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2517
2518 Signal-handler cleanup (Bug#12327).
2519 Emacs's signal handlers were written in the old 4.2BSD style with
2520 sigblock and sigmask and so forth, and this led to some
2521 inefficiencies and confusion. Rewrite these to use
2522 pthread_sigmask etc. without copying signal sets around. Also,
2523 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2524 'signal', and instead use functions that do not attempt to take
2525 over the system name space. This patch causes Emacs's text
2526 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2527 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2528 Do not include <signal.h> or "syssignal.h", as these
2529 modules do not use signals.
2530 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2531 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2532 Do not include <signal.h>, as "syssignal.h" does that for us now.
2533 * atimer.c (sigmask_atimers): New function.
2534 (block_atimers, unblock_atimers): New functions,
2535 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2536 All uses replaced.
2537 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2538 no longer needed here.
2539 * emacs.c (main): Inspect existing signal handler with sigaction,
2540 so that there's no need to block and unblock SIGHUP.
2541 * sysdep.c (struct save_signal): New member 'action', replacing
2542 old member 'handler'.
2543 (save_signal_handlers, restore_signal_handlers):
2544 Use sigaction instead of 'signal' to save and restore.
2545 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2546 New function. All users of 'signal' modified to use set_sighandler
2547 if they're writeonly, and to use sys_signal if they're read+write.
2548 (emacs_sigaction_init, forwarded_signal): New functions.
2549 (sys_signal): Remove. All uses replaced by calls to sigaction
2550 and emacs_sigaction_init, or by direct calls to 'signal'.
2551 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2552 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2553 all uses replaced by pthread_sigmask etc. calls.
2554 * syssignal.h: Include <signal.h>.
2555 (emacs_sigaction_init, forwarded_signal): New decls.
2556 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2557 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2558 (sigmask, sys_sigmask): Remove; no longer needed.
2559 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2560 (sigblock, sigunblock, sigfree):
2561 (sigsetmask) [!defined sigsetmask]:
2562 Remove. All uses replaced by pthread_sigmask.
2563 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2564 no longer need to be replaced, and its typical old uses
2565 are now done via emacs_sigaction_init and sigaction.
2566 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2567 (sys_sigdel): Remove; unused.
2568 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2569
2570 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2571
2572 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2573 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2574
2575 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2576
2577 Explicitly mark buffer_defaults and buffer_local_symbols.
2578 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2579 mark_local_symbols here.
2580 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2581 since special buffers aren't marked here any more.
2582 (allocate_buffer): Chain new buffer with all_buffers here...
2583 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2584 not here.
2585 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2586 (syms_of_buffer): Remove staticpro of the above.
2587 (init_buffer_once): Set names for buffer_defaults and
2588 buffer_local_symbols.
2589
2590 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2591
2592 Use bool for booleans in font-related modules.
2593 * font.c (font_intern_prop, font_style_to_value)
2594 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2595 (generate_otf_features, font_check_otf_features, font_check_otf)
2596 (font_match_p, font_list_entities, font_at):
2597 * fontset.c (fontset_id_valid_p, reorder_font_vector
2598 (fontset_find_font, Fset_fontset_font)
2599 (face_suitable_for_char_p) [0]:
2600 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2601 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2602 (m17n_flt_initialized, ftfont_shape_by_flt):
2603 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2604 * nsfont.m (nsfont_draw):
2605 * w32font.c (w32font_draw):
2606 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2607 Use bool for booleans.
2608 * font.h: Adjust to above API changes.
2609 (struct font, struct font_driver, struct font_driver_list):
2610 Use bool for booleans.
2611 (struct font): Remove useless member encoding_type.
2612 All users removed.
2613 * fontset.c, xftfont.c: Omit unnecessary static decls.
2614
2615 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2616
2617 * alloc.c (mark_object): Revert window marking code
2618 since it's unsafe for the Fset_window_configuration.
2619
2620 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2621
2622 Fix race conditions with signal handlers and errno (Bug#12327).
2623 Be more systematic about preserving errno whenever a signal
2624 handler returns, even if it's not in the main thread. Do this by
2625 renaming signal handlers to distinguish between signal delivery
2626 and signal handling. All uses changed.
2627 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2628 * data.c (deliver_arith_signal): Rename from arith_error.
2629 * dispnew.c (deliver_window_change_signal): Rename from
2630 window_change_signal.
2631 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2632 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2633 * keyboard.c (deliver_input_available_signal): Rename from
2634 input_available_signal.
2635 (deliver_user_signal): Rename from handle_user_signal.
2636 (deliver_interrupt_signal): Rename from interrupt_signal.
2637 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2638 (deliver_child_signal): Rename from sigchld_handler.
2639 * atimer.c (handle_alarm_signal):
2640 * data.c (handle_arith_signal):
2641 * dispnew.c (handle_window_change_signal):
2642 * emacs.c (handle_fatal_signal, handle_danger_signal):
2643 * keyboard.c (handle_input_available_signal):
2644 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2645 * process.c (handle_pipe_signal, handle_child_signal):
2646 New functions, with the actual signal-handling code taken from the
2647 original respective signal handlers, sans the sporadic attempts to
2648 preserve errno, since that's now done by handle_on_main_thread.
2649 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2650 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2651 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2652 Move to sysdep.c.
2653 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2654 Move initialization of main_thread to sysdep.c's init_signals.
2655 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2656 our usage, and simplifies the mainline code.
2657 (record_child_status_change): New static function, as a helper
2658 for handle_child_signal, and with most of the old child handler's
2659 contents.
2660 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2661 (handle_child_signal): Use the above.
2662 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2663 Moved here from emacs.c.
2664 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2665 code moved here from emacs.c's main function.
2666 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2667 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2668 This lets callers save and restore errno properly.
2669
2670 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2671
2672 Remove redundant or unused things here and there.
2673 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2674 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2675 * editfns.c (Fcompare_buffer_substrings): Likewise.
2676 * frame.h (struct terminal, struct font_driver_list):
2677 Remove redundant declarations.
2678 * window.h (Qleft, Qright): Likewise.
2679
2680 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2681
2682 Do not mark objects from deleted buffers, windows and frames.
2683 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2684 (mark_object): Likewise for windows and frames.
2685
2686 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2687
2688 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2689 buffer_defaults and buffer_local_symbols as valid objects.
2690 Return special value to denote them.
2691
2692 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2693
2694 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2695 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2696 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2697 (file_name_absolute_p, Fsubstitute_in_file_name):
2698 (check_executable, check_writable, Ffile_accessible_directory_p)
2699 (Fset_file_selinux_context, Fdefault_file_modes)
2700 (Finsert_file_contents, choose_write_coding_system)
2701 (Fwrite_region, build_annotations, a_write, e_write)
2702 (Fdo_auto_save):
2703 * filelock.c (boot_time_initialized, get_boot_time)
2704 (get_boot_time_1, lock_file_1, within_one_second):
2705 * floatfns.c (in_float):
2706 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2707 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2708 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2709 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2710 * window.c (compare_window_configurations):
2711 Use bool for booleans.
2712 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2713 (Fdefault_file_modes): Now mode_t, not int, for modes.
2714 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2715 (internal_delete_file): Now returns void, not a (boolean) int,
2716 since nobody was looking at the return value.
2717 * lisp.h, window.h: Adjust to above API changes.
2718
2719 * xdisp.c (set_message): Simplify and reindent last change.
2720
2721 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2722
2723 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2724
2725 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2726
2727 * eval.c (call_debugger): Make the function non-static so that we
2728 can call it from set_message.
2729
2730 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2731 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2732
2733 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2734
2735 Give more-useful info on a fatal error (Bug#12328).
2736 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2737 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2738 of doing the work ourselves.
2739 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2740 do most of the work.
2741 (fatal_error_backtrace): New function, taken from the guts
2742 of the old fatal_error_signal, but with a new option to output
2743 a backtrace.
2744 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2745 info about the signal than just its number.
2746 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2747 * sysdep.c: Include <execinfo.h>
2748 (emacs_backtrace): New function, taken partly from the previous
2749 code of the 'die' function.
2750 (emacs_abort): Call fatal_error_backtrace rather than abort.
2751
2752 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2753
2754 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2755 eager (load-time) macro-expansion.
2756 * lisp.mk (lisp): Add macroexp.
2757
2758 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2759
2760 Simplify redefinition of 'abort' (Bug#12316).
2761 Do not try to redefine the 'abort' function. Instead, redo
2762 the code so that it calls 'emacs_abort' rather than 'abort'.
2763 This removes the need for the NO_ABORT configure-time macro
2764 and makes it easier to change the abort code to do a backtrace.
2765 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2766 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2767 Remove; sysdep.c's emacs_abort now takes its place.
2768 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2769 'abort' changed to use 'emacs_abort'.
2770 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2771 (abort) [!defined abort]: Rename to ...
2772 (emacs_abort): ... new name.
2773 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2774 the place of the old 'abort' in emacs.c.
2775 * w32.c, w32fns.c (abort): Do not #undef.
2776 * w32.c (emacs_abort): Rename from w32_abort.
2777
2778 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2779
2780 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2781 offsets[j].dv, since the y axis of the screen coordinates points
2782 down, while the y axis of the font definition coordinates points
2783 up. This fixes display of Arabic diacritics such as KASRA and
2784 KASRATAN. (Bug#11860)
2785
2786 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2787
2788 Be more systematic about _setjmp vs setjmp.
2789 * alloc.c (test_setjmp, mark_stack):
2790 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2791 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2792 (png_load, my_error_exit, jpeg_load):
2793 * process.c (send_process_trap, send_process):
2794 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2795 The underscored versions are up to 30x faster on some hosts.
2796 Formerly, the code used setjmp+longjmp sometimes and
2797 _setjmp+_longjmp at other times, with no particular reason to
2798 prefer setjmp+longjmp.
2799
2800 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2801
2802 Fix minor problem found by static checking.
2803 * buffer.c (Fdelete_all_overlays): Return nil.
2804
2805 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2806
2807 * buffer.c (Fdelete_all_overlays): New function.
2808
2809 2012-09-03 Chong Yidong <cyd@gnu.org>
2810
2811 * gtkutil.c: Add extern decl for Qxft.
2812
2813 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2814
2815 * emacs.c, eval.c: Use bool for boolean.
2816 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2817 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2818 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2819 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2820 (main, decode_env_path, Fdaemon_initialized):
2821 * eval.c (call_debugger, Finteractive_p, interactive_p):
2822 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2823 (maybe_call_debugger, Fbacktrace):
2824 * process.c (read_process_output, exec_sentinel):
2825 Use bool for booleans.
2826 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2827 All callers changed.
2828 * eval.c (interactive_p): Omit always-true boolean argument
2829 EXCLUDE_SUBRS_P. All callers changed.
2830 * dispextern.h, lisp.h: Reflect above API changes.
2831 * firstfile.c (dummy): Use the address of 'main', whose signature
2832 won't change, instead of the address of 'initialize', whose
2833 signature just changed from int to bool.
2834 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2835 * msdos.c (fatal_error_in_progress): ... from here.
2836 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2837 of incrementing it.
2838 (redisplay_internal, unwind_redisplay): Simply clear
2839 REDISPLAYING_P when unwinding, instead of saving its previous,
2840 always-false value and then restoring it.
2841
2842 Clean up some extern decls.
2843 Mostly, this hoists extern decls out of .c files and into .h files.
2844 That way, we're more likely to catch errors if the interfaces change.
2845 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2846 declare xg_mark_data.
2847 * dispextern.h (x_frame_parm_handlers):
2848 * font.h (Qxft):
2849 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2850 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2851 (Qultra_bold, Qoblique, Qitalic):
2852 Move extern decl here from .c file.
2853 * alloc.c (xg_mark_data) [USE_GTK]:
2854 * doc.c (Qclosure):
2855 * eval.c (Qlexical_binding):
2856 * fns.c (time) [!HAVE_UNISTD_H]:
2857 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2858 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2859 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2860 * lread.c (Qinternal_interpreter_environment):
2861 * minibuf.c (Qbuffer):
2862 * process.c (QCfamily, QCfilter):
2863 * widget.c (free_frame_faces):
2864 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2865 * xfont.c (x_clear_errors):
2866 * xterm.c (x_frame_parm_handlers):
2867 Remove now-redundant extern decls.
2868 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2869 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2870 Now static.
2871 * xfaces.c: Remove unnecessary static decls.
2872 * xterm.c (updating_frame): Remove decl of nonexistent object.
2873
2874 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2875 when building globals.h, as the objects that are not built on
2876 this host are not needed to compile C files on this host.
2877
2878 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2879
2880 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2881
2882 * frame.h: Add missing prototype for x_wm_set_size_hint.
2883
2884 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2885
2886 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2887 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2888 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2889 (Fsubstitute_command_keys):
2890 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2891 (save_excursion_save, save_excursion_restore)
2892 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2893 (format_time_string, general_insert_function)
2894 (make_buffer_string, make_buffer_string_both)
2895 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2896 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2897 (copy_text, insert_1, insert_1_both, insert_from_string)
2898 (insert_from_string_before_markers, insert_from_string_1)
2899 (insert_from_buffer, insert_from_buffer_1, replace_range)
2900 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2901 (del_range_2, modify_region):
2902 * intervals.c (intervals_equal, balance_possible_root_interval)
2903 (adjust_intervals_for_insertion, merge_properties_sticky)
2904 (graft_intervals_into_buffer, lookup_char_property)
2905 (adjust_for_invis_intang, set_point_both)
2906 (get_property_and_range, compare_string_intervals)
2907 (set_intervals_multibyte_1, set_intervals_multibyte):
2908 * keyboard.c (decode_timer):
2909 Use bool for boolean.
2910 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2911 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2912
2913 2012-09-02 Chong Yidong <cyd@gnu.org>
2914
2915 * keymap.c (push_key_description): Print M-TAB as C-M-i
2916 (Bug#11758).
2917
2918 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2919
2920 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2921 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2922 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2923 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2924 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2925 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2926 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2927
2928 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2929
2930 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2931 more than one grapheme cluster passed to the shaper: compute the
2932 offset adjustment values separately for each cluster. (Bug#11860)
2933
2934 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2935 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2936 about implicit conversions from integer to pointer.
2937
2938 2012-09-01 Daniel Colascione <dancol@dancol.org>
2939
2940 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2941 system used too early.
2942
2943 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 Better seed support for (random).
2946 * emacs.c (main): Call init_random.
2947 * fns.c (Frandom): Set the seed from a string argument, if given.
2948 Remove long-obsolete Gentzel cruft.
2949 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2950 (init_random): New function.
2951
2952 2012-09-01 Daniel Colascione <dancol@dancol.org>
2953
2954 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2955 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2956 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2957 x_wm_set_size_hint, x_query_colors, x_real_positions,
2958 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2959 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2960 all of which have been moved to common code.
2961
2962 * xfaces.c: Include TERM_HEADER instead of listing all possible
2963 window-system headers.
2964
2965 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2966 to match header.
2967
2968 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2969 directly accessing frame internals.
2970
2971 * w32font.h: Include font.h. Define syms_of_w32font and
2972 globals_of_w32font.
2973
2974 * process.c: Include TERM_HEADER instead of listing all possible
2975 window-system headers.
2976
2977 * nsterm.h: Remove declarations now in frame.h.
2978 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2979
2980 * menu.c: Include TERM_HEADER instead of listing all possible
2981 window-system headers.
2982
2983 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2984 window system.
2985
2986 * keyboard.c: Include TERM_HEADER instead of listing all possible
2987 window-system headers.
2988
2989 * image.c: Include TERM_HEADER instead of listing all possible
2990 window-system headers. Declare Vlibrary_cache when compiling for
2991 Windows.
2992
2993 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2994 window system declarations.
2995
2996 * frame.h: Move common functions here: set_frame_menubar,
2997 x_set_window_size, x_sync, x_get_focus_frame,
2998 x_set_mouse_position, x_set_mouse_pixel_position,
2999 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3000 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3001 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3002 x_activate_menubar, x_real_positions, x_bitmap_icon,
3003 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3004 and x_query_colors.
3005
3006 * frame.c: Include TERM_HEADER instead of listing all possible
3007 window-system headers.
3008
3009 * font.c: Include TERM_HEADER instead of listing all possible
3010 window-system headers.
3011
3012 * emacs.c: Include TERM_HEADER.
3013
3014 * dispnew.c: Include TERM_HEADER instead of listing all possible
3015 window-system headers.
3016
3017 * ccl.h: Include character.h.
3018
3019 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3020 the current window system; include in list of objects to link into
3021 Emacs.
3022
3023 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3024
3025 Remove mark_ttys function and fix tty_display_info initialization.
3026 * lisp.h (mark_ttys): Remove prototype.
3027 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3028 to mark_ttys because all possible values of 'top_frame' slot are
3029 the frames which are reachable from Vframe_list.
3030 * term.c (mark_ttys): Remove.
3031 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3032
3033 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3034
3035 Change struct frame bitfields from unsigned char to unsigned.
3036 * frame.h (struct frame): Change type of 'display_preempted',
3037 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3038 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3039 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3040 bitfields from unsigned char to unsigned.
3041
3042 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3043
3044 Remove unused member of struct x_output and struct w32_output.
3045 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3046 * w32term.h (struct w32_output): Likewise.
3047
3048 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3049
3050 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3051 does not become zero (Bug#12234).
3052
3053 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3054
3055 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3056 for GCC 4.7.1 x86-64.
3057
3058 2012-08-30 Glenn Morris <rgm@gnu.org>
3059
3060 * lread.c (init_lread): For out-of-tree builds, only add the
3061 source directory's site-lisp dir to the load-path if it exists,
3062 consistent with in-tree builds. (Bug#12302)
3063
3064 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3065
3066 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3067 button_values to NULL. Call setStykeMask so dialogs get a close button.
3068 (windowShouldClose:): Set window_closed.
3069 (dealloc): New member, free button_values.
3070 (process_dialog:): Make member function. Remove window argument,
3071 replace window with self. Count buttons and allocate and store values
3072 in button_values.
3073 (addButton:value:row:): value is int with the name tag. Call setTag
3074 with tag. Remove return self, declare return value as void.
3075 (addString:row:): Remove return self, declare return value as void.
3076 (addSplit): Remove return self, declare return value as void.
3077 (clicked:): Remove return self, declare return value as void.
3078 Set dialog_return to button_values[seltag]. Code formatting change.
3079 (initFromContents:isQuestion:): Adjust call to process_dialog.
3080 Code formatting change.
3081 (timeout_handler:): Set timer_fired to YES.
3082 (runDialogAt:): Set timer_fired to NO.
3083 Handle click on close button as quit.
3084
3085 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3086 Add window_closed and button_values. Add void as return value for
3087 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3088 Add process_dialog as new member.
3089
3090 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3091
3092 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3093 is not one of the heaps we manage. (Bug#12242)
3094
3095 2012-08-28 Glenn Morris <rgm@gnu.org>
3096
3097 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3098
3099 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3100
3101 * window.c (Fset_window_configuration): Remove handling of
3102 auto-buffer-name window parameter. Install revision of reverted
3103 fix.
3104
3105 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3106
3107 Do not allow to set major mode for a dead buffer.
3108 * buffer.c (Fset_buffer_major_mode): Signal an error
3109 if the buffer is dead.
3110 (Fother_buffer, other_buffer_safely): Remove redundant
3111 nested declaration.
3112
3113 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3114
3115 Always use set_buffer_if_live to restore original buffer at unwind.
3116 * buffer.h (record_unwind_current_buffer): New function.
3117 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3118 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3119 * undo.c, window.c: Adjust users.
3120 * buffer.c (set_buffer_if_live): Fix comment.
3121
3122 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3123
3124 Fix usage of set_buffer_internal.
3125 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3126 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3127 * coding.c (decode_coding): Omit redundant test.
3128 * fileio.c (decide_coding_unwind): Likewise.
3129 * fns.c (secure_hash): Likewise.
3130 * insdel.c (modify_region): Likewise.
3131 * keyboard.c (command_loop_1): Likewise.
3132 * print.c (PRINTFINISH): Likewise.
3133 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3134
3135 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3136
3137 * dispnew.c: Use bool for boolean.
3138 (frame_garbaged, display_completed, delayed_size_change)
3139 (fonts_changed_p, add_window_display_history)
3140 (add_frame_display_history, verify_row_hash)
3141 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3142 (row_equal_p, realloc_glyph_pool)
3143 (allocate_matrices_for_frame_redisplay)
3144 (showing_window_margins_p)
3145 (adjust_frame_glyphs_for_frame_redisplay)
3146 (build_frame_matrix_from_leaf_window, make_current)
3147 (mirrored_line_dance, mirror_line_dance, update_frame)
3148 (update_window_tree, update_single_window)
3149 (check_current_matrix_flags, update_window, update_text_area)
3150 (update_window_line, set_window_update_flags, scrolling_window)
3151 (update_frame_1, scrolling, buffer_posn_from_coords)
3152 (do_pending_window_change, change_frame_size)
3153 (change_frame_size_1, sit_for):
3154 Use bool for boolean.
3155 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3156 and remove last int (actually boolean) argument, which was always 0.
3157 All callers changed.
3158 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3159 * dispextern.h (struct composition_it): Use bool for boolean.
3160 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3161 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3162 * dired.c (file_name_completion):
3163 Use bool for boolean. (This was missed in an earlier change.)
3164
3165 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3166
3167 * window.c (Fset_window_configuration): Revert first part of
3168 last change.
3169
3170 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3171
3172 * nsterm.h (NSPanel): New class variable dialog_return.
3173
3174 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3175 Initialize dialog_return.
3176 (windowShouldClose:): Use stop instead of stopModalWithCode.
3177 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3178 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3179 event.
3180 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3181 modal loop returns.
3182
3183 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3186 * composite.c (find_composition, composition_gstring_p)
3187 (composition_reseat_it, find_automatic_composition):
3188 * data.c (let_shadows_buffer_binding_p)
3189 (let_shadows_global_binding_p, set_internal, make_blv)
3190 (Fmake_variable_buffer_local, Fmake_local_variable)
3191 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3192 (cons_to_signed, arith_driver):
3193 * dbusbind.c (xd_in_read_queued_messages):
3194 * dired.c (directory_files_internal, file_name_completion):
3195 Use bool for booleans.
3196 * dired.c (file_name_completion):
3197 * process.h (fd_callback):
3198 Omit int (actually boolean) argument. It wasn't being used.
3199 All uses changed.
3200 * composite.h, lisp.h: Reflect above API changes.
3201
3202 * cmds.c, coding.c: Use bool for booleans.
3203 * cmds.c (move_point, Fself_insert_command):
3204 * coding.h (struct composition status, struct coding_system):
3205 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3206 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3207 (emacs_mule_char, decode_coding_emacs_mule)
3208 (encode_coding_emacs_mule, detect_coding_iso_2022)
3209 (decode_coding_iso_2022, encode_invocation_designation)
3210 (encode_designation_at_bol, encode_coding_iso_2022)
3211 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3212 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3213 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3214 (encode_coding_raw_text, detect_coding_charset)
3215 (decode_coding_charset, encode_coding_charset, detect_eol)
3216 (detect_coding, get_translation_table, produce_chars)
3217 (consume_chars, reused_workbuf_in_use)
3218 (make_conversion_work_buffer, code_conversion_save)
3219 (decode_coding_object, encode_coding_object)
3220 (detect_coding_system, char_encodable_p)
3221 (Funencodable_char_position, code_convert_region)
3222 (code_convert_string, code_convert_string_norecord)
3223 (Fset_coding_system_priority):
3224 * fileio.c (Finsert_file_contents):
3225 Use bool for booleans.
3226 * coding.h, lisp.h: Reflect above API changes.
3227 * coding.c: Remove unnecessary static function decls.
3228 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3229 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3230 not a boolean 'int', since callers never look at the return value.
3231 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3232 * coding.h (decoding_buffer_size, encoding_buffer_size)
3233 (emacs_mule_string_char): Remove unused extern decls.
3234 (struct iso_2022_spec, struct coding_system):
3235 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3236 (struct emacs_mule_spec): Remove unused field 'full_support'.
3237 All initializations removed.
3238 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3239
3240 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3241
3242 Fix spare memory change (Bug#12286).
3243 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3244 (valid_lisp_object_p): Likewise.
3245
3246 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3247
3248 * window.c (Fset_window_configuration): Record any window's old
3249 buffer if it's replaced (see Bug#8789). If the new current
3250 buffer doesn't appear in the selected window, go to its old
3251 point (Bug#12208).
3252
3253 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3254
3255 Special MEM_TYPE_SPARE to denote reserved memory.
3256 * alloc.c (enum mem_type): New memory type.
3257 (refill_memory_reserve): Use new type for spare memory.
3258 This prevents live_cons_p and live_string_p from incorrect
3259 detection of uninitialized objects from spare memory as live.
3260
3261 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3262
3263 Spelling fixes.
3264 * Makefile.in (.PHONY): versioclean -> versionclean.
3265
3266 Remove unused external symbols.
3267 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3268 * window.c (Qwindow_valid_p, decode_valid_window):
3269 Now static, not extern.
3270 * data.c (Qinterval): Remove; unused.
3271 (syms_of_data): Do not define 'interval'.
3272 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3273 * window.h (decode_valid_window):
3274 Remove decls.
3275
3276 * character.c, charset.c, chartab.c: Use bool for booleans.
3277 * character.c (lisp_string_width, string_count_byte8)
3278 (string_escape_byte8):
3279 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3280 (load_charset_map_from_file, map_charset_chars)
3281 (Fdefine_charset_internal, define_charset_internal)
3282 (Fdeclare_equiv_charset, find_charsets_in_text)
3283 (Ffind_charset_region, char_charset, Fiso_charset):
3284 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3285 (sub_char_table_set, sub_char_table_set_range)
3286 (char_table_set_range, optimize_sub_char_table)
3287 (map_sub_char_table):
3288 Use bool for boolean.
3289 * character.c (str_to_unibyte): Omit last boolean argument; it was
3290 always 0. All callers changed.
3291 * character.h, charset.h: Adjust to match previous changes.
3292 * character.h (char_printable_p): Remove decl of nonexistent function.
3293 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3294 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3295 are all boolean, so make them single-bit bitfields.
3296
3297 * lisp.h (ASET): Remove attempt to detect side effects.
3298 It was meant to be temporary and it often doesn't work,
3299 because when IDX has side effects the behavior of IDX==IDX
3300 is undefined. See Stefan Monnier in
3301 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3302
3303 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3304
3305 * lisp.h (functionp): New function (extracted from Ffunctionp).
3306 (FUNCTIONP): Use it.
3307 * eval.c (Ffunctionp): Use it.
3308
3309 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3310
3311 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3312 as that's faster and simpler than static storage. Don't bother
3313 with the g_main_context_query overhead if g_main_context_pending
3314 says no events are pending.
3315 (gfds, gfds_size): Remove these static vars.
3316 (xgselect_initialize): Remove; no longer needed.
3317 All uses and decls removed.
3318
3319 * emacs.c (fatal_error_signal_hook): Remove.
3320 All uses removed. This leftover from old code was always 0.
3321
3322 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3323 * casefiddle.c (casify_object, casify_region):
3324 * casetab.c (set_case_table):
3325 * category.c, category.h (word_boundary_p):
3326 * category.h (CHAR_HAS_CATEGORY):
3327 Use bool for booleans, instead of int.
3328
3329 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3330
3331 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3332
3333 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3334
3335 On assertion failure, print backtrace if available.
3336 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3337 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3338 * Makefile.in (LIB_EXECINFO): New macro.
3339 (LIBES): Use it.
3340
3341 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3342 * bytecode.c (exec_byte_code):
3343 * callint.c (check_mark, Fcall_interactively):
3344 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3345 (getenv_internal, sync_process_alive, call_process_exited):
3346 * lisp.h (USE_SAFE_ALLOCA):
3347 Use bool for booleans, instead of int.
3348 * lisp.h, process.h: Adjust prototypes to match above changes.
3349 * callint.c (Fcall_interactively): Don't assume the mark's
3350 offset fits in 'int'.
3351
3352 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3353
3354 * buffer.c, buffer.h: Use bool for boolean.
3355 * buffer.c (reset_buffer_local_variables)
3356 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3357 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3358 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3359 (overlay_touches_p, overlay_strings, Foverlay_put)
3360 (report_overlay_modification, call_overlay_mod_hooks):
3361 (mmap_enlarge, mmap_set_vars):
3362 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3363 Use bool for booleans, instead of int.
3364 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3365 since the 1-or-0 return value is always ignored anyway.
3366 (mmap_initialized_p):
3367 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3368 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3369
3370 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3371
3372 * bidi.c: Use bool for boolean.
3373 This is a bit more readable, and makes the text segment of bidi.o
3374 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3375 Presumably it's faster too.
3376 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3377 Now bool.
3378 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3379 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3380 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3381 (bidi_explicit_dir_char, bidi_level_of_next_char)
3382 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3383 Use bool for booleans, instead of int.
3384 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3385 (bidi_unshelve_cache): Adjust decls to match code.
3386
3387 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3388
3389 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3390 argument.
3391
3392 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3393
3394 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3395 * atimer.h: Include <stdbool.h>.
3396
3397 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3398
3399 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3400 compile time tests instead of run time tests on systems that do
3401 not use them.
3402 (FRAME_MAC_P): Remove leftover from deleted code.
3403 * frame.c (syms_of_frame): Remove leftover from deleted code.
3404
3405 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3406
3407 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3408
3409 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3412 Otherwise, the compiler complains about (A?B:C) where B is void
3413 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3414 (fontset_add): Return void, for FONTSET_ADD.
3415
3416 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3417
3418 * alloc.c: Use bool for booleans.
3419 (gc_in_progress, abort_on_gc)
3420 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3421 (dont_register_blocks) [GC_MALLOC_CHECK]:
3422 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3423 (check_string_bytes, make_specified_string, memory_full)
3424 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3425 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3426 (mark_stack, valid_pointer_p, make_pure_string)
3427 (Fgarbage_collect, survives_gc_p, gc_sweep):
3428 Use bool for booleans, instead of int.
3429 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3430 Remove unused local.
3431 * alloc.c (PURE_POINTER_P):
3432 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3433 * editfns.c (Fformat):
3434 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3435 (Fdo_auto_save):
3436 * fns.c (sweep_weak_table):
3437 * lisp.h (suppress_checking, push_message, survives_gc_p)
3438 (make_pure_string, gc_in_progress, abort_on_gc):
3439 * lread.c (readchar, read1):
3440 * print.c (Fprin1_to_string):
3441 * xdisp.c (push_message):
3442 Use bool for booleans affected directly or indirectly by
3443 alloc.c's changes.
3444
3445 Make recently-introduced setters macros.
3446 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3447 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3448 (set_fontset_default, set_fontset_fallback): Rename from their
3449 upper-case counterparts, and make them functions rather than macros.
3450 This is more consistent with the other recently-introduced setters.
3451 These don't need to be inline, since they're local.
3452
3453 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3454
3455 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3456 the loop (Bug#12247).
3457
3458 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3459
3460 * lisp.h (vcopy): Use memcpy rather than our own loop.
3461 This fixes a performance regression introduced by the recent
3462 addition of vcopy. This means 'vcopy' will need to be modified
3463 for a copying collector, but that's OK. Also, tighten the
3464 checking in the assertion.
3465
3466 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3467
3468 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3469 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3470 non-base glyph for the width of the base character, according to
3471 what x_draw_composite_glyph_string_foreground expects.
3472 Generate WADJUST value according to composition_gstring_width's
3473 expectations, to produce correct width of the composed character.
3474 Reverse the sign of the DU offset produced by ScriptPlace.
3475
3476 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3477
3478 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3479
3480 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3481
3482 Avoid direct writes to contents member of struct Lisp_Vector.
3483 * lisp.h (vcopy): New function to copy data into vector.
3484 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3485 * fns.c (Ffillarray): Use ASET.
3486 * keyboard.c (timer_check_2): Use AREF and ASET.
3487 (append_tool_bar_item, Frecent_keys): Use vcopy.
3488 * lread.c (read_vector): Use ASET.
3489 * msdos.c (Frecent_doskeys): Use vcopy.
3490 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3491 (Finternal_merge_in_global_face): Use ASET and vcopy.
3492 * xfont.c (xfont_list_pattern): Likewise.
3493
3494 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3495
3496 * window.c (Fwindow_point): For the selected window always return
3497 the position of its buffer's point.
3498 (Fset_window_point): For the selected window always go in its
3499 buffer to the specified position.
3500
3501 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3502
3503 Setter macros for fontsets.
3504 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3505 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3506 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3507 Adjust users.
3508
3509 2012-08-20 Glenn Morris <rgm@gnu.org>
3510
3511 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3512 Don't assume that `ln -f' works.
3513
3514 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3515
3516 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3517 and later about non-assignments with no effect. See discussion at
3518 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3519 details.
3520
3521 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3522
3523 Inline setter functions for Lisp_Objects slots of struct specbinding.
3524 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3525 Adjust users.
3526
3527 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3528
3529 * window.c (select_window): Always make selected window's buffer
3530 current.
3531
3532 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3533
3534 Use AREF and ASET for docstrings of category tables.
3535 * category.h (CATEGORY_DOCSTRING): Use AREF.
3536 (SET_CATEGORY_DOCSTRING): Use ASET.
3537 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3538
3539 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3540
3541 Inline setter functions for hash table members.
3542 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3543 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3544 (set_hash_key_and_value, set_hash_index, set_hash_next)
3545 (set_hash_hash): New functions.
3546 * charset.c, fns.c: Adjust users.
3547
3548 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3549
3550 Inline getter and setter functions for per-buffer values.
3551 * buffer.h (per_buffer_default, set_per_buffer_default)
3552 (per_buffer_value, set_per_buffer_value): New functions.
3553 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3554 * buffer.c, data.c: Adjust users.
3555
3556 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3557
3558 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3559
3560 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3561
3562 Rely on <config.h> + <unistd.h> to declare 'environ',
3563 as gnulib does this if the system doesn't.
3564 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3565 Remove declaration. MS-Windows declares it on stdlib.h which is
3566 included by conf_post.h.
3567 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3568 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3569 * vm-limit.c: Include <unistd.h>, for 'environ'.
3570
3571 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3572 (start_of_data): Remove decl; mem-limits.h provides it.
3573
3574 * xdisp.c (handle_invisible_prop): Make it a bit faster
3575 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3576
3577 2012-08-19 Chong Yidong <cyd@gnu.org>
3578
3579 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3580 ends (Bug#3874).
3581
3582 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3583
3584 * .gdbinit: Use call instead of set when calling a function in the
3585 inferior.
3586
3587 * data.c (set_internal): Don't use set_blv_found.
3588 (Fkill_local_variable): Likewise.
3589
3590 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3591
3592 * nsfont.m (ns_ascii_average_width): Ensure the string
3593 ascii_printable is initialized with a null-terminated character
3594 array. Otherwise, it can contain undesired extra characters.
3595
3596 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3597
3598 port new setting code to Sun C 5.8 2005/10/13
3599 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3600 Return void, not Lisp_Object. Otherwise, the compiler
3601 complains about (A?B:C) where B is void and C is Lisp_Object
3602 when compiling CHAR_TABLE_SET, due to the recent change to
3603 the API of sub_char_table_set_contents.
3604
3605 2012-08-18 Chong Yidong <cyd@gnu.org>
3606
3607 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3608 for the string case (Bug#3874).
3609
3610 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3611
3612 * buffer.h (BSET): Remove (Bug#12215).
3613 Replace all uses with calls to new setter functions.
3614 (bset_bidi_paragraph_direction, bset_case_canon_table)
3615 (bset_case_eqv_table, bset_directory, bset_display_count)
3616 (bset_display_time, bset_downcase_table)
3617 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3618 (bset_last_selected_window, bset_local_var_alist)
3619 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3620 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3621 (bset_width_table):
3622 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3623 (bset_auto_fill_function, bset_auto_save_file_format)
3624 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3625 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3626 (bset_cache_long_line_scans, bset_case_fold_search)
3627 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3628 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3629 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3630 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3631 (bset_header_line_format, bset_indicate_buffer_boundaries)
3632 (bset_indicate_empty_lines, bset_invisibility_spec)
3633 (bset_left_fringe_width, bset_major_mode, bset_mark)
3634 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3635 (bset_name, bset_overwrite_mode, bset_pt_marker)
3636 (bset_right_fringe_width, bset_save_length)
3637 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3638 (bset_scroll_up_aggressively, bset_selective_display)
3639 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3640 (bset_word_wrap, bset_zv_marker):
3641 * category.c (bset_category_table):
3642 * syntax.c (bset_syntax_table):
3643 New setter functions.
3644
3645 * process.h (PSET): Remove (Bug#12215).
3646 Replace all uses with calls to new setter functions.
3647 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3648 (PROCESS_INLINE): New macro.
3649 (pset_childp): New setter function.
3650 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3651 * process.c (PROCESS_INLINE):
3652 Define to EXTERN_INLINE, so that the corresponding functions
3653 are compiled into code.
3654 (pset_buffer, pset_command, pset_decode_coding_system)
3655 (pset_decoding_buf, pset_encode_coding_system)
3656 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3657 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3658 (pset_type, pset_write_queue): New setter functions.
3659
3660 * window.h (WSET): Remove (Bug#12215).
3661 Replace all uses with calls to new setter functions.
3662 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3663 (WINDOW_INLINE): New macro.
3664 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3665 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3666 (wset_total_lines, wset_vertical_scroll_bar)
3667 (wset_window_end_pos, wset_window_end_valid)
3668 (wset_window_end_vpos): New setter functions.
3669 * window.c (WINDOW_INLINE):
3670 Define to EXTERN_INLINE, so that the corresponding functions
3671 are compiled into code.
3672 (wset_combination_limit, wset_dedicated, wset_display_table)
3673 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3674 (wset_new_normal, wset_new_total, wset_next_buffers)
3675 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3676 (wset_prev_buffers, wset_right_fringe_width)
3677 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3678 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3679 (wset_window_parameters):
3680 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3681 (wset_column_number_displayed, wset_region_showing):
3682 New setter functions.
3683
3684 * termhooks.h (TSET): Remove (Bug#12215).
3685 Replace all uses with calls to new setter functions.
3686 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3687 (TERMHOOKS_INLINE): New macro.
3688 (tset_charset_list, tset_selection_alist): New setter functions.
3689 * terminal.c (TERMHOOKS_INLINE):
3690 Define to EXTERN_INLINE, so that the corresponding functions
3691 are compiled into code.
3692 (tset_param_alist): New setter function.
3693
3694 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3695
3696 * keyboard.h (KSET): Remove (Bug#12215).
3697 Replace all uses with calls to new setter functions.
3698 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3699 (KEYBOARD_INLINE): New macro.
3700 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3701 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3702 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3703 New setter functions.
3704 * keyboard.c (KEYBOARD_INLINE):
3705 Define to EXTERN_INLINE, so that the corresponding functions
3706 are compiled into code.
3707 (kset_echo_string, kset_kbd_queue)
3708 (kset_keyboard_translate_table, kset_last_prefix_arg)
3709 (kset_last_repeatable_command, kset_local_function_key_map)
3710 (kset_overriding_terminal_local_map, kset_real_last_command)
3711 (kset_system_key_syms): New setter functions.
3712
3713 * frame.h (FSET): Remove (Bug#12215).
3714 Replace all uses with calls to new setter functions.
3715 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3716 (FRAME_INLINE): New macro.
3717 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3718 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3719 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3720 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3721 (fset_param_alist, fset_root_window, fset_scroll_bars)
3722 (fset_selected_window, fset_title, fset_tool_bar_items)
3723 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3724 * frame.c (FRAME_INLINE):
3725 Define to EXTERN_INLINE, so that the corresponding functions
3726 are compiled into code.
3727 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3728
3729 A few more naming-convention fixes for getters and setters.
3730 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3731 and rename from buffer_overlays_set_before.
3732 (set_buffer_overlays_after): Move here from buffer.h, and rename
3733 from buffer_overlays_set_after.
3734 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3735 All uses changed.
3736 (set_buffer_intervals): Rename from buffer_set_intervals.
3737 * intervals.c (set_interval_object): Move here from intervals.h,
3738 and rename from interval_set_object.
3739 (set_interval_left): Move here from intervals.h, and rename from
3740 interval_set_left.
3741 (set_interval_right): Move here from intervals.h, and rename from
3742 interval_set_right.
3743 (copy_interval_parent): Move here from intervals.h, and rename from
3744 interval_copy_parent.
3745 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3746 (set_interval_plist): Rename from interval_set_plist.
3747 Return void, not Lisp_Object, since no caller uses the result.
3748 * lisp.h (string_intervals): Rename from string_get_intervals.
3749 (set_string_intervals): Rename from string_set_intervals.
3750
3751 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3752 (set_char_table_contents): Rename from char_table_set_contents.
3753 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3754 All uses changed. See the end of
3755 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3756
3757 * lisp.h (CSET): Remove (Bug#12215).
3758 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3759 (set_char_table_purpose): New functions,
3760 replacing CSET. All uses changed. For example, replace
3761 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3762 "set_char_table_parent (char_table, parent);".
3763 The old version was confusing because it used the same name
3764 'parent' for two different things.
3765
3766 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3767
3768 Functions to get and set Lisp_Object fields of buffer-local variables.
3769 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3770 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3771 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3772 * data.c, eval.c, frame.c: Adjust users.
3773
3774 2012-08-17 Chong Yidong <cyd@gnu.org>
3775
3776 * xfaces.c (merge_face_vectors): If the target font specfies a
3777 font spec, make the font's attributes take precedence over
3778 directly-specified attributes.
3779 (merge_face_ref): Recognize :font.
3780
3781 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3782
3783 Do not use memcpy for copying intervals.
3784 * intervals.c (reproduce_interval): New function.
3785 (reproduce_tree, reproduce_tree_obj): Use it.
3786 (reproduce_tree_obj): Remove prototype.
3787
3788 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3789
3790 * lisp.h (duration_to_sec_usec): Remove unused decl.
3791
3792 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3793
3794 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3795 to an allocated instance of NSString, not to the class itself.
3796
3797 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3798
3799 * makefile.w32-in (C_CTYPE_H): New macro.
3800 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3801 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3802 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3803
3804 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 Use ASCII tests for character types.
3807 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3808 * xfns.c, xterm.c:
3809 Don't include <ctype.h>; was not needed.
3810 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3811 * sysdep.c, xfaces.c:
3812 Include <c-ctype.h> instead of <ctype.h>.
3813 * nsterm.m: Include <c-ctype.h>.
3814 * charset.c (read_hex):
3815 * doc.c (Fsnarf_documentation):
3816 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3817 (DRIVE_LETTER) [DOS_NT]:
3818 (Ffile_name_directory, Fexpand_file_name)
3819 (Fsubstitute_in_file_name):
3820 * font.c (font_parse_xlfd, font_parse_fcname):
3821 * frame.c (x_set_font_backend):
3822 * gtkutil.c (xg_get_font):
3823 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3824 * nsimage.m (hexchar):
3825 * nsterm.m (ns_xlfd_to_fontname):
3826 * sysdep.c (system_process_attributes):
3827 * xfaces.c (hash_string_case_insensitive):
3828 Use C-locale tests instead of locale-specific tests for character
3829 types, since we want the ASCII interpretation here, not the
3830 interpretation suitable for whatever happens to be the current locale.
3831
3832 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3833
3834 Consistently check windows for validity/liveness
3835 (Bug#11984, Bug#12025, Bug#12026).
3836 * lisp.h (CHECK_VALID_WINDOW): New macro.
3837 * window.c (decode_window): Rename to decode_live_window.
3838 (decode_valid_window, Fwindow_valid_p): New functions.
3839 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3840 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3841 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3842 (Fwindow_prev_sibling, Fwindow_combination_limit)
3843 (Fset_window_combination_limit, Fwindow_use_time)
3844 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3845 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3846 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3847 (Fwindow_hscroll, Fset_window_hscroll)
3848 (Fwindow_redisplay_end_trigger)
3849 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3850 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3851 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3852 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3853 (Fwindow_end, Fset_window_point, Fset_window_start)
3854 (Fpos_visible_in_window_p, Fwindow_line_height)
3855 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3856 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3857 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3858 (Fset_window_parameter, Fwindow_display_table)
3859 (Fset_window_display_table, Fdelete_other_windows_internal)
3860 (Fset_window_buffer, Fset_window_new_total)
3861 (Fset_window_new_normal, Fdelete_window_internal)
3862 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3863 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3864 (Fwindow_scroll_bars): Check whether argument window is a valid or
3865 live window. Update doc-strings.
3866 (syms_of_window): New symbol Qwindow_valid_p.
3867 * keyboard.c (Fposn_at_x_y): Check whether argument
3868 frame_or_window denotes a valid window.
3869
3870 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3871
3872 Fix previous char table change.
3873 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3874 * chartab.c (optimize_sub_char_table): Likewise.
3875
3876 2012-08-16 Chong Yidong <cyd@gnu.org>
3877
3878 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3879
3880 * xfont.c (xfont_open):
3881 * xftfont.c (xftfont_open): Set the font's max_width field.
3882
3883 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3884 min_width to space_width and average_width to the average over
3885 printable ASCII characters.
3886 (ns_char_width): Code cleanup.
3887 (ns_ascii_average_width): New utility function.
3888
3889 * font.h (struct font): Update comments.
3890
3891 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3892
3893 Simple interface to set Lisp_Object fields of character tables.
3894 * lisp.h (CSET): New macro.
3895 (char_table_set_extras, char_table_set_contents)
3896 (sub_char_table_set_contents): New function.
3897 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3898 * syntax.c: Adjust users.
3899
3900 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3901
3902 * eval.c (eval_sub): Bind lexical-binding.
3903 * lread.c (Qlexical_binding): Make non-static.
3904
3905 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3906
3907 * nsmenu.m (popupSession): Remove.
3908 (pop_down_menu): Remove endModalSession.
3909 (timeout_handler:): New method.
3910 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3911 Call runModalForWindow. Check timer_fired when it returns.
3912 If not set, cancel timer and break out of loop.
3913 Otherwise loop again, with a new timeout.
3914
3915 * nsterm.m: Include fcntl.h if present.
3916 (fd_entry, t_readfds, inNsSelect): Remove.
3917 (select_writefds, select_valid, select_timeout, selfds)
3918 (select_mutex, apploopnr): Add.
3919 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3920 Otherwise call kbd_buffer_store_event.
3921 (ns_send_appdefined): Remove release of fd_entry.
3922 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3923 Increment and decrement apploopnr.
3924 (ns_select): If no file descriptors, just do a NSTimer.
3925 Otherwise copy read/write masks and start select thread (fd_handler).
3926 Start main loop and wait for application defined event.
3927 Inform select thread to stop selecting after main loop is exited.
3928 (ns_term_init): Create selfds pipe and set non-blocking.
3929 Initialize select_mutex. Start the select thread (fd_handler).
3930 (fd_handler:): Loop forever, wait for info from the main thread
3931 to either start or stop selecting. When select returns, send
3932 and appdefined event.
3933 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3934 If not call kbd_buffer_store_event.
3935
3936 * nsterm.h (EmacsApp): fd_handler takes id argument.
3937 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3938
3939 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3940
3941 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3942
3943 * region-cache.c (move_cache_gap): Update gap_len using the actual
3944 growth of the boundaries array. Do not change cache_len.
3945 (Bug#12196)
3946
3947 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3948
3949 Generalize and cleanup font subsystem checks.
3950 * font.h (FONT_DEBUG, font_assert): Remove.
3951 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3952 Change font_assert to eassert. Use eassert where appropriate.
3953
3954 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3955
3956 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3957
3958 2012-08-15 Chong Yidong <cyd@gnu.org>
3959
3960 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3961 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3962 extract the font descriptor instead of just the font name.
3963 In that case, return a font spec instead of a string.
3964 (x_last_font_name): Move to this file from xfns.c.
3965
3966 * xfns.c (Fx_select_font): The return value can also be a font
3967 spec. Move x_last_font_name management to gtkutil.c.
3968
3969 * xfaces.c: Make font weight and style symbols non-static.
3970
3971 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3972
3973 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3974 (bug#12117).
3975
3976 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3977
3978 * alloc.c (Fgarbage_collect): Use plural form consistently.
3979
3980 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3981
3982 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3983 iteration through the command loop. Fixes a problem whereby mouse
3984 movements are ignored until the first mouse click.
3985
3986 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3987
3988 Use bool, not int, for Lisp booleans.
3989 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3990 makes Emacs a bit smaller and presumably a bit faster.
3991 * lisp.h: Include <stdbool.h>.
3992 (struct Lisp_Boolfwd, defvar_bool):
3993 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3994 * regex.c [!emacs]: Include <stdbool.h>.
3995 (false, true): Remove; <stdbool.h> does this for us now.
3996
3997 2012-08-14 Chong Yidong <cyd@gnu.org>
3998
3999 * character.c (Fcharacterp): Doc fix (Bug#12076).
4000
4001 * data.c (Findirect_variable): Doc fix (Bug#11040).
4002
4003 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4004
4005 * editfns.c (Fformat): Doc fix (Bug#12059).
4006 (Fsave_current_buffer): Doc fix (Bug#11542).
4007
4008 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4009
4010 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4011 (bug#12022).
4012
4013 2012-08-14 Martin Rudalics <rudalics@gmx.at>
4014
4015 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4016 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4017 * minibuf.c (choose_minibuf_frame, read_minibuf):
4018 * w32fns.c (x_create_tip_frame):
4019 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4020 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4021
4022 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4023
4024 * intervals.c (offset_intervals): Remove obsolete comment.
4025
4026 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4027
4028 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4029
4030 2012-08-14 Gergely Risko <gergely@risko.hu>
4031
4032 * coding.c (decode_coding): Record buffer modification before
4033 disabling undo_list (Bug#11773).
4034
4035 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4036
4037 Revert and cleanup some recent overlay changes.
4038 * buffer.h (enum overlay_type): Remove.
4039 (buffer_get_overlays, buffer_set_overlays): Likewise.
4040 (buffer_set_overlays_before, buffer_set_overlays_after):
4041 New function. Adjust users.
4042 (unchain_both): Add eassert.
4043
4044 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4045
4046 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4047
4048 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4049
4050 * gtkutil.c (xg_mark_data): Don't assume C99.
4051
4052 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4053
4054 * gtkutil.c (xg_frame_tb_info): New struct.
4055 (TB_INFO_KEY): New define.
4056 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4057 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4058 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4059 if not present.
4060 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4061 is up to date. Otherwise store new data.
4062 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4063
4064 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4065
4066 Use KSET for write access to Lisp_Object members of struct kboard.
4067 * keyboard.h (KSET): New macro.
4068 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4069 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4070 * xterm.c: Adjust users.
4071
4072 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4073
4074 Use BSET for write access to Lisp_Object members of struct buffer.
4075 * buffer.h (BSET): New macro.
4076 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4077 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4078 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4079 * window.c, xdisp.c, xfns.c: Adjust users.
4080
4081 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4082
4083 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4084
4085 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4086
4087 * nsterm.m (not_in_argv): New function.
4088 (application:openFile, application:openTempFile:):
4089 (application:openFileWithoutUI:, application:openFiles:): Open file
4090 if not_in_argv returns non-zero (bug#12171).
4091
4092 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4093 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4094 Define for Gtk+ versions less than 3.2.
4095 (xg_get_font_name): Use those functions/macros here.
4096 Reported by Frans Oilinki <moilinki@gmail.com>.
4097
4098 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4099
4100 * unexmacosx.c (copy_data_segment): Copy initialized data in
4101 statically linked libraries from input file rather than memory.
4102
4103 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4104 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4105 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4106
4107 2012-08-10 Glenn Morris <rgm@gnu.org>
4108
4109 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4110 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4111
4112 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4113
4114 Fix last change to allow compilation with low optimization levels.
4115 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4116 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4117
4118 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4119
4120 Use common inline syntax in intervals.h.
4121 * intervals.h (INTERVALS_INLINE): New macro.
4122 Change all users from LISP_INLINE.
4123
4124 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4125
4126 Define Qnone once for all platforms.
4127 * frame.c (Qnone): Define here.
4128 (syms_of_frame): DEFSYM it.
4129 * lisp.h (Qnone): New declaration.
4130 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4131 * xfns.c: Remove duplication. Adjust users.
4132
4133 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4134
4135 Remove unused macros from intervals.h.
4136 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4137 * intervals.c: Adjust comment.
4138
4139 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4140
4141 * w32fns.c <w32_unicode_gui>: New static variable.
4142 (globals_of_w32fns): Initialize it according to os_subtype.
4143 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4144 testing os_subtype.
4145
4146 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4147 Eli Zaretskii <eliz@gnu.org>
4148
4149 Fix bug #10299 with Unicode characters sent by customized
4150 keyboards created by MSKLC.
4151 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4152 (w32_init_class): Use it to initialize the Emacs class with either
4153 ANSI or Unicode API calls.
4154 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4155 later.
4156 (w32_wnd_proc): If the character code sent by WM_CHAR or
4157 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4158 original message. Call DefWindowProcW on NT and later.
4159
4160 2012-08-10 Glenn Morris <rgm@gnu.org>
4161
4162 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4163
4164 * lisp.h (DIRECTORY_SEP): Let configure set it.
4165
4166 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4167
4168 Use TSET for write access to Lisp_Object slots of struct terminal.
4169 * termhooks.h (TSET): New macro.
4170 * coding.c, terminal.c, xselect.c: Adjust users.
4171
4172 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4173
4174 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4175 the failing expression, include them in the error message.
4176 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4177 * lisp.h (internal_condition_case_n): Update declaration.
4178
4179 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4180
4181 Inline functions to examine and change buffer overlays.
4182 * buffer.c (unchain_both): New function.
4183 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4184 (buffer_has_overlays): New function.
4185 (enum overlay_type): New enum.
4186 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4187 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4188
4189 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4190
4191 Inline functions to examine and change buffer intervals.
4192 * alloc.c (mark_interval_tree): Remove.
4193 (MARK_INTERVAL_TREE): Simplify.
4194 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4195 * intervals.c (buffer_balance_intervals): New function.
4196 (graft_intervals_into_buffer): Adjust indentation.
4197 (set_intervals_multibyte): Simplify.
4198 * buffer.h (BUF_INTERVALS): Remove.
4199 (buffer_get_intervals, buffer_set_intervals): New function.
4200 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4201 * intervals.c, textprop.c: Adjust users.
4202
4203 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4204
4205 Inline functions to examine and change string intervals.
4206 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4207 (string_get_intervals, string_set_intervals): New function.
4208 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4209 * lread.c, print.c, textprop.c: Adjust users.
4210
4211 2012-08-08 Glenn Morris <rgm@gnu.org>
4212
4213 * lisp.mk (lisp): Remove language/persian.elc.
4214
4215 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 Cleanup intervals.
4218 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4219 (NULL_INTERVAL_P): Likewise. Adjust users.
4220 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4221 Adjust comment. Move under #if 0.
4222 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4223 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4224
4225 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4226
4227 Check total length of intervals with eassert.
4228 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4229 * intervals.c: Change all users to eassert.
4230
4231 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4232
4233 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4234 Rename fields to match removal of FGET and WGET and disuse of
4235 INTERNAL_FIELD in Lisp_Cons.
4236
4237 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4238
4239 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4240 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4241 name since all xname users are fixed long time ago. Do not
4242 use INTERNAL_FIELD.
4243 (set_symbol_name, set_symbol_function, set_symbol_plist):
4244 (set_symbol_next, set_overlay_plist): New function.
4245 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4246 (struct Lisp_Overlay): Likewise.
4247 (CVAR, MVAR, SVAR): Remove.
4248 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4249 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4250 * xterm.c: Adjust users.
4251 * .gdbinit: Change to use name field of struct Lisp_Symbol
4252 where appropriate.
4253
4254 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4255
4256 Basic functions to set Lisp_Object and pointer slots of intervals.
4257 * intervals.h (interval_set_parent, interval_set_object):
4258 (interval_set_left, interval_set_right, interval_set_plist):
4259 (interval_copy_parent): New function.
4260 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4261 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4262 Adjust indentation.
4263 (INTERVAL_SIZE): Remove. Adjust users.
4264 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4265
4266 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4267
4268 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4269 * process.h (PGET): Remove.
4270 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4271 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4272
4273 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4274
4275 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4276 * window.h (WGET): Remove.
4277 (struct window): Do not use INTERNAL_FIELD.
4278 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4279 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4280 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4281 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4282 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4283 Adjust users.
4284
4285 2012-08-07 Chong Yidong <cyd@gnu.org>
4286
4287 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4288 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4289 (Fdelete_window_internal): Signal an error if the window is not on
4290 a live frame (Bug#12025).
4291
4292 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4293
4294 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4295 * frame.h (FGET): Remove.
4296 (struct frame): Do not use INTERNAL_FIELD.
4297 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4298 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4299 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4300 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4301
4302 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4303
4304 * w32.c: Silence compiler warnings.
4305 (map_w32_filename): Remove unused variable `is_fat'.
4306 (chase_symlinks): Add parentheses around expression.
4307
4308 2012-08-06 Glenn Morris <rgm@gnu.org>
4309
4310 * sysdep.c: Respect BROKEN_GETWD.
4311
4312 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4313 Let configure handle it.
4314 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4315
4316 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4317
4318 Use GCALIGNMENT where appropriate.
4319 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4320 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4321 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4322
4323 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4324
4325 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4326 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4327
4328 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4329
4330 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4331 that should be sufficient for everyone.
4332
4333 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4334
4335 * keyboard.c (timer_check_2): Add break so timer_check returns next
4336 timeout.
4337
4338 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4339
4340 Fix Windows build errors introduced after converting to WGET and WSET.
4341 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4342 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4343
4344 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4345
4346 * nsterm.m (ns_frame_rehighlight): Use FSET.
4347
4348 * nsmenu.m (ns_update_menubar): Use FSET.
4349
4350 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4351
4352 Separate read and write access to Lisp_Object slots of Lisp_Process.
4353 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4354 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4355
4356 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4357
4358 Separate read and write access to Lisp_Object slots of struct window.
4359 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4360 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4361 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4362 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4363 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4364 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4365 Adjust users.
4366
4367 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4368
4369 Fix Windows build errors introduced after converting to FGET and FSET.
4370 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4371 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4372 (w32_judge_scroll_bars): Change to use FSET.
4373 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4374
4375 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4376
4377 Fix replacement typo.
4378 * window.c (replace_window): Set root_window instead of
4379 selected_window. This fixes a total window subsystem
4380 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4381
4382 2012-08-06 Glenn Morris <rgm@gnu.org>
4383
4384 * lisp.mk (lisp): Add language/persian.elc.
4385
4386 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4387
4388 Separate read and write access to Lisp_Object slots of struct frame.
4389 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4390 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4391 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4392 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4393 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4394
4395 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4396
4397 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4398
4399 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4400
4401 Generalize common compile-time constants.
4402 * lisp.h (header_size, bool_header_size, word_size): Now here.
4403 (struct Lisp_Vector): Add comment.
4404 (struct Lisp_Bool_Vector): Move up to define handy constants.
4405 (VECSIZE, PSEUDOVECSIZE): Simplify.
4406 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4407 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4408 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4409 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4410 * xfont.c, xmenu.c: Use word_size where appropriate.
4411
4412 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4413
4414 * search.c (Freplace_match): Treat \? in the replacement text
4415 literally (Bug#8161).
4416
4417 2012-08-05 Chong Yidong <cyd@gnu.org>
4418
4419 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4420 * frame.c (Vdelete_frame_functions):
4421 * emacs.c (Vkill_emacs_hook): Doc fix.
4422
4423 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4424
4425 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4426 --with-x-toolkit=no builds.
4427 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4428
4429 2012-08-04 Chong Yidong <cyd@gnu.org>
4430
4431 * syntax.c (Fmodify_syntax_entry): Doc fix.
4432
4433 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4434
4435 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4436 * w32.c (init_environment): Change the default values of many
4437 environment variables in dflt_envvars[] to NULL, to avoid pushing
4438 them into environment when they were not already defined.
4439 Remove the code that deletes site-lisp subdirectories from the default
4440 value of EMACSLOADPATH, as it is no longer needed.
4441 (check_windows_init_file): Now external, not static.
4442 Use Vload_path as is, without adding anything, as this function is now
4443 called when Vload_path is already set up.
4444
4445 * w32.h (check_windows_init_file): Add prototype.
4446
4447 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4448 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4449 compatibility with Posix platforms.
4450 (main): Move the call to check_windows_init_file to here from
4451 w32.c.
4452 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4453 any, in the DEFALT argument into the root of the Emacs build or
4454 installation tree, as appropriate.
4455
4456 * callproc.c (init_callproc_1): Call decode_env_path instead of
4457 doing its equivalent by hand.
4458 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4459 the code that sets Vexec_path run on MS-Windows.
4460
4461 * lread.c (init_lread): Add comments to #ifdef's.
4462
4463 * msdos.c (dos_set_window_size, IT_update_begin)
4464 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4465 instead of direct references.
4466
4467 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4468
4469 Export DEFAULT_REHASH_* to GDB.
4470 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4471 Now constants, not macros.
4472
4473 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4474
4475 Remove unnecessary casts involving pointers.
4476 These casts are no longer needed now that we assume C89 or later,
4477 since they involve casting to or from void *.
4478 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4479 (make_pure_float, make_pure_vector):
4480 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4481 * macros.c (Fstart_kbd_macro):
4482 * menu.c (find_and_return_menu_selection):
4483 * minibuf.c (read_minibuf_noninteractive):
4484 * sysdep.c (closedir):
4485 * xdisp.c (x_produce_glyphs):
4486 * xfaces.c (compare_fonts_by_sort_order):
4487 * xfns.c (x_real_positions, select_visual):
4488 * xselect.c (x_stop_queuing_selection_requests)
4489 (x_get_window_property, x_get_window_property_as_lisp_data):
4490 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4491 Remove unnecessary pointer casts.
4492 * alloc.c (record_xmalloc): New function.
4493 * lisp.h (record_xmalloc): New decl.
4494 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4495 more like a function. This is because the pointer cast is not
4496 needed. All uses changed.
4497 * print.c (print_string, print_error_message): Avoid length recalc.
4498
4499 Improve fix for macroexp crash with debugging (Bug#12118).
4500 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4501 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4502 not supposed to be invoked from the garbage collector.
4503 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4504 (gc_aset): New function, which is like ASET but can be
4505 used in the garbage collector.
4506 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4507 (set_hash_index): Use it instead of ASET.
4508
4509 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4510
4511 Support symlinks on latest versions of MS-Windows.
4512 * w32.c: Include winioctl.h and aclapi.h.
4513 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4514 (revert_to_self): Forward declarations of static functions.
4515 <static BOOL g_b_init_get_security_info>:
4516 <g_b_init_create_symbolic_link>: New static flags.
4517 (globals_of_w32): Initialize them to zero.
4518 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4519 (map_w32_filename): Improve commentary. Simplify switch.
4520 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4521 headers (most versions of MinGW w32api don't).
4522 (get_security_info, create_symbolic_link)
4523 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4524 New functions.
4525 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4526 in the argument file name.
4527 (sys_access): Call unc_volume_file_attributes only if
4528 GetFileAttributes fails with network-related error codes.
4529 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4530 have the required privileges.
4531 (get_file_security_desc_by_name): Rename from
4532 get_file_security_desc.
4533 (stat_worker): New function, with most of the guts of 'stat', and
4534 with addition of handling of symlinks and support for 'lstat'.
4535 If possible, get file's attributes and security information by
4536 handle, not by name. Produce S_IFLNK bit for symlinks, when
4537 called from 'lstat'.
4538 (stat, lstat): New functions, call 'stat_worker'.
4539 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4540 symlinks when the underlying filesystem supports them.
4541
4542 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4543
4544 Fix macroexp crash on Windows with debugging (Bug#12118).
4545 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4546 checking subscripts; problem introduced with the recent
4547 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4548 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4549 since it's used in non-static inline functions now.
4550
4551 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4552 Don't assume buffer size fits in 'int'. Remove unused local.
4553
4554 Use C99-style 'extern inline' if available.
4555 * buffer.h (BUFFER_INLINE):
4556 * category.h (CATEGORY_INLINE):
4557 * character.h (CHARACTER_INLINE):
4558 * charset.h (CHARSET_INLINE):
4559 * composite.h (COMPOSITE_INLINE):
4560 * dispextern.h (DISPEXTERN_INLINE):
4561 * lisp.h (LISP_INLINE):
4562 * systime.h (SYSTIME_INLINE):
4563 New macro, replacing 'static inline' in this header.
4564 * buffer.h, category.h, character.h, charset.h, composite.h:
4565 * dispextern.h, lisp.h, systime.h:
4566 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4567 * alloc.c (LISP_INLINE):
4568 * buffer.c (BUFFER_INLINE):
4569 * category.c (CATEGORY_INLINE):
4570 * character.c (CHARACTER_INLINE):
4571 * charset.c (CHARSET_INLINE):
4572 * composite.c (COMPOSITE_INLINE):
4573 * dispnew.c (DISPEXTERN_INLINE):
4574 * sysdep.c (SYSTIME_INLINE):
4575 Define to EXTERN_INLINE, so that the corresponding functions
4576 are compiled into code.
4577 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4578 (INLINE_HEADER_END): New macros.
4579 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4580 since it's used in non-static inline functions now.
4581 (VALMASK) [!USE_LSB_TAG]: Likewise.
4582
4583 2012-08-02 Glenn Morris <rgm@gnu.org>
4584
4585 * s/: Remove empty directory.
4586
4587 * s/ms-w32.h: Move to ../nt/inc.
4588 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4589 Update for new ms-w32.h location.
4590
4591 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4592
4593 Port to Solaris 8.
4594 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4595
4596 2012-08-02 Glenn Morris <rgm@gnu.org>
4597
4598 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4599 hard-coding the path separator.
4600
4601 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4604 This how ASET and AREF are supposed to work, and makes
4605 it easier to think about future improvements. See
4606 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4607 * charset.h (set_charset_attr): New function.
4608 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4609 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4610 (aref_addr): New function. All uses of &AREF(...) changed.
4611 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4612 (set_hash_index): New functions. All lvalue-style uses of
4613 HASH_KEY etc. changed.
4614 * keyboard.c (set_prop): New function. All lvalue-style uses
4615 of PROP changed.
4616
4617 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4618
4619 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4620 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4621 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4622 * nsfns.m (ns_set_name_as_filename): Likewise.
4623 * nsmenu.m (ns_update_menubar): Likewise.
4624 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4625
4626 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4627
4628 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4629 Adapt to latest changes in field names of the corresponding Lisp
4630 objects.
4631
4632 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4633
4634 2012-08-01 Glenn Morris <rgm@gnu.org>
4635
4636 * s/msdos.h: Remove file.
4637 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4638 * Makefile.in (S_FILE): Remove.
4639 (config_h): Remove S_FILE.
4640
4641 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4642
4643 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4644 Remove; moved to nt/config.nt.
4645
4646 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4647
4648 Use INTERNAL_FIELD for conses and overlays.
4649 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4650 Remove obsolete comment.
4651 (MVAR): New macro.
4652 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4653 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4654
4655 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4656
4657 Use INTERNAL_FIELD for symbols.
4658 * lisp.h (SVAR): New macro. Adjust users.
4659 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4660 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4661
4662 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4663
4664 Use INTERNAL_FIELD for processes.
4665 * process.h (PVAR): New macro. Adjust style.
4666 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4667 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4668
4669 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4670
4671 Use INTERNAL_FIELD for windows.
4672 * window.h (WVAR): New macro.
4673 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4674 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4675 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4676 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4677 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4678 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4679
4680 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4681
4682 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4683
4684 2012-08-01 Glenn Morris <rgm@gnu.org>
4685
4686 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4687 Move to configure.ac.
4688
4689 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4690
4691 * makefile.w32-in (CONFIG_H): Update dependencies.
4692 (CONF_POST_H): New macro.
4693
4694 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4695
4696 2012-07-31 Glenn Morris <rgm@gnu.org>
4697
4698 * Makefile.in (S_FILE): No longer set by configure.
4699
4700 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4701 is available.
4702 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4703
4704 * process.h (NULL_DEVICE):
4705 * emacs.c (SEPCHAR):
4706 * editfns.c (USER_FULL_NAME): Let configure set them.
4707
4708 * s/README, s/template.h: Remove files.
4709
4710 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4711
4712 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4713 Move to configure.ac.
4714
4715 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4716
4717 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4718 resulting renaming of 'struct frame' members.
4719
4720 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4721
4722 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4723 after introduction of FVAR.
4724
4725 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4726
4727 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4728
4729 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4730 instead of compositeToPoint.
4731 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4732
4733 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4734
4735 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4736
4737 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4738 * lisp.h (INTERNAL_FIELD): New macro.
4739 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4740 (BVAR): Change to use INTERNAL_FIELD.
4741 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4742 (KVAR): Change to use INTERNAL_FIELD.
4743 * frame.h (FVAR): New macro.
4744 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4745 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4746 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4747 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4748 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4749
4750 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4751
4752 Miscellaneous fixes for non-default X toolkits.
4753 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4754 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4755 Move under #ifdef USE_LUCID.
4756 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4757 definition and usage to avoid warnings.
4758
4759 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4760
4761 * nsterm.m (openFiles): Fix previous checkin.
4762
4763 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4764
4765 * indent.c (compute_motion): Remove unused local.
4766
4767 2012-07-31 Glenn Morris <rgm@gnu.org>
4768
4769 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4770
4771 * conf_post.h [USG5_4]:
4772 Move remaining contents of s/usg5-4-common.h here.
4773 * s/usg5-4-common.h: Remove file.
4774
4775 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4776 * s/irix6-5.h: Remove file.
4777
4778 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4779 * s/darwin.h: Remove file.
4780
4781 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4782 * s/hpux10-20.h: Remove file, which is now empty.
4783
4784 2012-07-30 Glenn Morris <rgm@gnu.org>
4785
4786 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4787 * Makefile.in (config_h): Add conf_post.h.
4788 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4789
4790 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4791
4792 * nsterm.m (ns_do_open_file): New variable.
4793 (ns_term_init): Set ns_do_open_file to YES after run returns.
4794 (openFile, openTempFile, openFileWithoutUI, openFiles):
4795 Open files only if ns_do_open_file.
4796
4797 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4798
4799 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4800 This no-op macro hasn't been needed for many years.
4801 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4802
4803 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4804 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4805 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4806 gdb_make_enums_visible.
4807 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4808 (DIRECTORY_SEP): Now a constant, not a macro.
4809
4810 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4811
4812 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4813 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4814
4815 * w32term.c <w32_keyboard_codepage>: Renamed from
4816 keyboard_codepage and now external. All users changed.
4817
4818 * w32term.h: Add declaration of w32_keyboard_codepage.
4819
4820 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4821 the codepage to translate keys to Unicode. If this argument is
4822 -1, use the value returned by GetConsoleCP. All callers changed.
4823
4824 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4825
4826 Update .PHONY listings in makefiles.
4827 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4828 bootstrap-clean, distclean, maintainer-clean, versioclean,
4829 extraclean, frc.
4830
4831 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4832 This is a bit clearer. Fix some commentary typos.
4833
4834 2012-07-30 Glenn Morris <rgm@gnu.org>
4835
4836 * s/netbsd.h: Let configure include signal.h if needed.
4837 Remove file, which is now empty.
4838
4839 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4840 Let configure set them.
4841 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4842 No more need to undefine.
4843
4844 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4845
4846 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4847 non-single-byte char when adding meta modifier. (Bug#12090)
4848
4849 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4850
4851 Convert safe_call to use variable number of arguments.
4852 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4853 (safe_call2): Fix comment.
4854 * lisp.h (safe_call): Adjust prototype.
4855 * coding.c (encode_coding_object): Change to use safe_call2.
4856 * xfaces.c (merge_face_heights): Change to use safe_call1.
4857
4858 2012-07-30 Glenn Morris <rgm@gnu.org>
4859
4860 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4861 does that unconditionally. Remove file, which is now empty.
4862
4863 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4864 Remove empty files.
4865
4866 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4867
4868 Export to GDB most of lisp.h's remaining object-like macros.
4869 * lisp.h (min, max): Move earlier, because they're used earlier now.
4870 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4871 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4872 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4873 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4874 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4875 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4876 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4877 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4878 Now constants, for GDB. They need not be macros.
4879 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4880 Now constants, for GDB, as well as macros, for static initializers.
4881 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4882 Move to after the definition of struct Lisp_Char_Table,
4883 since the former now needs that type defined.
4884 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4885 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4886 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4887 New enums, for gdb_make_enums_visible.
4888 (GLYPH_MODE_LINE_FACE): Remove; unused.
4889 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4890 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4891 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4892 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4893 enum maxargs, enum MAX_ALLOCA.
4894 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4895 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4896 no longer needed, now that they are done in lisp.h.
4897
4898 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4899
4900 Cleanup string bytes checking.
4901 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4902 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4903 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4904 (check_sblock, compact_small_strings): Simplify.
4905
4906 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4907
4908 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4909 These macros are confusing and no longer need to be defined, as
4910 the enum values now suffice. All uses replaced with definiens.
4911 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4912
4913 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4914
4915 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4916 ($(BLD)/w32console.$(O)): Update dependencies.
4917
4918 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4919
4920 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4921 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4922 time. Adjust users.
4923 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4924
4925 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4926
4927 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4928 setting sitelisp (Bug#12010).
4929
4930 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4931
4932 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4933
4934 * w32heap.c (cache_system_info):
4935 * w32.c (sys_rename):
4936 * w32proc.c (find_child_console, sys_kill): All users changed.
4937
4938 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4939
4940 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4941
4942 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4943
4944 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4945
4946 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4947
4948 Cleanup statistics calculation in Fgarbage_collect.
4949 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4950 Fix zombies percentage calculation. Simplify elapsed time calculation.
4951
4952 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4953
4954 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4955 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4956 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4957 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4958 (replace_range, replace_range_2, del_range_2): Change to eassert.
4959 * marker.c (byte_char_debug_check): Adjust style.
4960
4961 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4962
4963 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4964 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4965 long-ago-commented-out code that talks about "WIN32".
4966 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4967 All uses changed.
4968
4969 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4970
4971 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4972 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4973 Simplify by using alignof.
4974 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4975 * lisp.h: Include <stdalign.h>.
4976 (GCALIGNMENT): New macro and constant.
4977 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4978 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4979 (stdalign): New macro, if not already defined.
4980
4981 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4982
4983 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4984 * w32inevt.c: Include w32inevt.h.
4985 (w32_read_console_input): New inline function, calls either
4986 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4987 w32_console_unicode_input.
4988 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4989 (w32_kbd_patch_key, key_event): Use the codepage returned by
4990 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4991 (key_event): use uChar.UnicodeChar only if
4992 w32_console_unicode_input is non-zero.
4993
4994 * w32console.c: Include w32heap.h.
4995 <w32_console_unicode_input>: New global variable.
4996 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4997 family of Windows, zero otherwise.
4998
4999 * w32inevt.h: Declare w32_console_unicode_input.
5000
5001 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5002 --without-x. (Bug#11742)
5003
5004 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5005
5006 Adjust GDB to reflect pvec_type changes (Bug#12036).
5007 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
5008 2012-07-04 changes to pseudovector representation.
5009 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
5010
5011 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
5012
5013 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5014 bus address.
5015 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5016
5017 2012-07-27 Eli Zaretskii <eliz@gnu.org>
5018
5019 * alloc.c (listn): Fix the order the arguments are consed onto the
5020 list.
5021
5022 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5023 enumeration constants, as PURE and HEAP are too general, and clash
5024 with other headers and sources, such as gmalloc.c and the
5025 MS-Windows system headers. All users changed.
5026
5027 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5028
5029 Revert last save_excursion_save and save_excursion_restore changes.
5030 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5031 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5032
5033 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5034
5035 Fix recently-introduced typos in Windows port.
5036 Reported by Martin Rudalics <rudalics@gmx.at>.
5037 * w32.c (init_environment): Replace comma with semicolon.
5038 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
5039
5040 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5041
5042 Improve GDB symbol export (Bug#12036).
5043 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5044 arms of an 'if', not using conditional expressions; otherwise GDB
5045 complains about the types in the unevaluated arm when the argument
5046 is an integer literal.
5047 (xgetint): Simplify expression.
5048 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5049 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5050 Zaretskii in <http://bugs.gnu.org/12036#13>.
5051 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5052 needed now that we have gdb_make_enums_visible.
5053 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5054 (enum enum_USE_LSB_TAG):
5055 New enum types, packaging up enums that need to be exported to GDB.
5056
5057 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5058
5059 Utility function to make a list from specified amount of objects.
5060 * lisp.h (enum constype): New datatype.
5061 (listn): New prototype.
5062 * alloc.c (listn): New function.
5063 (Fmemory_use_count, syms_of_alloc): Use it.
5064 * buffer.c (syms_of_buffer): Likewise.
5065 * callint.c (syms_of_callint): Likewise.
5066 * charset.c (define_charset_internal): Likewise.
5067 * coding.c (syms_of_coding): Likewise.
5068 * keymap.c (syms_of_keymap): Likewise.
5069 * search.c (syms_of_search): Likewise.
5070 * syntax.c (syms_of_syntax): Likewise.
5071 * w32.c (init_environment): Likewise.
5072 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5073 * xdisp.c (syms_of_xdisp): Likewise.
5074 * xfns.c (syms_of_xfns): Likewise.
5075
5076 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5077
5078 Fast save_excursion_save and save_excursion_restore.
5079 * lisp.h (struct Lisp_Excursion): New data type.
5080 (PVEC_EXCURSION): New pseudovector type.
5081 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5082 to deal with it. Adjust comments.
5083 (init_marker, attach_marker): New prototype.
5084 (unchain_marker): Adjust prototype.
5085 * marker.c (attach_marker): Change to global.
5086 (init_marker): New function.
5087 * alloc.c (Fmake_marker, build_marker): Use it.
5088 (build_marker): More easserts.
5089 (mark_object): Handle struct Lisp_Excursion.
5090 * editfns.c (save_excursion_save, save_excursion_restore):
5091 Reimplement to use struct Lisp_Excursion. Add comments.
5092
5093 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5094
5095 Fix export of symbols to GDB (Bug#12036).
5096 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5097 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5098 emacs.c, as this is a more-suitable home. Had this been done earlier
5099 the fix for 12036 would have avoided some of the problems noted in
5100 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5101 would have been more obvious.
5102 * emacs.c: Do not include <verify.h>; no longer needed.
5103 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5104 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5105 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5106 Remove; now done in lisp.h.
5107 * lisp.h (PUBLISH_TO_GDB): New macro.
5108 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5109 (DATA_SEG_BITS): Use it.
5110 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5111 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5112 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5113 not be usable in #if. This simplifies things.
5114
5115 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5116
5117 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5118
5119 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 Simplify export of symbols to GDB (Bug#12036).
5122 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5123 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5124 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5125 Adjust to changes in lisp.h and emacs.c, by using
5126 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5127 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5128 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5129 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5130 instead of gdb_valbits.
5131 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5132 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5133 instead of gdb_array_mark_flag.
5134 (xboolvector): Get size from $->size, not $->header.size.
5135 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5136 (xreload, hook-run, hookpost-run): Remove.
5137 * emacs.c: Include <verify.h>.
5138 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5139 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5140 Remove.
5141 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5142 (gdb_USE_LSB_TAG): New enum constants.
5143 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5144 Also define these as enum constants, so they're visible to GDB.
5145 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5146 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5147 as constants, so they're visible to GDB.
5148 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5149 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5150 Now enum constants, not macros, so they're visible to GDB.
5151 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5152 more convenient now. All uses changed.
5153 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5154 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5155
5156 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5157
5158 Explicitly free restriction data that are not needed anymore.
5159 * editfns.c (save_restriction_restore): Free restriction data.
5160
5161 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5162
5163 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5164 add argument, tune behavior, and adjust all callers.
5165
5166 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5167
5168 Use typedef for EMACS_INT, EMACS_UINT.
5169 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5170 than macros. This simplifies debugging in the usual case, since
5171 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5172 and it allows expressions involving EMACS_INT casts.
5173 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5174
5175 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5176
5177 * nsterm.m (ns_read_socket): Return early if there is a modal
5178 window (Bug#12043).
5179
5180 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5181
5182 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5183 that FOCUS-FRAME can be omitted.
5184
5185 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5186
5187 Adjust buffer text indirection counters at the end of Fkill_buffer.
5188 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5189 buffer is definitely dead. This should really fix an issue reported
5190 by Christoph Scholtes again. (Bug#12007).
5191 (init_buffer_once): Initialize indirection counters of
5192 buffer_defaults and buffer_local_symbols (for sanity and safety).
5193
5194 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5195
5196 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5197 and continuation glyphs on tooltip frames, leave them at zero.
5198 Avoids continued lines in tooltips. (Bug#11832)
5199
5200 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5201
5202 Simplify copy_overlay.
5203 * buffer.c (copy_overlay): Simplify. Use build_marker.
5204 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5205
5206 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5207
5208 * print.c (print_object): Don't crash when a frame's name is nil
5209 or invalid. (Bug#12025)
5210
5211 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5212 it signals an error when a tooltip frame is being created.
5213
5214 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5215
5216 Cleanup miscellaneous objects allocation and initialization.
5217 * alloc.c (allocate_misc): Change to static. Add argument to
5218 specify the subtype. Adjust comment and users.
5219 (build_overlay): New function.
5220 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5221 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5222 (allocate_misc): Remove prototype.
5223 (build_overlay): Add prototype.
5224
5225 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5226
5227 Swap buffer text indirection counters in Fbuffer_swap_text.
5228 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5229 This avoids crash reported by Christoph Scholtes at
5230 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5231
5232 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5233
5234 * nsmenu.m (Popdown_data): New struct.
5235 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5236 free Popdown_data.
5237 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5238 (initWithContentRect): Make imgView and contentView non-static
5239 and autorelease them. Also autorelease img and matrix (Bug#12005).
5240 (dealloc): Remove (Bug#12005).
5241
5242 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5243
5244 Adjust consing_since_gc when objects are explicitly freed.
5245 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5246 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5247 (free_cons, free_misc): Subtract object size from consing_since_gc.
5248
5249 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5250
5251 Simplify and cleanup markers positioning code.
5252 * marker.c (attach_marker): More useful eassert.
5253 (live_buffer, set_marker_internal): New function.
5254 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5255 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5256
5257 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5258
5259 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5260 as it's limited by the amount of memory, not by INT_MAX.
5261
5262 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5263
5264 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5265 in special-event-map. See the discussion at
5266 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5267 for the reasons.
5268
5269 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5270 info.dwItemData. Fixes crashes on 64-bit Windows.
5271 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5272
5273 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5274
5275 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5276 (conversationIdentifier): Return value is NSInteger.
5277 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5278
5279 2012-07-21 Chong Yidong <cyd@gnu.org>
5280
5281 * window.c (decode_any_window): Signal an error if the window is
5282 on a dead frame (Bug#11984).
5283
5284 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5285
5286 Add indirection counting to speed up Fkill_buffer.
5287 * buffer.h (struct buffer): New member.
5288 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5289 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5290 base buffer indirection counter.
5291 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5292 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5293 through buffer list if indirection counter is 0.
5294
5295 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5296
5297 Extend the value returned by Fgarbage_collect with heap statistics.
5298 * alloc.c (Qheap): New symbol.
5299 (syms_of_alloc): DEFSYM it.
5300 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5301 (Fmemory_free): Remove.
5302 (syms_of_alloc): Don't defsubr it.
5303 * buffer.c (Fcompact_buffer): Remove.
5304 (syms_of_buffer): Don't defsubr it.
5305
5306 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5307
5308 Make maybe_gc inline.
5309 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5310 * lisp.h (consing_since_gc, gc_relative_threshold)
5311 (memory_full_cons_threshold): Revert declaration.
5312 (maybe_gc): Remove prototype, define as inline.
5313 * alloc.c: Remove old commented-out code.
5314 (consing_since_gc, gc_relative_threshold)
5315 (memory_full_cons_threshold): Revert to global.
5316 (maybe_gc): Remove.
5317
5318 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5319
5320 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5321 * lisp.h (build_unibyte_string): New function.
5322 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5323 * sysdep.c, w32fns.c, xfns.c: Use it.
5324 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5325 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5326 Adjust users accordingly.
5327 * font.h (font_open_by_name): Adjust prototype.
5328
5329 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5330
5331 Cleanup calls to Fgarbage_collect.
5332 * lisp.h (maybe_gc): New prototype.
5333 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5334 Remove declarations.
5335 * alloc.c (maybe_gc): New function.
5336 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5337 Make them static.
5338 * bytecode.c (MAYBE_GC): Use maybe_gc.
5339 * eval.c (eval_sub, Ffuncall): Likewise.
5340 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5341 to avoid dependency from auto-save feature.
5342
5343 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5346 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5347 'for_each_per_buffer_object_at'.
5348 All uses changed. It's better to use upper-case for macros that
5349 cannot be implemented as functions, to give the reader a clue
5350 that they're special.
5351
5352 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5353
5354 * alloc.c (Fgarbage_collect): Tweak docstring.
5355
5356 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5357
5358 Tweak the value returned from Fgarbage_collect again.
5359 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5360 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5361 Adjust documentation.
5362 (total_vector_bytes): Rename to total_vector_slots, adjust
5363 accounting.
5364 (total_free_vector_bytes): Rename to total_free_vector_slots,
5365 adjust accounting.
5366 (Qstring_bytes, Qvector_slots): New symbols.
5367 (syms_of_alloc): DEFSYM them.
5368
5369 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5370
5371 Buffer compaction primitive which may be used from Lisp.
5372 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5373 (syms_of_buffer): Register Fcompact_buffer.
5374 * alloc.c (Fgarbage_collect): Use compact_buffer.
5375 * buffer.h (compact_buffer): New prototype.
5376 (struct buffer_text): New member.
5377
5378 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5379
5380 New macro to iterate over all buffers, miscellaneous cleanups.
5381 * lisp.h (all_buffers): Remove declaration.
5382 * buffer.h (all_buffers): Add declaration, with comment.
5383 (for_each_buffer): New macro.
5384 * alloc.c (Fgarbage_collect, mark_object): Use it.
5385 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5386 (init_buffer): Likewise.
5387 * data.c (Fset_default): Likewise.
5388 * coding.c (code_conversion_restore): Remove redundant check
5389 for dead buffer.
5390 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5391
5392 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5393
5394 Fix bug that created negative-length intervals.
5395 * intervals.c (merge_interval_right, merge_interval_left):
5396 Do not zero out this interval if it is absorbed by its children,
5397 as this interval's total length doesn't change in that case. See
5398 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5399
5400 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5401
5402 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5403 when invoking (make-bool-vector N t) and N is a positive
5404 multiple of 8 -- the last 8 bits were mistakenly cleared.
5405
5406 Remove some struct layout assumptions in bool vectors.
5407 * alloc.c (bool_header_size): New constant.
5408 (header_size, word_size): Move earlier, as they're now used earlier.
5409 Use 'word_size' in a few more places, where it's appropriate.
5410 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5411 padding before the data member of a bool vector.
5412 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5413 than doing the check by hand with an abort ().
5414
5415 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5416
5417 * eval.c (Fdefvar): Don't check constants since we only set the var if
5418 it's not yet defined anyway (bug#11904).
5419
5420 * lisp.h (last_undo_boundary): Declare new var.
5421 * keyboard.c (command_loop_1): Set it.
5422 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5423 were auto-added by the command loop (bug#11774).
5424
5425 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5426
5427 * w32font.c (Qsymbol): Remove local definition.
5428 (syms_of_w32font): Don't DEFSYM it.
5429
5430 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5431
5432 Fix sweep_vectors to handle large bool vectors correctly.
5433 * alloc.c (sweep_vectors): Account total_vector_bytes for
5434 bool vectors larger than VBLOCK_BYTES_MAX.
5435
5436 2012-07-18 Chong Yidong <cyd@gnu.org>
5437
5438 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5439 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5440
5441 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5442
5443 Return more descriptive data from Fgarbage_collect.
5444 Suggested by Stefan Monnier in
5445 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5446 * alloc.c (bounded_number): New function.
5447 (total_buffers, total_vectors): New variable.
5448 (total_string_size): Rename to total_string_bytes, adjust users.
5449 (total_vector_size): Rename to total_vector_bytes, adjust users.
5450 (sweep_vectors): Account total_vectors and total_vector_bytes.
5451 (Fgarbage_collect): New return value. Adjust documentation.
5452 (gc_sweep): Account total_buffers.
5453 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5454 (VECTOR_SIZE): Remove.
5455 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5456 (Qinterval, Qmisc): New symbols.
5457 (syms_of_data): Initialize them.
5458 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5459 (Qcons, Qbuffer): New declarations.
5460
5461 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5462
5463 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5464 Round up, not down. Improve doc.
5465
5466 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5467
5468 Restore old code in allocate_string_data to avoid Faset breakage.
5469 Reported by Julien Danjou <julien@danjou.info> in
5470 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5471 * alloc.c (allocate_string_data): Restore old code with minor
5472 adjustments, fix comment to explain this subtle issue.
5473
5474 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5475
5476 Remove FILE_SYSTEM_CASE.
5477 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5478
5479 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5480 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5481 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5482 call-process-region passes it through expand-file-name.
5483
5484 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5485
5486 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5487
5488 Fix crash when creating indirect buffer (Bug#11917)
5489 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5490 Don't handle unbound variables specially if non-zero.
5491 (Fbuffer_local_variables): Pass zero.
5492 (clone_per_buffer_values): Pass non-zero.
5493
5494 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5495
5496 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5497 to make the loop interruptible.
5498
5499 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5500
5501 * gnutls.c (emacs_gnutls_handshake): Only retry if
5502 GNUTLS_E_INTERRUPTED.
5503
5504 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5505
5506 Cleanup and convert miscellaneous checks to eassert.
5507 * alloc.c (mark_interval): Fix comment, partially rephrase
5508 old comment from intervals.h (see below).
5509 * intervals.c (find_interval, adjust_intervals_for_insertion)
5510 (delete_interval, adjust_intervals_for_deletion)
5511 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5512 Convert to eassert.
5513 (adjust_intervals_for_insertion, make_new_interval):
5514 Remove obsolete and unused code.
5515 * intervals.h (struct interval): Remove obsolete comment.
5516 * textprotp.c (erase_properties): Remove unused code.
5517 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5518 (Fremove_list_of_text_properties): Convert to eassert.
5519
5520 2012-07-17 Chong Yidong <cyd@gnu.org>
5521
5522 * editfns.c (Finsert_char): Doc fix.
5523
5524 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5525
5526 Fix previous change to make Fmemory_free always accurate.
5527 * alloc.c (make_interval): Update total_free_intervals.
5528 (make_float): Likewise for total_free_floats.
5529 (free_cons, Fcons): Likewise for total_free_conses.
5530 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5531 Likewise for total_free_vector_bytes.
5532 (Fmake_symbol): Likewise for total_free_symbols.
5533 (bytes_free): Remove.
5534
5535 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5536
5537 Simple free memory accounting feature.
5538 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5539 (sweep_vectors): Accumulate size of free vectors.
5540 (Fgarbage_collect): Setup bytes_free.
5541 (Fmemory_free): New function.
5542 (syms_of_alloc): Register it.
5543
5544 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5545
5546 Cleanup overlays checking.
5547 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5548 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5549 eassert and OVERLAYP.
5550 (sort_overlays): Change to use OVERLAYP.
5551
5552 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5553
5554 * editfns.c (Finsert_char): Make it interactive, and make the
5555 second arg optional. Copy interactive spec and docstring from
5556 ucs-insert.
5557
5558 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5559
5560 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5561 Unlike the other wrapped functions, fabs has an unspecified
5562 effect on errno.
5563
5564 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5565
5566 * nsterm.m (keyDown): Interpret flags without left/right bits
5567 as the left key (Bug#11670).
5568
5569 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5570
5571 Remove empty and useless init functions.
5572 * lisp.h (init_character_once, init_fns, init_image)
5573 (init_filelock, init_sound): Remove prototype.
5574 * character.c (init_character_once): Remove.
5575 * filelock.c (init_filelock): Likewise.
5576 * fns.c (init_fns): Likewise.
5577 * image.c (init_image): Likewise.
5578 * sound.c (init_sound): Likewise.
5579 * emacs.c (main): Adjust accordingly.
5580
5581 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5582
5583 * gtkutil.h: Tiny cleanups.
5584 (use_old_gtk_file_dialog): Remove useless declaration.
5585 (xg_uses_old_file_dialog): Add suggested const attribute.
5586
5587 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5588
5589 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5590 (bidi_paragraph_init): Use it to limit search forward for a strong
5591 directional character in abnormally large paragraphs full of
5592 neutral or weak characters. (Bug#11943)
5593
5594 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5595
5596 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5597 the toolbar (Bug#9451).
5598 (xg_make_tool_item): Give the widget event box a transparent
5599 background.
5600
5601 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5602
5603 Cleanup basic allocation variables and functions.
5604 * alloc.c (ignore_warnings, init_intervals, init_float)
5605 (init_cons, init_symbol, init_marker): Remove.
5606 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5607 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5608 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5609 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5610 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5611 (staticidx, init_alloc_once, init_strings, free_ablock):
5612 Remove redundant initialization.
5613 * fns.c (init_weak_hash_tables): Remove.
5614 * lisp.h (init_weak_hash_tables): Remove prototype.
5615
5616 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5617
5618 Use zero_vector where appropriate.
5619 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5620 accordingly.
5621 * lisp.h (zero_vector): New declaration.
5622 * font.c (null_vector): Remove.
5623 (syms_of_font): Remove initialization and staticpro.
5624 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5625 * keymap.c (Faccessible_keymaps): Likewise.
5626
5627 2012-07-15 Leo Liu <sdl.web@gmail.com>
5628
5629 * fringe.c: Fix typo in comments.
5630
5631 2012-07-14 Leo Liu <sdl.web@gmail.com>
5632
5633 * fringe.c: Add a new bitmap exclamation-mark.
5634
5635 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5636
5637 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5638
5639 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5640 (HAVE_MENUS): Don't define, defined by editing config.in with
5641 msdos/sed2v2.inp.
5642 (GMALLOC_INHIBIT_VALLOC): Don't define.
5643 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5644
5645 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5646
5647 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5648
5649 2012-07-14 Glenn Morris <rgm@gnu.org>
5650
5651 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5652 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5653 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5654
5655 2012-07-13 Glenn Morris <rgm@gnu.org>
5656
5657 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5658
5659 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5660 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5661
5662 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5663
5664 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5665 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5666 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5667 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5668 where appropriate.
5669 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5670 as boolean expression.
5671 (x_set_window_size): Remove unused variable toolbar.
5672 (ns_get_color_default, ns_mod_to_lisp): Remove.
5673 (ns_mouse_position): Remove unused variables xchar and ychar.
5674 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5675 (ns_set_vertical_scroll_bar): Remove unused variable count.
5676 (ns_delete_terminal): Remove unused variable i.
5677 (ns_term_init): Remove unused variables r, g and b.
5678 (mouseDown): Remove unused variable window.
5679 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5680 (initFrameFromEmacs): Remove unused variable vbextra.
5681 (mouseEntered): Remove unused variables p and dpyinfo.
5682 (mouseExited): Remove unused variables p and r.
5683 (ns_define_frame_cursor, ns_clear_frame_area)
5684 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5685 (menuDown): Assign [sender tag] to variable and cast the variable.
5686
5687 * nsterm.h (menuDown): Add id as type to argument sender.
5688 (ns_display_info_for_name): Add Lisp_Object argument.
5689 (ns_term_init): Add Lisp_Object argument.
5690 (ns_map_event_to_object): Add void argument.
5691 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5692 prototype with arguments and only declare if __OBJC__.
5693 (nxatoms_of_nsselect): Add void argument.
5694 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5695 (ns_alloc_autorelease_pool): Add void argument.
5696 (ns_release_autorelease_pool): Add void* argument.
5697 (ns_get_defaults_value): Add const char* argument.
5698
5699 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5700 (initFromContents): Use SSDATA where appropriate.
5701 (ns_update_menubar): Add braces to ambigous if-else.
5702 (initWithTitle): Put () around assignment in if statement.
5703 (ns_menu_show): Remove unused variables window and keymap.
5704 (update_frame_tool_bar): Remove unused variable selected_p.
5705 (initWithContentRect): Remove unused variable this_cmd_name.
5706
5707 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5708 appropriate.
5709 (setXBMColor): Remove unused variable len.
5710 (setPixmapData): Put () around assignment in loop statement.
5711
5712 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5713 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5714 where appropriate.
5715 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5716 around assignment in loop statement.
5717 (nsfont_open): Remove unused variable i.
5718 (nsfont_open): Remove unused variable len.
5719 (nsfont_draw): Remove unused variable cs.
5720
5721 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5722 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5723 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5724 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5725 (Fns_font_name, Fns_perform_service)
5726 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5727 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5728 (ns_set_name): Remove unused variable view.
5729 (x_set_menu_bar_lines): Remove unused variable olines.
5730 (x_set_tool_bar_lines): Remove unused variable root_window.
5731 (Fns_list_colors): Put () around assignment in while statement.
5732 (Fns_perform_service): Remove unused variable len.
5733 (Fns_display_usable_bounds): Remove unused variable top.
5734 (syms_of_nsfns): Remove unused variable i.
5735
5736 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5737 memcpy (Bug#11907).
5738
5739 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5740
5741 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5742 and free it with DestroyExceptionInfo (Bug#11558).
5743
5744 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5745
5746 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5747 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5748 Set here, not in nt/config.nt.
5749
5750 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5751
5752 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5753 cursor overflow into the last glyph on display line when the right
5754 fringe is off. (Bug#11832)
5755
5756 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5757
5758 * xdisp.c (produce_special_glyphs): Now static.
5759 * dispextern.h (produce_special_glyphs): Remove decl.
5760
5761 2012-07-13 Glenn Morris <rgm@gnu.org>
5762
5763 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5764 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5765
5766 * s/usg5-4-common.h (USG, USG5):
5767 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5768 * s/sol2-6.h (SOLARIS2):
5769 * s/irix6-5.h (IRIX6_5):
5770 * s/hpux10-20.h (USG, USG5, HPUX):
5771 * s/gnu-linux.h (USG, GNU_LINUX):
5772 * s/freebsd.h (BSD_SYSTEM):
5773 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5774 * s/cygwin.h (CYGWIN):
5775 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5776 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5777
5778 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5779
5780 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5781
5782 2012-07-13 Glenn Morris <rgm@gnu.org>
5783
5784 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5785
5786 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5787
5788 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5789 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5790
5791 2012-07-12 Glenn Morris <rgm@gnu.org>
5792
5793 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5794
5795 * process.c (init_process_emacs): Rename from init_process.
5796 The old name is also the name of a Mach system call.
5797 * lisp.h, emacs.c: Update for this name change.
5798 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5799 longer needed.
5800
5801 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5802
5803 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5804 memmove call that removes glyphs covered by the left truncation
5805 glyph. Improve commentary.
5806 (display_line): Fix display of continuation glyphs on GUI frames
5807 when the right fringe is turned off and variable-size fonts are
5808 used in the window. Move the code that appends a stretch glyph to
5809 produce_special_glyphs, so that it could be used for truncation
5810 and continuation glyphs alike.
5811 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5812 glyph of a suitably computed width, to align the special glyphs at
5813 the window margin. Code moved from display_line. (Bug#11832)
5814
5815 2012-07-12 Glenn Morris <rgm@gnu.org>
5816
5817 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5818
5819 * s/gnu-linux.h, s/hpux10-20.h:
5820 Do not unconditionally define HAVE_XRMSETDATABASE.
5821
5822 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5823
5824 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5825
5826 Fix typos that broke OS X build.
5827 Reported by Randal L. Schwartz in
5828 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5829 * nsterm.m (ns_timeout): Add missing local decl.
5830 (ns_get_color): snprintf -> sprintf, to fix typo.
5831
5832 2012-07-12 Glenn Morris <rgm@gnu.org>
5833
5834 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5835 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5836 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5837 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5838
5839 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5840 Move PTY_OPEN to configure.
5841
5842 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5843 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5844 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5845
5846 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5847
5848 Use empty_unibyte_string where applicable.
5849 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5850 * lread.c (read1): Likewise.
5851 * xsettings.c (syms_of_xsettings): Likewise.
5852
5853 2012-07-12 Glenn Morris <rgm@gnu.org>
5854
5855 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5856 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5857 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5858 * s/hpux10-20.h (RUN_TIME_REMAP):
5859 * s/bsd-common.h (TABDLY): Move to configure.
5860
5861 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5862
5863 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5864
5865 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5866 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5867
5868 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5869
5870 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5871 * s/template.h: Move NARROWPROTO to configure.
5872
5873 2012-07-11 Glenn Morris <rgm@gnu.org>
5874
5875 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5876 unused since 2011-01-17 change to systty.h.
5877
5878 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5879 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5880 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5881
5882 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5883
5884 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5885
5886 2012-07-11 Glenn Morris <rgm@gnu.org>
5887
5888 * s/darwin.h, s/gnu-linux.h, s/template.h:
5889 Move INTERRUPT_INPUT to configure.
5890
5891 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5892
5893 Minor adjustments to interning code.
5894 * lisp.h (intern, intern_c_string): Redefine as static inline
5895 wrappers for intern_1 and intern_c_string_1, respectively.
5896 (intern_1, intern_c_string_1): Rename prototypes.
5897 * lread.c (intern_1, intern_c_string_1, oblookup):
5898 Simplify Vobarray checking.
5899 * font.c (font_intern_prop): Likewise. Adjust comment.
5900 * w32font.c (intern_font_name): Likewise.
5901
5902 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5903
5904 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5905
5906 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5907 of Fcar/Fcdr if possible.
5908 * font.c (check_otf_features): Likewise.
5909 * fontset.c (Fnew_fontset): Likewise.
5910 * gnutls.c (Fgnutls_boot): Likewise.
5911 * minibuf.c (read_minibuf): Likewise.
5912 * msdos.c (IT_set_frame_parameters): Likewise.
5913 * xmenu.c (Fx_popup_dialog): Likewise.
5914 * w32menu.c (Fx_popup_dialog): Likewise.
5915
5916 2012-07-11 Glenn Morris <rgm@gnu.org>
5917
5918 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5919 since nothing has defined it on these platforms.
5920
5921 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5922 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5923
5924 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5925 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5926 Move CLASH_DETECTION to configure.
5927
5928 * s/gnu.h: Remove file, which is now empty.
5929
5930 * s/gnu.h, s/gnu-linux.h:
5931 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5932
5933 2012-07-11 John Wiegley <johnw@newartisans.com>
5934
5935 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5936 function attribute, so we only use it if it exists in the
5937 compiler.
5938
5939 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5940
5941 Avoid call to strlen in fast_c_string_match_ignore_case.
5942 * search.c (fast_c_string_match_ignore_case): Change to use
5943 length argument. Adjust users accordingly.
5944 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5945
5946 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5947
5948 Assume mkdir, rmdir.
5949 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5950 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5951
5952 Assume rename.
5953 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5954
5955 Assume perror.
5956 * s/hpux10-20.h (HAVE_PERROR): Remove.
5957 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5958 Remove dummy definition, as this problem was obsolete long ago.
5959
5960 Assume strerror.
5961 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5962
5963 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5964
5965 Avoid calls to strlen in font processing functions.
5966 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5967 (font_open_by_name): Change to use length argument.
5968 Adjust users accordingly.
5969 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5970 Adjust prototypes.
5971 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5972 Change to return ptrdiff_t.
5973 (xfont_list_pattern, xfont_match): Use length returned by
5974 xfont_decode_coding_xlfd.
5975 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5976
5977 2012-07-11 Glenn Morris <rgm@gnu.org>
5978
5979 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5980 Move DONT_REOPEN_PTY to configure.
5981
5982 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5983 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5984
5985 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5986
5987 Remove "#define unix" that is no longer needed (Bug#11905).
5988 * s/aix4-2.h (unix): Remove; no longer needed.
5989
5990 EMACS_TIME simplification (Bug#11875).
5991 This replaces macros (which typically do not work in GDB)
5992 with functions, typedefs and enums, making the code easier to debug.
5993 The functional style also makes code easier to read and maintain.
5994 * systime.h: Include <sys/time.h> on all hosts, not just if
5995 WINDOWSNT, since 'struct timeval' is needed in general.
5996 (EMACS_TIME): Now a typedef, not a macro.
5997 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5998 not macros.
5999 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6000 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6001 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6002 (EMACS_TIME_LE): Now functions, not macros.
6003 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6004 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6005 which are not functions. All uses rewritten to use:
6006 (make_emacs_time): New function.
6007 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6008 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6009 not functions. All uses rewritten to use the following, respectively:
6010 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6011 (add_emacs_time, sub_emacs_time): New functions.
6012 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
6013 * fileio.c (Fcopy_file):
6014 * xterm.c (XTflash): Get the current time closer to when it's used.
6015 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6016
6017 * bytecode.c (targets): Suppress -Woverride-init warnings.
6018
6019 Simplify by avoiding confusing use of strncpy etc.
6020 * doc.c (Fsnarf_documentation):
6021 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6022 * frame.c (Fmake_terminal_frame):
6023 * gtkutil.c (get_utf8_string):
6024 * lread.c (openp):
6025 * nsmenu.m (ns_update_menubar):
6026 * regex.c (regerror):
6027 Prefer memcpy to strncpy and strncat when either will do.
6028 * fileio.c (Fsubstitute_in_file_name):
6029 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6030 (menu_separator_name_p):
6031 * nsmenu.m (ns_update_menubar):
6032 Prefer memcmp to strncmp when either will do.
6033 * nsterm.m: Include <ftoastr.h>.
6034 (ns_get_color):
6035 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6036 Prefer snprintf to strncpy.
6037 * nsterm.m (ns_term_init):
6038 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6039 * nsterm.m (ns_term_init):
6040 Avoid the need for strncpy, by using build_string or
6041 make_unibyte_string directly. Use dtoastr, not snprintf.
6042 * process.c (Fmake_network_process): Diagnose service names that
6043 are too long, rather than silently truncating them or creating
6044 non-null-terminated names.
6045 (Fnetwork_interface_info): Likewise, for interface names.
6046 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6047 Prefer sprintf to strncat.
6048 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6049 Prefer vsnprintf to vsprintf + strncpy.
6050
6051 2012-07-10 Glenn Morris <rgm@gnu.org>
6052
6053 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6054 Clarify fallback case.
6055
6056 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6057
6058 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6059 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6060 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6061 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6062 where argument type is known to be a Lisp_Cons.
6063
6064 2012-07-10 Tom Tromey <tromey@redhat.com>
6065
6066 * bytecode.c (BYTE_CODE_THREADED): New macro.
6067 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6068 (enum byte_code_op): New type.
6069 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6070 (exec_byte_code): Use them. Use token threading when applicable.
6071
6072 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6073
6074 Optimize pure C strings initialization.
6075 * lisp.h (make_pure_string): Fix prototype.
6076 (build_pure_c_string): New function, defined as static inline. This
6077 provides a better opportunity to optimize away calls to strlen when
6078 the function is called with compile-time constant argument.
6079 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6080 argument, adjust users accordingly. Use build_pure_c_string where
6081 appropriate.
6082 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6083 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6084 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6085
6086 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6087
6088 Avoid calls to strlen in miscellaneous functions.
6089 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6090 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6091 * lread.c (openp): Likewise.
6092
6093 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6094
6095 Avoid calls to strlen in path processing functions.
6096 * fileio.c (file_name_as_directory): Add comment. Change to add
6097 srclen argument and return the length of result. Adjust users
6098 accordingly.
6099 (directory_file_name): Fix comment. Change to add srclen argument,
6100 swap 1st and 2nd arguments to obey the common convention.
6101 Adjust users accordingly.
6102 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6103
6104 2012-07-10 Glenn Morris <rgm@gnu.org>
6105
6106 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6107 Move PENDING_OUTPUT_COUNT definition to configure.
6108
6109 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6110 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6111 * s/gnu.h (DATA_START): Move definitions to configure.
6112
6113 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6114 We include usg5-4-common.h, which defines them both.
6115
6116 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6117 O_RDONLY already includes it).
6118
6119 Stop ns builds setting the EMACSLOADPATH environment variable.
6120 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6121 Now it does not set EMACSLOADPATH, just returns the load-path string.
6122 * nsterm.h: Update accordingly.
6123 * lread.c [HAVE_NS]: Include nsterm.h.
6124 (init_lread) [HAVE_NS]: Use ns_load_path.
6125 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6126
6127 2012-07-09 Glenn Morris <rgm@gnu.org>
6128
6129 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6130 since the included bsd-common.h does so.
6131
6132 Stop ns builds setting the EMACSPATH environment variable.
6133 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6134 (ns_init_paths): Do not set EMACSPATH.
6135 * nsterm.h (ns_exec_path): Add it.
6136 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6137 Use ns_exec_path.
6138
6139 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6140
6141 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6142
6143 * process.c (wait_reading_process_output): 'waitchannels' was unset
6144 when read_kbd || !NILP (wait_for_cell); fix this.
6145
6146 Add GCC-style 'const' attribute to functions that can use it.
6147 * character.h (char_resolve_modifier_mask):
6148 * keyboard.h (make_ctrl_char):
6149 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6150 (init_character_once, next_almost_prime, init_fns, init_image)
6151 (flush_pending_output, init_sound):
6152 * mem-limits.h (start_of_data):
6153 * menu.h (finish_menu_items):
6154 Add ATTRIBUTE_CONST.
6155 * emacs.c (DEFINE_DUMMY_FUNCTION):
6156 Declare the dummy function with ATTRIBUTE_CONST.
6157 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6158 Add decls with ATTRIBUTE_CONST.
6159
6160 Minor improvements to make_formatted_string.
6161 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6162 where int is good enough, as vsprintf returns an int.
6163 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6164
6165 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6166
6167 Use make_formatted_string to avoid double length calculation.
6168 * lisp.h (make_formatted_string): New prototype.
6169 * alloc.c (make_formatted_string): New function.
6170 * buffer.c (Fgenerate_new_buffer_name): Use it.
6171 * dbusbind.c (syms_of_dbusbind): Likewise.
6172 * editfns.c (Fcurrent_time_zone): Likewise.
6173 * filelock.c (get_boot_time): Likewise.
6174 * frame.c (make_terminal_frame, set_term_frame_name)
6175 (x_report_frame_params): Likewise.
6176 * image.c (gs_load): Likewise.
6177 * minibuf.c (get_minibuffer): Likewise.
6178 * msdos.c (dos_set_window_size): Likewise.
6179 * process.c (make_process): Likewise.
6180 * xdisp.c (ensure_echo_area_buffers): Likewise.
6181 * xsettings.c (apply_xft_settings): Likewise.
6182
6183 2012-07-09 Glenn Morris <rgm@gnu.org>
6184
6185 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6186 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6187 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6188 * nsterm.h (ns_etc_directory): Add it.
6189 * callproc.c [HAVE_NS]: Include nsterm.h.
6190 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6191
6192 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6193
6194 Move marker debugging code under MARKER_DEBUG.
6195 * marker.c (MARKER_DEBUG): Move marker debugging code under
6196 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6197 for bootstrap with --enable-checking (~3x slowdown reported
6198 by Juanma Barranquero <lekktu@gmail.com>).
6199 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6200
6201 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6202
6203 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6204 See <http://bugs.gnu.org/11825#29>.
6205
6206 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6207
6208 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6209 has no font, use the frame's font. (Bug#11813)
6210 (display_line): Add commentary about displaying truncation glyphs
6211 on GUI frames.
6212 (produce_special_glyphs): Move here from term.c.
6213
6214 * term.c (produce_special_glyphs): Move to xdisp.c.
6215
6216 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6217 section.
6218
6219 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6220
6221 * xdisp.c (display_line): Avoid warning about implicit declaration
6222 of FRAME_FONT.
6223
6224 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6225
6226 * lisp.h: Remove empty conditional.
6227
6228 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6229
6230 * lread.c (load_path_check): Now static.
6231
6232 Fix some minor --with-ns problems found by static checking.
6233 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6234 (x_set_font) [!HAVE_X_WINDOWS]:
6235 * image.c (xpm_load_image) [HAVE_NS]:
6236 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6237 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6238 Remove unused local.
6239 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6240 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6241 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6242 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6243 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6244 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6245 Fix pointer signedness problem.
6246 * xfaces.c (FRAME_X_FONT_TABLE):
6247 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6248
6249 2012-07-07 Glenn Morris <rgm@gnu.org>
6250
6251 * lread.c (load_path_check): New function, split from init_lread.
6252 (init_lread): Reorganize. Motivation:
6253 If EMACSLOADPATH is set, check/warn about that rather than the
6254 defaults, which we are not going to use. Hence we can remove
6255 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6256 Don't warn if site-lisp directories are missing.
6257 If not installed, start from a blank load-path, since
6258 PATH_LOADSEARCH refers to the eventual installation directories.
6259
6260 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6261
6262 Support truncation and continuation glyphs on GUI frames, when
6263 fringes are disabled. (Bug#11832)
6264 * xdisp.c (init_iterator): Get dimensions of truncation and
6265 continuation glyphs even if on GUI frames.
6266 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6267 or both, are absent.
6268 (start_display, move_it_in_display_line_to): Handle the case of a
6269 GUI frame without a fringe to display continuation or truncation
6270 glyphs.
6271 (insert_left_trunc_glyphs): Support GUI frames: make sure
6272 truncation glyphs overwrite enough glyphs from the current line to
6273 have sufficient space in pixels.
6274 (display_line): Support truncation and continuation glyphs on GUI
6275 frames. If some spare pixels are left on the line after inserting
6276 the truncation glyphs, fill that space with a stretch glyph of a
6277 suitably computed width.
6278
6279 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6280 produce_glyphs, to support GUI sessions.
6281
6282 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6283
6284 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6285
6286 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6287
6288 Do not require float-time's arg to fit in time_t (Bug#11825).
6289 This works better on hosts where time_t is unsigned, and where
6290 float-time is applied to the (negative) difference between two times.
6291 * editfns.c (decode_time_components): Last arg is now double *,
6292 not int *, and means to store all the result as a double, without
6293 worrying about whether the seconds part fits in time_t.
6294 All callers changed.
6295 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6296 All callers changed.
6297 (Ffloat_time): Do not fail merely because the specified time falls
6298 outside of time_t range.
6299
6300 2012-07-07 Glenn Morris <rgm@gnu.org>
6301
6302 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6303 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6304 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6305
6306 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6307
6308 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6309 Update dependencies.
6310
6311 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6312
6313 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6314
6315 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6316 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6317 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6318 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6319 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6320 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6321
6322 * xfont.c (compare_font_names): Redo to omit the need for casts.
6323
6324 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6325
6326 * xfns.c (Fx_change_window_property): Doc fix.
6327 * w32fns.c (Fx_change_window_property): Doc fix.
6328
6329 * w32fns.c (Fx_window_property): Accept the same arguments as the
6330 X Windows version. Doc fix.
6331 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6332
6333 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6334 Eli Zaretskii <eliz@gnu.org>
6335
6336 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6337 Windows-specific code from nt/config.nt moved here.
6338 Obsolete settings removed.
6339
6340 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6341
6342 * process.c: Avoid unnecessary calls to gettime.
6343 (wait_reading_process_output): Don't get the time of day
6344 when gobbling data immediately and not waiting, as there's no need
6345 for it in that case. This removes a FIXME.
6346
6347 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6348
6349 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6350 is defined (Bug#11768).
6351
6352 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6353
6354 Fix marker debugging code.
6355 * marker.c (byte_char_debug_check): Do not perform the check
6356 if buffer is not multibyte.
6357 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6358 Call byte_char_debug_check with correct arguments.
6359
6360 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6361
6362 Compile marker debugging code only if ENABLE_CHECKING is defined.
6363 * marker.c (byte_char_debug_check, count_markers):
6364 Use only if ENABLE_CHECKING is defined.
6365 (byte_debug_flag): Remove.
6366 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6367 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6368
6369 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6370
6371 Avoid code repetition in marker-related functions.
6372 * marker.c (attach_marker): New function.
6373 (Fset_marker, set_marker_restricted, set_marker_both)
6374 (set_marker_restricted_both): Use it.
6375 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6376 Consistently rename charno to charpos.
6377 (marker_position): Add eassert.
6378 (marker_byte_position): Convert to eassert.
6379
6380 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6381
6382 Simplify list operations in unchain_overlay and unchain_marker.
6383 * buffer.c (unchain_overlay): Simplify. Add comment.
6384 * marker.c (unchain_marker): Simplify. Fix comments.
6385
6386 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6387
6388 Introduce fast path for the widely used marker operation.
6389 * alloc.c (build_marker): New function.
6390 * lisp.h (build_marker): New prototype.
6391 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6392 * composite.c (autocmp_chars): Likewise.
6393 * editfns.c (buildmark): Remove.
6394 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6395 (save_restriction_save): Use build_marker.
6396 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6397 * window.c (save_window_save): Likewise.
6398
6399 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6400
6401 Do not use Fdelete_overlay in delete_all_overlays
6402 to avoid redundant calls to unchain_overlay.
6403 * buffer.c (drop_overlay): New function.
6404 (delete_all_overlays, Fdelete_overlay): Use it.
6405 * minibuf.c (get_minibuffer): Fix comment.
6406
6407 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6408
6409 Port to OpenBSD 5.1 amd64.
6410 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6411 This is needed for OpenBSD, and should be harmless on all BSD systems.
6412 Also, include <sys/sysctl.h>, as it should be available on all
6413 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6414 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6415 use p_pid member, not kp_proc.pid.
6416
6417 2012-07-06 Glenn Morris <rgm@gnu.org>
6418
6419 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6420
6421 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6422
6423 More xmalloc and related cleanup.
6424 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6425 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6426 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6427 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6428 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6429 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6430 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6431 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6432 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6433 * xterm.c:
6434 Omit needless casts involving void * pointers and allocation.
6435 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6436 as the former is more robust if P's type is changed.
6437 Prefer xzalloc to xmalloc + memset 0.
6438 Simplify malloc-or-realloc to realloc.
6439 Don't worry about xmalloc returning a null pointer.
6440 Prefer xstrdup to xmalloc + strcpy.
6441 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6442 growing it.
6443 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6444 alloca of a constant.
6445
6446 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6447
6448 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6449 hscroll is larger than the line width. Fixes long and futile
6450 looping inside extend_face_to_end_of_line (on a TTY) producing
6451 glyphs that are not needed and thrown away.
6452
6453 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6454
6455 * marker.c (set_marker_restricted_both): Simplify by using
6456 clip_to_bounds.
6457
6458 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6459
6460 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6461
6462 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6463
6464 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6465 not defined (Bug#11768).
6466 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6467 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6468 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6469 followed by gtk_box_set_homogeneous (Bug#11768).
6470 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6471 (update_theme_scrollbar_width, xg_create_scroll_bar):
6472 Use gtk_scrollbar_new (Bug#11768).
6473 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6474 (is_box_type): New function (Bug#11768).
6475 (xg_tool_item_stale_p): Call is_box_type.
6476 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6477 with default display (Bug#11768).
6478
6479 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6480
6481 * xdisp.c (window_hscroll_limited): New function.
6482 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6483 coordinates when window's hscroll is set to insanely large
6484 values. (Bug#11857)
6485
6486 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6487
6488 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6489 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6490
6491 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6492
6493 Cleanup xmalloc.
6494 * lisp.h (xzalloc): New prototype. Omit needless casts.
6495 * alloc.c (xzalloc): New function. Omit needless casts.
6496 * charset.c: Omit needless casts. Convert all calls to
6497 xmalloc with following memset to xzalloc.
6498 * dispnew.c: Likewise.
6499 * fringe.c: Likewise.
6500 * image.c: Likewise.
6501 * sound.c: Likewise.
6502 * term.c: Likewise.
6503 * w32fns.c: Likewise.
6504 * w32font.c: Likewise.
6505 * w32term.c: Likewise.
6506 * xfaces.c: Likewise.
6507 * xfns.c: Likewise.
6508 * xterm.c: Likewise.
6509 * atimer.c: Omit needless casts.
6510 * buffer.c: Likewise.
6511 * callproc.c: Likewise.
6512 * ccl.c: Likewise.
6513 * coding.c: Likewise.
6514 * composite.c: Likewise.
6515 * doc.c: Likewise.
6516 * doprnt.c: Likewise.
6517 * editfns.c: Likewise.
6518 * emacs.c: Likewise.
6519 * eval.c: Likewise.
6520 * filelock.c: Likewise.
6521 * fns.c: Likewise.
6522 * gtkutil.c: Likewise.
6523 * keyboard.c: Likewise.
6524 * lisp.h: Likewise.
6525 * lread.c: Likewise.
6526 * minibuf.c: Likewise.
6527 * msdos.c: Likewise.
6528 * print.c: Likewise.
6529 * process.c: Likewise.
6530 * region-cache.c: Likewise.
6531 * search.c: Likewise.
6532 * sysdep.c: Likewise.
6533 * termcap.c: Likewise.
6534 * terminal.c: Likewise.
6535 * tparam.c: Likewise.
6536 * w16select.c: Likewise.
6537 * w32.c: Likewise.
6538 * w32reg.c: Likewise.
6539 * w32select.c: Likewise.
6540 * w32uniscribe.c: Likewise.
6541 * widget.c: Likewise.
6542 * xdisp.c: Likewise.
6543 * xmenu.c: Likewise.
6544 * xrdb.c: Likewise.
6545 * xselect.c: Likewise.
6546
6547 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6548
6549 * fileio.c (time_error_value): Check the right error number.
6550 Problem reported by Troels Nielsen in
6551 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6552
6553 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6554
6555 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6556 This should be fixed in a better way; see Eli Zaretskii in
6557 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6558 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6559
6560 * fileio.c (time_error_value): Rename from special_mtime.
6561 The old name's problems were noted by Eli Zaretskii in
6562 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6563
6564 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6565 This variable's comment says Emacs needs at least one GDB-visible
6566 symbol of type enum pvec_type, to work around GDB problems.
6567 The symbol's value doesn't matter.
6568
6569 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6570 that causes compilation to fail on pre-C99 compilers.
6571
6572 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6573
6574 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6575 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6576
6577 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6578
6579 * buffer.c (init_buffer_once): Fix initialization of
6580 headers for buffer_defaults and buffer_local_symbols.
6581 Reported by Juanma Barranquero <lekktu@gmail.com>.
6582
6583 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6584
6585 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6586 * lisp.h (enum pvec_type): Use fewer bits.
6587 (PSEUDOVECTOR_SIZE_BITS): New constant.
6588 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6589 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6590 change in pvec_type.
6591 (PSEUDOVECTOR_TYPEP): New macro.
6592 (TYPED_PSEUDOVECTORP): Use it.
6593 * fns.c (internal_equal): Adapt code to extract pvectype.
6594 * emacs.c (gdb_pvec_type): Update type.
6595 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6596 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6597 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6598 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6599 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6600 abusing vector->header.next.nbytes.
6601 (live_vector_p): Use PVEC_TYPE.
6602 (mark_object): Adapt code to extract pvectype. Use switch.
6603
6604 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6605
6606 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6607 Tighten new eassert a bit.
6608
6609 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6610
6611 Fix compilation with --enable-gcc-warnings and -O1
6612 optimization level.
6613 * doprnt.c (doprnt): Change type of tem to int, initialize
6614 to avoid compiler warning. Add eassert.
6615 * search.c (simple_search): Initialize match_byte to avoid
6616 compiler warning. Add eassert.
6617
6618 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6619
6620 Avoid weird behavior with large horizontal scrolls.
6621 Without this change, for example, large hscroll values would
6622 mess up Emacs's display on Fedora 15 x86, presumably due to
6623 overflows in int calculations in the display code.
6624 Also, if buffers had long lines, Emacs would freeze.
6625 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6626 (set_window_hscroll): New function, containing the old guts of
6627 Fset_window_hscroll. Return the clipped value.
6628 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6629 This avoids the need to check against PTRDIFF_MAX.
6630
6631 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6632
6633 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6634
6635 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6636
6637 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6638
6639 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6640 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6641 since GCC 4.4.6 issues a bogus warning for them.
6642
6643 Fix bugs in file timestamp newness comparisons.
6644 * fileio.c (Ffile_newer_than_file_p):
6645 * lread.c (Fload): Use full timestamp resolution of files,
6646 not just the 1-second resolution, so that files that are only
6647 slightly newer still count as newer.
6648 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6649 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6650
6651 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6652
6653 * fileio.c: Improve handling of file time marker. (Bug#11852)
6654 (special_mtime): New function.
6655 (Finsert_file_contents, Fverify_visited_file_modtime):
6656 Use it to set special mtime values consistently.
6657
6658 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6659
6660 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6661 marker for non-existing file. (Bug#11852)
6662
6663 2012-07-03 Glenn Morris <rgm@gnu.org>
6664
6665 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6666 and did not make it into globals.h).
6667
6668 2012-07-03 Tom Tromey <tromey@redhat.com>
6669
6670 * window.c (Fset_window_margins, Fset_window_fringes)
6671 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6672 * textprop.c (Fprevious_property_change): No longer static.
6673 * syntax.c (Fsyntax_table_p): No longer static.
6674 * process.c (Fget_process, Fprocess_datagram_address): No longer
6675 static.
6676 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6677 * keyboard.c (Fcommand_execute): No longer static.
6678 Remove EXFUN.
6679 * insdel.c (Fcombine_after_change_execute): No longer static.
6680 * image.c (Finit_image_library): No longer static.
6681 * fileio.c (Fmake_symbolic_link): No longer static.
6682 * eval.c (Ffetch_bytecode): No longer static.
6683 * editfns.c (Fuser_full_name): No longer static.
6684 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6685 No longer static.
6686 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6687 static.
6688 * dired.c (Ffile_attributes): No longer static.
6689 * composite.c (Fcomposition_get_gstring): No longer static.
6690 * callproc.c (Fgetenv_internal): No longer static.
6691
6692 * ccl.h: Remove EXFUNs.
6693 * buffer.h: Remove EXFUNs.
6694 * dispextern.h: Remove EXFUNs.
6695 * intervals.h: Remove EXFUNs.
6696 * fontset.h: Remove EXFUN.
6697 * font.h: Remove EXFUNs.
6698 * dosfns.c (system_process_attributes): Remove EXFUN.
6699 * keymap.h: Remove EXFUNs.
6700 * lisp.h: Remove EXFUNs.
6701 * w32term.h: Remove EXFUNs.
6702 * window.h: Remove EXFUNs.
6703 * xsettings.h: Remove EXFUN.
6704 * xterm.h: Remove EXFUN.
6705
6706 2012-07-03 Glenn Morris <rgm@gnu.org>
6707
6708 * lisp.h (Frandom): Make it visible to C.
6709 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6710 buffer for invisible buffers. (Bug#1229)
6711
6712 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6713
6714 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6715 values which aren't power of 2.
6716 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6717 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6718 accordingly.
6719
6720 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6721
6722 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6723
6724 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6725
6726 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6727
6728 * alloc.c (allocate_vector_block): Remove redundant
6729 calls to mallopt if DOUG_LEA_MALLOC is defined.
6730 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6731 avoid calls to mallopt if zero_vector is returned.
6732
6733 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6734
6735 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6736 is enabled, avoid dereferencing NULL current_sblock if
6737 running undumped.
6738
6739 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6740
6741 Cleanup basic buffer management.
6742 * buffer.h (struct buffer): Change layout to use generic vector
6743 marking code. Fix some comments. Change type of 'clip_changed'
6744 to bitfield. Remove unused #ifndef old.
6745 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6746 (GET_OVERLAYS_AT): Fix indentation.
6747 (for_each_per_buffer_object_at): New macro.
6748 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6749 (Fbuffer_local_variables): Use it.
6750 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6751 * alloc.c (allocate_buffer): Adjust to match new layout of
6752 struct buffer. Fix comment.
6753 (mark_overlay): New function.
6754 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6755 Lisp area of struct buffer.
6756 (mark_object): Use it. Adjust marking of misc objects
6757 and related comments.
6758
6759 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6762 wrapper that is not needed because the wrapped code is a no-op (zero
6763 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6764 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6765
6766 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6767
6768 * alloc.c (mark_buffer): Simplify. Remove prototype.
6769 (mark_object): Add comment. Reorganize marking of vector-like
6770 objects. Use CHECK_LIVE for all vector-like objects except buffers
6771 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6772 Avoid redundant calls to mark_vectorlike for bool vectors.
6773
6774 2012-06-30 Glenn Morris <rgm@gnu.org>
6775
6776 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6777
6778 * epaths.in (PATH_SITELOADSEARCH): New.
6779 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6780 This is rather than relying on --enable-locallisppath elements
6781 having "site-lisp" in their names. (Bug#10208#25, 11658)
6782
6783 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6784
6785 * w32proc.c (sys_select): Accept and ignore one more argument.
6786
6787 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6788
6789 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6790 (pselect) [!MS_DOS]: Redirect to sys_select.
6791
6792 * sysdep.c: Don't include dos.h and dosfns.h.
6793
6794 * process.c (sys_select):
6795 * msdos.c (sys_select): Accept one more argument and ignore it.
6796
6797 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6798 adapt data types and code to that.
6799
6800 * dosfns.c:
6801 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6802 which clashes with the gnulib function of the same name.
6803
6804 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6805
6806 * font.c (font_style_to_value, font_style_symbolic)
6807 (font_prop_validate_style): Add type checks for values in
6808 font_style_table.
6809
6810 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6811 argument.
6812 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6813 uses.
6814
6815 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6816
6817 * xdisp.c (try_window_id): Undo last change.
6818
6819 * w32.c (getwd): Adjust commentary about startup_dir.
6820 (init_environment): Always call sys_access, even in non-MSVC
6821 builds. Don't chdir to the directory of the Emacs executable.
6822 This undoes code from 1997 which was justified by the need to
6823 "avoid conflicts when removing and renaming directories". But its
6824 downside was that every relative file name was being interpreted
6825 relative to the directory of the Emacs executable, which can never
6826 be TRT. In particular, it broke sys_access when called with
6827 relative file names.
6828 (sys_access): Map GetLastError to errno.
6829
6830 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6831
6832 * window.h (struct window): Change type of 'fringes_outside_margins'
6833 to bitfield. Fix comment. Adjust users accordingly.
6834 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6835 Adjust comment.
6836 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6837 to ptrdiff_t.
6838
6839 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6840
6841 * gnutls.c (emacs_gnutls_handshake):
6842 Add QUIT to make the loop interruptible.
6843
6844 2012-06-29 Glenn Morris <rgm@gnu.org>
6845
6846 * charset.c (init_charset): Make lack of etc/charsets fatal.
6847
6848 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6849
6850 * editfns.c (region_limit): Fix type mismatch.
6851
6852 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6853
6854 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6855 undefined. Convert from xassert to eassert.
6856 * nsmenu.m: Convert from xassert to eassert.
6857 * nsterm.m: Likewise.
6858
6859 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6860
6861 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6862
6863 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6864
6865 Avoid integer overflow on scroll-left and scroll-right.
6866 * window.c (HSCROLL_MAX): New macro.
6867 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6868 overflow when requested scroll falls outside ptrdiff_t range.
6869
6870 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6871
6872 * window.h (struct window): Change type of 'hscroll',
6873 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6874 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6875 Adjust users accordingly.
6876 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6877 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6878 from EMACS_INT to ptrdiff_t.
6879 (make_window): Omit redundant initialization.
6880
6881 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6882
6883 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6884
6885 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6886
6887 * window.h (struct window): Change type of 'use_time' and
6888 'sequence_number' from Lisp_Object to int.
6889 * frame.c (make_frame): Adjust users accordingly.
6890 * print.c (print_object): Likewise.
6891 * window.c (select_window, Fwindow_use_time, make_parent_window)
6892 (make_window): Likewise.
6893
6894 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6895
6896 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6897 enabled with --enable-checking=[all,glyphs] configure option.
6898 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6899 adjust comments accordingly.
6900 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6901 undefined, adjust comments accordingly.
6902 * image.c: Likewise.
6903 * scroll.c: Likewise.
6904 * w32fns.c: Likewise.
6905 * w32term.c: Likewise.
6906 * xdisp.c: Likewise.
6907 * xfaces.c: Likewise.
6908 * xfns.c: Likewise.
6909 * xterm.c: Likewise.
6910
6911 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6912
6913 Generalize run-time debugging checks.
6914 * dispextern.h (XASSERTS): Remove.
6915 * fontset.c (xassert): Remove.
6916 Convert from xassert to eassert.
6917 * alloc.c: Convert from xassert to eassert.
6918 * bidi.c: Likewise.
6919 * dispnew.c: Likewise.
6920 * fns.c: Likewise.
6921 * fringe.c: Likewise.
6922 * ftfont.c: Likewise.
6923 * gtkutil.c: Likewise.
6924 * image.c: Likewise.
6925 * keyboard.c: Likewise.
6926 * menu.c: Likewise.
6927 * process.c: Likewise.
6928 * scroll.c: Likewise.
6929 * sound.c: Likewise.
6930 * term.c: Likewise.
6931 * w32console.c: Likewise.
6932 * w32fns.c: Likewise.
6933 * w32term.c: Likewise.
6934 * window.c: Likewise.
6935 * xdisp.c: Likewise.
6936 * xfaces.c: Likewise.
6937 * xfns.c: Likewise.
6938 * xselect.c: Likewise.
6939 * xterm.c: Likewise.
6940
6941 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6942
6943 * fns.c (maybe_resize_hash_table): Output message when growing the
6944 purify-hashtable.
6945
6946 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6947
6948 * alloc.c (allocate_string_data): Remove dead code.
6949 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6950 avoid GCC warning about unused macro.
6951
6952 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6953
6954 * alloc.c (allocate_string): Omit intervals initialization.
6955 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6956 as in make_pure_string and make_pure_c_string.
6957
6958 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6959
6960 * alloc.c (allocate_string): Fix last change.
6961
6962 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6963
6964 * alloc.c (allocate_string): Remove two redundant calls
6965 to memset, add explicit initialization where appropriate.
6966
6967 2012-06-27 Glenn Morris <rgm@gnu.org>
6968
6969 * lisp.mk (lisp): Remove paths.elc.
6970
6971 2012-06-27 Chong Yidong <cyd@gnu.org>
6972
6973 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6974
6975 2012-06-26 John Wiegley <johnw@newartisans.com>
6976
6977 * unexmacosx.c (copy_data_segment): Add two section names used
6978 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6979
6980 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6981 when building with Clang.
6982
6983 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6984
6985 * eval.c (Fapply): Allow calling it with a single argument.
6986
6987 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6988
6989 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6990 _stricmp and _strnicmp.
6991 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6992
6993 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6994
6995 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6996 allocated window.
6997 (allocate_process): Likewise for new process.
6998 (allocate_terminal): Change to use offsetof.
6999 (allocate_frame): Likewise.
7000 * frame.c (make_frame): Omit redundant initialization.
7001 * window.c (make_parent_window): Use memset.
7002 (make_window): Omit redundant initialization.
7003 * process.c (make_process): Omit redundant initialization.
7004 * terminal.c (create_terminal): Likewise.
7005
7006 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7007
7008 * term.c (delete_tty): Remove redundant call to memset.
7009
7010 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7011
7012 * alloc.c: Remove build_string.
7013 * lisp.h: Define build_string as static inline. This provides
7014 a better opportunity to optimize away calls to strlen when the
7015 function is called with compile-time constant argument.
7016 * image.c (imagemagick_error): Convert to build_string.
7017 * w32proc.c (sys_spawnve): Likewise.
7018 * xterm.c (x_term_init): Likewise.
7019
7020 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7021
7022 Use sprintf return value instead of invoking strlen on result.
7023 In the old days this wasn't portable, since some sprintf
7024 implementations returned char *. But they died out years ago and
7025 Emacs already assumes sprintf returns int.
7026 Similarly for float_to_string.
7027 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7028 * ccl.c (ccl_driver):
7029 * character.c (string_escape_byte8):
7030 * data.c (Fnumber_to_string):
7031 * doprnt.c (doprnt):
7032 * print.c (print_object):
7033 * xdisp.c (message_dolog):
7034 * xfns.c (syms_of_xfns):
7035 Use sprintf or float_to_string result to avoid need to call strlen.
7036 * data.c (Fnumber_to_string):
7037 Use make_unibyte_string, since the string must be ASCII.
7038 * lisp.h, print.c (float_to_string): Now returns int length.
7039 * term.c (produce_glyphless_glyph):
7040 Use sprintf result rather than recomputing it.
7041
7042 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7043 * Makefile.in (ALL_CFLAGS):
7044 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7045 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7046
7047 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7048
7049 * dispextern.h (xstrcasecmp): Define to library function
7050 strcasecmp if available.
7051 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7052
7053 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7054
7055 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7056 Avoid comma operator.
7057 * menu.c (push_submenu_start, push_submenu_end)
7058 (push_left_right_boundary, push_menu_pane): Likewise.
7059 * msdos.c (dos_rawgetc): Likewise.
7060
7061 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7062
7063 * xfns.c (xic_create_fontsetname): Remove redundant calls
7064 to memset.
7065
7066 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7067
7068 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7069 sprintf already null-terminates its output.
7070
7071 * xfns.c (x_window): Remove redundant cast.
7072
7073 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7074
7075 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7076 `const char *' to `char *' to avoid compiler warning.
7077
7078 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7081 instead of truncating it to 63 (admittedly a generous limit).
7082
7083 * process.c: Fix spelling and caps in comments.
7084
7085 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7086
7087 * emacs.c (setpgrp): Remove definition, unused.
7088 * sysdep.c (setpgrp): Remove definition, not used in this file.
7089
7090 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7091
7092 * makefile.w32-in: Update dependencies.
7093
7094 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7095
7096 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7097 (SYSTIME_H): Add nt/inc/sys/time.h.
7098
7099 * systime.h [WINDOWSNT]: Include sys/time.h.
7100
7101 * s/ms-w32.h (struct timespec): Definition moved from
7102 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7103
7104 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7105
7106 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7107 * buffer.h (buffer_slot_type_mismatch):
7108 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7109 * eval.c (unwind_to_catch):
7110 * image.c (my_png_error, my_error_exit):
7111 * keyboard.c (quit_throw_to_read_char, user_error)
7112 (Fexit_recursive_edit, Fabort_recursive_edit):
7113 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7114 (wrong_type_argument, buffer_overflow, __executable_start)
7115 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7116 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7117 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7118 (fatal):
7119 (child_setup) [!DOS_NT]:
7120 * lread.c (end_of_file_error, invalid_syntax):
7121 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7122 * puresize.h (pure_write_error):
7123 * search.c (matcher_overflow):
7124 * sound.c (sound_perror, alsa_sound_perror):
7125 * sysdep.c, syssignal.h (croak):
7126 * term.c (maybe_fatal, vfatal):
7127 * textprop.c (text_read_only):
7128 * undo.c (user_error):
7129 * unexmacosx.c (unexec_error):
7130 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7131 Use _Noreturn rather than NO_RETURN.
7132 No need for separate decl merely because of _Noreturn.
7133 * sound.c (sound_warning, parse_sound):
7134 Remove unnecessary forward decls.
7135
7136 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7137
7138 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7139 * lisp.h (WAIT_READING_MAX): New macro.
7140 * dispnew.c (Fsleep_for, sit_for):
7141 * keyboard.c (kbd_buffer_get_event):
7142 * process.c (Faccept_process_output):
7143 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7144 This improves on the previous patch, which introduced a bug
7145 when time_t is unsigned and as wide as intmax_t.
7146 See <http://bugs.gnu.org/9000#51>.
7147
7148 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7149
7150 * dispnew.c (sit_for, Fsleep_for):
7151 * keyboard.c (kbd_buffer_get_event):
7152 * process.c (Faccept_process_output): Avoid compiler warnings when
7153 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7154
7155 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7156
7157 * makefile.w32-in: Update dependencies.
7158
7159 * w32.c (ltime): Add return type and declare static.
7160 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7161
7162 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7163
7164 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7165 Privately reported by Herbert J. Skuhra.
7166 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7167 All uses changed.
7168 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7169 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7170
7171 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7172
7173 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7174 last argument of make_unibyte_string.
7175
7176 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7177 language ID in the event parameters.
7178
7179 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7180 event.code, not the obscure "character set ID".
7181
7182 2012-06-23 Chong Yidong <cyd@gnu.org>
7183
7184 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7185
7186 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7187
7188 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7189 * w32.c (fdutimens): New function.
7190
7191 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7192
7193 * s/ms-w32.h (pselect): Redirect to sys_select.
7194
7195 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7196
7197 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7198 in the logic of incrementing and decrementing the value of
7199 use_relocatable_buffers.
7200
7201 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7202
7203 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7204 Privately reported by Herbert J. Skuhra.
7205 [__FreeBSD__]: Remove "*/" typo after "#include".
7206 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7207 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7208 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7209 Don't assume EMACS_TIME and struct timeval are the same type.
7210
7211 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7212
7213 Support higher-resolution time stamps (Bug#9000).
7214 The time stamps are only nanosecond-resolution at the C level,
7215 since that's the best that any real-world system supports now.
7216 But they are picosecond-resolution at the Lisp level, as that's
7217 easy, and leaves room for future OS improvements.
7218
7219 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7220 (LIBES): Use it.
7221
7222 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7223 Don't get current time unless it's needed.
7224
7225 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7226 now provides it if it's absent.
7227 (start_atimer): Port to higher-res time stamps.
7228 Check for time stamp overflow. Don't get current time more
7229 often than is needed.
7230
7231 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7232 Include systime.h, not time.h.
7233 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7234
7235 * dired.c: Include stat-time.h.
7236 (Ffile-attributes): File times now have higher resolution.
7237
7238 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7239 (struct image): Timestamp now has higher resolution.
7240
7241 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7242 has at least microseconds now. All uses removed.
7243 (update_frame, update_single_window, update_window, update_frame_1)
7244 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7245 (duration_to_sec_usec): Remove; no longer needed.
7246
7247 * editfns.c (time_overflow): Now extern.
7248 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7249 (float-time, Fformat_time_string, Fcurrent_time_string)
7250 (Fcurrent_time_zone): Accept and generate higher-resolution
7251 time stamps.
7252 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7253 (decode_time_components, lisp_seconds_argument): New functions.
7254 (make_time): Now static.
7255 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7256 Report an error if the time is invalid, rather than having the caller
7257 do that.
7258
7259 * fileio.c: Include <stat-time.h>
7260 (Fcopy_file): Copy higher-resolution time stamps.
7261 Prefer to set the time stamp via a file descriptor if that works.
7262 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7263 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7264 (Fvisited_file_modtime, Fset_visited_file_modtime):
7265 Support higher-resolution time stamps.
7266
7267 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7268
7269 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7270
7271 * image.c (prepare_image_for_display, clear_image_cache)
7272 (lookup_image): Port to higer-resolution time stamps.
7273
7274 * keyboard.c (start_polling, bind_polling_period):
7275 Check for time stamp overflow.
7276 (read_char, kbd_buffer_get_event, timer_start_idle)
7277 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7278 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7279 Port to higher-resolution time stamps. Do not assume time_t is signed.
7280 (decode_timer): New function. Timers are now vectors of length 9,
7281 not 8, to accommodate the picosecond component.
7282 (timer_check_2): Use it.
7283
7284 * nsterm.m (select_timeout, timeval_subtract): Remove.
7285 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7286 as they're a bit more accurate and handle overflow better.
7287 (ns_select): Change prototype to be compatible with pselect.
7288 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7289 * nsterm.h (ns_select): Adjust prototype.
7290
7291 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7292 us-resolution time stamps.
7293 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7294
7295 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7296
7297 * lisp.h (time_overflow): New decl.
7298 (wait_reading_process_output): First arg is now intmax_t, not int,
7299 to accommodate larger waits.
7300
7301 * process.h (struct Lisp_Process.read_output_delay):
7302 Now counts nanoseconds, not microseconds.
7303 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7304 EMACS_HAS_USECS.
7305 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7306 (wait_reading_process_output):
7307 Port to ns-resolution time stamps.
7308 (Faccept_process_output, wait_reading_process_output):
7309 Check for time stamp overflow. Do not assume time_t is signed.
7310 (select_wrapper): Remove; we now use pselect.
7311 (Fprocess_attributes): Now generates ns-resolution time stamps.
7312
7313 * sysdep.c: Include utimens.h. Don't include utime.h
7314 or worry about struct utimbuf; gnulib does that for us now.
7315 (gettimeofday): Remove; gnulib provides a substitute.
7316 (make_timeval): New function.
7317 (set_file_times): Now sets ns-resolution time stamps.
7318 New arg FD; all uses changed.
7319 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7320 (system_process_attributes):
7321 Now returns ns-resolution time stamp. All uses changed.
7322 Check for time stamp overflow.
7323
7324 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7325 provides a substitute now.
7326
7327 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7328 since it guarantees struct timespec.
7329 (EMACS_TIME): Now struct timespec, so that we can support
7330 ns-resolution time stamps.
7331 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7332 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7333 (EMACS_USECS): Remove.
7334 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7335 so multiply the arg by 1000 before storing it.
7336 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7337 New macros.
7338 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7339 Port to ns-resolution time stamps.
7340 (EMACS_TIME_NEG_P): Remove; replaced by....
7341 (EMACS_TIME_SIGN): New macro.
7342 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7343 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7344 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7345 (make_timeval, make_lisp_time, decode_time_components): New decls.
7346 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7347 that it mishandled time_t overflow. You can't compare by subtracting!
7348 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7349 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7350
7351 * term.c: Include <sys/time.h>.
7352 (timeval_to_Time): New function, for proper overflow wraparound.
7353 (term_mouse_position, term_mouse_click): Use it.
7354
7355 * undo.c (record_first_change): Support higher-resolution time stamps
7356 in the undo buffer.
7357 (Fprimitive_undo): Use them when restoring time stamps.
7358
7359 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7360 (w32_get_internal_run_time):
7361 Port to higher-resolution Emacs time stamps.
7362 (ltime): Now accepts single 64-bit integer, as that's more convenient
7363 for callers.
7364
7365 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7366
7367 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7368 for compatibility with pselect. Support ns-resolution time stamps.
7369
7370 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7371
7372 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7373 Check for time stamp overflow, and support ns-resolution time stamps.
7374
7375 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7376 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7377 (timeval_subtract): Remove; no longer needed.
7378 (XTflash, XTring_bell, x_wait_for_event):
7379 Port to ns-resolution time stamps. Don't assume time_t is signed.
7380
7381 2012-06-22 Chong Yidong <cyd@gnu.org>
7382
7383 * xdisp.c (x_consider_frame_title): Revert last change.
7384
7385 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7386
7387 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7388 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7389 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7390 staticidx goes up to 1597 out of 1600 = 0x640.)
7391
7392 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7393
7394 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7395 Otherwise, the umask might be mistakenly 0 while handling input signals.
7396
7397 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7398
7399 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7400
7401 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7402
7403 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7404 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7405 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7406 access to `contents' member of Lisp_Vector objects with AREF and ASET
7407 where appropriate.
7408
7409 2012-06-19 Chong Yidong <cyd@gnu.org>
7410
7411 * frame.c (delete_frame): When selecting a frame on a different
7412 text terminal, do not alter the terminal's top-frame.
7413
7414 * xdisp.c (format_mode_line_unwind_data): Record the target
7415 frame's selected window and its terminal's top-frame.
7416 (unwind_format_mode_line): Restore them.
7417 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7418 Callers changed.
7419 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7420 since tty frames can be explicitly named.
7421 (prepare_menu_bars): Likewise.
7422
7423 * term.c (Ftty_top_frame): New function.
7424
7425 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7426
7427 Port byte-code-meter to modern targets.
7428 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7429 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7430 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7431 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7432 (METER_1, METER_2): Simplify.
7433
7434 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7435
7436 * data.c (Fdefalias): Return `symbol' (bug#11686).
7437
7438 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7439
7440 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7441 gets killed during executing of this function (Bug#11665).
7442 Try to always return Qt when the buffer has been actually killed.
7443 (Vkill_buffer_query_functions): In doc-string say that functions
7444 run by this hook should not change the current buffer.
7445
7446 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7447
7448 Fix recently-introduced process.c problems found by static checking.
7449 * process.c (write_queue_push, write_queue_pop, send_process):
7450 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7451 (write_queue_pop): Fix pointer signedness problem.
7452 (send_process): Remove unused local.
7453
7454 2012-06-17 Chong Yidong <cyd@gnu.org>
7455
7456 * xdisp.c (redisplay_internal): No need to redisplay terminal
7457 frames that are not on top.
7458
7459 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7460
7461 * process.c (make_process): Initialize write_queue.
7462 (write_queue_push, write_queue_pop): New functions.
7463 (send_process): Use them to maintain correct ordering of process
7464 writes (Bug#10815).
7465
7466 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7467
7468 * lisp.h (eassert): Assume C89 or later.
7469 This removes the need for CHECK.
7470 (CHECK): Remove. Its comments about always evaluating its
7471 argument were confusing, as 'eassert' typically does not evaluate
7472 its argument.
7473
7474 * coding.c (produce_chars): Use ptrdiff_t, not int.
7475
7476 * xterm.c (x_draw_underwave): Check for integer overflow.
7477 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7478
7479 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7480
7481 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7482 referenced (Bug#11583).
7483
7484 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7485
7486 Implement wave-style variant of underlining.
7487 * dispextern.h (face_underline_type): New enum.
7488 (face): Add field for underline type.
7489 * nsterm.m (ns_draw_underwave): New function.
7490 (ns_draw_text_decoration): Use it.
7491 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7492 New functions.
7493 (x_draw_glyph_string): Use them.
7494 * xfaces.c (Qline, Qwave): New Lisp objects.
7495 (check_lface_attrs, merge_face_ref)
7496 (Finternal_set_lisp_face_attribute, realize_x_face):
7497 Handle wave-style underline face attributes.
7498 * xterm.c (x_draw_underwave): New function.
7499 (x_draw_glyph_string): Use it.
7500
7501 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7502
7503 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7504 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7505 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7506 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7507 ($(BLD)/w32select.$(O)): Update dependencies.
7508
7509 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7510
7511 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7512 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7513 * character.c (_fetch_multibyte_char_p): Remove.
7514 * alloc.c: Include "character.h" before "buffer.h".
7515 * bidi.c: Likewise.
7516 * buffer.c: Likewise.
7517 * bytecode.c: Likewise.
7518 * callint.c: Likewise.
7519 * callproc.c: Likewise.
7520 * casefiddle.c: Likewise.
7521 * casetab.c: Likewise.
7522 * category.c: Likewise.
7523 * cmds.c: Likewise.
7524 * coding.c: Likewise.
7525 * composite.c: Likewise.
7526 * dired.c: Likewise.
7527 * dispnew.c: Likewise.
7528 * doc.c: Likewise.
7529 * dosfns.c: Likewise.
7530 * editfns.c: Likewise.
7531 * emacs.c: Likewise.
7532 * fileio.c: Likewise.
7533 * filelock.c: Likewise.
7534 * font.c: Likewise.
7535 * fontset.c: Likewise.
7536 * fringe.c: Likewise.
7537 * indent.c: Likewise.
7538 * insdel.c: Likewise.
7539 * intervals.c: Likewise.
7540 * keyboard.c: Likewise.
7541 * keymap.c: Likewise.
7542 * lread.c: Likewise.
7543 * macros.c: Likewise.
7544 * marker.c: Likewise.
7545 * minibuf.c: Likewise.
7546 * nsfns.m: Likewise.
7547 * nsmenu.m: Likewise.
7548 * print.c: Likewise.
7549 * process.c: Likewise.
7550 * regex.c: Likewise.
7551 * region-cache.c: Likewise.
7552 * search.c: Likewise.
7553 * syntax.c: Likewise.
7554 * term.c: Likewise.
7555 * textprop.c: Likewise.
7556 * undo.c: Likewise.
7557 * unexsol.c: Likewise.
7558 * w16select.c: Likewise.
7559 * w32fns.c: Likewise.
7560 * w32menu.c: Likewise.
7561 * window.c: Likewise.
7562 * xdisp.c: Likewise.
7563 * xfns.c: Likewise.
7564 * xmenu.c: Likewise.
7565 * xml.c: Likewise.
7566 * xselect.c: Likewise.
7567
7568 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7569
7570 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7571 If all the glyphs of the glyph row came from strings, and we have no
7572 cursor positioning clues, put the cursor on the first glyph of the
7573 row.
7574 (handle_face_prop): Use chunk-relative overlay string index when
7575 indexing into it->string_overlays array. (Bug#11653)
7576 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7577 the rightmost. (Bug#11720)
7578
7579 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7580
7581 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7582 (CATEGORY_MEMBER): Enforce 1/0 value.
7583 * category.c (_temp_category_set): Remove.
7584
7585 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7586
7587 * window.c (Fdelete_other_windows_internal)
7588 (Fdelete_window_internal): Don't access frame's mouse highlight
7589 info of the initial frame. (Bug#11677)
7590
7591 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7592
7593 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7594 Assume USE_2_TAGS_FOR_INTS.
7595 (xreload): Adjust $tagmask width to match recent lisp.h change.
7596
7597 Simplify lisp.h in minor ways that should not affect code.
7598 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7599 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7600 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7601 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7602 (INTTYPEBITS): New macro, for clarity.
7603 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7604 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7605 Simplify now that USE_LSB_TAG is always defined.
7606 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7607 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7608
7609 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7610
7611 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7612
7613 2012-06-13 Glenn Morris <rgm@gnu.org>
7614
7615 * s/bsd-common.h (BSD4_3):
7616 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7617
7618 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7619
7620 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7621 instead of union.
7622 (XLI, XIL): Define.
7623 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7624 Use them.
7625 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7626 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7627 * alloc.c (widen_to_Lisp_Object): Remove.
7628 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7629 * frame.c (delete_frame): Remove outdated comment.
7630 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7631 USE_LISP_UNION_TYPE.
7632 (Fw32_unregister_hot_key): Likewise.
7633 (Fw32_toggle_lock_key): Likewise.
7634 * w32menu.c (add_menu_item): Likewise.
7635 (w32_menu_display_help): Use XIL instead of checking
7636 USE_LISP_UNION_TYPE.
7637 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7638 (init_heap): Likewise.
7639 * w32term.c (w32_read_socket): Update comment.
7640
7641 2012-06-13 Glenn Morris <rgm@gnu.org>
7642
7643 * s/usg5-4-common.h, src/s/unixware.h:
7644 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7645
7646 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7647
7648 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7649
7650 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7651 * alloc.c (make_number) [!defined make_number]:
7652 Remove, as lisp.h always defines this now.
7653 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7654 (roundup_size): Verify that it is a power of 2.
7655 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7656 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7657 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7658 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7659 USE_LSB_TAG now is always defined to be either 0 or 1.
7660 All uses changed.
7661 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7662 code works fine either way, and efficiency is not a concern here,
7663 as the union type is for debugging, not for production.
7664 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7665 Use an inline function on all platforms when using the union type,
7666 since this is simpler and 'static inline' can be used portably
7667 within Emacs now.
7668 (LISP_INITIALLY_ZERO): New macro.
7669 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7670 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7671
7672 2012-06-12 Glenn Morris <rgm@gnu.org>
7673
7674 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7675
7676 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7677
7678 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7679 Move BROKEN_SIGIO to configure.
7680
7681 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7682 Move NO_TERMIO to configure.
7683
7684 2012-06-12 Chong Yidong <cyd@gnu.org>
7685
7686 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7687 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7688 MagickExportImagePixels is undefined.
7689
7690 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7691
7692 * image.c (imagemagick_load_image): Remove unused label.
7693
7694 2012-06-11 Glenn Morris <rgm@gnu.org>
7695
7696 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7697 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7698 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7699 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7700
7701 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7702
7703 * alloc.c (make_byte_code): New function.
7704 (Fmake_byte_code): Use it. Don't purify here.
7705 * lread.c (read1): Use it as well to avoid extra allocation.
7706
7707 2012-06-11 Chong Yidong <cyd@gnu.org>
7708
7709 * image.c (imagemagick_load_image): Implement transparency.
7710
7711 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7712
7713 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7714 account for preceding backslashes. (Bug#11663)
7715
7716 2012-06-09 Chong Yidong <cyd@gnu.org>
7717
7718 * term.c: Support italics in capable terminals (Bug#9652).
7719 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7720 (turn_on_face): Output using TS_enter_italic_mode if available.
7721 Don't handle unused blinking and alt-charset cases.
7722 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7723 and tty_alt_charset_p cases.
7724 (tty_capable_p, init_tty): Support italics.
7725
7726 * termchar.h (struct tty_display_info): Add field for italics.
7727 Remove unused blink field.
7728
7729 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7730 Handle slant.
7731
7732 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7733 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7734 tty_alt_charset_p. Add tty_italic_p.
7735
7736 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7737
7738 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7739 dbus_type_is_basic if available.
7740 (xd_extract_signed, xd_extract_unsigned): Rename from
7741 extract_signed and extract_unsigned, respectively. Adapt callers.
7742
7743 2012-06-09 Chong Yidong <cyd@gnu.org>
7744
7745 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7746
7747 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7748 case (Bug#9752).
7749
7750 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7751
7752 * xdisp.c (vmessage): Treat frame message as multibyte.
7753 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7754 would generate the diagnostic "Making \302\247 buffer-local while
7755 let-bound!".
7756
7757 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7758
7759 * dispnew.c (showing_window_margins_p): Undo last change, which
7760 was done due to an inadvertent commit.
7761 (adjust_frame_glyphs_for_frame_redisplay): Do call
7762 showing_window_margins_p.
7763
7764 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7765
7766 * eval.c (Fmake_var_non_special): New primitive.
7767 (syms_of_eval): Defsubr it.
7768 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7769
7770 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7771
7772 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7773 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7774
7775 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7776
7777 * alloc.c (allocate_vectorlike): Fix last change.
7778
7779 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7780
7781 Block-based vector allocation of small vectors.
7782 * lisp.h (struct vectorlike_header): New field `nbytes',
7783 adjust comment accordingly.
7784 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7785 to denote vector blocks. Adjust users (live_vector_p,
7786 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7787 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7788 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7789 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7790 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7791 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7792 (roundup_size): New constant.
7793 (struct vector_block): New data type.
7794 (vector_blocks, vector_free_lists, zero_vector): New variables.
7795 (all_vectors): Rename to `large_vectors'.
7796 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7797 (sweep_vectors): New functions.
7798 (allocate_vectorlike): Return `zero_vector' as the only vector of
7799 0 items. Allocate new vector from block if vector size is less than
7800 or equal to VBLOCK_BYTES_MAX.
7801 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7802 (init_alloc_once): Add call to init_vectors.
7803
7804 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7805
7806 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7807
7808 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7809
7810 * doprnt.c (doprnt): Truncate multibyte char correctly.
7811 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7812 would mishandle a string argument "Xc" if X was a multibyte
7813 character of length 2: it would truncate after X's first byte
7814 rather than including all of X.
7815
7816 2012-06-06 Chong Yidong <cyd@gnu.org>
7817
7818 * buffer.c (word_wrap): Doc fix.
7819
7820 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7821
7822 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7823
7824 2012-06-03 Glenn Morris <rgm@gnu.org>
7825
7826 * xdisp.c (tool-bar-style): Doc fix.
7827
7828 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7829
7830 * Makefile.in (PAXCTL): Define.
7831 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7832 binary via PaX flags if the paxctl utility is available.
7833 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7834 Restore PaX flags to their default. (Bug#11398)
7835
7836 2012-06-03 Chong Yidong <cyd@gnu.org>
7837
7838 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7839 buffer (Bug#11226).
7840
7841 2012-06-03 Chong Yidong <cyd@gnu.org>
7842
7843 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7844 (note_mode_line_or_margin_highlight): If there is no help echo,
7845 use mode-line-default-help-echo. Handle the case where the mouse
7846 position is past the end of the mode line string.
7847
7848 * buffer.c (buffer_local_value_1): New function, split from
7849 Fbuffer_local_value; can return Qunbound.
7850 (Fbuffer_local_value): Use it.
7851 (Vmode_line_format): Docstring tweaks.
7852
7853 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7854
7855 * sysdep.c (system_process_attributes): Improve comment.
7856
7857 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7858
7859 * keyboard.c: Export real-this-command to Elisp.
7860 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7861 and DEFVAR it. Update all users.
7862
7863 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7864
7865 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7866
7867 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7868 Convert pctcpu and pctmem to Lisp float properly.
7869 Let the compiler fold better, as 100.0/0x8000 is exact.
7870
7871 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7872
7873 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7874 cons_block.
7875
7876 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7877
7878 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7879
7880 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7881
7882 For a 'struct window', replace some Lisp_Object fields to
7883 bitfields where appropriate, remove unused fields.
7884 * window.h (struct window): Remove unused 'last_mark_x' and
7885 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7886 change its type from Lisp_Object to bitfield.
7887 Change type of 'force_start', 'optional_new_start',
7888 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7889 fields from Lisp_Object to bitfield. Adjust users accordingly.
7890
7891 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7892
7893 Pacify gcc -Wdouble-precision when using Xaw.
7894 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7895 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7896 Use 'float' consistently, rather than 'float' in most places
7897 and 'double' in a couple of places.
7898
7899 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7900
7901 * xdisp.c (handle_stop): Detect whether we have overlay strings
7902 loaded by testing it->current.overlay_string_index to be
7903 non-negative, instead of checking whether n_overlay_strings is
7904 positive. (Bug#11587)
7905
7906 2012-05-31 Chong Yidong <cyd@gnu.org>
7907
7908 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7909
7910 * doc.c (Fsubstitute_command_keys): Doc fix.
7911
7912 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7913
7914 * search.c (search_buffer): Remove calls to
7915 r_alloc_inhibit_buffer_relocation, as it is now called by
7916 maybe_unify_char, which was the cause of relocation of buffer text
7917 in bug#11519.
7918
7919 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7920
7921 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7922 for the duration of call to load_charset, to avoid problems with
7923 callers of maybe_unify_char that access buffer text through C
7924 pointers.
7925
7926 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7927 decrement the inhibition flag, instead of just setting or
7928 resetting it.
7929
7930 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7931
7932 Remove obsolete '#define static' cruft.
7933 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7934 This #undef was "temporary" in 2000; it is no longer needed
7935 now that '#define static' has gone away.
7936 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7937 (gray_bitmap_bits): Remove; no longer needed.
7938 All uses replaced with definiens.
7939 * xterm.c: Include "bitmaps/gray.xbm".
7940
7941 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7942
7943 Clean up __executable_start, monstartup when --enable-profiling.
7944 The following changes affect the code only when profiling.
7945 * dispnew.c (__executable_start): Rename from safe_bcopy.
7946 Define only on platforms that need it.
7947 * emacs.c: Include <sys/gmon.h> when profiling.
7948 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7949 (__executable_start): Remove decl, since lisp.h does it now.
7950 (safe_bcopy): Remove decl; no longer has that name.
7951 (main): Coalesce #if into single bit of code, for simplicity.
7952 Cast pointers to uintptr_t, since standard libraries want integers
7953 and not pointers.
7954 * lisp.h (__executable_start): New decl.
7955
7956 2012-05-31 Glenn Morris <rgm@gnu.org>
7957
7958 * image.c (Fimagemagick_types): Doc fix.
7959
7960 2012-05-30 Jim Meyering <meyering@redhat.com>
7961
7962 * callproc.c (Fcall_process_region): Include directory component
7963 in mkstemp error message (Bug#11586).
7964
7965 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7966
7967 * alloc.c, lisp.h (make_pure_vector): Now static.
7968
7969 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7970
7971 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7972 Move to byte-run.el.
7973 (Fautoload): Do the hash-doc more carefully.
7974 * data.c (Fdefalias): Purify definition, except for keymaps.
7975 (Qdefun): Move from eval.c.
7976 * lisp.h (Qdefun): Remove.
7977 * lread.c (read1): Tiny simplification.
7978
7979 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7980
7981 Do not create empty overlays with the evaporate property (Bug#9642).
7982 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7983 Bug#9642, but explicitly check that the buffer the overlay would
7984 be moved to is live and rearrange lines to make sure that errors
7985 will not put the overlay in an inconsistent state.
7986 (Fdelete_overlay): Cosmetics.
7987
7988 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7989
7990 * w32term.c (my_bring_window_to_top): New function.
7991 (x_raise_frame): Use handle returned by DeferWindowPos, which
7992 could be different from the original one.
7993 Call my_bring_window_to_top instead of my_set_foreground_window.
7994 (Bug#11513)
7995
7996 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7997 by calling BringWindowToTop.
7998
7999 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8000 (WM_EMACS_END): Increase by one.
8001
8002 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8003
8004 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8005 This avoids undefined behavior that might cause the eassert
8006 to not catch an out-of-range value.
8007
8008 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
8009
8010 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8011 Update dependencies.
8012
8013 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8014
8015 * bidi.c (bidi_mirror_char): Fix last change.
8016
8017 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8018
8019 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8020 when referring to sectname field in printf format.
8021
8022 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8023
8024 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8025 Only r_alloc_inhibit_buffer_relocation needed to be added;
8026 the others were already declared.
8027
8028 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8029 before checking whether it's out of range. Put the check inside
8030 eassert. See
8031 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8032
8033 2012-05-27 Ken Brown <kbrown@cornell.edu>
8034
8035 * callproc.c (Fcall_process): Restore a line that was accidentally
8036 commented out in the 2011-02-13 change (bug#11547).
8037
8038 2012-05-27 Eli Zaretskii <eliz@gnu.org>
8039
8040 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8041 defined on ralloc.c.
8042
8043 * buffer.c [REL_ALLOC]: Remove prototypes of
8044 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8045 they are now on lisp.h.
8046
8047 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8048
8049 * search.c (search_buffer): Use it to inhibit relocation of buffer
8050 text while re_search_2 is doing its job, because re_search_2 is
8051 passed C pointers to buffer text. (Bug#11519)
8052
8053 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8054 Update value to 24.
8055
8056 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8057 state after an additional call to move_it_in_display_line_to, keep
8058 the values of it->max_ascent and it->max_descent found for the
8059 entire line.
8060 (pos_visible_p): Revert the comparison against bottom_y to what it
8061 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8062 (Bug#11464)
8063
8064 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 Fix coding-related core dumps with gcc -ftrapv.
8067 The code was computing A - B, where A and B are pointers, and B is
8068 random garbage. This can lead to core dumps on platforms that
8069 have special pointer registers, and it also leads to core dumps on
8070 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8071 A - B only when B is initialized properly.
8072 * coding.c (coding_set_source, coding_set_destination): Return void.
8073 (coding_change_source, coding_change_destinations): New functions,
8074 with the old behaviors of coding_set_source and coding_set_destination.
8075 All callers that need an offset changed to use these new functions.
8076
8077 2012-05-26 Glenn Morris <rgm@gnu.org>
8078
8079 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8080
8081 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8082
8083 Extend mouse support on W32 text-mode console.
8084 * xdisp.c (draw_row_with_mouse_face):
8085 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8086
8087 * w32console.c: Include window.h.
8088 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8089 New functions.
8090 (initialize_w32_display): Initialize mouse-highlight data.
8091
8092 * w32inevt.c: Include termchar.h and window.h.
8093 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8094 moves, call note_mouse_highlight. If help_echo changed, call
8095 gen_help_event to produce help-echo message in the echo area.
8096 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8097 highlight info.
8098
8099 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8100
8101 * lread.c (read1): Simplify slightly to avoid an overflow warning
8102 with GCC 4.7.0 on x86-64.
8103
8104 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8105
8106 * bidi.c (bidi_mirror_char): Revert last change: an int is
8107 definitely wide enough here.
8108
8109 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8110
8111 Fix integer width and related bugs (Bug#9874).
8112 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8113 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8114 (string_bytes, check_sblock, allocate_string_data):
8115 (compact_small_strings, Fmake_bool_vector, make_string)
8116 (make_unibyte_string, make_multibyte_string)
8117 (make_string_from_bytes, make_specified_string)
8118 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8119 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8120 (mark_vectorlike):
8121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8122 (allocate_pseudovector):
8123 Use int, not EMACS_INT, where int is wide enough.
8124 (inhibit_garbage_collection, Fgarbage_collect):
8125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8126 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8127 int might not be wide enough.
8128 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8129 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8130 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8131 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8132 (bidi_level_of_next_char, bidi_move_to_visually_next):
8133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8134 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8135 (Fkill_buffer, Fset_buffer_major_mode)
8136 (advance_to_char_boundary, Fbuffer_swap_text)
8137 (Fset_buffer_multibyte, overlays_at, overlays_in)
8138 (overlay_touches_p, struct sortvec, record_overlay_string)
8139 (overlay_strings, recenter_overlay_lists)
8140 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8141 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8142 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8143 (Foverlay_recenter, last_overlay_modification_hooks_used)
8144 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8146 (validate_region): Omit unnecessary test for b <= e,
8147 since that's guaranteed by the previous test.
8148 (adjust_overlays_for_delete): Avoid pos + length overflow.
8149 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8150 (report_overlay_modification):
8151 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8152 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8153 Omit pointer cast, which isn't needed anyway, and doesn't work
8154 after the EMACS_INT -> ptrdiff_t change.
8155 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8156 * buffer.h: Adjust decls to match defn changes elsewhere.
8157 (struct buffer_text, struct buffer):
8158 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8159 Use EMACS_INT, not int, where int might not be wide enough.
8160 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8161 not int, to avoid needless 32-bit limit on 64-bit hosts.
8162 (exec_byte_code): Use tighter memory-full test, one that checks
8163 for alloca overflow. Don't compute the address of the object just
8164 before an array, as that's not portable. Use EMACS_INT, not
8165 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8166 * callint.c (Fcall_interactively):
8167 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8168 * callproc.c (call_process_kill, Fcall_process):
8169 Don't assume pid_t fits into an Emacs fixnum.
8170 (call_process_cleanup, Fcall_process, child_setup):
8171 Don't assume pid_t fits into int.
8172 (call_process_cleanup, Fcall_process, delete_temp_file)
8173 (Fcall_process_region):
8174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8175 (Fcall_process): Simplify handling of volatile integers.
8176 Use int, not EMACS_INT, where int will do.
8177 * casefiddle.c (casify_object, casify_region, operate_on_word)
8178 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8180 (casify_object): Avoid integer overflow when overallocating buffer.
8181 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8182 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8183 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8184 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8185 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8186 integers are now checked earlier. All uses replaced with XINT.
8187 (ccl_driver):
8188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8189 For CCL_MapSingle, check that content and value are in int range.
8190 (ccl_driver, Fregister_code_conversion_map):
8191 Check that Vcode_version_map_vector is a vector.
8192 (resolve_symbol_ccl_program): Check that vector header is in range.
8193 Always copy the vector, so that we can check its contents reliably
8194 now rather than having to recheck each instruction as it's being
8195 executed. Check that vector words fit in 'int'.
8196 (ccl_get_compiled_code, Fregister_ccl_program)
8197 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8198 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8199 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8200 contents are in range.
8201 (Fccl_execute_on_string): Check that status is in range.
8202 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8203 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8204 Accept and return EMACS_INT, not int, because callers can pass values
8205 out of 'int' range.
8206 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8207 (multibyte_chars_in_text, parse_str_as_multibyte)
8208 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8209 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8210 (string_escape_byte8, Fget_byte):
8211 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8212 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8213 avoid mishandling large integers.
8214 * character.h: Adjust decls to match defn changes elsewhere.
8215 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8216 (Ffind_charset_region):
8217 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8218 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8219 (load_charset_map_from_vector, Fdefine_charset_internal):
8220 Don't assume fixnum fits in int.
8221 (load_charset_map_from_vector, Fmap_charset_chars):
8222 Remove now-unnecessary CHECK_NATNUMs.
8223 (Fdefine_charset_internal): Check ranges here, more carefully.
8224 Don't rely on undefined behavior with signed left shift overflow.
8225 Don't assume unsigned int fits into fixnum, or that fixnum fits
8226 into unsigned int. Don't require max_code to be a valid fixnum;
8227 that's not true for gb10830 4-byte on a 32-bit host. Allow
8228 invalid_code to be a cons, for the same reason. Require code_offset
8229 to be a character. Avoid int overflow if max_char is close
8230 to INT_MAX.
8231 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8232 this is intended anyway and avoids some undefined behavior.
8233 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8234 INDEX_TO_CODE_POINT, as that's what it expects.
8235 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8236 * charset.h (DECODE_CHAR): Return int, not unsigned;
8237 this is what was intended anyway, and it avoids undefined behavior.
8238 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8239 integer-overflow issues.
8240 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8241 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8242 where the argument is EMACS_INT, and this behavior is not intended.
8243 * chartab.c (Fmake_char_table, Fset_char_table_range)
8244 (uniprop_get_decoder, uniprop_get_encoder):
8245 Don't assume fixnum fits in int.
8246 * cmds.c (move_point): New function, that does the gist of
8247 Fforward_char and Fbackward_char, but does so while checking
8248 for integer overflow more accurately.
8249 (Fforward_char, Fbackward_char): Use it.
8250 (Fforward_line, Fend_of_line, internal_self_insert)
8251 (internal_self_insert):
8252 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8253 Fix a FIXME, by checking for integer overflow when calculating
8254 target_clm and actual_clm.
8255 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8256 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8257 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8258 (coding_alloc_by_making_gap, alloc_destination)
8259 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8260 (encode_coding_utf_16, detect_coding_emacs_mule)
8261 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8262 (detect_coding_iso_2022, decode_coding_iso_2022)
8263 (encode_invocation_designation, encode_designation_at_bol)
8264 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8265 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8266 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8267 (encode_coding_ccl, encode_coding_raw_text)
8268 (detect_coding_charset, decode_coding_charset)
8269 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8270 (produce_composition, produce_charset, produce_annotation)
8271 (decode_coding, handle_composition_annotation)
8272 (handle_charset_annotation, consume_chars, decode_coding_gap)
8273 (decode_coding_object, encode_coding_object, detect_coding_system)
8274 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8275 (code_convert_region, code_convert_string)
8276 (Fdefine_coding_system_internal)
8277 (coding_set_source, coding_set_destination):
8278 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8279 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8280 (Fdefine_coding_system_internal):
8281 Don't assume fixnums fit in int.
8282 (decode_coding_gap, decode_coding_object, encode_coding_object)
8283 (Fread_coding_system, Fdetect_coding_region)
8284 (Funencodable_char_position, Fcheck_coding_systems_region)
8285 (get_translation, handle_composition_annotation, consume_chars):
8286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8287 (consume_chars): Rewrite to not calculate an address outside buffer.
8288 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8289 Don't access memory outside of the args array.
8290 (Fdefine_coding_system_internal): Check for charset-id overflow.
8291 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8292 result of ENCODE_CHAR.
8293 * coding.h: Adjust decls to match defn changes elsewhere.
8294 (struct coding_system):
8295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8296 * composite.c (get_composition_id, find_composition)
8297 (run_composition_function, update_compositions)
8298 (compose_text, composition_gstring_put_cache)
8299 (composition_gstring_p, composition_gstring_width)
8300 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8301 (composition_compute_stop_pos, composition_reseat_it)
8302 (composition_update_it, struct position_record)
8303 (find_automatic_composition, composition_adjust_point)
8304 (Fcomposition_get_gstring, Ffind_composition_internal):
8305 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8306 (update_compositions):
8307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8308 * composite.h: Adjust decls to match defn changes elsewhere.
8309 (struct composition):
8310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8311 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8312 Do not attempt to compute the address of the object just before a
8313 buffer; this is not portable.
8314 (Faref, Faset):
8315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8316 (Faset): Use int, not EMACS_INT, where int is wide enough.
8317 (Fstring_to_number): Don't assume fixnums fit in int.
8318 (Frem): Don't assume arg is nonnegative.
8319 * dbusbind.c (xd_append_arg): Check for integers out of range.
8320 (Fdbus_call_method): Don't overflow the timeout int.
8321 (extract_signed, extract_unsigned): New functions.
8322 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8323 (xd_get_connection_references): Return ptrdiff_t, not int.
8324 All uses changed.
8325 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8326 (xd_read_message_1):
8327 Use int, not unsigned, where the dbus API uses int.
8328 (Fdbus_message_internal): Don't overflow mtype.
8329 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8330 * dired.c (directory_files_internal, file_name_completion, scmp)
8331 (file_name_completion_stat):
8332 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8333 (file_name_completion): Don't overflow matchcount.
8334 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8335 * dispextern.h: Adjust decls to match defn changes elsewhere.
8336 (struct text_pos, struct glyph, struct bidi_saved_info)
8337 (struct bidi_string_data, struct bidi_it, struct composition_it)
8338 (struct it):
8339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8340 (struct display_pos, struct composition_it, struct it):
8341 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8342 * dispnew.c (increment_matrix_positions)
8343 (increment_row_positions, mode_line_string)
8344 (marginal_area_string):
8345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8346 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8347 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8348 (duration_to_sec_usec): New function, to check for overflow better.
8349 (Fsleep_for, sit_for): Use it.
8350 * doc.c (get_doc_string, store_function_docstring):
8351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8352 (get_doc_string, Fsnarf_documentation):
8353 Use int, not EMACS_INT, where int is wide enough.
8354 (get_doc_string):
8355 Use SAFE_ALLOCA, not alloca.
8356 Check for overflow when converting EMACS_INT to off_t.
8357 * doprnt.c (doprnt):
8358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8359 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8360 Don't assume uid_t fits into fixnum.
8361 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8362 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8363 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8364 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8365 (general_insert_function)
8366 (Finsert_char, make_buffer_string, make_buffer_string_both)
8367 (update_buffer_properties, Fbuffer_substring)
8368 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8369 (Fsubst_char_in_region, check_translation)
8370 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8371 (transpose_markers, Ftranspose_regions):
8372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8373 (clip_to_bounds): Move to lisp.h as an inline function).
8374 (Fconstrain_to_field): Don't assume integers are nonnegative.
8375 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8376 (Fsubst_char_in_region, Fsave_restriction):
8377 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8378 (Femacs_pid): Don't assume pid_t fits into fixnum.
8379 (lo_time): Use int, not EMACS_INT, when int suffices.
8380 (lisp_time_argument): Check for usec out of range.
8381 (Fencode_time): Don't assume fixnum fits in int.
8382 (Fuser_login_name, Fuser_full_name): Signal an error
8383 if a uid argument is out of range, rather than relying on
8384 undefined behavior.
8385 (Fformat_time_string): Remove now-unnecessary check.
8386 lisp_time_argument checks for out-of-range usec now.
8387 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8388 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8389 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8390 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8391 (init_cmdargs, Fdump_emacs):
8392 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8393 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8394 the bottom (typically) 32 bits of the fixnum.
8395 * eval.c (specpdl_size, call_debugger):
8396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8397 (when_entered_debugger, Fbacktrace_debug):
8398 Don't assume fixnum can fit in int.
8399 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8400 the object just before a buffer; this is not portable.
8401 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8402 (grow_specpdl, unbind_to):
8403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8404 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8405 (grow_specpdl): Simplify allocation by using xpalloc.
8406 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8407 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8408 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8410 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8411 (a_write, e_write):
8412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8413 (Fcopy_file, non_regular_nbytes, read_non_regular)
8414 (Finsert_file_contents):
8415 Use int, not EMACS_INT, where int is wide enough.
8416 (READ_BUF_SIZE): Verify that it fits in int.
8417 (Finsert_file_contents): Check that counts are in proper range,
8418 rather than assuming fixnums fit into ptrdiff_t etc.
8419 Don't assume fixnums fit into int.
8420 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8421 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8422 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8423 (string_char_to_byte, string_byte_to_char)
8424 (string_make_multibyte, string_to_multibyte)
8425 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8426 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8427 (substring_both, Fdelete, internal_equal, Ffillarray)
8428 (Fclear_string, mapcar1)
8429 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8430 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8431 (larger_vector, make_hash_table, maybe_resize_hash_table)
8432 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8433 (Fmaphash, secure_hash):
8434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8435 (concat): Check for string index and length overflow.
8436 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8437 (Frequire):
8438 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8439 (larger_vector): New API (vec, incr_min, size_max) replaces old
8440 one (vec, new_size, init). This catches size overflow.
8441 INIT was removed because it was always Qnil.
8442 All callers changed.
8443 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8444 the upper bound on a hash table index size.
8445 (make_hash_table, maybe_resize_hash_table): Use it.
8446 (secure_hash): Computer start_byte and end_byte only after
8447 they're known to be in ptrdiff_t range.
8448 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8449 (Ffont_get_glyphs, Ffont_at):
8450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8451 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8452 (Flist_fonts, Fopen_font):
8453 Don't assume fixnum can fit in int.
8454 (check_gstring): Don't assume index can fit in int.
8455 (font_match_p): Check that fixnum is a character, not a nonnegative
8456 fixnum, since the later code needs to stuff it into an int.
8457 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8458 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8459 conversion overflow issues.
8460 (Fopen_font): Check for integer out of range.
8461 (Ffont_get_glyphs): Don't assume index can fit in int.
8462 * font.h: Adjust decls to match defn changes elsewhere.
8463 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8464 integer overflow.
8465 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8466 printmax_t, where ptrdiff_t is wide enough.
8467 (Finternal_char_font):
8468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8469 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8470 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8471 (Fset_frame_position, x_set_frame_parameters)
8472 (x_set_line_spacing, x_set_border_width)
8473 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8474 Check that fixnums are in proper range for system types.
8475 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8477 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8478 Use SAFE_ALLOCA_LISP, not alloca.
8479 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8480 intptr_t is wide enough.
8481 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8482 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8483 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8484 Check for fixnum out of range.
8485 * ftfont.c (ftfont_list): Don't assume index fits in int.
8486 Check that fixnums are in proper range for system types.
8487 (ftfont_shape_by_flt):
8488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8489 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8491 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8492 Check that fixnums are in proper range for system types.
8493 * gnutls.h: Adjust decls to match defn changes elsewhere.
8494 * gtkutil.c (xg_dialog_run):
8495 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8496 (update_frame_tool_bar):
8497 Check that fixnums are in proper range for system types.
8498 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8499 (lookup_image): Check that fixnums are in range for system types.
8500 * indent.c (last_known_column, last_known_column_point):
8501 (current_column_bol_cache):
8502 (skip_invisible, current_column, check_display_width):
8503 (check_display_width, scan_for_column, current_column_1)
8504 (Findent_to, Fcurrent_indentation, position_indentation)
8505 (indented_beyond_p, Fmove_to_column, compute_motion):
8506 (Fcompute_motion, Fvertical_motion):
8507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8508 (last_known_column_modified): Use EMACS_INT, not int.
8509 (check_display_width):
8510 (Fcompute_motion):
8511 Check that fixnums and floats are in proper range for system types.
8512 (compute_motion): Don't assume index or fixnum fits in int.
8513 (compute_motion, Fcompute_motion):
8514 Use int, not EMACS_INT, when it is wide enough.
8515 (vmotion): Omit local var start_hpos that is always 0; that way
8516 we don't need to worry about overflow in expressions involving it.
8517 * indent.h: Adjust decls to match defn changes elsewhere.
8518 (struct position):
8519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8520 Use int, not EMACS_INT, where int is wide enough.
8521 Remove unused members ovstring_chars_done and tab_offset;
8522 all uses removed.
8523 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8524 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8525 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8526 (make_gap, copy_text, insert, insert_and_inherit)
8527 (insert_before_markers, insert_before_markers_and_inherit)
8528 (insert_1, count_combining_before, count_combining_after)
8529 (insert_1_both, insert_from_string)
8530 (insert_from_string_before_markers, insert_from_string_1)
8531 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8532 (adjust_after_replace, adjust_after_insert, replace_range)
8533 (replace_range_2, del_range, del_range_1, del_range_byte)
8534 (del_range_both, del_range_2, modify_region)
8535 (prepare_to_modify_buffer, signal_before_change)
8536 (signal_after_change, Fcombine_after_change_execute):
8537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8538 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8539 (balance_an_interval, split_interval_right, split_interval_left)
8540 (find_interval, next_interval, update_interval)
8541 (adjust_intervals_for_insertion, delete_node, delete_interval)
8542 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8543 (static_offset_intervals, offset_intervals)
8544 (merge_interval_right, merge_interval_left, make_new_interval)
8545 (graft_intervals_into_buffer, temp_set_point_both)
8546 (temp_set_point, set_point, adjust_for_invis_intang)
8547 (set_point_both, move_if_not_intangible, get_property_and_range)
8548 (get_local_map, copy_intervals, copy_intervals_to_string)
8549 (compare_string_intervals, set_intervals_multibyte_1):
8550 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8551 * intervals.h: Adjust decls to match defn changes elsewhere.
8552 (struct interval):
8553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8554 * keyboard.c (this_command_key_count, this_single_command_key_start)
8555 (before_command_key_count, before_command_echo_length, echo_now)
8556 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8557 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8558 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8559 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8561 (last_non_minibuf_size, last_point_position, echo_truncate)
8562 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8563 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8564 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8565 (stuff_buffered_input):
8566 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8567 (last_auto_save, command_loop_1, read_char):
8568 Use EMACS_INT, not int, to avoid integer overflow.
8569 (record_char): Avoid overflow in total_keys computation.
8570 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8571 * keyboard.h: Adjust decls to match defn changes elsewhere.
8572 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8573 (Fkey_description, Fdescribe_vector, Flookup_key):
8574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8575 (click_position): New function, to check that positions are in range.
8576 (Fcurrent_active_maps):
8577 (describe_command):
8578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8579 (Faccessible_keymaps, Fkey_description):
8580 (preferred_sequence_p):
8581 Don't assume fixnum can fit into int.
8582 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8583 Check for integer overflow in size calculations.
8584 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8585 avoid mishandling large integers.
8586 * lisp.h: Adjust decls to match defn changes elsewhere.
8587 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8588 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8589 (struct Lisp_Marker):
8590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8591 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8592 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8593 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8594 All callers changed.
8595 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8596 Assume the arg has valid form, since it always does.
8597 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8598 unsigned integer system type.
8599 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8600 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8601 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8602 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8603 (duration_to_sec_usec): New decl.
8604 * lread.c (read_from_string_index, read_from_string_index_byte)
8605 (read_from_string_limit, readchar, unreadchar, openp)
8606 (read_internal_start, read1, oblookup):
8607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8608 (Fload, readevalloop, Feval_buffer, Feval_region):
8609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8610 (openp): Check for out-of-range argument to 'access'.
8611 (read1): Use int, not EMACS_INT, where int is wide enough.
8612 Don't assume fixnum fits into int.
8613 Fix off-by-one error that can read outside a buffer.
8614 (read_filtered_event): Use duration_to_sec_usec
8615 to do proper overflow checking on durations.
8616 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8617 in size calculation.
8618 (Fexecute_kbd_macro):
8619 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8620 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8621 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8622 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8623 (set_marker_both, set_marker_restricted_both, marker_position)
8624 (marker_byte_position, Fbuffer_has_markers_at):
8625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8626 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8627 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8628 It now merely ensures that the menu is large enough, without
8629 necessarily growing it, as this avoids some integer overflow issues.
8630 All callers changed.
8631 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8633 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8634 Use SAFE_ALLOCA_LISP, not alloca.
8635 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8636 to EMACS_INT. Check that fixnums are in proper range for system types.
8637 * minibuf.c (minibuf_prompt_width, string_to_object)
8638 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8639 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8640 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8641 (get_minibuffer, read_minibuf_unwind):
8642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8643 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8644 this simplifies overflow checking. All callers changed.
8645 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8646 (Ftest_completion):
8647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8648 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8649 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8650 Check that fixnums are in proper range for system types.
8651 (Fx_create_frame, Fx_show_tip):
8652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8653 * nsfont.m (ns_findfonts, nsfont_list_family):
8654 Don't assume fixnum fits in long.
8655 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8656 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8657 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8658 wide enough.
8659 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8661 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8662 (PRINTDECLARE, PRINTPREPARE):
8663 (strout, print_string):
8664 (print, print_preprocess, print_check_string_charset_prop)
8665 (print_object):
8666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8667 (PRINTDECLARE):
8668 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8669 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8670 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8671 (printchar, strout): Use xpalloc to catch size calculation overflow.
8672 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8673 (print_error_message): Use SAFE_ALLOCA, not alloca.
8674 (print_object): Use int, not EMACS_INT, where int is wide enough.
8675 (print_depth, new_backquote_output, print_number_index):
8676 Use ptrdiff_t, not int, where int might not be wide enough.
8677 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8678 (Fset_process_window_size, Fformat_network_address)
8679 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8680 (sigchld_handler):
8681 Check that fixnums are in proper range for system types.
8682 (Fsignal_process): Simplify by avoiding a goto.
8683 Check for process-ids out of pid_t range rather than relying on
8684 undefined behavior.
8685 (process_tick, update_tick): Use EMACS_INT, not int.
8686 (Fformat_network_address, read_process_output, send_process)
8687 (Fprocess_send_region, status_notify):
8688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8689 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8690 (wait_reading_process_output, read_process_output, exec_sentinel):
8691 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8692 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8693 (Faccept_process_output): Use duration_to_sec_usec to do proper
8694 overflow checking on durations.
8695 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8696 Don't assume pid_t fits in int.
8697 * process.h (struct Lisp_Process): Members tick and update_tick
8698 are now of type EMACS_INT, not int.
8699 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8700 configured --with-wide-int.
8701 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8702 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8703 * search.c (looking_at_1, string_match_1):
8704 (fast_string_match, fast_c_string_match_ignore_case)
8705 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8706 (scan_newline, find_before_next_newline, search_command)
8707 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8708 (set_search_regs, wordify):
8709 (Freplace_match):
8710 (Fmatch_data):
8711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8712 (string_match_1, search_buffer, set_search_regs):
8713 (Fmatch_data):
8714 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8715 (wordify): Check for overflow in size calculation.
8716 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8717 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8718 Check that fixnums are in proper range for system types.
8719 * sound.c (struct sound_device)
8720 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8722 (Fplay_sound_internal):
8723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8724 * syntax.c (struct lisp_parse_state, find_start_modiff)
8725 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8726 (Fparse_partial_sexp):
8727 Don't assume fixnums can fit in int.
8728 (struct lisp_parse_state, find_start_pos, find_start_value)
8729 (find_start_value_byte, find_start_begv)
8730 (update_syntax_table, char_quoted, dec_bytepos)
8731 (find_defun_start, prev_char_comend_first, back_comment):
8732 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8733 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8735 (Finternal_describe_syntax_value): Check that match_lisp is a
8736 character, not an integer, since the code stuffs it into int.
8737 (scan_words, scan_sexps_forward):
8738 Check that fixnums are in proper range for system types.
8739 (Fforward_word):
8740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8741 (scan_sexps_forward):
8742 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8743 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8744 * syntax.h: Adjust decls to match defn changes elsewhere.
8745 (struct gl_state_s):
8746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8747 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8748 MOST_POSITIVE_FIXNUM.
8749 * sysdep.c (wait_for_termination_1, wait_for_termination)
8750 (interruptible_wait_for_termination, mkdir):
8751 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8752 (emacs_read, emacs_write):
8753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8754 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8755 and double all fit in int.
8756 * term.c (set_tty_color_mode):
8757 Check that fixnums are in proper range for system types.
8758 * termhooks.h (struct input_event):
8759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8760 * textprop.c (validate_interval_range, interval_of)
8761 (Fadd_text_properties, set_text_properties_1)
8762 (Fremove_text_properties, Fremove_list_of_text_properties)
8763 (Ftext_property_any, Ftext_property_not_all)
8764 (copy_text_properties, text_property_list, extend_property_ranges)
8765 (verify_interval_modification):
8766 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8767 (Fnext_single_char_property_change)
8768 (Fprevious_single_char_property_change):
8769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8770 (copy_text_properties):
8771 Check for integer overflow in index calculation.
8772 * undo.c (last_boundary_position, record_point, record_insert)
8773 (record_delete, record_marker_adjustment, record_change)
8774 (record_property_change):
8775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8776 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8777 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8778 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8779 (Fx_hide_tip, Fx_file_dialog):
8780 * w32menu.c (set_frame_menubar):
8781 Use ptrdiff_t, not int, for consistency with rest of code.
8782 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8783 (select_window, Fdelete_other_windows_internal)
8784 (window_scroll_pixel_based, window_scroll_line_based)
8785 (Frecenter, Fset_window_configuration):
8786 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8787 (Fset_window_hscroll, run_window_configuration_change_hook)
8788 (set_window_buffer, temp_output_buffer_show, scroll_command)
8789 (Fscroll_other_window, Frecenter):
8790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8791 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8792 Don't assume fixnum fits in int.
8793 (Fset_window_scroll_bars):
8794 Check that fixnums are in proper range for system types.
8795 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8796 (string_pos, c_string_pos, number_of_chars, init_iterator)
8797 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8798 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8799 (compute_display_string_end, handle_face_prop)
8800 (face_before_or_after_it_pos, handle_invisible_prop)
8801 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8802 (display_prop_intangible_p, string_buffer_position_lim)
8803 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8804 (get_overlay_strings_1, get_overlay_strings)
8805 (iterate_out_of_display_property, forward_to_next_line_start)
8806 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8807 (get_next_display_element, set_iterator_to_next)
8808 (get_visually_first_element, compute_stop_pos_backwards)
8809 (handle_stop_backwards, next_element_from_buffer)
8810 (move_it_in_display_line_to, move_it_in_display_line)
8811 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8812 (add_to_log, message_dolog, message_log_check_duplicate)
8813 (message2, message2_nolog, message3, message3_nolog
8814 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8815 (current_message_1, truncate_echo_area, truncate_message_1)
8816 (set_message, set_message_1, store_mode_line_noprop)
8817 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8818 (text_outside_line_unchanged_p, check_point_in_composition)
8819 (reconsider_clip_changes)
8820 (redisplay_internal, set_cursor_from_row, try_scrolling)
8821 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8822 (redisplay_window, find_last_unchanged_at_beg_row)
8823 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8824 (trailing_whitespace_p, find_row_edges, display_line)
8825 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8826 (display_mode_element, store_mode_line_string)
8827 (pint2str, pint2hrstr, decode_mode_spec)
8828 (display_count_lines, display_string, draw_glyphs)
8829 (x_produce_glyphs, x_insert_glyphs)
8830 (rows_from_pos_range, mouse_face_from_buffer_pos)
8831 (fast_find_string_pos, mouse_face_from_string_pos)
8832 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8834 (safe_call, init_from_display_pos, handle_fontified_prop)
8835 (handle_single_display_spec, load_overlay_strings)
8836 (with_echo_area_buffer, setup_echo_area_for_printing)
8837 (display_echo_area, echo_area_display)
8838 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8839 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8840 (redisplay_window, dump_glyph_row, display_mode_line)
8841 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8842 (handle_display_spec, display_prop_string_p):
8843 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8844 (handle_single_display_spec, build_desired_tool_bar_string)
8845 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8846 (get_specified_cursor_type):
8847 Check that fixnums are in proper range for system types.
8848 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8849 (Flookup_image_map):
8850 Don't assume fixnums fit in int.
8851 (compare_overlay_entries):
8852 Avoid mishandling comparisons due to subtraction overflow.
8853 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8854 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8855 (handle_tool_bar_click):
8856 Use int, not unsigned, since we prefer signed and the signedness
8857 doesn't matter here.
8858 (get_next_display_element, next_element_from_display_vector):
8859 Use int, not EMACS_INT, when int is wide enough.
8860 (start_hourglass): Use duration_to_sec_usec to do proper
8861 overflow checking on durations.
8862 * xfaces.c (Fbitmap_spec_p):
8863 Check that fixnums are in proper range for system types.
8864 (compare_fonts_by_sort_order):
8865 Avoid mishandling comparisons due to subtraction overflow.
8866 (Fx_family_fonts, realize_basic_faces):
8867 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8868 (Fx_family_fonts):
8869 Don't assume fixnum fits in int.
8870 Use SAFE_ALLOCA_LISP, not alloca.
8871 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8872 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8873 (face_at_buffer_position, face_for_overlay_string)
8874 (face_at_string_position):
8875 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8876 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8877 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8878 (Fx_show_tip):
8879 Check that fixnums are in proper range for system types.
8880 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8881 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8882 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8883 (Fx_change_window_property): Don't assume fixnums fit in int.
8884 * xfont.c (xfont_chars_supported):
8885 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8886 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8887 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8888 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8889 * xml.c (parse_region):
8890 * xrdb.c (magic_file_p):
8891 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8892 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8893 (x_get_local_selection, x_reply_selection_request)
8894 (x_handle_selection_request, wait_for_property_change):
8895 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8896 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8897 short is wide enough.
8898 (x_send_client_event): Don't assume fixnum fits in int.
8899 * xterm.c (x_x_to_emacs_modifiers):
8900 Don't assume EMACS_INT overflows nicely into int.
8901 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8902 may come from Lisp.
8903 (handle_one_xevent): NATNUMP can eval its arg twice.
8904 (x_connection_closed):
8905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8906 * xterm.h: Adjust decls to match defn changes elsewhere.
8907 (struct scroll_bar): Use struct vectorlike_header
8908 rather than rolling our own approximation.
8909 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8910
8911 2012-05-25 Glenn Morris <rgm@gnu.org>
8912
8913 * lisp.mk (lisp): Update for more files being compiled now.
8914
8915 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8916
8917 * lread.c: Remove `read_pure' which makes no difference.
8918 (read_pure): Remove var.
8919 (unreadpure): Remove function.
8920 (readevalloop): Don't call read_list with -1 flag.
8921 (read1, read_vector): Don't test read_pure any more.
8922 (read_list): Simplify.
8923
8924 * fileio.c, character.h: Minor style tweaks.
8925
8926 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8927
8928 * window.h (clip_changed): Remove useless declaration.
8929
8930 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8931
8932 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8933 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8934
8935 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8936
8937 Remove src/m/*.
8938 This directory predates autoconf and is no longer needed nowadays.
8939 Move its few remaining bits of functionality to where they're needed.
8940 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8941 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8942 * m/template.h: Remove.
8943 * Makefile.in (M_FILE): Remove. All uses removed.
8944 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8945 * lisp.h (USE_LSB_TAG):
8946 * mem-limits.h (EXCEEDS_LISP_PTR):
8947 Use VAL_MAX, not VALBITS, in #if.
8948 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8949 (EMACS_UINT): Define unconditionally now.
8950 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8951 (BITS_PER_EMACS_INT): New constants, replacing
8952 what used to be in config.h, but not useful in #if.
8953 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8954 define them any more.
8955 (VAL_MAX): New macro.
8956 (VALMASK): Use it.
8957 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8958 BITS_PER_EMACS_INT, in #if.
8959 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8960 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8961 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8962 * s/ms-w32.h (DATA_START):
8963 Move here from removed file m/intel386.h.
8964 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8965 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8966
8967 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8968
8969 Assume C89 or later.
8970 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8971 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8972 (xrealloc):
8973 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8974 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8975 * textprop.c, tparam.c (NULL): Remove.
8976 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8977 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8978 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8979 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8980 * xterm.c (input_signal_count): Assume volatile works.
8981
8982 2012-05-21 Ken Brown <kbrown@cornell.edu>
8983
8984 * xgselect.c (xg_select): Fix first argument in call to 'select'
8985 (bug#11508).
8986
8987 2012-05-20 Ken Brown <kbrown@cornell.edu>
8988
8989 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8990 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8991
8992 2012-05-19 Ken Brown <kbrown@cornell.edu>
8993
8994 * xfns.c (x_in_use): Remove `static' qualifier.
8995 * xterm.h (x_in_use): Declare.
8996 * xgselect.c: Include xterm.h.
8997 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8998 and `display_arg' (bug#9754).
8999
9000 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9001
9002 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9003
9004 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9005 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9006
9007 2012-05-18 Eli Zaretskii <eliz@gnu.org>
9008
9009 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9010
9011 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
9012 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
9013
9014 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9015 reference to image_cache->refcount.
9016 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9017
9018 2012-05-17 Juri Linkov <juri@jurta.org>
9019
9020 * search.c (Fword_search_regexp, Fword_search_backward)
9021 (Fword_search_forward, Fword_search_backward_lax)
9022 (Fword_search_forward_lax): Move functions to isearch.el
9023 (bug#10145, bug#11381).
9024
9025 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9026
9027 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9028
9029 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9030
9031 * lread.c (init_obarray): Declare Qt and Qnil as special.
9032
9033 2012-05-14 Glenn Morris <rgm@gnu.org>
9034
9035 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
9036 Put "libexec" before "bin", for the sake of init_callproc_1.
9037
9038 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9039
9040 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9041
9042 * unexaix.c: Port to more-recent AIX compilers.
9043 (report_error, report_error_1, make_hdr, copy_sym)
9044 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9045 Make arguments const char *, not char *, to avoid violations of C
9046 standard and to fix some AIX warnings reported by Gilles Pion.
9047
9048 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9049
9050 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9051 already have overlays loaded.
9052 (handle_single_display_spec): Before returning without displaying
9053 fringe bitmap, synchronize the bidi iterator with the main display
9054 iterator, by calling iterate_out_of_display_property.
9055 (iterate_out_of_display_property): Detect buffer iteration by
9056 testing that it->string is a Lisp string.
9057 (get_next_display_element): When the current object is exhausted,
9058 and there's something on it->stack, call set_iterator_to_next to
9059 proceed with what's on the stack, instead of returning zero.
9060 (set_iterator_to_next): If called at the end of a Lisp string,
9061 proceed to consider_string_end without incrementing string
9062 position. Don't increment display vector index past the end of
9063 the display vector. (Bug#11417)
9064 (pos_visible_p): Don't report a position visible when move_it_to
9065 stopped at the last line of window, which happens to be scanned
9066 backwards by the bidi iteration. (Bug#11464)
9067
9068 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9069
9070 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9071 and right-margin display specs even if the spec is invalid or we
9072 are on a TTY, and thus unable to display on the fringes.
9073 That's because the text with the property will not be displayed anyway,
9074 so we need to signal to the caller that this is a "replacing"
9075 display spec. This fixes display when the spec is invalid or we
9076 are on a TTY.
9077
9078 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9079
9080 * unexaix.c (make_hdr): Fix typo in prototype.
9081 This bug broke the build on AIX. Problem reported by Gilles Pion.
9082
9083 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9084
9085 * keyboard.c (kbd_buffer_get_event): Read special events also in
9086 batch mode. (Bug#11415)
9087
9088 2012-05-12 Glenn Morris <rgm@gnu.org>
9089
9090 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9091
9092 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9093
9094 * lisp.mk (lisp): Add newcomment.elc.
9095
9096 2012-05-12 Glenn Morris <rgm@gnu.org>
9097
9098 * Makefile.in (MKDIR_P): New, set by configure.
9099 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9100
9101 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9102
9103 Remove unused function hourglass_started.
9104 * dispextern.h (hourglass_started):
9105 * w32fns.c (hourglass_started):
9106 * xdisp.c (hourglass_started): Remove.
9107
9108 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9109
9110 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9111 Update dependencies.
9112
9113 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9114
9115 * xgselect.c (xg_select): Put maxfds+1 into a var.
9116 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9117
9118 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9119
9120 2012-05-10 Dave Abrahams <dave@boostpro.com>
9121
9122 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9123 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9124
9125 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9126
9127 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9128 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9129 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9130 Initialize xd_registered_buses.
9131
9132 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9133
9134 Untag more efficiently if USE_LSB_TAG.
9135 This is based on a proposal by YAMAMOTO Mitsuharu in
9136 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9137 For an admittedly artificial (nth 8000 longlist) benchmark on
9138 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9139 Emacs's overall text size by 1%.
9140 * lisp.h (XUNTAG): New macro.
9141 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9142 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9143 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9144 * eval.c (Fautoload):
9145 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9146 * frame.h (XFRAME): Use XUNTAG.
9147
9148 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9149 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9150 Remove unportable assumptions about print widths of types like
9151 dbus_uint32_t.
9152 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9153 intptr_t when converting between pointer and integer, to avoid GCC
9154 warnings about wrong width.
9155
9156 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9157
9158 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9159 stack for each reader_thread, instead of defaulting to 8MB
9160 determined by the linker. This avoids failures in creating
9161 subprocesses on Windows 7, see the discussion in this thread:
9162 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9163
9164 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9165
9166 Fix up display of the *Minibuf-0* buffer in the mini window.
9167 * keyboard.c (read_char): Don't clear the echo area if there's no
9168 message to clear.
9169 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9170 contents of *Minibuf-0*) if there's no message displayed in its stead.
9171
9172 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9173
9174 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9175 batch mode.
9176
9177 2012-05-06 Chong Yidong <cyd@gnu.org>
9178
9179 * lisp.mk (lisp): Update.
9180
9181 2012-05-05 Jim Meyering <meyering@redhat.com>
9182
9183 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9184
9185 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9186
9187 * data.c (PUT_ERROR): New macro.
9188 (syms_of_data): Use it. Add new error type `user-error'.
9189 * undo.c (user_error): New function.
9190 (Fprimitive_undo): Use it.
9191 * print.c (print_error_message): Adjust print style for `user-error'.
9192 * keyboard.c (user_error): New function.
9193 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9194
9195 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9196
9197 Do not limit current-time-string to years 1000..9999.
9198 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9199 (Fcurrent_time_string): Support any year that is supported by the
9200 underlying localtime representation. Don't use asctime, as it
9201 has undefined behavior for years outside the range -999..9999.
9202
9203 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9204
9205 Fix race conditions involving setenv, gmtime, localtime, asctime.
9206 Without this fix, interrupts could mess up code that uses these
9207 nonreentrant functions, since setting TZ invalidates existing
9208 tm_zone or tzname values, and since most of these functions return
9209 pointers to static storage.
9210 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9211 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9212 Grow the critical sections to include not just invoking
9213 localtime/gmtime, but also accessing these functions' results
9214 including their tm_zone values if any, and any related TZ setting.
9215 (format_time_string): Last arg is now struct tm *, not struct tm **,
9216 so that the struct tm is saved in the critical section.
9217 All callers changed. Simplify allocation of initial buffer, partly
9218 motivated by the fact that memory allocation needs to be outside
9219 the critical section.
9220
9221 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9222
9223 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9224 with RESET_INTERVAL.
9225
9226 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9227 Remove duplicated buffer name initialization.
9228
9229 2012-05-02 Jim Meyering <jim@meyering.net>
9230
9231 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9232
9233 * xfns.c (x_window): Use xstrdup (Bug#11375).
9234
9235 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9236
9237 * xdisp.c (pos_visible_p): If already at a newline from the
9238 display string before the 'while' loop, don't walk back the glyphs
9239 from it3.glyph_row. Solves assertion violation when the display
9240 string begins with a newline (egg.el). (Bug#11367)
9241
9242 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9243
9244 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9245 Move to simple.el.
9246
9247 2012-05-01 Glenn Morris <rgm@gnu.org>
9248
9249 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9250 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9251 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9252 All were removed before 23.1.
9253
9254 * dispnew.c: Remove HAVE_LIBNCURSES test;
9255 it is always true on relevant platforms.
9256
9257 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9258 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9259
9260 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9261
9262 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9263
9264 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9265 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9266 Remove.
9267
9268 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9269
9270 Do not avoid creating empty evaporating overlays (Bug#9642).
9271 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9272 That is, do not delete an evaporating overlay if it becomes
9273 empty after its bounds are adjusted to fit within its buffer.
9274 This fix caused other problems, and I'm reverting it until we get
9275 to the bottom of them.
9276
9277 2012-04-27 Chong Yidong <cyd@gnu.org>
9278
9279 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9280
9281 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9282
9283 * xdisp.c (pos_visible_p): If the window start position is beyond
9284 ZV, start the display from buffer beginning. Prevents assertion
9285 violation in init_iterator when the minibuffer window is scrolled
9286 via the scroll bar.
9287
9288 * window.c (window_scroll_pixel_based): Likewise.
9289
9290 2012-04-27 Chong Yidong <cyd@gnu.org>
9291
9292 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9293
9294 2012-04-27 Glenn Morris <rgm@gnu.org>
9295
9296 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9297 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9298
9299 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9300
9301 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9302 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9303
9304 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9305
9306 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9307 display element, check also the underlying string or buffer
9308 character. (Bug#11341)
9309
9310 * w32menu.c: Include w32heap.h.
9311 (add_menu_item): If the call to AppendMenuW (via
9312 unicode_append_menu) fails, disable Unicode menus only if we are
9313 running on Windows 9X/Me.
9314
9315 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9316
9317 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9318 (xgetint): Add missing shift for LSB tags.
9319
9320 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9321
9322 * keyboard.c (read_char): Don't wipe echo area for select window
9323 events: These might get delayed via `mouse-autoselect-window'
9324 (Bug#11304).
9325
9326 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9327
9328 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9329 manipulation of :loaded-from data.
9330
9331 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9332
9333 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9334 now a cons (bug#11311).
9335
9336 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9337
9338 Do not create empty overlays with the evaporate property (Bug#9642).
9339 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9340 if it becomes empty after its bounds are adjusted to fit within
9341 its buffer. Without this fix, in a nonempty buffer (let ((o
9342 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9343 yields an empty overlay that has the evaporate property, which is
9344 not supposed to happen.
9345
9346 Fix minor GTK3 problems found by static checking.
9347 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9348 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9349 (struct _EmacsFixedClass, emacs_fixed_get_type):
9350 Move decls here from emacsgtkfixed.h, since they needn't be public.
9351 (emacs_fixed_get_type): Now static.
9352 (emacs_fixed_class_init): Omit unused local.
9353 (emacs_fixed_child_type): Remove; unused.
9354 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9355 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9356 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9357 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9358 (EMACS_FIXED_GET_CLASS): Remove; unused.
9359 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9360
9361 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9362 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9363
9364 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9365
9366 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9367 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9368 (__malloc_size_t, __malloc_ptrdiff_t):
9369 Remove. All uses removed, replaced by the definiens if needed,
9370 since we can assume C89 or better now.
9371 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9372 (protect_malloc_state, align, get_contiguous_space)
9373 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9374 (malloc_atfork_handler_child, malloc_enable_thread)
9375 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9376 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9377 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9378 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9379 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9380 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9381 Define using prototypes, not old style.
9382 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9383 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9384 (align): Don't assume that signed integer overflow wraps around.
9385 Omit unused local var.
9386 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9387 (_free_internal_nolock, memalign, mallochook, reallochook):
9388 Omit no-longer-needed casts.
9389 (valloc): Use getpagesize, not __getpagesize.
9390 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9391 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9392
9393 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9394
9395 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9396
9397 Move functions from C to Lisp. Make non-blocking method calls
9398 the default. Implement further D-Bus standard interfaces.
9399
9400 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9401 (QCdbus_request_name_allow_replacement)
9402 (QCdbus_request_name_replace_existing)
9403 (QCdbus_request_name_do_not_queue)
9404 (QCdbus_request_name_reply_primary_owner)
9405 (QCdbus_request_name_reply_in_queue)
9406 (QCdbus_request_name_reply_exists)
9407 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9408 (QCdbus_registered_serial, QCdbus_registered_method)
9409 (QCdbus_registered_signal): New Lisp objects.
9410 (XD_DEBUG_MESSAGE): Use sizeof.
9411 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9412 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9413 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9414 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9415 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9416 (xd_signature, xd_append_arg): Allow float for integer types.
9417 (xd_get_connection_references): New function.
9418 (xd_get_connection_address): Rename from xd_initialize.
9419 Return cached address.
9420 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9421 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9422 level.
9423 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9424 Return number of refcounts.
9425 (Fdbus_get_unique_name): Make stronger parameter check.
9426 (Fdbus_message_internal): New defun.
9427 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9428 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9429 (Fdbus_send_signal, Fdbus_register_service)
9430 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9431 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9432 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9433 (Vdbus_compiled_version, Vdbus_runtime_version)
9434 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9435 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9436 (Vdbus_message_type_signal): New defvars.
9437 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9438 Adapt docstring.
9439
9440 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9441
9442 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9443 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9444 Do not assume ptrdiff_t is the same width as 'int'.
9445
9446 * alloc.c: Handle unusual debugging option combinations.
9447 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9448 since the two debugging options are incompatible.
9449 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9450 is defined.
9451 (mem_init, mem_insert, mem_insert_fixup):
9452 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9453 (NEED_MEM_INSERT): Remove; no longer needed.
9454
9455 2012-04-22 Leo Liu <sdl.web@gmail.com>
9456
9457 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9458
9459 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9460
9461 * sysdep.c [__FreeBSD__]: Minor cleanups.
9462 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9463 Use Emacs indenting style more consistently. Avoid some casts.
9464 Use 'double' consistently rather than mixing 'float' and 'double'.
9465
9466 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9467
9468 * sysdep.c (list_system_processes, system_process_attributes):
9469 Add implementation for FreeBSD (Bug#5243).
9470
9471 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9472
9473 * lisp.mk (lisp): Update.
9474
9475 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9476
9477 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9478 It is never used otherwise.
9479
9480 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9481
9482 * print.c (print_preprocess): Only check print_depth if print-circle
9483 is nil.
9484 (print_object): Check for cycles even when print-circle is nil and
9485 print-gensym is t, but only check print_depth if print-circle is nil.
9486
9487 2012-04-20 Chong Yidong <cyd@gnu.org>
9488
9489 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9490 set the status to "failed" and ensure that sentinel is run.
9491
9492 2012-04-20 Glenn Morris <rgm@gnu.org>
9493
9494 * process.c (Fset_process_inherit_coding_system_flag)
9495 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9496 (Fmake_network_process, Fmake_serial_process): Doc fix.
9497
9498 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9499
9500 * xdisp.c (string_buffer_position_lim): Limit starting position to
9501 BEGV.
9502 (set_cursor_from_row): If called for a mode-line or header-line
9503 row, return zero immediately.
9504 (try_cursor_movement): If inside continuation line, don't back up
9505 farther than the first row after the header line, if any.
9506 Don't consider the header-line row as "partially visible", even if
9507 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9508
9509 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9510
9511 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9512 (bug#11238).
9513
9514 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9515 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9516
9517 configure: new option --enable-gcc-warnings (Bug#11207)
9518 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9519 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9520 (ALL_CFLAGS): Use new macros rather than old.
9521 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9522 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9523 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9524 -Wunused-result, -Wunused-variable. This should go away once
9525 the Emacs and Gnulib regex code is merged.
9526 (xmalloc, xrealloc): Now static.
9527
9528 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9529
9530 * dired.c (Fsystem_groups): Remove unused local.
9531
9532 2012-04-17 Glenn Morris <rgm@gnu.org>
9533
9534 * dired.c (Fsystem_users): Doc fix.
9535
9536 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9537
9538 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9539 (syms_of_dired): Add them.
9540
9541 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9542
9543 Fix minor alloc.c problems found by static checking.
9544 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9545 New extern decls, to avoid calling undeclared functions.
9546 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9547 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9548 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9549 (NEED_MEM_INSERT): New macro.
9550 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9551 Remove one incorrect comment and fix another.
9552
9553 Fix minor ralloc.c problems found by static checking.
9554 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9555 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9556 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9557 (r_alloc_sbrk): Now static.
9558
9559 Improve ralloc.c interface checking.
9560 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9561 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9562 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9563 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9564 [REL_ALLOC]: ... to here, to check interface.
9565 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9566 Remove decls. This fixes an "It stinks!".
9567
9568 * alloc.c (which_symbols): Fix alignment issue / type clash.
9569
9570 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9571
9572 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9573 (struct Lisp_Misc_Any): Likewise.
9574 (struct Lisp_Free): Likewise.
9575 * alloc.c (union aligned_Lisp_Symbol): Define.
9576 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9577 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9578 (union aligned_Lisp_Misc): Define.
9579 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9580 aligned_Lisp_Misc instead of union Lisp_Misc.
9581 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9582
9583 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9584
9585 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9586 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9587 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9588 * s/netbsd.h, s/sol2-6.h:
9589 Remove definition of GC_MARK_STACK, since the default now works.
9590 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9591 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9592 no longer the default.
9593 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9594
9595 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9596
9597 * lread.c (lisp_file_lexically_bound_p):
9598 Fix hang at ";-*-\n" (bug#11238).
9599
9600 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9601
9602 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9603 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9604
9605 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9606
9607 * nsterm.m (constrainFrameRect): Always constrain when there is only
9608 one screen (Bug#10962).
9609
9610 2012-04-13 Ken Brown <kbrown@cornell.edu>
9611
9612 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9613
9614 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9615
9616 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9617
9618 2012-04-11 Daniel Colascione <dancol@dancol.org>
9619
9620 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9621 against is gone. It's better to use vfork now so that when Cygwin
9622 gains a new, working vfork, we use it automatically (bug#10398).
9623
9624 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9625
9626 * window.c (save_window_save): Obey window-point-insertion-type.
9627
9628 2012-04-11 Glenn Morris <rgm@gnu.org>
9629
9630 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9631
9632 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9633
9634 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9635
9636 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9637
9638 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9639 (force_quit_count): New var.
9640 (handle_interrupt): Use it.
9641
9642 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9643
9644 * w32.c (w32_delayed_load): Record the full path of the library
9645 being loaded (bug#10424).
9646
9647 2012-04-09 Glenn Morris <rgm@gnu.org>
9648
9649 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9650 not just in the obarray, before snarfing them. (Bug#11036)
9651
9652 * Makefile.in ($(leimdir)/leim-list.el):
9653 Pass EMACS rather than BUILT_EMACS.
9654
9655 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9656
9657 * process.c (make_process):
9658 * process.h: Add integer `gnutls_handshakes_tried' member to
9659 process struct.
9660
9661 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9662 Add convenience `GNUTLS_LOG2i' macro.
9663
9664 * gnutls.c (gnutls_log_function2i): Convenience log function.
9665 (emacs_gnutls_read): Use new log functions,
9666 `gnutls_handshakes_tried' process member, and
9667 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9668 attempts per process (connection).
9669
9670 2012-04-09 Chong Yidong <cyd@gnu.org>
9671
9672 * eval.c (Fuser_variable_p, user_variable_p_eh)
9673 (lisp_indirect_variable): Functions deleted.
9674 (Fdefvar): Caller changed.
9675
9676 * callint.c (Finteractive, Fcall_interactively):
9677 * minibuf.c (Fread_variable): Callers changed.
9678
9679 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9680
9681 * xdisp.c (set_cursor_from_row): If the display string appears in
9682 the buffer at position that is closer to point than the position
9683 after the display string, display the cursor on the first glyph of
9684 the display string. Fixes cursor display when a 'display' text
9685 property immediately follows invisible text. (Bug#11094)
9686
9687 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 composite.c: use 'double' consistently
9690 * composite.c (get_composition_id): Use 'double' consistently
9691 instead of converting 'float' to 'double' and vice versa; this is
9692 easier to understand and avoids a GCC warning.
9693
9694 2012-04-09 Glenn Morris <rgm@gnu.org>
9695
9696 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9697 preparation for dumping it with emacs. (Bug#4789)
9698 (leimdir): New variable.
9699 ($(leimdir)/leim-list.el): New rule.
9700 (emacs$(EXEEXT)): Depend on leim-list.el.
9701
9702 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9703 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9704 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9705
9706 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9707
9708 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9709 proper alignment.
9710
9711 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9712
9713 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9714 Remove unused local variable.
9715
9716 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9717
9718 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9719 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9720 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9721 objects, as mark_maybe_pointer will catch them otherwise.
9722 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9723 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9724
9725 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9726
9727 Fix typo that broke non-Windows builds.
9728 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9729
9730 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9731
9732 Support building on MS-Windows with libxml2.
9733
9734 * makefile.w32-in (OBJ2): Add xml.$(O).
9735 (GLOBAL_SOURCES): Add xml.c.
9736 ($(BLD)/xml.$(O)): New dependency list.
9737
9738 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9739 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9740 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9741 [!WINDOWSNT]: New macros.
9742 (init_libxml2_functions, libxml2_loaded_p): New functions.
9743 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9744 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9745 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9746 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9747 linked in).
9748 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9749 Call init_libxml2_functions before calling libxml2 functions.
9750 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9751
9752 * emacs.c: Don't include libxml/parser.h.
9753 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9754 xmlCleanupParser directly.
9755
9756 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9757
9758 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9759
9760 * indent.c (Fvertical_motion): If there is a display string at
9761 point, use it.vpos to compute how many lines to backtrack after
9762 move_it_to point. (Bug#11133)
9763
9764 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9765
9766 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9767 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9768 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9769 macros related to unification of CJK characters. For the details,
9770 see the discussion following the message here:
9771 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9772
9773 2012-04-04 Chong Yidong <cyd@gnu.org>
9774
9775 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9776
9777 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9778
9779 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9780 instead of alloca. (Bug#11138)
9781
9782 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9783
9784 * w32menu.c (is_simple_dialog): Properly check lisp types.
9785 (Bug#11141)
9786
9787 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9788
9789 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9790 position we get to after a call to move_it_to fails the
9791 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9792 only if we wind up in a string from display property. (Bug#11063)
9793
9794 * window.c (Fdelete_other_windows_internal): Invalidate the row
9795 and column information about mouse highlight, so that redisplay
9796 restores it after reallocating the glyph matrices. (Bug#7464)
9797
9798 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9799 string comes from a `display' text property, use the buffer
9800 position of that property as if we actually saw that position in
9801 the row's glyphs.
9802 (move_it_by_lines): Remove the assertion that
9803 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9804 violated when there's a before-string at the beginning of a line.
9805 (Bug#11063)
9806
9807 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9808
9809 * xdisp.c (append_space_for_newline): If the default face was
9810 remapped, use the remapped face for the appended newline.
9811 (extend_face_to_end_of_line): Use the remapped default face for
9812 extending the face to the end of the line.
9813 (display_line): Call extend_face_to_end_of_line when the default
9814 face was remapped. (Bug#11068)
9815
9816 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9817
9818 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9819
9820 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9821
9822 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9823
9824 2012-03-27 Glenn Morris <rgm@gnu.org>
9825
9826 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9827 Doc fixes.
9828
9829 2012-03-26 Kenichi Handa <handa@m17n.org>
9830
9831 * dispextern.h (struct glyph): Fix previous change. Change the
9832 bit length of glyphless.ch to 25 (Bug#11082).
9833
9834 2012-03-26 Chong Yidong <cyd@gnu.org>
9835
9836 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9837 (command_loop_1): Use it; inhibit selection update for
9838 handle-select-window too (Bug#8996).
9839
9840 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9841
9842 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9843
9844 2012-03-25 Kenichi Handa <handa@m17n.org>
9845
9846 * dispextern.h (struct glyph): Change the bit length of
9847 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9848
9849 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9850
9851 * s/ms-w32.h (tzname): Include time.h before redirecting to
9852 _tzname. Fixes the MSVC build. (Bug#9960)
9853
9854 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9855
9856 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9857 characters.
9858
9859 * xterm.c (XTread_socket): Only modify handling_signal if
9860 !SYNC_INPUT. (Bug#11080)
9861
9862 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9863
9864 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9865 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9866 when fetching a multibyte character consumes more bytes than
9867 CHAR_BYTES returns, due to unification of CJK characters in
9868 string_char. (Bug#11073)
9869
9870 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9871
9872 * process.c (wait_reading_process_output): Handle pty disconnect
9873 by refraining from sending oneself a SIGCHLD (bug#10933).
9874
9875 2012-03-22 Chong Yidong <cyd@gnu.org>
9876
9877 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9878
9879 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9880 Mark string as coming from a prefix property.
9881 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9882 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9883
9884 2012-03-21 Chong Yidong <cyd@gnu.org>
9885
9886 * xfaces.c (Vface_remapping_alist): Doc fix.
9887
9888 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9889
9890 * w32proc.c (Fw32_set_console_codepage)
9891 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9892 Doc fixes.
9893
9894 2012-03-20 Chong Yidong <cyd@gnu.org>
9895
9896 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9897 to reflect default non-nil value of redisplay-dont-pause.
9898
9899 2012-03-19 Kenichi Handa <handa@m17n.org>
9900
9901 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9902 it fit in a valid range (Bug#11003).
9903
9904 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9905
9906 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9907 that is not from display property, accept the row as a "cursor
9908 row" if one of the string's character has a non-nil `cursor'
9909 property. Fixes cursor positioning when there are newlines in
9910 overlay strings, e.g. in icomplete.el. (Bug#11035)
9911
9912 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9913
9914 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9915
9916 2012-03-12 Chong Yidong <cyd@gnu.org>
9917
9918 * eval.c (inhibit_lisp_code): Rename from
9919 inhibit_window_configuration_change_hook; move from window.c.
9920
9921 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9922 * window.c (run_window_configuration_change_hook)
9923 (syms_of_window): Callers changed.
9924
9925 2012-03-11 Chong Yidong <cyd@gnu.org>
9926
9927 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9928
9929 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9930
9931 2012-03-10 Chong Yidong <cyd@gnu.org>
9932
9933 * frame.c (other_visible_frames): Don't assume the selected frame
9934 is visible (Bug#10955).
9935
9936 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9937
9938 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9939
9940 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9941
9942 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9943 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9944 zero (Bug#10954).
9945
9946 2012-03-03 Glenn Morris <rgm@gnu.org>
9947
9948 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9949
9950 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9951
9952 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9953 position past the first glyph_row that ends at ZV. (Bug#10902)
9954 (redisplay_window, next_element_from_string): Fix typos in
9955 comments.
9956 (redisplay_window): Pass to move_it_vertically the margin in
9957 pixels, not in screen lines.
9958
9959 2012-03-02 Glenn Morris <rgm@gnu.org>
9960
9961 * buffer.c (buffer-list-update-hook): Doc fix.
9962
9963 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9964
9965 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9966 push_it before setting up the iterator for the first overlay
9967 string, even if we have an empty string loaded.
9968 (next_overlay_string): If there's an empty string on the iterator
9969 stack, pop the stack. (Bug#10903)
9970
9971 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9972
9973 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9974 Suggested by Stefan Monnier in
9975 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9976 * alloc.c (widen_to_Lisp_Object): New static function.
9977 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9978 and widening them to Lisp_Objects. This would work even if
9979 USE_LSB_TAG is defined and wide integers are used, which might
9980 happen in a future version of Emacs.
9981
9982 2012-02-25 Chong Yidong <cyd@gnu.org>
9983
9984 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9985 Doc fix.
9986
9987 * xselect.c (Fx_selection_exists_p): Doc fix.
9988 (x_clipboard_manager_save_all): Print an informative message
9989 before saving to clipboard manager.
9990
9991 2012-02-24 Chong Yidong <cyd@gnu.org>
9992
9993 * keyboard.c (process_special_events): Handle all X selection
9994 requests in kbd_buffer, not just the next one (Bug#8869).
9995
9996 2012-02-23 Chong Yidong <cyd@gnu.org>
9997
9998 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9999 call when setting menu-bar-lines and tool-bar-lines parameters.
10000 (unwind_create_frame_1): New helper function.
10001
10002 * window.c (inhibit_window_configuration_change_hook): New var.
10003 (run_window_configuration_change_hook): Obey it.
10004 (syms_of_window): Initialize it.
10005
10006 2012-02-22 Chong Yidong <cyd@gnu.org>
10007
10008 * xterm.c (x_draw_image_relief): Add missing type check for
10009 Vtool_bar_button_margin (Bug#10743).
10010
10011 2012-02-21 Chong Yidong <cyd@gnu.org>
10012
10013 * fileio.c (Vfile_name_handler_alist): Doc fix.
10014
10015 * buffer.c (Fget_file_buffer): Protect against invalid file
10016 handler return value.
10017
10018 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10019
10020 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10021 when computing $valmask.
10022
10023 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10024 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10025 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10026 It's useless in that case, and it can cause problems on hosts
10027 that allocate halves of EMACS_INT values separately.
10028 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10029 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10030 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10031 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10032 it avoids undefined behavior on hosts where shifting right by more
10033 than the word width has undefined behavior.
10034
10035 2012-02-19 Chong Yidong <cyd@gnu.org>
10036
10037 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10038 (Funhandled_file_name_directory, Ffile_name_as_directory)
10039 (Fdirectory_file_name, Fexpand_file_name)
10040 (Fsubstitute_in_file_name): Protect against invalid file handler
10041 return values (Bug#10845).
10042
10043 2012-02-18 Eli Zaretskii <eliz@gnu.org>
10044
10045 * .gdbinit (pitx): Fix incorrect references to fields of the
10046 iterator stack.
10047
10048 2012-02-17 Chong Yidong <cyd@gnu.org>
10049
10050 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10051
10052 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10053
10054 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10055 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10056
10057 2012-02-15 Chong Yidong <cyd@gnu.org>
10058
10059 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10060 marked as special. Also, starting docstrings with * is obsolete.
10061
10062 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10063
10064 * gnutls.c (emacs_gnutls_write): Fix last change.
10065
10066 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10067
10068 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10069 send_process.
10070
10071 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10072
10073 * keymap.c (Fsingle_key_description): Handle char ranges.
10074
10075 2012-02-12 Chong Yidong <cyd@gnu.org>
10076
10077 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10078 as that creates a dangerous corner case.
10079
10080 * window.c (Fdelete_window_internal): Invalidate the mouse
10081 highlight (Bug#9904).
10082
10083 2012-02-12 Glenn Morris <rgm@gnu.org>
10084
10085 * xselect.c (Fx_own_selection_internal)
10086 (Fx_get_selection_internal, Fx_disown_selection_internal)
10087 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10088 * nsselect.m (Fx_own_selection_internal)
10089 (Fx_disown_selection_internal, Fx_selection_exists_p)
10090 (Fx_selection_owner_p, Fx_get_selection_internal):
10091 Sync docs and argument specs with the xselect.c versions.
10092
10093 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10094
10095 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10096
10097 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10098
10099 * w32select.c (Fx_selection_exists_p): Sync doc string and
10100 argument list with xselect.c. (Bug#10783)
10101
10102 * w16select.c (Fx_selection_exists_p): Sync doc string and
10103 argument list with xselect.c. (Bug#10783)
10104
10105 2012-02-10 Glenn Morris <rgm@gnu.org>
10106
10107 * fns.c (Fsecure_hash): Doc fix.
10108
10109 2012-02-09 Kenichi Handa <handa@m17n.org>
10110
10111 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10112
10113 2012-02-07 Chong Yidong <cyd@gnu.org>
10114
10115 * buffer.c (Fbuffer_local_variables)
10116 (buffer_lisp_local_variables): Handle unbound vars correctly;
10117 don't let Qunbound leak into Lisp.
10118
10119 2012-02-07 Glenn Morris <rgm@gnu.org>
10120
10121 * image.c (Fimagemagick_types): Doc fix.
10122
10123 * image.c (imagemagick-render-type): Change it from a lisp object
10124 to an integer. Move the doc here from the lisp manual.
10125 Treat all values not equal to 0 the same.
10126
10127 2012-02-06 Chong Yidong <cyd@gnu.org>
10128
10129 * doc.c (store_function_docstring): Avoid applying docstring of
10130 alias to base function (Bug#2603).
10131
10132 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10133
10134 * .gdbinit (pp1, pv1): Remove redundant defines.
10135 (pr): Use pp.
10136
10137 2012-02-04 Chong Yidong <cyd@gnu.org>
10138
10139 * nsterm.m: Declare a global (Bug#10694).
10140
10141 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10142
10143 * w32.c (get_emacs_configuration_options):
10144 Include --enable-checking, if specified, in the return value.
10145
10146 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10147
10148 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10149 after rounding frame sizes. (Bug#9723)
10150
10151 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10152
10153 * keyboard.c (adjust_point_for_property): Don't position point
10154 before BEGV. (Bug#10696)
10155
10156 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10157
10158 Handle overflow when computing char display width (Bug#9496).
10159 * character.c (char_width): Return EMACS_INT, not int.
10160 (char_width, c_string_width): Check for overflow when
10161 computing the width; this is possible now that individual
10162 characters can have unbounded width. Problem introduced
10163 by merge from Emacs 23 on 2012-01-19.
10164
10165 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10166
10167 * dbusbind.c (Fdbus_register_method): Mention the return value
10168 :ignore in the docstring.
10169
10170 2012-02-02 Glenn Morris <rgm@gnu.org>
10171
10172 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10173
10174 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10175 Unconditionally set to t. (Bug#10673)
10176 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10177 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10178 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10179
10180 2012-02-02 Kenichi Handa <handa@m17n.org>
10181
10182 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10183 0, do not call append_composite_glyph.
10184
10185 2012-02-02 Kenichi Handa <handa@m17n.org>
10186
10187 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10188 NULL (Bug#6988).
10189 (x_produce_glyphs): If the component of a composition is a null
10190 string, set it->pixel_width to 1 to avoid zero-width glyph.
10191
10192 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10193
10194 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10195 first 2 arguments are identical. This makes inserting large
10196 output from a subprocess an order of magnitude faster on
10197 MS-Windows, where all sbrk'ed memory is always contiguous.
10198
10199 2012-01-31 Glenn Morris <rgm@gnu.org>
10200
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>: Sync docs.
10204
10205 2012-01-29 Glenn Morris <rgm@gnu.org>
10206
10207 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10208
10209 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10210
10211 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10212
10213 2012-01-28 Chong Yidong <cyd@gnu.org>
10214
10215 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10216
10217 2012-01-26 Chong Yidong <cyd@gnu.org>
10218
10219 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10220
10221 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10222 repeat counts (Bug#10507).
10223
10224 2012-01-26 Glenn Morris <rgm@gnu.org>
10225
10226 * lread.c (syms_of_lread): Doc fix.
10227
10228 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10229
10230 * coding.c (encode_designation_at_bol): Change return value to
10231 EMACS_INT.
10232
10233 2012-01-25 Chong Yidong <cyd@gnu.org>
10234
10235 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10236
10237 2012-01-21 Chong Yidong <cyd@gnu.org>
10238
10239 * floatfns.c (Fcopysign): Make the second argument non-optional,
10240 since nil is not allowed anyway.
10241
10242 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10243
10244 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10245 (send_process): Likewise.
10246
10247 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10248
10249 * window.c (save_window_save, Fcurrent_window_configuration)
10250 (Vwindow_persistent_parameters): Do not use Qstate.
10251 Rewrite doc-strings.
10252
10253 2012-01-19 Kenichi Handa <handa@m17n.org>
10254
10255 * character.c (char_width): New function.
10256 (Fchar_width, c_string_width, lisp_string_width):
10257 Use char_width (Bug#9496).
10258
10259 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10260
10261 * window.c (Vwindow_persistent_parameters): New variable.
10262 (Fset_window_configuration, save_window_save): Handle persistent
10263 window parameters.
10264
10265 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10266
10267 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10268 thrashing the stack of the thread. (Bug#9087)
10269
10270 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10271
10272 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10273
10274 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10275
10276 * xdisp.c (rows_from_pos_range): Handle the case where the
10277 highlight ends on a newline. (Bug#10464)
10278 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10279 he end column for display of highlight that ends on a newline
10280 before a R2L line.
10281
10282 2012-01-11 Glenn Morris <rgm@gnu.org>
10283
10284 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10285 from load-path also when installation-directory is nil. (Bug#10208)
10286
10287 2012-01-10 Glenn Morris <rgm@gnu.org>
10288
10289 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10290
10291 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10292 Update template values to be closer to their typical values these days.
10293
10294 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10295
10296 * xdisp.c (rows_from_pos_range): Accept additional argument
10297 DISP_STRING, and accept any glyph in a row whose object is that
10298 string as eligible for mouse highlight. Fixes mouse highlight of
10299 display strings from overlays. (Bug#10464)
10300
10301 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10302
10303 emacs: fix an auto-save permissions race condition (Bug#10400)
10304 * fileio.c (auto_saving_dir_umask): New static var.
10305 (Fmake_directory_internal): Use it.
10306 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10307 creating the directory. The old code temporarily assigns
10308 too-generous permissions to the directory.
10309 (do_auto_save_eh): Clear it.
10310 (Fdo_auto_save): Catch all errors, not just file errors, so
10311 that the var is always cleared.
10312
10313 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10314
10315 * search.c (scan_buffer): Pass character positions to
10316 know_region_cache, not byte positions. (Bug#6540)
10317
10318 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10319
10320 * w32.c (sys_rename): Report EXDEV when rename of a directory
10321 fails because the target is on another logical disk. (Bug#10284)
10322
10323 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10324
10325 * xterm.c (x_embed_request_focus): New function.
10326
10327 * xterm.h: Add prototype.
10328
10329 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10330
10331 2012-01-05 Glenn Morris <rgm@gnu.org>
10332
10333 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10334
10335 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10336
10337 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10338 Load gnutls_transport_set_lowat only if GnuTLS version is below
10339 2.11.1.
10340 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10341 GnuTLS versions below 2.11.1.
10342
10343 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10344
10345 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10346 to the doc string advising against its use for altering the way
10347 windows are scrolled.
10348
10349 2011-12-28 Kenichi Handa <handa@m17n.org>
10350
10351 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10352 coding-system ASCII compatible only when it does not produce BOM
10353 on encoding (Bug#10383).
10354
10355 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10356
10357 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10358 can scroll.
10359 (create_and_show_popup_menu): Always use menu_position_func for
10360 Gtk3 (Bug#10361).
10361
10362 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10363
10364 * callint.c (Fcall_interactively): Don't truncate prompt string.
10365
10366 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10367
10368 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10369 property that ends at ZV, so that the bidi iteration could be
10370 resumed from there (after widening). (Bug#10360)
10371
10372 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10373
10374 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10375
10376 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10377
10378 * nsterm.m (x_free_frame_resources):
10379 Release f->output_data.ns->miniimage.
10380 (ns_index_color): Fix indentation. Do not retain
10381 color_table->colors[i].
10382
10383 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10384 before returning.
10385
10386 * nsfns.m (x_set_background_color): Assign return value from
10387 ns_index_color to face-background instead of NSColor*.
10388 (ns_implicitly_set_icon_type): Fix indentation.
10389 Change assignment in for loop to comparison.
10390
10391 * emacs.c (ns_pool): New variable.
10392 (main): Assign ns_pool.
10393 (Fkill_emacs): Call ns_release_autorelease_pool.
10394
10395 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10396 autorelease fdesc, release fdAttrs and tdict.
10397 (ns_get_covering_families): Release charset.
10398 (ns_findfonts): Release NSFontDescriptor created with new.
10399 (ns_uni_to_glyphs): Fix indentation.
10400 (setString): Release attrStr before assigning new value.
10401
10402 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10403
10404 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10405 and NS_IMPL_COCOA.
10406 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10407 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10408
10409 2011-12-18 David Reitter <reitter@cmu.edu>
10410
10411 * nsterm.m (ns_term_init): Subscribe for notifications
10412 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10413 to method trackingNotification in EmacsMenu.
10414
10415 * nsmenu.m (trackingMenu): New variable.
10416 (trackingNotification): New method (from Aquamacs).
10417 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10418 from Aquamacs (Bug#7030).
10419
10420 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10421
10422 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10423 (symbol_to_nsstring): Fix indentation.
10424 (ns_symbol_to_pb): New function.
10425 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10426 (Fns_rotate_cut_buffers_internal): Remove.
10427 (Fns_store_selection_internal): Rename from
10428 Fns_store_cut_buffer_internal.
10429 (ns_get_foreign_selection, Fx_own_selection_internal)
10430 (Fx_disown_selection_internal, Fx_selection_exists_p)
10431 (Fns_get_selection_internal, Fns_store_selection_internal):
10432 Use ns_symbol_to_pb and check if return value is nil.
10433 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10434 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10435 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10436 renamed to Sns_store_selection_internal.
10437 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10438 and remove this function.
10439 (ns_handle_selection_clear): Remove, never used.
10440 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10441 here.
10442
10443 2011-12-17 Ken Brown <kbrown@cornell.edu>
10444
10445 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10446 GID is unknown (Bug#10257).
10447
10448 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10449
10450 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10451 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10452 which caused a build failure on GNU/Linux IA-64. This problem was
10453 introduced by my 2011-10-07 patch.
10454
10455 2011-12-15 Juri Linkov <juri@jurta.org>
10456
10457 * image.c (imagemagick_error): New function. (Bug#10112)
10458 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10459 Use `imagemagick_error' where ImageMagick functions return
10460 `MagickFalse'.
10461 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10462 proper order.
10463
10464 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10465
10466 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10467 fill background (Bug#8992).
10468
10469 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10470
10471 * window.c (Vwindow_combination_resize)
10472 (Vwindow_combination_limit): Use t instead of non-nil in
10473 doc-strings.
10474 (Vrecenter_redisplay): Add first sentence of doc-string on
10475 separate line.
10476 (Frecenter): Fix doc-string typo.
10477
10478 2011-12-11 Kenichi Handa <handa@m17n.org>
10479
10480 * coding.c (Funencodable_char_position): Pay attention to the
10481 buffer text relocation (Bug#9389).
10482
10483 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10484
10485 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10486 gtk_init (Bug#10100).
10487
10488 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10489
10490 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10491 IT->string is nil. (Bug#10263)
10492
10493 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10494
10495 * nsterm.h (x_free_frame_resources): Declare.
10496
10497 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10498 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10499
10500 * nsterm.h (ns_get_defaults_value): Declare.
10501
10502 * nsterm.m (ns_default): Call ns_get_defaults_value.
10503
10504 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10505
10506 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10507 (Bug#10170)
10508
10509 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10510
10511 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10512 that where the value of an _OBJC_* symbol points to is in the .bss
10513 section (Bug#10240).
10514
10515 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10516
10517 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10518 after the loop to call ccl_driver at least once (Bug#8619).
10519
10520 2011-12-08 Kenichi Handa <handa@m17n.org>
10521
10522 * ftfont.c (get_adstyle_property): Fix previous change
10523 (Bug#10233).
10524
10525 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10526
10527 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10528 dirs from the default value of EMACSLOADPATH (bug#10208).
10529
10530 2011-12-07 Glenn Morris <rgm@gnu.org>
10531
10532 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10533 installation and source directories as well. (Bug#10208)
10534
10535 2011-12-06 Chong Yidong <cyd@gnu.org>
10536
10537 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10538
10539 2011-12-06 Glenn Morris <rgm@gnu.org>
10540
10541 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10542 as an error, not just -1. (Bug#10217)
10543
10544 2011-12-05 Chong Yidong <cyd@gnu.org>
10545
10546 * keyboard.c (process_special_events): New function.
10547 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10548
10549 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10550
10551 * coding.c (encode_designation_at_bol): Don't use uninitialized
10552 local variable (Bug#9318).
10553
10554 2011-12-05 Kenichi Handa <handa@m17n.org>
10555
10556 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10557 return Qnil (Bug#8046, Bug#10193).
10558
10559 2011-12-05 Kenichi Handa <handa@m17n.org>
10560
10561 * coding.c (encode_designation_at_bol): New args charbuf_end and
10562 dst. Return the number of produced bytes. Callers changed.
10563 (coding_set_source): Return how many bytes coding->source was
10564 relocated.
10565 (coding_set_destination): Return how many bytes
10566 coding->destination was relocated.
10567 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10568 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10569
10570 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10571
10572 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10573 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10574 macro (Bug#9318).
10575
10576 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10577
10578 The following changes are to fix Bug#9318.
10579
10580 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10581 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10582 (encode_coding_iso_2022, encode_coding_sjis)
10583 (encode_coding_big5, encode_coding_charset): Use the above macros.
10584
10585 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10586
10587 * lisp.h (process_quit_flag): Fix external declaration.
10588
10589 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10590
10591 Don't macro-inline non-performance-critical code.
10592 * eval.c (process_quit_flag): New function.
10593 * lisp.h (QUIT): Use it.
10594
10595 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10596
10597 * nsfns.m (get_geometry_from_preferences): New function.
10598 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10599
10600 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10601
10602 * emacs.c (Qkill_emacs): Define.
10603 (syms_of_emacs): Initialize it.
10604 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10605 Qquit_flag to `kill-emacs' instead.
10606 (quit_throw_to_read_char): Add parameter `from_signal'.
10607 All callers changed. Call Fkill_emacs if requested and safe.
10608 * lisp.h (QUIT): Call Fkill_emacs if requested.
10609
10610 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10611
10612 * widget.c (update_wm_hints): Return if wmshell is null.
10613 (widget_update_wm_size_hints): New function.
10614
10615 * widget.h (widget_update_wm_size_hints): Declare.
10616
10617 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10618 widget_update_wm_size_hints (Bug#10104).
10619
10620 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10621
10622 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10623 before a newline, prepare the bidi iterator for consuming the
10624 newline, and keep the current paragraph direction. (Bug#10183)
10625 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10626
10627 2011-12-02 Juri Linkov <juri@jurta.org>
10628
10629 * search.c (Fword_search_regexp): New Lisp function created from
10630 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10631 (Fword_search_backward, Fword_search_forward)
10632 (Fword_search_backward_lax, Fword_search_forward_lax):
10633 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10634 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10635
10636 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10637
10638 * fileio.c (Finsert_file_contents): Move after-change-function call
10639 to before the "handled:" label, since all "goto handled" appear in
10640 cases where the *-change-functions have already been properly called
10641 (bug#10117).
10642
10643 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10644
10645 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10646 waiting for input. (Bug#10169)
10647
10648 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10649
10650 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10651 verifies glyph row's hash code--we have just reallocated the
10652 glyphs, so their contents can be complete garbage. (Bug#10164)
10653
10654 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10655
10656 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10657
10658 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10659
10660 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10661 attributes are tested _before_ calling verify_row_hash, to protect
10662 against GCC re-ordering of the tests. (Bug#10164)
10663
10664 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10665
10666 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10667
10668 * xterm.c (handle_one_xevent): Only set async_visible and friends
10669 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10670 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10671 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10672
10673 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10674
10675 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10676 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10677 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10678 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10679 All uses changed to use GCPRO1 etc.
10680 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10681 Revert to old implementation (i.e., before 2011-03-11).
10682
10683 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10684
10685 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10686 of scroll runs so as to avoid assigning disabled bogus rows and
10687 unnecessary graphics copy operations.
10688
10689 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10690
10691 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10692 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10693 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10694 (malloc, free, realloc, calloc): Redirect to e_* only when
10695 compiling Emacs.
10696
10697 * lisp.h (GCTYPEBITS): Move before first use.
10698 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10699 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10700 this macro definition.
10701
10702 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10703 _MSC_VER.
10704
10705 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10706
10707 * gtkutil.c (xg_create_frame_widgets):
10708 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10709 present with Gtk+ 2.0.
10710
10711 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10712
10713 * fileio.c (Finsert_file_contents): Undo previous change; see
10714 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10715
10716 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10717
10718 Rename locals to avoid shadowing.
10719 * fileio.c (Finsert_file_contents):
10720 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10721 * process.c (wait_reading_process_output):
10722 Rename inner 'proc' to 'p' to avoid shadowing.
10723 Indent for consistency with usual Emacs style.
10724
10725 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10726
10727 * xdisp.c (redisplay_window): If cursor row is not fully visible
10728 after recentering, and scroll-conservatively is set to a large
10729 number, scroll window by a few more lines to make the cursor fully
10730 visible and out of scroll-margin. (Bug#10105)
10731 (start_display): Don't move to the next line if the display should
10732 start at a newline that is part of a display vector or an overlay
10733 string. (Bug#10119)
10734
10735 2011-11-24 Juri Linkov <juri@jurta.org>
10736
10737 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10738 after the `MagickPingImage' call. (Bug#10112)
10739
10740 2011-11-23 Chong Yidong <cyd@gnu.org>
10741
10742 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10743
10744 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10745
10746 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10747 making another buffer current. (Bug#10114)
10748
10749 2011-11-23 Glenn Morris <rgm@gnu.org>
10750
10751 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10752
10753 2011-11-23 Chong Yidong <cyd@gnu.org>
10754
10755 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10756 using it (Bug#5984).
10757
10758 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10759
10760 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10761 and header-lines, as they don't have one computed for them.
10762 (Bug#10098)
10763
10764 * .gdbinit (prow): Make displayed values more self-explaining.
10765 Add row's hash code.
10766
10767 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10768
10769 * process.c (wait_reading_process_output): Fix asynchrounous
10770 GnuTLS socket handling on some versions of the GnuTLS library.
10771 (wait_reading_process_output): Add comment and URL.
10772
10773 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10774
10775 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10776
10777 2011-11-21 Chong Yidong <cyd@gnu.org>
10778
10779 * window.c (Fnext_window, Fprevious_window): Doc fix.
10780
10781 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10782
10783 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10784
10785 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10786
10787 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10788
10789 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10790
10791 * window.c (Fset_window_combination_limit): Rename argument
10792 STATUS to LIMIT.
10793 (Vwindow_combination_limit): Remove "status" from doc-string.
10794
10795 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10796
10797 * m/ibms390.h: Remove.
10798 * m/ibms390x.h: Don't include "ibms390.h".
10799
10800 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10801
10802 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10803 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10804
10805 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10806
10807 * casetab.c (Fset_case_table):
10808 * charset.c (Fcharset_after): Fix typos.
10809
10810 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10811
10812 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10813 Otherwise, valgrind does not work on some platforms.
10814 Problem reported by Andreas Schwab in
10815 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10816 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10817 is set, removing the need for VIRT_ADDRESS_VARIES.
10818 (PURE_P): Use a more-efficient implementation that needs just one
10819 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10820 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10821 to 4 (xorl, subq, cmpq, setbe).
10822 * alloc.c (pure): Always extern now, since that's the
10823 VIRT_ADDR_VARIES behavior.
10824 (PURE_POINTER_P): Use a single comparison, not two, for
10825 consistency with the new puresize.h.
10826 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10827 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10828 Remove VIRT_ADDR_VARIES no longer needed.
10829
10830 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10831
10832 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10833 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10834 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10835 behave as if the cursor position were at the window margin.
10836
10837 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10838 and the cursor position is out of bounds, behave as if the cursor
10839 position were at the window margin. (Bug#10075)
10840
10841 2011-11-18 Chong Yidong <cyd@gnu.org>
10842
10843 * window.c (Fwindow_combination_limit): Make first argument
10844 non-optional, since it is meaningless for live windows like the
10845 selected window.
10846
10847 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10848
10849 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10850
10851 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10852
10853 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10854 (graft_intervals_into_buffer): Simplify.
10855
10856 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10857
10858 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10859 hash values of the two rows.
10860 (copy_row_except_pointers): Preserve the used[] arrays and the
10861 hash values of the two rows. (Bug#10035)
10862 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10863
10864 * xdisp.c (row_hash): New function, body extracted from
10865 compute_line_metrics.
10866 (compute_line_metrics): Call row_hash, instead of computing the
10867 hash code inline.
10868
10869 * dispnew.c (verify_row_hash): Call row_hash for computing the
10870 hash code of a row, instead of duplicating code from xdisp.c.
10871
10872 * dispextern.h (row_hash): Add prototype.
10873
10874 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10875
10876 * frame.c (delete_frame): Don't delete the terminal when the last
10877 X frame is closed if emacs is built with GTK toolkit.
10878
10879 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10880
10881 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10882
10883 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10884
10885 * window.c (Vwindow_splits): Rename to
10886 Vwindow_combination_resize. Suggested by Juri Linkov.
10887 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10888 of Vwindow_splits.
10889
10890 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10891
10892 * nsfns.m (Fns_font_name):
10893 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10894
10895 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10896
10897 * window.h (window): Rename slot "nest" to "combination_limit".
10898 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10899 (Fset_window_nest): Rename to Fset_window_combination_limit.
10900 (Vwindow_nest): Rename to Vwindow_combination_limit.
10901 (recombine_windows, make_parent_window, make_window)
10902 (Fsplit_window_internal, saved_window)
10903 (Fset_window_configuration, save_window_save): Rename all
10904 occurrences of window_nest to window_combination_limit.
10905
10906 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10907
10908 * image.c (imagemagick_load_image): Fix typo.
10909
10910 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10911
10912 * xdisp.c (display_line): Move the call to
10913 highlight_trailing_whitespace before the call to
10914 compute_line_metrics, since the latter needs to see the final
10915 faces of all the glyphs to compute ROW's hash value.
10916 Fixes assertion violations in row_equal_p. (Bug#10035)
10917
10918 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10919
10920 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10921 just return (bug#10044).
10922
10923 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10924
10925 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10926 with user-defined heap size. Bump the default size of the temacs
10927 heap to 27MB, to avoid memory warning when running temacs.
10928 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10929
10930 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10931 current_matrix and desired_matrix. (Bug#9990)
10932 (verify_row_hash) [XASSERTS]: New function.
10933 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10934 that the hash value of glyph rows is correct.
10935
10936 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10937
10938 * window.h (window): Remove splits slot.
10939 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10940 (Fdelete_other_windows_internal, make_parent_window)
10941 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10942 (Fset_window_configuration, save_window_save): Don't deal with
10943 split status of windows.
10944 (saved_window): Remove splits slot.
10945 (Vwindow_splits): Rewrite doc-string.
10946
10947 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10948
10949 * xfns.c (unwind_create_frame):
10950 * nsfns.m (unwind_create_frame):
10951 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10952 Vframe_list (Bug#9999).
10953
10954 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10955
10956 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10957
10958 2011-11-11 Kenichi Handa <handa@m17n.org>
10959
10960 * callproc.c (Fcall_process): Set the member dst_multibyte of
10961 process_coding.
10962
10963 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10964
10965 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10966 avoid a crash (bug#9496).
10967
10968 2011-11-09 Chong Yidong <cyd@gnu.org>
10969
10970 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10971 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10972
10973 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10974
10975 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10976
10977 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10978
10979 Avoid some portability problems by eschewing 'extern inline' functions.
10980 The trivial performance wins aren't worth the portability hassles; see
10981 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10982 et seq.
10983 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10984 (window_box_width, window_box_left, window_box_left_offset)
10985 (window_box_right, window_box_right_offset): Undo previous change,
10986 by removing the "extern"s.
10987 * intervals.c (adjust_intervals_for_insertion)
10988 (adjust_intervals_for_deletion): Undo previous change,
10989 making these static again.
10990 (offset_intervals, temp_set_point_both, temp_set_point)
10991 (copy_intervals_to_string): No longer inline.
10992 * xdisp.c (window_text_bottom_y, window_box_width)
10993 (window_box_height, window_box_left_offset)
10994 (window_box_right_offset, window_box_left, window_box_right)
10995 (window_box): No longer inline.
10996
10997 2011-11-08 Chong Yidong <cyd@gnu.org>
10998
10999 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
11000 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11001 Signal an error if not a live window.
11002 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11003 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11004
11005 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
11006
11007 * lisp.h (syms_of_abbrev): Remove declaration.
11008 Reported by CHENG Gao <chenggao@royau.me>.
11009
11010 2011-11-07 Eli Zaretskii <eliz@gnu.org>
11011
11012 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11013 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11014 of temacs in GUI mode.
11015
11016 2011-11-07 Martin Rudalics <rudalics@gmx.at>
11017
11018 * window.h: Declare delete_all_child_windows instead of
11019 delete_all_subwindows.
11020 * window.c (Fwindow_nest, Fset_window_nest)
11021 (Fset_window_new_total, Fset_window_new_normal)
11022 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11023 (delete_all_subwindows): Rename to delete_all_child_windows.
11024 (Fdelete_other_windows_internal, Fset_window_configuration):
11025 Call delete_all_child_windows instead of delete_all_subwindows.
11026 * frame.c (delete_frame): Call delete_all_child_windows instead
11027 of delete_all_subwindows.
11028
11029 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11030
11031 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11032 This is also needed for porting to any host where GC_MARK_STACK is
11033 not GC_MAKE_GCPROS_NOOPS.
11034 (which_symbols): Use it.
11035
11036 2011-11-07 Kenichi Handa <handa@m17n.org>
11037
11038 * coding.c (coding_set_destination): Check coding->src_pos only
11039 when coding->src_object is a buffer (bug#9910).
11040
11041 * process.c (send_process): Set the member src_multibyte of coding
11042 to 0 (bug#9911) when sending a unibyte text.
11043
11044 * callproc.c (Fcall_process): Set the member src_multibyte of
11045 process_coding to 0 (bug#9912).
11046
11047 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11048
11049 * xmenu.c (cleanup_widget_value_tree): New function.
11050 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11051 calling free_menubar_widget_value_tree directly (Bug#9830).
11052
11053 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11054
11055 Fix some portability problems with 'inline'.
11056 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11057 (window_box_width, window_box_left, window_box_left_offset)
11058 (window_box_right, window_box_right_offset): Declare extern.
11059 Otherwise, these inline functions do not conform to C99 and
11060 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11061 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11062 * intervals.c (adjust_intervals_for_insertion)
11063 (adjust_intervals_for_deletion): Now extern, because otherwise the
11064 extern inline functions 'offset_intervals' couldn't refer to it.
11065 (static_offset_intervals): Remove.
11066 (offset_intervals): Rewrite using the old contents of
11067 static_offset_intervals. The old version didn't conform to C99
11068 because an extern inline function contained a reference to an
11069 identifier with static linkage.
11070
11071 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11072
11073 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11074 GC.
11075
11076 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11077
11078 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11079 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11080 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11081 return Qleft_to_right.
11082
11083 2011-11-06 Chong Yidong <cyd@gnu.org>
11084
11085 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11086 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11087 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11088 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11089 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11090 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11091 (Fwindow_vscroll): Doc fix.
11092 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11093 argument, since it makes no sense to pass a live window and for
11094 consistency with window-child.
11095
11096 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11097
11098 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11099 support MSVC.
11100
11101 2011-11-05 Jason Rumney <jasonr@gnu.org>
11102
11103 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11104 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11105 fonts (Bug#6029).
11106 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11107 bitwise arithmetic preventing use of unicode-sip and non-truetype
11108 opentype fonts.
11109
11110 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11111
11112 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11113 "emacs"-only part.
11114
11115 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11116 initialization code to keep similarity to xfns.c after changes
11117 from 2011-11-05.
11118
11119 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11120
11121 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11122 (unwind_create_frame): New function (Bug#9943).
11123 (Fx_create_frame): Restructure code to be more similar to the one in
11124 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11125 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11126 Move terminal->reference_count++ just before making the frame official
11127 (Bug#9943).
11128
11129 * nsterm.m (x_free_frame_resources): New function.
11130 (x_destroy_window): Move code to x_free_frame_resources.
11131
11132 * xfns.c (unwind_create_frame): Fix comment.
11133 (Fx_create_frame, x_create_tip_frame):
11134 Move terminal->reference_count++ just before making the frame
11135 official. Move initialization of image_cache_refcount and
11136 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11137
11138 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11139
11140 Support MSVC build with newer versions of Visual Studio.
11141 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11142 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11143 nt/gmake.defs.
11144
11145 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11146 which are not supported by MSVC.
11147 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11148 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11149 bitfields.
11150 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11151 types in bitfields.
11152 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11153
11154 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11155
11156 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11157
11158 Support MSVC build with newer versions of Visual Studio.
11159 * w32.c: Don't include w32api.h for MSVC.
11160 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11161
11162 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11163 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11164 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11165 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11166 e_* cousins.
11167 (alloca) [_MSC_VER]: Define to _alloca.
11168
11169 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11170
11171 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11172
11173 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11174
11175 * xdisp.c (note_mouse_highlight): If either of
11176 previous/next-single-property-change returns nil, treat that as
11177 the beginning or the end of the buffer. (Bug#9955)
11178
11179 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11180
11181 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11182 label is not null (Bug#9951).
11183 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11184 may be NULL.
11185
11186 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11187
11188 * window.c (Fwindow_body_size): Mention in the doc string that the
11189 return value is in frame's canonical units. (Bug#9949)
11190
11191 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11192
11193 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11194
11195 * w32fns.c (unwind_create_frame): If needed, free the glyph
11196 matrices of the partially constructed frame. (Bug#9943)
11197 * xfns.c (unwind_create_frame): Likewise.
11198
11199 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11200
11201 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11202 Don't stop backward scan on the continuation glyph, even though
11203 its CHARPOS is positive.
11204 (mouse_face_from_buffer_pos, note_mouse_highlight):
11205 Rename cover_string to disp_string.
11206
11207 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11208
11209 * window.c (temp_output_buffer_show): Don't use
11210 Vtemp_buffer_show_specifiers.
11211 (Vtemp_buffer_show_specifiers): Remove unused variable.
11212
11213 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11214
11215 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11216 past the beginning of the current glyph matrix.
11217
11218 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11219
11220 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11221 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11222 HAVE_GTK3 (Bug#9869).
11223
11224 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11225 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11226
11227 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11228
11229 * xterm.c: Declare x_handle_net_wm_state to return int.
11230 (handle_one_xevent): Check if we are iconified but don't have
11231 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11232 (get_current_wm_state): Return non-zero if not hidden,
11233 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11234 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11235 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11236 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11237
11238 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11239
11240 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11241 so that this new function doesn't get optimized away by a
11242 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11243
11244 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11245
11246 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11247
11248 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11249
11250 Fix the `xbytecode' command.
11251 * .gdbinit (xprintbytestr): New command.
11252 (xwhichsymbols): Rename from `which'; all callers changed.
11253 (xbytecode): Print the byte-code string as well.
11254
11255 2011-10-29 Kim Storm <storm@cua.dk>
11256
11257 * alloc.c (which_symbols): New function.
11258
11259 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11260
11261 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11262 line. (Bug#9903)
11263
11264 2011-10-29 Glenn Morris <rgm@gnu.org>
11265
11266 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11267 Not clear what it was for, and it causes various bugs. (Bug#9839)
11268
11269 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11270
11271 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11272 possible random value that matches one of those tested as
11273 condition to clear the mouse face.
11274
11275 2011-10-28 Chong Yidong <cyd@gnu.org>
11276
11277 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11278
11279 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11280
11281 * window.c (make_window): Initialize phys_cursor_on_p.
11282
11283 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11284
11285 * lisp.h (struct Lisp_Symbol): Update comments.
11286
11287 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11288
11289 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11290
11291 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11292
11293 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11294 <oslsachem@gmail.com> for helping to debug this.
11295
11296 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11297 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11298 (g_b_init_get_glyph_outline_w): New static variables.
11299 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11300 (GetGlyphOutlineW_Proc): New typedefs.
11301 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11302 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11303 New functions.
11304 (w32font_open_internal, compute_metrics):
11305 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11306 instead of calling the "wide" APIs directly.
11307
11308 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11309
11310 * w32.h (syms_of_w32font): Add prototype.
11311
11312 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11313
11314 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11315 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11316 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11317 (Fmove_to_window_line): Doc fix.
11318
11319 2011-10-27 Chong Yidong <cyd@gnu.org>
11320
11321 * process.c (make_process): Set gnutls_state to NULL.
11322
11323 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11324 non-NULL, regardless of GNUTLS_INITSTAGE.
11325 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11326 an error. Set process slots as soon as we allocate them.
11327
11328 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11329
11330 2011-10-27 Chong Yidong <cyd@gnu.org>
11331
11332 * gnutls.c (emacs_gnutls_deinit): New function.
11333 Deallocate credentials structures as well as calling gnutls_deinit.
11334 (Fgnutls_deinit, Fgnutls_boot): Use it.
11335
11336 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11337 (deactivate_process): Call emacs_gnutls_deinit.
11338
11339 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11340
11341 * image.c (x_create_x_image_and_pixmap):
11342 * w32.c (sys_rename, w32_delayed_load):
11343 * w32font.c (fill_in_logfont):
11344 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11345
11346 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11347
11348 * w32fns.c (w32_default_color_map): New function,
11349 extracted from Fw32_default_color_map.
11350 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11351
11352 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11353
11354 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11355
11356 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11357
11358 * keyboard.c (test_undefined): New function (bug#9751).
11359 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11360
11361 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11362
11363 * sysdep.c (init_sys_modes): Fix the check for the controlling
11364 terminal (Bug#6649).
11365
11366 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11367
11368 * dispextern.h (struct bidi_it): New member next_en_type.
11369
11370 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11371 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11372 current character, check also for next_en_type being WEAK_EN.
11373 (bidi_resolve_weak): Don't enter the expensive loop if the current
11374 position is before next_en_pos. Record the bidi type of the first
11375 non-ET, non-BN character we find, in addition to its position.
11376 (bidi_level_of_next_char): Invalidate next_en_type when
11377 next_en_pos is over-stepped.
11378
11379 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11380
11381 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11382 * editfns.c: Rewrite current-time-zone so that it invokes
11383 the equivalent of (format-time-string "%Z") to get the time zone name.
11384 This fixes a bug when the time zone name contains characters that
11385 need converting from the system time locale to Emacs internal format.
11386 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11387 that patch fixed format-time-string to do the conversion, but
11388 I forgot to fix current-time-zone.
11389 (format_time_string): New function, containing most of
11390 what Fformat_time_string used to contain.
11391 (Fformat_time_string): Rewrite in terms of format_time_string.
11392 This doesn't change this function's behavior.
11393 (current-time-zone): Rewrite to use format_time_string.
11394 This fixes the bug reported by Michael Schierl in
11395 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11396 Jason Rumney's 2007-06-07 change worked around this bug, but
11397 didn't fix it.
11398 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11399
11400 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11401
11402 * xdisp.c (start_display): If the character at POS is displayed
11403 via a display vector, reset IT->current.dpvec_index to zero.
11404 (try_window_reusing_current_matrix): If a line ends in a display
11405 vector or the next line starts in a display vector, continue
11406 redrawing the window even though the character position of
11407 start_row was reached.
11408 (Bug#9771, part 2)
11409
11410 2011-10-18 Chong Yidong <cyd@gnu.org>
11411
11412 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11413 with nobreak-char-display too.
11414
11415 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11416
11417 Fix part 3 of bug#9771.
11418 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11419 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11420 non-neutral characters if the current character is a paragraph
11421 separator (a.k.a. Newline). This avoids running the same
11422 expensive loop twice, once when we consume the preceding newline
11423 and the other time when the line actually needs to be displayed.
11424 Avoid the loop when we see neutrals on the base embedding level
11425 following a character whose directionality is the same as the
11426 paragraph's. This avoids running the expensive loop when a line
11427 ends in a long sequence of neutrals, like control characters.
11428 Add assertion against STRONG_AL type. Slightly rearrange code
11429 that determines the type of a neutral given the first non-neutral
11430 that follows it.
11431 (bidi_level_of_next_char): Set next_en_pos to zero when
11432 invalidating its info.
11433
11434 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11435
11436 * xdisp.c (push_display_prop): Determine whether to record string
11437 or buffer position by IT->string, not by IT->method. Allow
11438 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11439 (move_it_vertically_backward): Don't look for character position
11440 immediately after the newline when in a continuation line.
11441 (Bug#9771, part 1)
11442
11443 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11444
11445 * window.c (coordinates_in_window): Rewrite and delabelize
11446 vertical border check. (Bug#5357) (Bug#9618)
11447
11448 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11449
11450 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11451 errors in XSetWindowBorder (bug#9310).
11452
11453 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11454
11455 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11456 avoid crash when xmalloc overrun checking is enabled.
11457
11458 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11459
11460 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11461 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11462 cursor motion with <left> and <right> arrow keys.
11463
11464 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11465 some callers set that themselves.
11466
11467 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11468
11469 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11470 display string and the previous row comes from the same string and
11471 is empty. (Bug#9739) (Bug#9738)
11472
11473 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11474
11475 * doc.c (get_doc_string): Encode file name (bug#9735).
11476
11477 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11478
11479 * bidi.c (bidi_level_of_next_char):
11480 * xdisp.c (get_visually_first_element): Remove old incorrect
11481 comments regarding the Unicode Line Separator character.
11482
11483 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11484
11485 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11486
11487 * alloc.c (Fgc_status): Do not access beyond zombies array
11488 boundary if nzombies > MAX_ZOMBIES.
11489 * alloc.c (dump_zombies): Add missing format specifier.
11490
11491 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11492
11493 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11494 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11495
11496 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11497 Some packages use them to denote characters with modifiers.
11498
11499 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11500
11501 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11502 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11503 matching a pp-number. Rename parameter var to var1.
11504
11505 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11506
11507 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11508
11509 2011-10-08 Glenn Morris <rgm@gnu.org>
11510
11511 * callint.c (Fcall_interactively): Give a more explicit error for the
11512 'c' case with a non-character input. (Bug#8479)
11513
11514 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11515
11516 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11517 lines.
11518 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11519 lines that are hscrolled on the left.
11520
11521 * dispnew.c (buffer_posn_from_coords): Account for a possible
11522 presence of header-line. (Bug#4426)
11523
11524 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11525
11526 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11527 Don't advertise functionality which we discourage or doesn't work.
11528
11529 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11530
11531 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11532 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11533 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11534 this makes Emacs dump core during garbage collection on rare
11535 occasions. sizeof is obviously inferior to offsetof here, so
11536 stick with offsetof.
11537 (GC_POINTER_ALIGNMENT): New macro.
11538 (mark_memory): Omit 3rd (offset) arg; caller changed.
11539 Don't assume EMACS_INT alignment is the same as pointer alignment.
11540
11541 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11542
11543 * keyboard.c (read_key_sequence_remapped): New var.
11544 (read_key_sequence): Compute remapping in the right buffer.
11545 (command_loop_1): Use read_key_sequence's remapping directly.
11546
11547 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11548
11549 * dired.c (file_name_completion): Don't expand file name.
11550 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11551 before checking file name handler.
11552
11553 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11554 they've been requested explicitly (bug#9591).
11555
11556 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11557
11558 * keymap.c (Fsingle_key_description): Use make_specified_string
11559 instead of build_string to build string from push_key_description.
11560 (Bug#5193)
11561
11562 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11563
11564 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11565 This fixes a Y2038 bug on 64-bit hosts.
11566 * buffer.c (reset_buffer):
11567 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11568 (Fclear_buffer_auto_save_failure):
11569 Use 0, not -1, to represent an unset failure time, since time_t
11570 might not be signed.
11571
11572 Remove dependency on glibc malloc internals.
11573 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11574 Move back here from lisp.h, but with their new implementations.
11575 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11576 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11577 * charset.c (charset_table_init): New static var.
11578 (syms_of_charset): Use it instead of xmalloc. This removes a
11579 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11580 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11581 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11582 Move back to alloc.c.
11583 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11584 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11585
11586 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11587
11588 * nsterm.m (windowDidResize): Call x_set_window_size only when
11589 ns_in_resize is true. Otherwise set pixelwidth/height and
11590 call change_frame_size (Bug#9628).
11591
11592 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11593
11594 Port --enable-checking=all to Fedora 14 x86-64.
11595 * charset.c (syms_of_charset): Also account for glibc malloc's
11596 internal overhead when calculating the initial malloc maximum.
11597
11598 Port --enable-checking=all to Fedora 14 x86.
11599 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11600 Move to lisp.h.
11601 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11602 (overrun_check_realloc, overrun_check_free):
11603 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11604 That way, xmalloc returns a properly-aligned pointer even if
11605 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11606 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11607 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11608 into account when calculating the initial malloc maximum.
11609 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11610 Move here from alloc.c, so that charset.c can use it too.
11611 Properly align; the old code wasn't right for common 32-bit hosts
11612 when configured with --enable-checking=all.
11613 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11614 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11615
11616 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11617
11618 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11619 use EDOM.
11620
11621 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11622
11623 * xdisp.c (compute_display_string_end): If there's no display
11624 string at CHARPOS, return -1.
11625
11626 * bidi.c (bidi_fetch_char): When compute_display_string_end
11627 returns a negative value, treat the character as a normal
11628 character not covered by a display string. (Bug#9624)
11629
11630 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11631
11632 * lread.c (Fread_from_string): Fix typo in docstring.
11633
11634 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11635
11636 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11637 newline, reseat the iterator instead of bidi-iterating there one
11638 character at a time. (Bug#9610)
11639 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11640 TO_CHARPOS if the bidi iterator is at base embedding level.
11641
11642 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11643
11644 * lread.c (readevalloop): Use correct code for NBSP.
11645 (read1): Likewise. (Bug#9608)
11646
11647 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11648
11649 * dbusbind.c (Fdbus_register_signal): When service is not
11650 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11651
11652 2011-09-25 Glenn Morris <rgm@gnu.org>
11653
11654 * buffer.c (truncate-lines): Doc fix.
11655
11656 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11657
11658 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11659 (Fset_window_next_buffers): Doc fix.
11660
11661 2011-09-24 Glenn Morris <rgm@gnu.org>
11662
11663 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11664
11665 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11666
11667 Fix minor problems found by static checking.
11668 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11669 * indent.c (Fvertical_motion): Fix == vs = typo.
11670
11671 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11672
11673 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11674 Default value is now t. Doc fix.
11675
11676 * indent.c (Fvertical_motion): Compute and apply the overshoot
11677 logic when moving up, not only when moving down. Fix the
11678 confusing name and values of the it_overshoot_expected variable;
11679 logic changes accordingly. (Bug#9254) (Bug#9549)
11680
11681 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11682 CHARPOS is covered by a display string which includes newlines.
11683 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11684 is covered by a display string with embedded newlines.
11685
11686 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11687
11688 * dbusbind.c (Fdbus_register_signal): Add match rule to
11689 Vdbus_registered_objects_table. (Bug#9581)
11690 (Fdbus_register_method, Vdbus_registered_objects_table):
11691 Fix docstring.
11692
11693 2011-09-24 Jim Meyering <meyering@redhat.com>
11694
11695 do not ignore write error for any output size
11696 The previous change was incomplete.
11697 While it makes emacs --batch detect the vast majority of stdout
11698 write failures, errors were still ignored whenever the output size is
11699 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11700 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11701 && echo FAIL: ignored write error
11702 FAIL: ignored write error
11703 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11704 && echo FAIL: ignored write error
11705 FAIL: ignored write error
11706 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11707
11708 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11709
11710 * emacs.c (Fkill_emacs): In noninteractive mode exit
11711 non-successfully if a write error occurred on stdout. (Bug#9574)
11712
11713 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11714
11715 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11716 the xassert test.
11717
11718 * dispextern.h (struct it): Update the comment documenting what
11719 can it->OBJECT be.
11720
11721 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11722
11723 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11724 a display string, extend search for cursor position to end of row.
11725 (find_row_edges): If the row ends in a newline from a display
11726 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11727 Handle the case of a display string with multiple newlines.
11728 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11729 non-empty line. Fixes confusing cursor motion with arrow keys at
11730 the beginning of a line that starts with whitespace.
11731
11732 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11733
11734 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11735 (bug#9493).
11736
11737 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11738
11739 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11740 boolean (Bug#9154).
11741
11742 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11743
11744 * xdisp.c (display_line): Record maximum and minimum buffer
11745 positions even if no glyphs were produced (e.g., by a zero-width
11746 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11747 buffer positions that will be removed from the glyph row because
11748 they don't fit.
11749 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11750 column is beyond frame width: don't subtract 1 "pixel" when
11751 computing width of the stretch.
11752 (reseat_at_next_visible_line_start): Undo the change made on
11753 2011-09-17 that saved paragraph information and restored it after
11754 the call to `reseat'. (Bug#9545)
11755
11756 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11757
11758 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11759 and turn window cursor on if cleared (Bug#9415).
11760
11761 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11762
11763 * search.c (boyer_moore): Take unibyte characters from pattern
11764 literally. (Bug#9458)
11765
11766 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11767
11768 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11769
11770 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11771
11772 Fix minor problem found by static checking.
11773 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11774 initialized, to pacify gcc -Wuninitialized.
11775
11776 * fileio.c: Report proper errno when syscall falls.
11777 (Finsert_file_contents): Save and restore errno,
11778 so that report_file_error outputs the correct diagnostic.
11779 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11780
11781 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11782
11783 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11784
11785 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11786
11787 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11788 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11789
11790 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11791
11792 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11793 about the current paragraph and restore it after the call to reseat.
11794
11795 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11796 (bidi_find_paragraph_start): Search back for paragraph beginning
11797 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11798 (bidi_move_to_visually_next): Only trigger paragraph-related
11799 computations when the last character is a newline or at EOB, not
11800 just any NEUTRAL_B. (Bug#9470)
11801
11802 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11803 truncated lines if point is covered by a display string. (Bug#9524)
11804
11805 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11806
11807 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11808 (cons_to_x_long): New function.
11809 (lisp_data_to_selection_data): Use it. Correct the test for
11810 short-versus-long data; it was negated. Break out of vector
11811 loop, for efficiency, when a long datum is discovered.
11812
11813 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11814
11815 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11816
11817 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11818
11819 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11820 GCC PR/17406) by declaring this function with external scope.
11821
11822 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11823
11824 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11825 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11826
11827 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11828
11829 * editfns.c (Fformat): Correctly handle text properties on "%%".
11830
11831 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11832
11833 * xterm.c (x_draw_composite_glyph_string_foreground):
11834 * w32term.c (x_draw_composite_glyph_string_foreground):
11835 * term.c (encode_terminal_code):
11836 * composite.c (composition_update_it, get_composition_id):
11837 * xdisp.c (get_next_display_element)
11838 (fill_composite_glyph_string): Add comments about special meaning
11839 of TAB characters in a composition.
11840
11841 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11842
11843 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11844 This occurs when processing a multibyte format.
11845 Problem reported by Wolfgang Jenker.
11846
11847 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11848
11849 * xdisp.c (try_cursor_movement): Only check for exact match if
11850 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11851
11852 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11853
11854 Remove unused external symbols.
11855 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11856 * xdisp.c (calc_pixel_width_or_height): Now static.
11857 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11858 * indent.c (check_display_width):
11859 * w32term.c: Fix comment to match code.
11860 * xterm.c, xterm.h (x_catching_errors): Remove.
11861
11862 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11863
11864 * xselect.c: Use signed conversions more consistently (Bug#9498).
11865 (selection_data_to_lisp_data): Assume incoming selection data are
11866 signed integers, not unsigned. This is to be consistent with
11867 outgoing selection data, which was modified to use signed integers
11868 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11869 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11870 expects long, not unsigned long.
11871
11872 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11873
11874 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11875 computation of loop end. Reported by Johan Bockgård
11876 <bojohan@gnu.org>.
11877
11878 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11879
11880 * frame.c (Fother_visible_frames_p): Function deleted.
11881
11882 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11883
11884 * indent.c (compute_motion): Process display vector front to back
11885 rather than the other way around. (Bug#2496)
11886
11887 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11888
11889 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11890
11891 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11892
11893 * minibuf.c (Fread_from_minibuffer): Doc fix.
11894
11895 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11896
11897 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11898 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11899
11900 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11901
11902 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11903 value for non-existent files.
11904
11905 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11906
11907 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11908 set its "size" to -1. This will set the modtime_size field of
11909 the corresponding buffer to -1, which is what
11910 verify-visited-file-modtime expects for files that do not exist.
11911 (Bug#9139)
11912
11913 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11914
11915 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11916 here ...
11917 * lisp.h: ... from here. push_key_description is no longer
11918 defined in keyboard.c, so its declaration should not be in
11919 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11920 logically belongs with push_key_description.
11921
11922 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11923
11924 * buffer.h: Include <sys/types.h> instead of <time.h>.
11925 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11926 Problem reported by Herbert J. Skuhra.
11927
11928 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11929
11930 * xml.c (parse_region): Make the parsing work for
11931 non-comment-starting XML files again (bug#9144).
11932
11933 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11934
11935 * image.c (gif_load): Fix calculation of bottom and right corner.
11936 (Bug#9468)
11937
11938 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11939
11940 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11941 redisplay in small windows.
11942
11943 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11944
11945 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11946
11947 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11948
11949 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11950 Operate on live windows only.
11951
11952 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11953
11954 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11955
11956 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11957
11958 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11959 only under bidi iteration.
11960
11961 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11962
11963 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11964
11965 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11966
11967 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11968 Without this fix, the command to link temacs failed due to an
11969 undefined symbol __builtin_isnan. This is because
11970 /usr/include/iso/math_c99.h #defines isnan(x) to
11971 __builtin_isnan(x), but the bundled gcc, which identifies itself
11972 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11973 a __builtin_isnan.
11974 * floatfns.c (isnan): #undef, and then #define to a clone of
11975 what's in data.c.
11976 (Fisnan): Always define, since it's always available now.
11977 (syms_of_floatfns): Always define isnan at the Lisp level.
11978
11979 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11980
11981 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11982
11983 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11984
11985 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11986 The previous code assumed that file offsets (off_t values) fit in
11987 EMACS_INT variables, which is not true on typical 32-bit hosts.
11988 The code messed up by falsely reporting buffer overflow in cases
11989 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11990 when "big" contains more than 2**29 bytes, even though this
11991 inserts just one byte and does not overflow the buffer.
11992 (Finsert_file_contents): Store file offsets as off_t
11993 values, not as EMACS_INT values. Check for overflow when
11994 converting between EMACS_INT and off_t. When checking for
11995 buffer overflow or for overlap, take the offsets into account.
11996 Don't use EMACS_INT for small values where int suffices.
11997 When checking for overlap, fix a typo: ZV was used where
11998 ZV_BYTE was intended.
11999 (Fwrite_region): Don't assume off_t fits into 'long'.
12000 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12001
12002 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
12003
12004 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12005
12006 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12007
12008 sprintf-related integer and memory overflow issues (Bug#9412).
12009
12010 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
12011 (esprintf, exprintf, evxprintf): New functions.
12012 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12013 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
12014 (modify_event_symbol): Do not assume that the length of
12015 name_alist_or_stem is safe to alloca and fits in int.
12016 (Fexecute_extended_command): Likewise for function name and binding.
12017 (Frecursion_depth): Wrap around reliably on integer overflow.
12018 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12019 since some callers pass EMACS_INT values.
12020 (Fsingle_key_description): Don't crash if symbol name contains more
12021 than MAX_ALLOCA bytes.
12022 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12023 (get_minibuffer): Arg is now EMACS_INT, not int.
12024 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
12025 (esprintf, exprintf, evxprintf): New decls.
12026 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12027
12028 * dbusbind.c (signature_cat): New function.
12029 (xd_signature, Fdbus_register_signal):
12030 Do not overrun buffer; instead, report string overflow.
12031
12032 * dispnew.c (add_window_display_history): Don't overrun buffer.
12033 Truncate instead; this is OK since it's just a log.
12034
12035 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12036 even if the time zone offset is outlandishly large.
12037 Don't mishandle offset == INT_MIN.
12038
12039 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12040 when creating daemon; the previous buffer-overflow check was incorrect.
12041
12042 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12043 which has the guts of the old verror function.
12044
12045 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12046 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12047
12048 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12049 (font_unparse_xlfd): Don't blindly alloca long strings.
12050 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
12051 fits in int, when using sprintf. Use single snprintf to count
12052 length of string rather than counting it via multiple sprintfs;
12053 that's simpler and more reliable.
12054 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12055 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12056 sprintf, in case result does not fit in int.
12057
12058 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12059 (fontset_from_font): Print it.
12060
12061 * frame.c (tty_frame_count): Now printmax_t, not int.
12062 (make_terminal_frame, set_term_frame_name): Print it.
12063 (x_report_frame_params): In X, window IDs are unsigned long,
12064 not signed long, so print them as unsigned.
12065 (validate_x_resource_name): Check for implausibly long names,
12066 and don't assume name length fits in 'int'.
12067 (x_get_resource_string): Don't blindly alloca invocation name;
12068 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12069 not fit in int.
12070
12071 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12072 (xg_check_special_colors, xg_set_geometry):
12073 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12074
12075 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12076 Use esprintf, not sprintf, in case result does not fit in int.
12077
12078 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12079 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12080 it as a large positive number.
12081 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12082 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12083
12084 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12085 in case result does not fit in int.
12086
12087 * print.c (float_to_string): Detect width overflow more reliably.
12088 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12089 buffer overrun. Don't assume list length fits in 'int'. Treat
12090 print length of 0 as 0, not as infinity; to be consistent with other
12091 uses of print length in this function. Don't overflow print length
12092 index. Don't assume hash table size fits in 'long', or that
12093 vectorlike size fits in 'unsigned long'.
12094
12095 * process.c (make_process): Use printmax_t, not int, to format
12096 process-name gensyms.
12097
12098 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12099
12100 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12101 to avoid potential buffer overrun.
12102
12103 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12104 if X resource line is longer than 512 bytes.
12105
12106 * xfns.c (x_window): Make sprintf buffer a bit bigger
12107 to avoid potential buffer overrun.
12108
12109 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12110
12111 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12112
12113 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12114
12115 Integer overflow fixes for scrolling, etc.
12116 Without these, Emacs silently mishandles large integers sometimes.
12117 For example, "C-u 4294967297 M-x recenter" was treated as if
12118 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12119
12120 * xdisp.c (try_window_id): Check Emacs fixnum range before
12121 converting to 'int'.
12122
12123 * window.c (window_scroll_line_based, Frecenter):
12124 Check that an Emacs fixnum is in range before assigning it to 'int'.
12125 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12126 values converted from Emacs fixnums.
12127 (Frecenter): Don't wrap around a line count if it is out of 'int'
12128 range; instead, treat it as an extreme value.
12129 (Fset_window_configuration, compare_window_configurations):
12130 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12131
12132 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12133 that can exceed INT_MAX. Check that EMACS_INT value is in range
12134 before assigning it to the (possibly-narrower) index.
12135 (match_limit): Don't assume that a fixnum can fit in 'int'.
12136
12137 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12138 exceed INT_MAX.
12139
12140 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12141 (Fvertical_motion): Don't wrap around LINES values that don't fit
12142 in 'int'. Instead, treat them as extreme values. This is good
12143 enough for windows, which can't have more than INT_MAX lines anyway.
12144
12145 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12146
12147 * Require libxml/parser.h to avoid compilation warning.
12148
12149 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12150
12151 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12152 since this reportedly can destroy thread storage.
12153
12154 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12155
12156 * syntax.c (find_defun_start): Update all cache variables if
12157 exiting early (Bug#9401).
12158
12159 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12160
12161 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12162
12163 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12164 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12165 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12166
12167 * term.c (tty_append_glyph): New function.
12168 (produce_stretch_glyph): Static function and its prototype deleted.
12169
12170 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12171 Add prototypes.
12172
12173 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12174
12175 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12176 when checking :margin (Bug#9390).
12177 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12178 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12179 so that the name doesn't mislead. All uses changed.
12180
12181 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12182
12183 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12184 set_tty_hooks.
12185
12186 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12187
12188 * xdisp.c (move_it_to): Don't bail out early when reaching
12189 position beyond to_charpos, if we are scanning backwards.
12190 (move_it_vertically_backward): When DY == 0, make sure we get to
12191 the first character in the line after the newline.
12192
12193 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12194
12195 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12196 (ccl_driver): Do not generate an out-of-range pointer.
12197 (Fccl_execute_on_string): Remove unnecessary check for
12198 integer overflow, noted by Stefan Monnier in
12199 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12200 Remove a FIXME that didn't need fixing.
12201 Simplify the newly-introduced buffer reallocation code.
12202
12203 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12204
12205 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12206
12207 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12208
12209 Integer and memory overflow issues (Bug#9196).
12210
12211 * doc.c (get_doc_string): Rework so that
12212 get_doc_string_buffer_size is the actual buffer size, rather than
12213 being 1 less than the actual buffer size; this makes xpalloc more
12214 convenient.
12215
12216 * image.c (x_allocate_bitmap_record, cache_image):
12217 * xselect.c (Fx_register_dnd_atom):
12218 Simplify previous changes by using xpalloc.
12219
12220 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12221 since either will do and ptrdiff_t is convenient with xpalloc.
12222
12223 * charset.c (charset_table_size)
12224 (struct charset_sort_data.priority): Now ptrdiff_t.
12225 (charset_compare): Don't overflow if priorities differ greatly.
12226 (Fsort_charsets): Don't assume list length fits in int.
12227 Check for size-calculation overflow when allocating sort data.
12228 (syms_of_charset): Allocate an initial charset table that is
12229 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12230
12231 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12232
12233 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12234 The actual value is always <= INT_MAX, and leaving it unsigned made
12235 overflow checking harder.
12236
12237 * dispextern.h (struct glyph_matrix.rows_allocated)
12238 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12239 with xpalloc. The values are still always <= INT_MAX.
12240
12241 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12242
12243 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12244 (SAFE_NALLOCA): New macro.
12245
12246 * region-cache.c (struct boundary.pos, find_cache_boundary)
12247 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12248 (set_cache_region, invalidate_region_cache)
12249 (revalidate_region_cache, know_region_cache, region_cache_forward)
12250 (region_cache_backward, pp_cache):
12251 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12252 so that ptrdiff_t * can be passed to xpalloc.
12253 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12254 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12255 (pp_cache): Don't assume cache_len fits in int.
12256 * region-cache.h: Adjust extern decls to match.
12257
12258 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12259 EMACS_INT, since either will do, for xpalloc.
12260
12261 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12262 (xnmalloc, xnrealloc, xpalloc): New functions.
12263
12264 * bidi.c (bidi_shelve_header_size): New constant.
12265 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12266 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12267
12268 * bidi.c (bidi_cache_shrink):
12269 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12270 (overlay_strings):
12271 Don't update size of array until after memory allocation succeeds,
12272 because xmalloc/xrealloc may not return.
12273 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12274 now that we have proper integer overflow checking.
12275 (record_overlay_string, overlay_strings): Catch overflows when
12276 calculating size of overlay_str_buf.
12277
12278 * callproc.c (Fcall_process): Check for size overflow when
12279 calculating size of args2.
12280 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12281 Normally we prefer signed values, but sticking with ptrdiff_t would
12282 require adding more-complicated checks.
12283
12284 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12285 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12286 Redo buffer-overflow calculations to avoid integer overflow.
12287 Add a FIXME comment where memory seems to be over-allocated.
12288
12289 * character.c (Fstring): Check for size-calculation overflow.
12290
12291 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12292 unnecessary integer overflow. Check for size overflow.
12293 (encode_coding_object): Don't update size until xmalloc succeeds.
12294
12295 * composite.c (get_composition_id): Check for overflow in glyph
12296 length calculations.
12297
12298 Integer and memory overflow fixes for display code.
12299 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12300 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12301 (scrolling_window): Check for overflow in size calculations.
12302 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12303 Don't assume glyph table len fits in int.
12304 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12305 (row_table_size): Now ptrdiff_t, not int.
12306 (scrolling_window): Avoid overflow in size calculations.
12307 Don't update size until allocation succeeds.
12308 * fns.c (concat): Check for overflow in size calculations.
12309 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12310 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12311 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12312
12313 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12314 (get_doc_string): Check for size calculation overflow.
12315 Don't update size until allocation succeeds.
12316 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12317 EMACS_INT, where ptrdiff_t will do.
12318 (Fsubstitute_command_keys): Check for string overflow.
12319
12320 * editfns.c (set_time_zone_rule): Don't assume environment length
12321 fits in int.
12322 (message_length): Now ptrdiff_t, not int.
12323 (Fmessage_box): Don't update size until allocation succeeds.
12324 Don't assume message length fits in int.
12325 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12326
12327 * emacs.c (main): Do not reallocate argv, since there is a null at
12328 the end that can be overwritten, and this way there's no need to
12329 worry about size-calculation overflow.
12330 (sort_args): Check for size-calculation overflow.
12331
12332 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12333 alloc succeeds.
12334 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12335
12336 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12337 (x_set_scroll_bar_width, x_figure_window_size):
12338 Check for integer overflow.
12339 (x_set_alpha): Do not assume XINT fits in int.
12340
12341 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12342 This is for the members text_lines, text_cols, total_lines, total_cols,
12343 where the system imposes an 'int' limit.
12344
12345 * fringe.c (Fdefine_fringe_bitmap):
12346 Don't update size until alloc works.
12347
12348 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12349 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12350
12351 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12352 Check for size-calculation overflow.
12353 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12354 do, as we prefer signed integers.
12355 (id_to_widget.max_size, id_to_widget.used)
12356 (xg_store_widget_in_map, xg_remove_widget_from_map)
12357 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12358 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12359 Use and return ptrdiff_t, not int.
12360 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12361 * gtkutil.h: Change prototypes to match the above.
12362
12363 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12364 are duplicate now that they've been promoted to lisp.h.
12365 (x_allocate_bitmap_record, x_alloc_image_color)
12366 (make_image_cache, cache_image, xpm_load):
12367 Don't update size until alloc is done.
12368 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12369 (x_detect_edges):
12370 Check for size calculation overflow.
12371 (ct_colors_allocated_max): New constant.
12372 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12373 overflow.
12374
12375 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12376 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12377 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12378 Use ptrdiff_t, not int, to count maps.
12379 (read_char_minibuf_menu_prompt): Check for overflow in size
12380 calculations. Don't update size until allocation succeeds.
12381 Redo calculations to avoid overflow.
12382 * keyboard.h: Change prototypes to match the above.
12383
12384 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12385 to count maps.
12386 (current_minor_maps): Check for size calculation overflow.
12387 * keymap.h: Change prototypes to match the above.
12388
12389 * lread.c (read1, init_obarray): Don't update size until alloc done.
12390
12391 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12392 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12393
12394 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12395 Now ptrdiff_t, not int.
12396 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12397 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12398
12399 * process.c (Fnetwork_interface_list): Check for overflow
12400 in size calculation.
12401
12402 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12403
12404 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12405 overflow. Don't bother calling xmalloc when xrealloc will do.
12406
12407 * search.c (Freplace_match): Check for size calculation overflow.
12408 (Fset_match_data): Don't assume list lengths fit in 'int'.
12409
12410 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12411 for command line length. Do not attempt to address one before the
12412 beginning of an array, as that's not portable.
12413
12414 * term.c (max_frame_lines): Remove; unused.
12415 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12416 not int.
12417 (encode_terminal_code, calculate_costs): Check for size
12418 calculation overflow.
12419 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12420 table lengths and related sizes. Don't update size until alloc
12421 done. Redo calculations to avoid overflow.
12422 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12423
12424 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12425 subtracting pointers.
12426 (gobble_line): Check for overflow more carefully. Don't update size
12427 until alloc done.
12428
12429 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12430 Don't update size until alloc done.
12431 Redo size calculations to avoid overflow.
12432 Check for size calculation overflow.
12433 (main) [DEBUG]: Fix typo in invoking tparam1.
12434
12435 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12436 Use ptrdiff_t, not int, for sizes.
12437 (store_mode_line_noprop_char): Don't update size until alloc done.
12438
12439 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12440 Use ptrdiff_t, not int, for sizes.
12441 (Finternal_make_lisp_face, cache_face):
12442 Check for size calculation overflow.
12443 (cache_face): Treat size calculation overflows as if they were
12444 memory exhaustion (the usual treatment), rather than aborting.
12445
12446 * xfns.c (x_encode_text, x_set_name_internal)
12447 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12448 sizes, since they can exceed INT_MAX in size. Check for size
12449 calculation overflow.
12450
12451 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12452 (xg_select): Check for size calculation overflow.
12453 Don't update size until alloc done.
12454
12455 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12456 as sprintf is limited to int lengths.
12457
12458 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12459 (X_LONG_MIN): New macros.
12460 Use them to make the following changes clearer.
12461 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12462 This change doesn't affect the value now, but it may help remind
12463 future maintainers not to raise the value too much later.
12464 (SELECTION_QUANTUM): Remove, replacing with ...
12465 (selection_quantum): ... new function, which avoids overflow.
12466 All uses changed.
12467 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12468 assumption that selection length fits in 'int'.
12469 (x_reply_selection_request, x_handle_selection_request)
12470 (x_get_window_property, receive_incremental_selection)
12471 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12472 (lisp_data_to_selection_data, clean_local_selection_data):
12473 Use ptrdiff_t, not int, to record length of selection.
12474 (x_reply_selection_request, x_get_window_property)
12475 (receive_incremental_selection, x_property_data_to_lisp):
12476 Redo calculations to avoid overflow.
12477 (x_reply_selection_request): When sending hint, ceiling it at
12478 X_LONG_MAX rather than relying on wraparound overflow to send
12479 something.
12480 (x_get_window_property, receive_incremental_selection)
12481 (lisp_data_to_selection_data, x_property_data_to_lisp):
12482 Check for size-calculation overflow.
12483 (x_get_window_property, receive_incremental_selection)
12484 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12485 Don't store size until memory allocation succeeds.
12486 (x_get_window_property): Plug memory leak on memory exhaustion.
12487 Don't double-block input; malloc is safe here. Don't assume 2**34
12488 - 4 fits in unsigned long. Add an xassert to check
12489 XGetWindowProperty overflow. Be more careful about overflow
12490 calculations, and distinguish size from memory overflow better.
12491 (receive_incremental_selection): When tracing, don't assume
12492 unsigned int is less than INT_MAX.
12493 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12494 harmful) conversions of unsigned short to int.
12495 (lisp_data_to_selection_data): Don't assume that integers
12496 in the range -65535 through -1 fit in an X unsigned short.
12497 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12498 result parameters unless successful. Rely on cons_to_unsigned
12499 to report problems with elements; the old code wasn't right anyway.
12500 (x_check_property_data): Check for int overflow; we cannot use
12501 a wider type due to X limits.
12502 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12503
12504 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12505
12506 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12507 (x_term_init): Check for size calculation overflow.
12508 (x_color_cells): Don't store size until memory allocation succeeds.
12509 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12510 Don't assume alloca size is less than MAX_ALLOCA.
12511 (x_term_init): Don't assume length fits in int (sprintf is limited
12512 to int size).
12513
12514 Use ptrdiff_t for composition IDs.
12515 * character.c (lisp_string_width):
12516 * composite.c (composition_table_size, n_compositions)
12517 (get_composition_id, composition_gstring_from_id):
12518 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12519 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12520 * window.c (Frecenter):
12521 Use ptrdiff_t, not int, for composition IDs.
12522 * composite.c (get_composition_id): Check for integer overflow.
12523 * composite.h: Adjust prototypes to match the above changes.
12524
12525 Use ptrdiff_t for hash table indexes.
12526 * category.c (hash_get_category_set):
12527 * ccl.c (ccl_driver):
12528 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12529 * coding.c (coding_system_charset_list, detect_coding_system):
12530 * coding.h (struct coding_system.id):
12531 * composite.c (get_composition_id, gstring_lookup_cache):
12532 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12533 * image.c (xpm_get_color_table_h):
12534 * lisp.h (hash_lookup, hash_put):
12535 * minibuf.c (Ftest_completion):
12536 Use ptrdiff_t for hash table indexes, not int (which is too
12537 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12538 32-bit --with-wide-int hosts).
12539
12540 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12541 Add a FIXME comment about memory leaks.
12542 (syms_of_charset): Don't assume xmalloc returns.
12543
12544 Don't assume that stated character widths fit in int.
12545 * character.c (Fchar_width, c_string_width, lisp_string_width):
12546 * character.h (CHAR_WIDTH):
12547 * indent.c (MULTIBYTE_BYTES_WIDTH):
12548 Use sanitize_char_width to avoid undefined and/or bad behavior
12549 with outlandish widths.
12550 * character.h (sanitize_tab_width): Rename from sanitize_width,
12551 now that we have two such functions. All uses changed.
12552 (sanitize_char_width): New inline function.
12553
12554 Don't assume that tab-width fits in int.
12555 * character.h (sanitize_width): New inline function.
12556 (SANE_TAB_WIDTH): New macro.
12557 (ASCII_CHAR_WIDTH): Use it.
12558 * indent.c (sane_tab_width): Remove. All uses replaced by
12559 SANE_TAB_WIDTH (current_buffer).
12560 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12561
12562 * fileio.c: Integer overflow issues with file modes.
12563 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12564
12565 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12566 Remove unreachable code.
12567 (read_hex, load_charset_map_from_file): Check for integer overflow.
12568
12569 * xterm.c: Don't go over XClientMessageEvent limit.
12570 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12571 (x_send_scroll_bar_event): Likewise. Check that the size does not
12572 exceed limits imposed by XClientMessageEvent, as well as the usual
12573 ptrdiff_t and size_t limits.
12574
12575 * keyboard.c: Overflow, signedness and related fixes.
12576 (make_lispy_movement): Use same integer type in forward decl
12577 that is used in the definition.
12578 (read_key_sequence, keyremap_step):
12579 Change bufsize argument back to int, undoing my 2011-03-30 change.
12580 We prefer signed types, and int is wide enough here.
12581 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12582 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12583 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12584 length, not size_t. Use ptrdiff_t for index, not int.
12585 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12586 possibility of integer overflow.
12587
12588 Overflow, signedness and related fixes for images.
12589
12590 * dispextern.h (struct it.stack[0].u.image.image_id)
12591 (struct_it.image_id, struct image.id, struct image_cache.size)
12592 (struct image_cache.used, struct image_cache.ref_count):
12593 * gtkutil.c (update_frame_tool_bar):
12594 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12595 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12596 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12597 * nsmenu.m (update_frame_tool_bar):
12598 * xdisp.c (calc_pixel_width_or_height):
12599 * xfns.c (image_cache_refcount):
12600 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12601 on typical 64-bit hosts.
12602
12603 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12604 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12605 Omit unnecessary casts to int.
12606 (parse_image_spec): Check that integers fall into 'int' range
12607 when the callers expect that.
12608 (image_ascent): Redo ascent calculation to avoid int overflow.
12609 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12610 (lookup_image): Remove unnecessary tests.
12611 (xbm_image_p): Locals are now of int, not EMACS_INT,
12612 since parse_image_check makes sure they fit into int.
12613 (png_load, gif_load, svg_load_image):
12614 Prefer int to unsigned where either will do.
12615 (tiff_handler): New function, combining the cores of the
12616 old tiff_error_handler and tiff_warning_handler.
12617 This function is rewritten to use vsnprintf and thereby avoid
12618 stack buffer overflows. It uses only the features of vsnprintf
12619 that are common to both POSIX and native Microsoft.
12620 (tiff_error_handler, tiff_warning_handler): Use it.
12621 (tiff_load, gif_load, imagemagick_load_image):
12622 Don't assume :index value fits in 'int'.
12623 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12624 (imagemagick_load_image): Check that crop parameters fit into
12625 the integer types that MagickCropImage accepts. Don't assume
12626 Vimagemagick_render_type has a nonnegative value. Don't assume
12627 size_t fits in 'long'.
12628 (gs_load): Use printmax_t to print the widest integers possible.
12629 Check for integer overflow when computing image height and width.
12630
12631 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12632
12633 * xdisp.c (redisplay_window): Don't force window start if point
12634 will be invisible in the resulting window. (Bug#9324)
12635
12636 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12637
12638 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12639 the display spec is of the form `(space ...)'.
12640 (handle_display_spec): Return the value returned by
12641 handle_single_display_spec, not just 1 or zero.
12642 (handle_single_display_spec): If the display spec is of the form
12643 `(space ...)', and specifies display in the text area, return 2
12644 rather than 1.
12645 (try_cursor_movement): Check for the need to scroll more
12646 accurately, and prefer exact match for point under bidi.
12647 Don't advance `row' beyond the last row of the window.
12648
12649 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12650 into disp_prop; all users changed.
12651
12652 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12653 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12654 for the text covered by the display property.
12655
12656 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12657
12658 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12659 Change return value to nil.
12660 (Frecord_buffer): Delete unused function.
12661
12662 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12663
12664 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12665 buffers, return left-to-right.
12666 (set_cursor_from_row): Consider candidate row a win if its glyph
12667 represents a newline and point is on that newline. Fixes cursor
12668 positioning on the newline at EOL of R2L text within L2R
12669 paragraph, and vice versa.
12670 (try_cursor_movement): Check continued rows, in addition to
12671 continuation rows. Fixes unwarranted scroll when point enters a
12672 continued line of R2L text within an L2R paragraph, or vice versa.
12673 (cursor_row_p): Consider the case of point being equal to
12674 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12675 from the end of a short line to the beginning of a continued line
12676 of R2L text within L2R paragraph.
12677 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12678 composed characters.
12679
12680 * bidi.c (bidi_check_type): Use xassert.
12681 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12682 members.
12683
12684 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12685
12686 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12687 a character.
12688
12689 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12690
12691 * nsfont.m (ns_otf_to_script): Fix typo.
12692
12693 2011-08-22 Kenichi Handa <handa@m17n.org>
12694
12695 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12696 extra slot even if the purpose is char-code-property-table.
12697
12698 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12699
12700 * xdisp.c (redisplay_window): When computing centering_position,
12701 account for the height of the header line. (Bug#8874)
12702
12703 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12704 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12705 candidate is selected by the mouse, and that candidate has a
12706 composed character under the mouse.
12707
12708 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12709 coordinates reported by pos-visible-in-window-p for a composed
12710 character in column zero.
12711
12712 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12713
12714 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12715
12716 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12717
12718 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12719 consider it a hit if to_charpos is anywhere in the range of the
12720 composed buffer positions.
12721
12722 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12723
12724 * image.c (gif_load): Don't assume that each subimage has the same
12725 dimensions as the base image. Handle disposal method that is
12726 "undefined" by the gif spec (Bug#9335).
12727
12728 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12729
12730 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12731 (Fcondition_case): Document `debug' symbol in error handler.
12732
12733 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12734
12735 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12736 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12737 from an Org mode buffer to a Speedbar frame.
12738
12739 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12740 a composition, take its buffer position from IT->cmp_it.charpos.
12741 Fixes cursor positioning at the beginning of a line that begins
12742 with a composed character.
12743
12744 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12745
12746 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12747 character bidirectional type, use STRONG_L instead. Fixes crashes
12748 in a buffer produced by `describe-categories'.
12749
12750 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12751 members before the level stack, so they would be saved and
12752 restored when copying iterator state. Fixes incorrect reordering
12753 around TABs covered by display properties.
12754
12755 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12756
12757 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12758
12759 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12760
12761 * eval.c (internal_condition_case, internal_condition_case_1)
12762 (internal_condition_case_2, internal_condition_case_n):
12763 Remove unnecessary aborts (Bug#9081).
12764
12765 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12766
12767 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12768 has no `load' handler, try opening the file locally. (Bug#9311)
12769
12770 2011-08-16 Ken Brown <kbrown@cornell.edu>
12771
12772 * gmalloc.c: Expand comment.
12773
12774 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12775
12776 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12777 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12778
12779 2011-08-16 Ken Brown <kbrown@cornell.edu>
12780
12781 Fix memory allocation problems in Cygwin build (Bug#9273).
12782
12783 * unexcw.c ( __malloc_initialized): Declare external variable.
12784 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12785
12786 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12787 New variables.
12788 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12789 dumped emacs.
12790 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12791 in the static heap.
12792 [CYGWIN] (special_realloc): New function.
12793 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12794 requests to realloc storage in the static heap.
12795
12796 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12797
12798 * bidi.c (bidi_initialize): Remove unused local.
12799
12800 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12801
12802 * bidimirror.h:
12803 * biditype.h: Remove file.
12804 * makefile.w32-in ($(BLD)/bidi.$(O)):
12805 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12806
12807 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12808
12809 * chartab.c: Improve commentary for the uniprop_table API.
12810
12811 * bidi.c (bidi_paragraph_init): Support zero value of
12812 bidi_ignore_explicit_marks_for_paragraph_level.
12813 (bidi_initialize): Use uniprop_table instead of including
12814 biditype.h and bidimirror.h.
12815
12816 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12817 coordinates of the iterator when restoring from ppos_it.
12818 (Bug#9296)
12819
12820 2011-08-14 Kenichi Handa <handa@m17n.org>
12821
12822 * process.c (create_process): Call setup_process_coding_systems
12823 after the pid of the process is set to -1 (Bug#8162).
12824
12825 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12826
12827 * xdisp.c (move_it_in_display_line_to): Don't invoke
12828 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12829 ppos_it. Fixes vertical cursor motion when line beginning is
12830 covered by an image. (Bug#9296)
12831
12832 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12833
12834 * nsterm.h (ns_run_ascript): Declare.
12835 (NSAPP_DATA2_RUNASSCRIPT): Define.
12836
12837 * nsfns.m (as_script, as_result, as_status): New static variables.
12838 (ns_run_ascript): New function.
12839 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12840 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12841 the event loop. Get status from as_status (Bug#7276).
12842
12843 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12844 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12845 the event loop (Bug#7276).
12846
12847 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12848
12849 * gnutls.c (QCgnutls_bootprop_priority)
12850 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12851 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12852 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12853 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12854 (QCgnutls_bootprop_verify_hostname_error)
12855 (QCgnutls_bootprop_callbacks_verify): Rename from
12856 Qgnutls_bootprop_..., all uses changed.
12857
12858 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12859 uses changed.
12860
12861 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12862
12863 * xfaces.c (Qframe_set_background_mode): Now static.
12864 * dispextern.h (Qframe_set_background_mode): Remove decl.
12865
12866 * process.c (Fnetwork_interface_info): Declare local only if needed.
12867
12868 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12869
12870 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12871 (Fnetwork_interface_list): Allocate in increments of bytes instead
12872 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12873 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12874 sockaddr.
12875 (struct ifflag_def): notrailers is smart on OSX.
12876 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12877 Get hardware address with getifaddrs if available.
12878
12879 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12880
12881 * xdisp.c (iterate_out_of_display_property): xassert that
12882 IT->position is set to within IT->object's boundaries. Break from
12883 the loop as soon as EOB is reached; avoids infloops in redisplay
12884 when IT->position is set up wrongly due to some bug.
12885 Set IT->current to match the bidi iterator unconditionally.
12886 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12887 entry. Force push_it to save on the stack the current
12888 buffer/string position, to be restored by pop_it. Fix flags in
12889 the iterator structure wrt the object coming from a display
12890 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12891 properties. (Bug#9284)
12892
12893 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12894
12895 * fontset.c (fontset_get_font_group): Add proper type checks.
12896 (Bug#9172)
12897
12898 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12899
12900 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12901 and LC_VERSION_MIN_MACOSX.
12902 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12903 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12904
12905 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12906
12907 * xdisp.c (forward_to_next_line_start): Allow to use the
12908 no-display-properties-and-no-overlays under bidi display.
12909 Set disp_pos in the bidi iterator to avoid searches for display
12910 properties and overlays.
12911
12912 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12913
12914 * editfns.c (Fset_time_zone_rule): Document relationship with the
12915 setenv function.
12916
12917 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12918 the font entity extracted from the cache (Bug#8109).
12919
12920 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12921
12922 * composite.c (autocmp_chars): Don't reset point. That is done by
12923 restore_point_unwind (Bug#5984).
12924
12925 2011-08-07 Juri Linkov <juri@jurta.org>
12926
12927 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12928 to show the arg `TIME' instead of `TIMEVAL'.
12929
12930 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12931
12932 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12933 display property strides EOL and includes a newline, as in
12934 longlines-mode. (Bug#9254)
12935 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12936 word-wrap under bidirectional display. (Bug#9224)
12937
12938 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12939 is non-zero, even if the data buffer is NULL. Fixes a crash in
12940 vertical-motion with longlines-mode. (Bug#9254)
12941
12942 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12943
12944 * bidi.c <bidi_cache_total_alloc>: Now static.
12945 (bidi_initialize): Initialize bidi_cache_total_alloc.
12946
12947 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12948 cache. (Bug#9221)
12949
12950 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12951 amount allocated this far in `bidi_cache_total_alloc'.
12952 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12953 non-zero, only free the data buffer without restoring the cache
12954 contents. All callers changed.
12955
12956 * dispextern.h (bidi_unshelve_cache): Update prototype.
12957
12958 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12959 (move_it_in_display_line, move_it_to)
12960 (move_it_vertically_backward, move_it_by_lines): Replace the call
12961 to xfree to an equivalent call to bidi_unshelve_cache.
12962 (move_it_in_display_line_to): Fix logic of returning
12963 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12964
12965 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12966
12967 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12968 came from a string character with a `cursor' property. (Bug#9229)
12969
12970 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12971
12972 * Makefile.in (LIB_PTHREAD): New variable.
12973 (LIBES): Add LIB_PTHREAD (Bug#9216).
12974
12975 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12976 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12977
12978 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12979
12980 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12981
12982 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12983
12984 * xterm.c (x_find_topmost_parent): New function.
12985 (x_set_frame_alpha): Find topmost parent window with
12986 x_find_topmost_parent and set the property there also (bug#9181).
12987 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12988
12989 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12990
12991 * callproc.c (Fcall_process): Avoid vfork clobbering
12992 the local vars buffer, coding_systems, current_dir.
12993
12994 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12995
12996 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12997
12998 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12999
13000 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13001 so that it is not optimized away.
13002
13003 * xdisp.c (compute_display_string_pos): Remove unused local.
13004
13005 2011-08-02 Eli Zaretskii <eliz@gnu.org>
13006
13007 Fix slow cursor motion and scrolling in large buffers with
13008 selective display, like Org Mode buffers. (Bug#9218)
13009
13010 * dispextern.h (struct bidi_it): New member disp_prop_p.
13011
13012 * xdisp.c: Remove one-slot cache of display string positions.
13013 (compute_display_string_pos): Accept an additional argument
13014 DISP_PROP_P; callers changed. Scan at most 5K characters forward
13015 for a display string or property. If found, set DISP_PROP_P
13016 non-zero.
13017
13018 * bidi.c (bidi_fetch_char): Accept an additional argument
13019 DISP_PROP_P, and pass it to compute_display_string_pos.
13020 Only handle text covered by a display string if DISP_PROP_P is returned
13021 non-zero. All callers of bidi_fetch_char changed.
13022
13023 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13024
13025 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13026
13027 2010-12-03 Don March <don@ohspite.net>
13028
13029 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13030 last character M-[char] is translated to ESC [char] (bug#7541).
13031
13032 2011-08-02 Kenichi Handa <handa@m17n.org>
13033
13034 * lisp.h (uniprop_table): Extern it.
13035
13036 * chartab.c (uniprop_table): Make it non-static.
13037
13038 2011-08-01 Eli Zaretskii <eliz@gnu.org>
13039
13040 * xdisp.c (forward_to_next_line_start): Accept additional argument
13041 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13042 on the newline.
13043 (reseat_at_next_visible_line_start): Use the bidi iterator state
13044 returned by forward_to_next_line_start to restore the state of
13045 it->bidi_it after backing up to previous newline. (Bug#9212)
13046
13047 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13048
13049 * regex.c (re_comp): Protoize.
13050 (re_exec): Fix return type.
13051 (regexec): Fix type of `ret'. (Bug#9203)
13052
13053 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13054
13055 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13056 This is needed if max-image-size is a floating-point number.
13057
13058 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13059
13060 * print.c (print_object): Print empty symbol as ##.
13061
13062 * lread.c (read1): Read ## as empty symbol.
13063
13064 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13065
13066 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13067 setting frame foreground color (Bug#9175).
13068 (x_set_background_color): Likewise.
13069
13070 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13071 contents (Bug#9176).
13072 (EmacsTooltip -init): Remove bezels and add shadows to
13073 tooltip windows.
13074
13075 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13076 or scroll bar (Bug#8470).
13077
13078 * nsfont.m (nsfont_open): Remove assignment to voffset and
13079 unnecessary vars hshink, expand, hd, full_height, min_height.
13080 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13081
13082 * nsterm.h (nsfont_info): Remove voffset field.
13083
13084 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13085
13086 Implement strike-through and overline on NextStep (Bug#8863).
13087
13088 * nsfont.m (nsfont_open): Use underline position provided by font,
13089 instead of hard-coded value of 2.
13090 (nsfont_draw): Call ns_draw_text_decoration instead.
13091
13092 * nsterm.h: Add declaration for ns_draw_text_decoration.
13093
13094 * nsterm.m (ns_draw_text_decoration): New function for drawing
13095 underline, overline, and strike-through.
13096 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13097 ns_draw_text_decoration. Change treatment of cursor drawing to
13098 accommodate underlining, etc.
13099
13100 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13101
13102 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13103 default.
13104
13105 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13106
13107 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13108 Without this fix, if a signal arrives just after memory fills up,
13109 'malloc' might be invoked reentrantly.
13110
13111 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13112 In other words, assume that every image size is allowed, on non-X
13113 hosts. This assumption is probably wrong, but it lets Emacs compile.
13114
13115 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13116
13117 * regex.c (re_iswctype): Convert return values to boolean.
13118
13119 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13120
13121 * xdisp.c (compute_display_string_pos): Don't use cached display
13122 string position if the buffer had its restriction changed.
13123 (Bug#9184)
13124
13125 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13126
13127 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13128
13129 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13130
13131 Integer signedness and overflow and related fixes. (Bug#9079)
13132
13133 * bidi.c: Integer size and overflow fixes.
13134 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13135 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13136 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13137 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13138 (bidi_find_other_level_edge):
13139 Use ptrdiff_t instead of EMACS_INT where either will do.
13140 This works better on 32-bit hosts configured --with-wide-int.
13141 (bidi_cache_ensure_space): Check for size-calculation overflow.
13142 Use % rather than repeated addition, for better worst-case speed.
13143 Don't set bidi_cache_size until after xrealloc returns, because it
13144 might not return.
13145 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13146 (bidi_cache_ensure_space): Also check that the bidi cache size
13147 does not exceed that of the largest Lisp string or buffer. See Eli
13148 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13149
13150 * alloc.c (__malloc_size_t): Remove.
13151 All uses replaced by size_t. See Andreas Schwab's note
13152 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13153
13154 * image.c: Improve checking for integer overflow.
13155 (check_image_size): Assume that f is nonnull, since
13156 it is always nonnull in practice. This is one less thing to
13157 worry about when checking for integer overflow later.
13158 (x_check_image_size): New function, which checks for integer
13159 overflow issues inside X.
13160 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13161 This removes the need for a memory_full check.
13162 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13163 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13164 (xbm_read_bitmap_data): Change locals back to 'int', since
13165 their values must fit in 'int'.
13166 (xpm_load_image, png_load, tiff_load):
13167 Invoke x_create_x_image_and_pixmap earlier,
13168 to avoid much needless work if the image is too large.
13169 (tiff_load): Treat overly large images as if
13170 x_create_x_image_and_pixmap failed, not as malloc failures.
13171 (gs_load): Use x_check_image_size.
13172
13173 * gtkutil.c: Omit integer casts.
13174 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13175 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13176
13177 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13178
13179 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13180 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13181 would wrongly return t on a 64-bit host.
13182
13183 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13184 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13185 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13186 and therefore cause GCC to emit a bogus diagnostic in some cases.
13187
13188 * image.c: Integer signedness and overflow and related fixes.
13189 This is not an exhaustive set of fixes, but it's time to
13190 record what I've got.
13191 (lookup_pixel_color, check_image_size): Remove redundant decls.
13192 (check_image_size): Don't assume that arbitrary EMACS_INT values
13193 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13194 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13195 (tiff_load, imagemagick_load_image):
13196 Check for overflow in size calculations.
13197 (x_create_x_image_and_pixmap): Remove unnecessary test for
13198 xmalloc returning NULL; that can't happen.
13199 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13200 (xpm_color_bucket): Use better integer hashing function.
13201 (xpm_cache_color): Don't possibly over-allocate memory.
13202 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13203 (gif_memory_source):
13204 Use ptrdiff_t, not int or size_t, to record sizes.
13205 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13206 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13207 either works, as we prefer signed integers.
13208 (tiff_read_from_memory, tiff_write_from_memory):
13209 Return tsize_t, not size_t, since that's what the TIFF API wants.
13210 (tiff_read_from_memory): Don't fail simply because the read would
13211 go past EOF; instead, return a short read.
13212 (tiff_load): Omit no-longer-needed casts.
13213 (Fimagemagick_types): Don't assume size fits into 'int'.
13214
13215 Improve hashing quality when configured --with-wide-int.
13216 * fns.c (hash_string): New function, taken from sxhash_string.
13217 Do not discard information about ASCII character case; this
13218 discarding is no longer needed.
13219 (sxhash-string): Use it. Change sig to match it. Caller changed.
13220 * lisp.h: Declare it.
13221 * lread.c (hash_string): Remove, since we now use fns.c's version.
13222 The fns.c version returns a wider integer if --with-wide-int is
13223 specified, so this should help the quality of the hashing a bit.
13224
13225 * emacs.c: Integer overflow minor fix.
13226 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13227 Define only if GNU_LINUX.
13228 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13229
13230 * dispnew.c: Integer signedness and overflow fixes.
13231 Remove unnecessary forward decls, that were a maintenance hassle.
13232 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13233 All uses changed.
13234 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13235 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13236 (prepare_desired_row, line_draw_cost):
13237 Use int, not unsigned, where either works.
13238 (save_current_matrix, restore_current_matrix):
13239 Use ptrdiff_t, not size_t, where either works.
13240 (init_display): Check for overflow more accurately, and without
13241 relying on undefined behavior.
13242
13243 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13244 Remove, replacing with the new symbols in lisp.h. All uses changed.
13245 * fileio.c (make_temp_name):
13246 * filelock.c (lock_file_1, lock_file):
13247 * xdisp.c (message_dolog):
13248 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13249 Use pMd etc. instead.
13250 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13251 replacing the pWIDE etc. symbols removed from editfns.c.
13252
13253 * keyboard.h (num_input_events): Now uintmax_t.
13254 This is (very slightly) less likely to mess up due to wraparound.
13255 All uses changed.
13256
13257 * buffer.c: Integer signedness fixes.
13258 (alloc_buffer_text, enlarge_buffer_text):
13259 Use ptrdiff_t rather than size_t when either will do, as we prefer
13260 signed integers.
13261
13262 * alloc.c: Integer signedness and overflow fixes.
13263 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13264 (__malloc_size_t): Default to size_t, not to int.
13265 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13266 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13267 Prefer ptrdiff_t to size_t when either would do, as we prefer
13268 signed integers.
13269 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13270 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13271 Now const. Initialize with values that are in range even if char
13272 is signed.
13273 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13274 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13275 These functions do the right thing with sizes > 2**32.
13276 (check_depth): Now ptrdiff_t, not int.
13277 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13278 Adjust to new way of storing sizes. Check for size overflow bugs
13279 in rest of code.
13280 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13281 slightly wrong anyway, as it missed one instance of
13282 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13283 (refill_memory_reserve): Omit needless cast to size_t.
13284 (mark_object_loop_halt): Mark as externally visible.
13285
13286 * xselect.c: Integer signedness and overflow fixes.
13287 (Fx_register_dnd_atom, x_handle_dnd_message):
13288 Use ptrdiff_t, not size_t, since we prefer signed.
13289 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13290 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13291 x_dnd_atoms_size and x_dnd_atoms_length.
13292
13293 * doprnt.c: Prefer signed to unsigned when either works.
13294 * eval.c (verror):
13295 * doprnt.c (doprnt):
13296 * lisp.h (doprnt):
13297 * xdisp.c (vmessage):
13298 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13299 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13300 prefer signed arithmetic to avoid comparison confusion.
13301 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13302 but is a bit tricky.
13303
13304 Assume freestanding C89 headers, string.h, stdlib.h.
13305 * data.c, doprnt.c, floatfns.c, print.c:
13306 Include float.h unconditionally.
13307 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13308 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13309 * regex.c: Likewise for stddef.h, string.h.
13310 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13311 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13312 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13313 (STDC_HEADERS): Remove obsolete defines.
13314 * sysdep.c: Include limits.h unconditionally.
13315
13316 Assume support for memcmp, memcpy, memmove, memset.
13317 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13318 * regex.c (memcmp, memcpy):
13319 Remove; we assume C89 now.
13320
13321 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13322 (__malloc_safe_bcopy): Remove; no longer needed.
13323
13324 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13325 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13326 well either way, and we prefer signed to unsigned.
13327
13328 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13329
13330 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13331 closes the connection while we're reading (bug#9182).
13332
13333 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13334
13335 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13336 are specified (Bug#9168).
13337
13338 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13339
13340 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13341 Found by GCC static checking and --with-wide-int on a 32-bit host.
13342
13343 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13344
13345 * xdisp.c (compute_display_string_pos): Fix logic of caching
13346 previous display string position. Initialize cached_prev_pos to
13347 -1. Fixes slow-down at the beginning of a buffer.
13348
13349 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13350
13351 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13352 for attrs[LFACE_FONTSET_INDEX].
13353
13354 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13355
13356 * xml.c (parse_region): Remove unused local
13357 that was recently introduced.
13358
13359 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13360
13361 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13362 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13363
13364 * xdisp.c (move_it_in_display_line_to): Record the best matching
13365 position for TO_CHARPOS while scanning the line, and restore it on
13366 exit if none of the characters scanned was an exact match.
13367 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13368 when exact match is impossible due to invisible text, and the
13369 lines are truncated.
13370
13371 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13372
13373 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13374 for OSX >= 10.7.
13375
13376 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13377
13378 Fix a significant slow-down of cursor motion with C-n, C-p,
13379 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13380 auto-repeat under bidi redisplay in fontified buffers.
13381 * xdisp.c (compute_stop_pos_backwards): New function.
13382 (next_element_from_buffer): Call compute_stop_pos_backwards to
13383 find a suitable prev_stop when we find ourselves before
13384 base_level_stop.
13385 (reseat): Don't look for prev_stop, as that could mean a very long
13386 run.
13387 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13388 <cached_disp_overlay_modiff>: Cache for last found display string
13389 position.
13390 (compute_display_string_pos): Return the cached position if asked
13391 about the same buffer in the same area of character positions, and
13392 the buffer wasn't changed since the time the display string
13393 position was cached.
13394
13395 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13396
13397 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13398 is an integer, which is important for empty lines. (Bug#9149)
13399
13400 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13401
13402 * frame.c (Fmodify_frame_parameters): In tty case, update the
13403 default face if necessary (Bug#4238).
13404
13405 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13406
13407 * editfns.c (Fstring_to_char): No need to explain what a character
13408 is in the docstring (Bug#6576).
13409
13410 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13411
13412 * xml.c (parse_region): Make sure we always return a tree.
13413
13414 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13415
13416 * xml.c (parse_region): If a document contains only comments,
13417 return that, too.
13418
13419 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13420
13421 * xml.c (make_dom): Return comments, too.
13422
13423 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13424
13425 Port to OpenBSD.
13426 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13427 and the surrounding thread.
13428 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13429 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13430 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13431 timer goes off.
13432 * s/openbsd.h (BROKEN_SIGIO): Define.
13433 * unexelf.c (unexec) [__OpenBSD__]:
13434 Don't update the .mdebug section of the Alpha COFF symbol table.
13435
13436 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13437
13438 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13439 (bug#8460).
13440
13441 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13442
13443 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13444 This fixes some race conditions on the permissions of any newly
13445 created file.
13446
13447 * alloc.c (valid_pointer_p): Use pipe, not open.
13448 This fixes some permissions issues when debugging.
13449
13450 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13451 If fchown fails to set both uid and gid, try to set just gid,
13452 as that is sometimes allowed. Adjust the file's mode to eliminate
13453 setuid or setgid bits that are inappropriate if fchown fails.
13454
13455 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13456
13457 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13458 to compare Lisp_Objects.
13459 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13460 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13461 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13462
13463 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13464
13465 * lread.c (read_integer): Unread even EOF character.
13466 (read1): Likewise. Properly record start position of symbol.
13467
13468 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13469 symbol character follows.
13470
13471 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13472
13473 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13474 This works around a problem with the previous change to Fcopy_file.
13475 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13476 and without this change, GCC might complain about discarding
13477 fchown's return value.
13478
13479 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13480
13481 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13482
13483 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13484
13485 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13486
13487 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13488
13489 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13490 it's used from the C level.
13491
13492 * process.c: Use the same condition for POLL_FOR_INPUT in both
13493 keyboard.c and process.c (bug#1858).
13494
13495 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13496
13497 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13498 (Fgnutls_boot): Use it.
13499
13500 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13501
13502 * doc.c (Fsubstitute_command_keys): Revert last change.
13503
13504 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13505
13506 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13507 quotes the next character, and doesn't affect other longer
13508 sequences (bug#8935).
13509
13510 * lread.c (syms_of_lread): Clarify that is isn't only
13511 `eval-buffer' and `eval-defun' that's affected by
13512 `lexical-binding' (bug#8460).
13513
13514 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13515
13516 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13517 bidi redisplay when a line includes both an image and is truncated.
13518
13519 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13520
13521 Fix minor problems found by static checking.
13522 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13523 (elsz): Now a signed constant, not a size_t var. We prefer signed
13524 types to unsigned, to avoid integer comparison confusion. Without
13525 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13526 "cannot optimize loop, the loop counter may overflow", a symptom
13527 of the confusion.
13528 * indent.c (Fvertical_motion): Mark locals as initialized.
13529 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13530
13531 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13532
13533 * search.c (Fre_search_backward): Mention `case-fold-search' in
13534 all the re_search_* functions (bug#8138).
13535
13536 * keyboard.c (Fopen_dribble_file): Document when the file is
13537 closed (bug#8056).
13538
13539 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13540
13541 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13542 bidi_cache_idx.
13543
13544 Support bidi reordering of display and overlay strings.
13545 * xdisp.c (compute_display_string_pos)
13546 (compute_display_string_end): Accept additional argument STRING.
13547 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13548 (reseat_to_string): Initialize bidi_it->string.s and
13549 bidi_it->string.schars.
13550 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13551 NULL (avoids a crash in bidi_paragraph_init).
13552 Initialize itb.string.lstring.
13553 (init_iterator): Call bidi_init_it only of a valid
13554 buffer position was specified. Initialize paragraph_embedding to
13555 L2R.
13556 (reseat_to_string): Initialize the bidi iterator.
13557 (display_string): If we need to ignore text properties of
13558 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13559 original value of -1 will not work with bidi.)
13560 (compute_display_string_pos): First arg is now struct
13561 `text_pos *'; all callers changed. Support display properties on
13562 Lisp strings.
13563 (compute_display_string_end): Support display properties on Lisp
13564 strings.
13565 (init_iterator, reseat_1, reseat_to_string): Initialize the
13566 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13567 when iterating on a string not from display properties).
13568 (compute_display_string_pos, compute_display_string_end):
13569 Fix calculation of the object to scan. Fixes an error when using
13570 arrow keys.
13571 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13572 base_level_stop; instead, set base_level_stop to BEGV.
13573 Fixes crashes in vertical-motion.
13574 (next_element_from_buffer): Improve commentary for when
13575 the iterator is before prev_stop.
13576 (init_iterator): Initialize bidi_p from the default value of
13577 bidi-display-reordering, not from buffer-local value. Use the
13578 buffer-local value only if initializing for buffer iteration.
13579 (handle_invisible_prop): Support invisible properties on strings
13580 that are being bidi-reordered.
13581 (set_iterator_to_next): Support bidi reordering of C strings and
13582 Lisp strings.
13583 (next_element_from_string): Support bidi reordering of Lisp
13584 strings.
13585 (handle_stop_backwards): Support Lisp strings as well.
13586 (display_string): Support display of R2L glyph rows.
13587 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13588 (init_iterator): Don't initialize it->bidi_p for strings
13589 here.
13590 (reseat_to_string): Initialize it->bidi_p for strings here.
13591 (next_element_from_string, next_element_from_c_string)
13592 (next_element_from_buffer): Add xassert's for correspondence
13593 between IT's object being iterated and it->bidi_it.string
13594 structure.
13595 (face_before_or_after_it_pos): Support bidi iteration.
13596 (next_element_from_c_string): Handle the case of the first string
13597 character that is not the first one in the visual order.
13598 (get_visually_first_element): New function, refactored from common
13599 parts of next_element_from_buffer, next_element_from_string, and
13600 next_element_from_c_string.
13601 (tool_bar_lines_needed, redisplay_tool_bar)
13602 (display_menu_bar): Force left-to-right direction. Add a FIXME
13603 comment for making that be controlled by a user option.
13604 (push_it, pop_it): Save and restore the state of the
13605 bidi iterator. Save and restore the bidi_p flag.
13606 (pop_it): Iterate out of display property for string iteration as
13607 well.
13608 (iterate_out_of_display_property): Support iteration over strings.
13609 (handle_single_display_spec): Set up it->bidi_it for iteration
13610 over a display string, and call bidi_init_it.
13611 (handle_single_display_spec, next_overlay_string)
13612 (get_overlay_strings_1, push_display_prop): Set up the bidi
13613 iterator for displaying display or overlay strings.
13614 (forward_to_next_line_start): Don't use the shortcut if
13615 bidi-iterating.
13616 (back_to_previous_visible_line_start): If handle_display_prop
13617 pushed the iterator stack, restore the internal state of the bidi
13618 iterator by calling bidi_pop_it same number of times.
13619 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13620 and we are bidi-iterating, don't decrement the iterator position;
13621 instead, set the first_elt flag in the bidi iterator, to produce
13622 the same effect.
13623 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13624 (push_display_prop): xassert that we are iterating a buffer.
13625 (push_it, pop_it): Save and restore paragraph_embedding member.
13626 (handle_single_display_spec, next_overlay_string)
13627 (get_overlay_strings_1, reseat_1, reseat_to_string)
13628 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13629 correctly. Don't assume unibyte strings are not bidi-reordered.
13630 (compute_display_string_pos)
13631 (compute_display_string_end): Fix handling the case of C string.
13632 (push_it, pop_it): Save and restore from_disp_prop_p.
13633 (handle_single_display_spec, push_display_prop): Set the
13634 from_disp_prop_p flag.
13635 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13636 (pop_it): Call iterate_out_of_display_property only if we are
13637 popping after iteration over a string that came from a display
13638 property. Fix a typo in popping stretch info. Add an assertion
13639 for verifying that the iterator position is in sync with the bidi
13640 iterator.
13641 (handle_single_display_spec, get_overlay_strings_1)
13642 (push_display_prop): Fix initialization of paragraph direction for
13643 string when that of the parent object is not yet determined.
13644 (reseat_1): Call bidi_init_it to resync the bidi
13645 iterator with IT's position. (Bug#7616)
13646 (find_row_edges): If ROW->start.pos gives position
13647 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13648 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13649 Reset the from_disp_prop_p flag.
13650 (SAVE_IT, RESTORE_IT): New macros.
13651 (pos_visible_p, face_before_or_after_it_pos)
13652 (back_to_previous_visible_line_start)
13653 (move_it_in_display_line_to, move_it_in_display_line)
13654 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13655 (try_scrolling, redisplay_window, display_line): Use them when
13656 saving a temporary copy of the iterator and restoring it back.
13657 (back_to_previous_visible_line_start, reseat_1)
13658 (init_iterator): Empty the bidi cache "stack".
13659 (move_it_in_display_line_to): If iterator ended up at
13660 EOL, but we never saw any buffer positions smaller than
13661 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13662 motion in bidi-reordered lines.
13663 (move_it_in_display_line_to): Record prev_method and prev_pos
13664 immediately before the call to set_iterator_to_next. Fixes cursor
13665 motion in bidi-reordered lines with stretch glyphs and strings
13666 displayed in margins. (Bug#8133) (Bug#8867)
13667 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13668 TO_CHARPOS.
13669 (pos_visible_p): Support positions in bidi-reordered lines.
13670 Save and restore bidi cache.
13671
13672 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13673 (bidi_paragraph_info): Delete unused struct.
13674 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13675 (bidi_cache_start): New variable.
13676 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13677 to zero.
13678 (bidi_cache_fetch_state, bidi_cache_search)
13679 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13680 (bidi_cache_find, bidi_peek_at_next_level)
13681 (bidi_level_of_next_char, bidi_find_other_level_edge)
13682 (bidi_move_to_visually_next): Compare cache index with
13683 bidi_cache_start rather than with zero.
13684 (bidi_fetch_char): Accept new argument STRING; all callers
13685 changed. Support iteration over a string. Support strings with
13686 display properties. Support unibyte strings. Fix the type of
13687 `len' according to what STRING_CHAR_AND_LENGTH expects.
13688 (bidi_paragraph_init, bidi_resolve_explicit_1)
13689 (bidi_resolve_explicit, bidi_resolve_weak)
13690 (bidi_level_of_next_char, bidi_move_to_visually_next):
13691 Support iteration over a string.
13692 (bidi_set_sor_type, bidi_resolve_explicit_1)
13693 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13694 can now be zero (for strings); special values 0 and -1 were
13695 changed to -1 and -2, respectively.
13696 (bidi_char_at_pos): New function.
13697 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13698 Call it instead of FETCH_MULTIBYTE_CHAR.
13699 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13700 initialized to valid values.
13701 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13702 values.
13703 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13704 the test for valid cached positions. Fix the logic for looking up
13705 the sentinel state in the cache. GCPRO the Lisp string we are
13706 iterating.
13707 (bidi_push_it, bidi_pop_it): New functions.
13708 (bidi_initialize): Initialize the bidi cache start stack pointer.
13709 (bidi_cache_ensure_space): New function, refactored from part of
13710 bidi_cache_iterator_state. Don't assume the required size is just
13711 one BIDI_CACHE_CHUNK away.
13712 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13713 (bidi_count_bytes, bidi_char_at_pos): New functions.
13714 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13715 always valid if bidi_cache_idx is valid.
13716 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13717 is valid if it's going to be used.
13718 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13719 (bidi_cache_fetch_state, bidi_cache_search)
13720 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13721 (bidi_cache_iterator_state, bidi_cache_find)
13722 (bidi_find_other_level_edge, bidi_cache_start_stack):
13723 All variables related to cache indices are now EMACS_INT.
13724
13725 * dispextern.h (struct bidi_string_data): New structure.
13726 (struct bidi_it): New member `string'. Make flag members be 1-bit
13727 fields, and put them last in the struct.
13728 (compute_display_string_pos, compute_display_string_end):
13729 Update prototypes.
13730 (bidi_push_it, bidi_pop_it): Add prototypes.
13731 (struct iterator_stack_entry): New members bidi_p,
13732 paragraph_embedding, and from_disp_prop_p.
13733 (struct it): Member bidi_p is now a bit field 1 bit wide.
13734 (bidi_shelve_cache, bidi_unshelve_cache):
13735 Declare prototypes.
13736
13737 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13738 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13739 and vector-like objects.
13740
13741 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13742 cache around display iteration.
13743
13744 * window.c (Fwindow_end, window_scroll_pixel_based)
13745 (displayed_window_lines, Frecenter): Save and restore the bidi
13746 cache around display iteration.
13747
13748 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13749
13750 * editfns.c (Fdelete_region): Clarify the use of the named
13751 parameters (bug#6788).
13752
13753 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13754
13755 * indent.c (Fvertical_motion): Set and restore w->pointm when
13756 saving and restoring the window's buffer (Bug#9006).
13757
13758 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13759
13760 * editfns.c (Fstring_to_char): Clarify just what is returned
13761 (bug#6576). Text by Eli Zaretskii.
13762
13763 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13764
13765 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13766
13767 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13768
13769 * buffer.c (mmap_find): Fix a typo.
13770
13771 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13772
13773 Fix execution of x selection hooks.
13774 * xselect.c (Qx_lost_selection_functions)
13775 (Qx_sent_selection_functions): New vars.
13776 (syms_of_xselect): DEFSYM them.
13777 (x_handle_selection_request): Pass Qx_sent_selection_functions
13778 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13779 (x_handle_selection_clear,x_clear_frame_selections):
13780 Pass Qx_lost_selection_functions rather than
13781 Vx_lost_selection_functions to Frun_hook_with_args.
13782
13783 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13784
13785 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13786 The old code sometimes used this field without initializing it.
13787
13788 * alloc.c (gc_sweep): Don't read past end of array.
13789 In theory, the old code could also have corrupted Emacs internals,
13790 though it'd be very unlikely.
13791
13792 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13793
13794 * character.c (Fcharacterp): Don't advertise optional ignored
13795 argument. (Bug#4026)
13796
13797 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13798
13799 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13800 key" (bug#4257).
13801
13802 * window.c (Fset_window_start): Doc fix (bug#4199).
13803 (Fset_window_hscroll): Ditto.
13804
13805 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13806
13807 Fix minor new problems caught by GCC 4.6.1.
13808 * term.c (init_tty): Remove unused local.
13809 * xsettings.c (store_monospaced_changed): Define this function only
13810 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13811 not used otherwise.
13812
13813 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13814
13815 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13816
13817 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13818
13819 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13820 are the mini-buffer and the echo area (bug#3320).
13821
13822 * term.c (init_tty): Remove support for supdup, c10 and perq
13823 terminals, which are no longer supported (bug#1482).
13824
13825 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13826
13827 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13828
13829 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13830
13831 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13832 for non-popups (Bug#3642).
13833
13834 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13835
13836 * alloc.c (reset_malloc_hooks): Protoize.
13837 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13838 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13839 * cm.c (losecursor): Likewise.
13840 * data.c (fmod): Likewise.
13841 * dispnew.c (swap_glyphs_in_rows): Likewise.
13842 * emacs.c (memory_warning_signal): Likewise.
13843 * floatfns.c (float_error): Likewise.
13844 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13845 (otf_open, font_otf_capability, generate_otf_features)
13846 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13847 Likewise.
13848 * image.c (pbm_read_file): Likewise.
13849 * indent.c (string_display_width): Likewise.
13850 * intervals.c (check_for_interval, search_for_interval)
13851 (inc_interval_count, count_intervals, root_interval)
13852 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13853 * lread.c (defalias): Likewise.
13854 * ralloc.c (r_alloc_check): Likewise.
13855 * regex.c (set_image_of_range_1, set_image_of_range)
13856 (regex_grow_registers): Likewise.
13857 * sysdep.c (strerror): Likewise.
13858 * termcap.c (valid_filename_p, tprint, main): Likewise.
13859 * tparam.c (main): Likewise.
13860 * unexhp9k800.c (run_time_remap, save_data_space)
13861 (update_file_ptrs, read_header, write_header, calculate_checksum)
13862 (copy_file, copy_rest, display_header): Likewise.
13863 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13864 Likewise.
13865 * xdisp.c (check_it): Likewise.
13866 * xfaces.c (register_color, unregister_color, unregister_colors):
13867 Likewise.
13868 * xfns.c (print_fontset_result): Likewise.
13869 * xrdb.c (member, fatal, main): Likewise.
13870
13871 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13872
13873 Fix minor problems found by static checking (Bug#9031).
13874 * chartab.c (char_table_set_range, map_sub_char_table):
13875 Remove unused locals.
13876 (uniprop_table): Now static.
13877 * composite.c (_work_char): Remove unused static var.
13878
13879 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13880
13881 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13882
13883 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13884
13885 * gtkutil.c (qttip_cb): Remove code without function.
13886
13887 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13888
13889 * w32.c (pthread_sigmask): New stub.
13890
13891 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13892
13893 Use pthread_sigmask, not sigprocmask (Bug#9010).
13894 sigprocmask is portable only for single-threaded applications, and
13895 Emacs can be multi-threaded when it uses GTK.
13896 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13897 (LIBES): Use it.
13898 * callproc.c (Fcall_process):
13899 * process.c (create_process):
13900 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13901 Use pthread_sigmask, not sigprocmask.
13902
13903 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13904
13905 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13906 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13907 wrong (Bug#8591).
13908
13909 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13910
13911 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13912 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13913 (xg_hide_tooltip): Fix comment.
13914
13915 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13916 in registerServicesMenuSendTypes.
13917 (validRequestorForSendType): Don't check ns_return_types.
13918
13919 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13920 ns_return_type.
13921
13922 2011-07-08 Jason Rumney <jasonr@gnu.org>
13923
13924 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13925 SH_SHOW for hidden windows (Bug#5482).
13926
13927 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13928 frame struct members of non-existent frames (Bug#6284).
13929
13930 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13931
13932 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13933 variable firstTime not needed on OSX >= 10.6.
13934 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13935 >= 10.5. Use setKnobProportion, setDoubleValue.
13936
13937 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13938 (MAC_OS_X_VERSION_10_5): Define if not defined.
13939 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13940 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13941 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13942
13943 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13944 cString and lossyCString on OSX >= 10.4.
13945
13946 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13947 sizeToFit on OSX >= 10.2.
13948
13949 * nsimage.m (allocInitFromFile): Don't use deprecated method
13950 bestRepresentationForDevice on OSX >= 10.6.
13951
13952 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13953 to avoid warning.
13954
13955 * emacs.c: Declare unexec_init_emacs_zone.
13956
13957 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13958
13959 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13960
13961 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13962 on svcsMenu (Bug#8842).
13963
13964 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13965 ns_return_types.
13966 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13967
13968 * nsterm.m (QUTF8_STRING): Declare.
13969 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13970 (validRequestorForSendType): Return type is (id).
13971 Change indexOfObjectIdenticalTo to indexOfObject.
13972 Check if we have local selection before returning self (Bug#8842).
13973 (writeSelectionToPasteboard): Put local selection into paste board
13974 if we have a local selection (Bug#8842).
13975 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13976
13977 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13978 (ns_get_local_selection): Declare.
13979
13980 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13981
13982 * keymap.c (describe_map_tree): Don't insert a double newline at
13983 the end of the buffer (bug#1169) and return whether we inserted
13984 something.
13985
13986 * callint.c (Fcall_interactively): Change "reading args" to
13987 "providing args" to try to clarify what it does (bug#1010).
13988
13989 2011-07-07 Kenichi Handa <handa@m17n.org>
13990
13991 * composite.c (composition_compute_stop_pos): Ignore a static
13992 composition starting before CHARPOS (Bug#8915).
13993
13994 * xdisp.c (handle_composition_prop): Likewise.
13995
13996 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13997
13998 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13999 (Bug#9015)
14000
14001 2011-07-07 Kenichi Handa <handa@m17n.org>
14002
14003 * character.h (unicode_category_t): New enum type.
14004
14005 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14006 (Qchar_code_property_table): New variable.
14007 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14008 (UNIPROP_COMPRESSED_FORM_P): New macros.
14009 (char_table_ascii): Uncompress the compressed values.
14010 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14011 Uncompress the compressed values.
14012 (sub_char_table_ref_and_range): Likewise.
14013 (char_table_ref_and_range): Uncompress the compressed values.
14014 (sub_char_table_set): New arg is_uniprop. Callers changed.
14015 Uncompress the compressed values.
14016 (sub_char_table_set_range): Args changed. Callers changed.
14017 (char_table_set_range): Adjuted for the above change.
14018 (map_sub_char_table): Delete args default_val and parent. Add arg
14019 top. Give decoded values to a Lisp function.
14020 (map_char_table): Adjust for the above change. Give decoded
14021 values to a Lisp function. Gcpro more variables.
14022 (uniprop_table_uncompress)
14023 (uniprop_decode_value_run_length): New functions.
14024 (uniprop_decoder, uniprop_decoder_count): New variables.
14025 (uniprop_get_decoder, uniprop_encode_value_character)
14026 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14027 New functions.
14028 (uniprop_encoder, uniprop_encoder_count): New variables.
14029 (uniprop_get_encoder, uniprop_table)
14030 (Funicode_property_table_internal, Fget_unicode_property_internal)
14031 (Fput_unicode_property_internal): New functions.
14032 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14033 Sunicode_property_table_internal, Sget_unicode_property_internal,
14034 and Sput_unicode_property_internal. Defvar_lisp
14035 char-code-property-alist.
14036
14037 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
14038 Vunicode_category_table.
14039
14040 * font.c (font_range): Adjust for the change of
14041 Vunicode_category_table.
14042
14043 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14044
14045 * m/iris4d.h: Remove file, move contents ...
14046 * s/irix6-5.h: ... here.
14047
14048 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14049
14050 Remove unportable assumption about struct layout (Bug#8884).
14051 * alloc.c (mark_buffer):
14052 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14053 (clone_per_buffer_values): Don't assume that
14054 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14055 This isn't true in general, and it's particularly not true
14056 if Emacs is configured with --with-wide-int.
14057 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14058 New macros, used in the buffer.c change.
14059
14060 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14061
14062 * xsettings.c: Use both GConf and GSettings if both are available.
14063 (store_config_changed_event): Add comment.
14064 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14065 (store_tool_bar_style_changed): New functions.
14066 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14067 (struct xsettings): Move font inside HAVE_XFT.
14068 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14069 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14070 Move inside HAVE_XFT.
14071 (something_changed_gsettingsCB): Rename from something_changedCB.
14072 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14073 also.
14074 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14075 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14076 (something_changed_gconfCB): Rename from something_changedCB.
14077 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14078 (parse_settings): Move check for font inside HAVE_XFT.
14079 (read_settings, apply_xft_settings): Add comment.
14080 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14081 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14082 call store_font_name_changed.
14083 (xft_settings_event): Add comment.
14084 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14085 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14086 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14087 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14088 (xsettings_initialize): Call init_gsettings last.
14089 (xsettings_get_system_font, xsettings_get_system_normal_font):
14090 Add comment.
14091
14092 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14093
14094 Random fixes. E.g., (random) never returned negative values.
14095 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14096 subseconds part to the entropy, as that's a bit more random.
14097 Prefer signed to unsigned, since the signedness doesn't matter and
14098 in general we prefer signed. When given a limit, use a
14099 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14100 latter isn't right if USE_2_TAGS_FOR_INTS.
14101 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14102 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14103
14104 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14105
14106 * textprop.c (text_property_stickiness):
14107 Obey Vtext_property_default_nonsticky.
14108 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14109 * w32fns.c (syms_of_w32fns):
14110 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14111
14112 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14113
14114 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14115 This is more efficient than Ffile_directory_p and avoids a minor race.
14116
14117 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14118
14119 * buffer.c (Foverlay_put): Say what the return value is
14120 (bug#7835).
14121
14122 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14123 is a directory before asking whether to use the file name
14124 (bug#7564).
14125 (barf_or_query_if_file_exists): Make the "File is a directory"
14126 error be more correct.
14127
14128 * fns.c (Frequire): Remove the mention of the .gz files, since
14129 that's installation-specific, but keep the mention of
14130 `get-load-suffixes'.
14131
14132 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14133
14134 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14135 Report string overflow if the output is too long.
14136
14137 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14138
14139 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14140 (syms_of_gnutls): Remove duplicate DEFSYM for
14141 Qgnutls_bootprop_verify_hostname_error, an error for
14142 Qgnutls_bootprop_verify_error (which is no longer used).
14143
14144 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14145 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14146 Also (re)move comments that are misplaced or no longer relevant.
14147
14148 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14149
14150 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14151
14152 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14153
14154 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14155 and background color parameters if they have been changed.
14156
14157 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14158
14159 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14160
14161 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14162
14163 * xsettings.c (SYSTEM_FONT): Define only when used.
14164 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14165
14166 * keymap.c (access_keymap_1): Now static.
14167
14168 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14169
14170 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14171 leave any prefix arg for the up event (Bug#1586).
14172
14173 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14174
14175 * lread.c (syms_of_lread): Mention single symbols defined by
14176 `defvar' or `defconst' (bug#7154).
14177
14178 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14179 (Frequire): Mention get-load-suffixes.
14180
14181 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14182
14183 * window.h (window): Remove clone_number slot.
14184 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14185 Remove.
14186 (make_parent_window, make_window, saved_window)
14187 (Fset_window_configuration, save_window_save): Don't deal with
14188 clone numbers.
14189 * buffer.c (Qclone_number): Remove declaration.
14190 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14191
14192 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14193
14194 Add multiple inheritance to keymaps.
14195 * keymap.c (Fmake_composed_keymap): New function.
14196 (Fset_keymap_parent): Simplify.
14197 (fix_submap_inheritance): Remove.
14198 (access_keymap_1): New function extracted from access_keymap to handle
14199 embedded parents and handle lists of maps.
14200 (access_keymap): Use it.
14201 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14202 (Fcopy_keymap): Handle embedded parents.
14203 (Fcommand_remapping, define_as_prefix): Simplify.
14204 (Fkey_binding): Simplify.
14205 (syms_of_keymap): Move minibuffer-local-completion-map,
14206 minibuffer-local-filename-completion-map,
14207 minibuffer-local-must-match-map, and
14208 minibuffer-local-filename-must-match-map to Elisp.
14209 (syms_of_keymap): Defsubr make-composed-keymap.
14210 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14211 (parse_menu_item): Trivial simplification.
14212
14213 2011-07-01 Glenn Morris <rgm@gnu.org>
14214
14215 * Makefile.in (SETTINGS_LIBS): Fix typo.
14216
14217 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14218
14219 * coding.c (Fencode_coding_string): Record the last coding system
14220 used, as the function doc string says (bug#8738).
14221
14222 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14223
14224 * xsettings.c (store_monospaced_changed): Take new font as arg and
14225 check for change against current_mono_font.
14226 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14227 (emacs_settings_constructor, emacs_settings_get_property)
14228 (emacs_settings_set_property, emacs_settings_class_init)
14229 (emacs_settings_init, gsettings_obj): Remove.
14230 (something_changedCB): New function for HAVE_GSETTINGS.
14231 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14232 with value as argument.
14233 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14234 g_settings_new (Bug#8967). Do not create gsettings_obj.
14235 Remove calls to g_settings_bind. Connect something_changedCB to
14236 "changed".
14237
14238 * xgselect.c: Add defined (HAVE_GSETTINGS).
14239 (xgselect_initialize): Ditto.
14240
14241 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14242 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14243 xg_select.
14244
14245 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14246
14247 * eval.c (struct backtrace): Simplify and port the data structure.
14248 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14249 signed bit field, as this assumption is not portable and it makes
14250 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14251 "char debug_on_exit : 1" as this is not portable either; instead,
14252 use the portable "unsigned int debug_on_exit : 1". Remove unused
14253 member evalargs. Remove obsolete comments about cc bombing out.
14254
14255 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14256
14257 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14258 Let HAVE_GSETTINGS override HAVE_GCONF.
14259 (store_monospaced_changed): New function.
14260 (EMACS_SETTINGS): A new type derived from GObject to handle
14261 GSettings notifications.
14262 (emacs_settings_constructor, emacs_settings_get_property)
14263 (emacs_settings_set_property, emacs_settings_class_init):
14264 New functions.
14265 (gsettings_client, gsettings_obj): New variables.
14266 (GSETTINGS_SCHEMA): New define.
14267 (something_changedCB): Call store_monospaced_changed.
14268 (init_gsettings): New function.
14269 (xsettings_initialize): Call init_gsettings.
14270 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14271 to NULL.
14272
14273 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14274 GCONF_CFLAGS/LIBS.
14275
14276 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14277
14278 * window.c (resize_root_window, grow_mini_window)
14279 (shrink_mini_window): Rename Qresize_root_window to
14280 Qwindow_resize_root_window and Qresize_root_window_vertically to
14281 Qwindow_resize_root_window_vertically.
14282
14283 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14284
14285 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14286
14287 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14288
14289 * makefile.w32-in: Redesign dependencies so they reflect more
14290 clearly which files are directly included by each source file,
14291 and not through other includes.
14292
14293 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14294
14295 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14296 (sort_overlays, overlay_strings): When an overlay's clone number
14297 matches the window's clone number process the overlay even if
14298 the overlay's window property doesn't match the current window.
14299
14300 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14301 (Fwindow_hchild): Rename to Fwindow_left_child.
14302 (Fwindow_next): Rename to Fwindow_next_sibling.
14303 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14304 (resize_window_check): Rename to window_resize_check.
14305 (resize_window_apply): Rename to window_resize_apply.
14306 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14307 (Fdelete_other_windows_internal, resize_frame_windows)
14308 (Fsplit_window_internal, Fdelete_window_internal)
14309 (grow_mini_window, shrink_mini_window)
14310 (Fresize_mini_window_internal): Fix callers accordingly.
14311
14312 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14313
14314 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14315 (emacs_fixed_set_min_size): Remove.
14316 (emacs_fixed_new): Take frame as argument.
14317
14318 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14319 (_EmacsFixedPrivate): Remove minwidth/height.
14320 Add struct frame *f.
14321 (emacs_fixed_init): Initialize priv->f.
14322 (get_parent_class, emacs_fixed_set_min_size): Remove.
14323 (emacs_fixed_new): Set priv->f to argument.
14324 (emacs_fixed_get_preferred_width)
14325 (emacs_fixed_get_preferred_height): Use min_width/height from
14326 frames size_hint to set minimum and natural (Bug#8919).
14327 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14328 and use min_width/height from frames size_hint to set
14329 min_width/height (Bug#8919).
14330
14331 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14332 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14333 Fix indentation.
14334
14335 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14336
14337 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14338 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14339 called at ZV.
14340
14341 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14342
14343 * process.c (wait_reading_process_output): Bypass select if
14344 waiting for a cell while ignoring keyboard input, and input is
14345 pending. Suggested by Jan Djärv (Bug#8869).
14346
14347 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14348
14349 Use gnulib's dup2 module instead of rolling our own.
14350 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14351
14352 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14353
14354 * dispnew.c (scrolling_window): Before scrolling, turn off a
14355 mouse-highlight in the window being scrolled.
14356
14357 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14358
14359 Move DEFSYM to lisp.h and use everywhere.
14360
14361 * character.h (DEFSYM): Move declaration...
14362 * lisp.h (DEFSYM): ...here.
14363
14364 * gnutls.c:
14365 * minibuf.c:
14366 * w32menu.c:
14367 * w32proc.c:
14368 * w32select.c: Don't include character.h.
14369
14370 * alloc.c (syms_of_alloc):
14371 * buffer.c (syms_of_buffer):
14372 * bytecode.c (syms_of_bytecode):
14373 * callint.c (syms_of_callint):
14374 * casefiddle.c (syms_of_casefiddle):
14375 * casetab.c (init_casetab_once):
14376 * category.c (init_category_once, syms_of_category):
14377 * ccl.c (syms_of_ccl):
14378 * cmds.c (syms_of_cmds):
14379 * composite.c (syms_of_composite):
14380 * dbusbind.c (syms_of_dbusbind):
14381 * dired.c (syms_of_dired):
14382 * dispnew.c (syms_of_display):
14383 * doc.c (syms_of_doc):
14384 * editfns.c (syms_of_editfns):
14385 * emacs.c (syms_of_emacs):
14386 * eval.c (syms_of_eval):
14387 * fileio.c (syms_of_fileio):
14388 * fns.c (syms_of_fns):
14389 * frame.c (syms_of_frame):
14390 * fringe.c (syms_of_fringe):
14391 * insdel.c (syms_of_insdel):
14392 * keymap.c (syms_of_keymap):
14393 * lread.c (init_obarray, syms_of_lread):
14394 * macros.c (syms_of_macros):
14395 * msdos.c (syms_of_msdos):
14396 * print.c (syms_of_print):
14397 * process.c (syms_of_process):
14398 * search.c (syms_of_search):
14399 * sound.c (syms_of_sound):
14400 * syntax.c (init_syntax_once, syms_of_syntax):
14401 * terminal.c (syms_of_terminal):
14402 * textprop.c (syms_of_textprop):
14403 * undo.c (syms_of_undo):
14404 * w32.c (globals_of_w32):
14405 * window.c (syms_of_window):
14406 * xdisp.c (syms_of_xdisp):
14407 * xfaces.c (syms_of_xfaces):
14408 * xfns.c (syms_of_xfns):
14409 * xmenu.c (syms_of_xmenu):
14410 * xsettings.c (syms_of_xsettings):
14411 * xterm.c (syms_of_xterm): Use DEFSYM.
14412
14413 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14414
14415 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14416
14417 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14418
14419 Integer and buffer overflow fixes (Bug#8873).
14420
14421 * print.c (printchar, strout): Check for string overflow.
14422 (PRINTPREPARE, printchar, strout):
14423 Don't set size unless allocation succeeds.
14424
14425 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14426 for sizes. Check for string overflow more accurately.
14427 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14428
14429 * macros.c: Integer and buffer overflow fixes.
14430 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14431 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14432 Use ptrdiff_t, not int, for sizes.
14433 Don't increment bufsize until after realloc succeeds.
14434 Check for size-calculation overflow.
14435 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14436
14437 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14438
14439 * lread.c: Integer overflow fixes.
14440 (read_integer): Radix is now EMACS_INT, not int,
14441 to improve quality of diagnostics for out-of-range radices.
14442 Calculate buffer size correctly for out-of-range radices.
14443 (read1): Check for integer overflow in radices, and in
14444 read-circle numbers.
14445 (read_escape): Avoid int overflow.
14446 (Fload, openp, read_buffer_size, read1)
14447 (substitute_object_recurse, read_vector, read_list, map_obarray):
14448 Use ptrdiff_t, not int, for sizes.
14449 (read1): Use EMACS_INT, not int, for sizes.
14450 Check for size overflow.
14451
14452 * image.c (cache_image): Check for size arithmetic overflow.
14453
14454 * lread.c: Integer overflow issues.
14455 (saved_doc_string_size, saved_doc_string_length)
14456 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14457 Now ptrdiff_t, not int.
14458 (read1): Don't assume doc string length fits in int. Check for
14459 out-of-range doc string lengths.
14460 (read_list): Don't assume file position fits in int.
14461 (read_escape): Check for hex character overflow.
14462
14463 2011-06-22 Leo Liu <sdl.web@gmail.com>
14464
14465 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14466 Move to minibuffer.el.
14467
14468 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14469
14470 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14471 The following patches are for when GLYPH_DEBUG && !XASSERT.
14472 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14473 * dispnew.c (flush_stdout):
14474 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14475 Mark as externally visible.
14476 * dispnew.c (check_window_matrix_pointers): Now static.
14477 * dispnew.c (window_to_frame_vpos):
14478 * xfns.c (unwind_create_frame):
14479 * xterm.c (x_check_font): Remove unused local.
14480 * scroll.c (CHECK_BOUNDS):
14481 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14482 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14483 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14484 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14485 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14486 Now static.
14487 (debug_method_add): Use va_list and vsprintf rather than relying
14488 on undefined behavior with wrong number of arguments.
14489 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14490 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14491 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14492 since we're not interested in debugging glyphs with old libraries.
14493 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14494 GCC 4.6.0's static checking.
14495
14496 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14497
14498 Integer overflow and signedness fixes (Bug#8873).
14499 A few related buffer overrun fixes, too.
14500
14501 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14502
14503 * dispextern.h (struct face.stipple):
14504 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14505 (x_bitmap_mask, x_allocate_bitmap_record)
14506 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14507 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14508 (x_create_bitmap_from_xpm_data):
14509 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14510 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14511 (.bitmaps_last):
14512 * xfaces.c (load_pixmap):
14513 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14514 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14515 (.bitmaps_last, struct x_output.icon_bitmap):
14516 Use ptrdiff_t, not int, for bitmap indexes.
14517 (x_allocate_bitmap_record): Check for size overflow.
14518 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14519
14520 Use ptrdiff_t, not int, for overlay counts.
14521 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14522 * editfns.c (overlays_around, get_pos_property):
14523 * textprop.c (get_char_property_and_overlay):
14524 * xdisp.c (next_overlay_change, note_mouse_highlight):
14525 * xfaces.c (face_at_buffer_position):
14526 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14527 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14528 (Fnext_overlay_change, Fprevious_overlay_change)
14529 (mouse_face_overlay_overlaps, Foverlays_in):
14530 Use ptrdiff_t, not int, for sizes.
14531 (overlays_at, overlays_in): Check for size-calculation overflow.
14532
14533 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14534
14535 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14536 (x_session_initialize): Do not assume string length fits in int.
14537
14538 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14539 This is unlikely, but can occur if DPI is outlandish.
14540
14541 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14542 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14543
14544 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14545 * xrdb.c (magic_file_p, search_magic_path):
14546 Omit last arg SUFFIX; it was always 0. All callers changed.
14547 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14548
14549 * xfont.c (xfont_match): Avoid need for strlen.
14550
14551 * xfns.c: Don't assume strlen fits in int.
14552 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14553
14554 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14555 not unsigned long, as we prefer signed integers. All callers changed.
14556 Detect integer overflow in repeat count.
14557 (message_dolog): Don't assume print length fits in 39 bytes.
14558 (display_mode_element): Don't assume strlen fits in int.
14559
14560 * termcap.c: Don't assume sizes fit in int and never overflow.
14561 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14562 (gobble_line): Check for size-calculation overflow.
14563
14564 * minibuf.c (Fread_buffer):
14565 * lread.c (intern, intern_c_string):
14566 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14567 Don't assume string length fits in int.
14568
14569 * keyboard.c (parse_tool_bar_item):
14570 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14571
14572 * font.c: Don't assume string length fits in int.
14573 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14574 Use ptrdiff_t, not int.
14575 (font_intern_prop): Don't assume string length fits in int.
14576 Don't assume integer property fits in fixnum.
14577 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14578
14579 * filelock.c: Fix some buffer overrun and integer overflow issues.
14580 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14581 Reformulate so as not to need the command string.
14582 Invoke gzip -cd rather than gunzip, as it's more portable.
14583 (lock_info_type, lock_file_1, lock_file):
14584 Don't assume pid_t and time_t fit in unsigned long.
14585 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14586 (current_lock_owner): Prefer signed type for sizes.
14587 Use memcpy, not strncpy, where memcpy is what is really wanted.
14588 Don't assume (via atoi) that time_t and pid_t fit in int.
14589 Check for time_t and/or pid_t out of range, e.g., via a network share.
14590 Don't alloca where an auto var works fine.
14591
14592 * fileio.c: Fix some integer overflow issues.
14593 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14594 Don't assume string length fits in int.
14595 (directory_file_name): Don't assume string length fits in long.
14596 (make_temp_name): Don't assume pid fits in int, or that its print
14597 length is less than 20.
14598
14599 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14600
14601 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14602
14603 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14604
14605 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14606 We prefer signed integers, even for size calculations.
14607
14608 * emacs.c: Don't assume string length fits in 'int'.
14609 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14610 (main): Don't invoke strlen when not needed.
14611
14612 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14613 (XD_DEBUG_MESSAGE): Don't waste a byte.
14614
14615 * callproc.c (getenv_internal_1, getenv_internal)
14616 (Fgetenv_internal):
14617 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14618
14619 * lread.c (invalid_syntax): Omit length argument.
14620 All uses changed. This doesn't fix a bug, but it simplifies the
14621 code away from its former Hollerith-constant appearance, and it's
14622 one less 'int' to worry about when looking at integer-overflow issues.
14623 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14624
14625 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14626 This didn't break anything, but it didn't help either.
14627 It's confusing to put a bogus integer in a place where the actual
14628 value does not matter.
14629 (LIST_END_P): Remove unused macro and its bogus comment.
14630 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14631
14632 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14633 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14634 implementation.
14635 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14636 We prefer signed types, and the value cannot exceed the EMACS_INT
14637 range anyway (because otherwise the length would not be representable).
14638 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14639 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14640 This avoids a GCC warning when WIDE_EMACS_INT.
14641
14642 * indent.c (sane_tab_width): New function.
14643 (current_column, scan_for_column, Findent_to, position_indentation)
14644 (compute_motion): Use it. This is just for clarity.
14645 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14646
14647 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14648
14649 * lisp.h (lint_assume): New macro.
14650 * composite.c (composition_gstring_put_cache):
14651 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14652
14653 * editfns.c, insdel.c:
14654 Omit unnecessary forward decls, to simplify future changes.
14655
14656 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14657
14658 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14659
14660 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14661 Use much-faster test for byte-length change.
14662 Don't assume string byte-length fits in 'int'.
14663 Check that character arg fits in 'int'.
14664 (mapcar1): Declare byte as byte, for clarity.
14665
14666 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14667
14668 * fns.c (concat): Catch string overflow earlier.
14669 Do not rely on integer wraparound.
14670
14671 * dispextern.h (struct it.overlay_strings_charpos)
14672 (struct it.selective): Now EMACS_INT, not int.
14673 * xdisp.c (forward_to_next_line_start)
14674 (back_to_previous_visible_line_start)
14675 (reseat_at_next_visible_line_start, next_element_from_buffer):
14676 Don't arbitrarily truncate the value of 'selective' to int.
14677
14678 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14679
14680 * composite.c: Don't truncate sizes to 'int'.
14681 (composition_gstring_p, composition_reseat_it)
14682 (composition_adjust_point): Use EMACS_INT, not int.
14683 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14684 not EMACS_UINT, for indexes.
14685
14686 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14687
14688 * buffer.c: Include <verify.h>.
14689 (struct sortvec.priority, struct sortstr.priority):
14690 Now EMACS_INT, not int.
14691 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14692 (struct sortstr.size, record_overlay_string)
14693 (struct sortstrlist.size, struct sortlist.used):
14694 Don't truncate size to int.
14695 (record_overlay_string): Check for size-calculation overflow.
14696 (init_buffer_once): Check at compile-time, not run-time.
14697
14698 2011-06-22 Jim Meyering <meyering@redhat.com>
14699
14700 Don't leak an XBM-image-sized buffer
14701 * image.c (xbm_load): Free the image buffer after using it.
14702
14703 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14704
14705 Port to Sun C.
14706 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14707 that Sun C diagnosed.
14708 * fns.c (secure_hash): Fix pointer signedness issue.
14709 * intervals.c (static_offset_intervals): New function.
14710 (offset_intervals): Use it.
14711
14712 2011-06-21 Leo Liu <sdl.web@gmail.com>
14713
14714 * deps.mk (fns.o):
14715 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14716 sha512.h.
14717
14718 * fns.c (secure_hash): Rename from crypto_hash_function and change
14719 the first arg to accept symbols.
14720 (Fsecure_hash): New primitive.
14721 (syms_of_fns): New symbols.
14722
14723 2011-06-20 Deniz Dogan <deniz@dogan.se>
14724
14725 * process.c (Fset_process_buffer): Clarify return value in
14726 docstring.
14727
14728 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14729
14730 * dispnew.c (add_window_display_history): Use BVAR.
14731
14732 * xdisp.c (debug_method_add): Use BVAR.
14733 (check_window_end, dump_glyph_matrix, dump_glyph)
14734 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14735
14736 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14737 Likewise.
14738
14739 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14740 check till after the cache is created in init_frame_faces.
14741
14742 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14743
14744 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14745
14746 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14747
14748 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14749 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14750 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14751
14752 Improve buffer-overflow checking (Bug#8873).
14753 * fileio.c (Finsert_file_contents):
14754 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14755 Remove the old (too-loose) buffer overflow checks.
14756 They weren't needed, since make_gap checks for buffer overflow.
14757 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14758 The old code merely checked for Emacs fixnum overflow, and relied
14759 on undefined (wraparound) behavior. The new code avoids undefined
14760 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14761
14762 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14763 Tune. Don't use wider integers than needed. Don't use alloca.
14764 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14765
14766 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14767
14768 * insdel.c, lisp.h (buffer_overflow): New function.
14769 (insert_from_buffer_1, replace_range, replace_range_2):
14770 * insdel.c (make_gap_larger):
14771 * editfns.c (Finsert_char):
14772 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14773
14774 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14775
14776 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14777
14778 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14779
14780 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14781 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14782
14783 * fileio.c: Don't assume EMACS_INT fits in off_t.
14784 (emacs_lseek): New static function.
14785 (Finsert_file_contents, Fwrite_region): Use it.
14786 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14787
14788 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14789
14790 * fns.c: Don't overflow int when computing a list length.
14791 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14792 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14793 truncation on 64-bit hosts. Check for QUIT every
14794 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14795 faster and is responsive enough.
14796 (Flength): Report an error instead of overflowing an integer.
14797 (Fsafe_length): Return a float if the value is not representable
14798 as a fixnum. This shouldn't happen except in contrived situations.
14799 (Fnthcdr, Fsort): Don't assume list length fits in int.
14800 (Fcopy_sequence): Don't assume vector length fits in int.
14801
14802 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14803 (header_size, word_size): New constants.
14804 (allocate_vectorlike): Don't check size overflow here.
14805 (allocate_vector): Check it here instead, since this is the only
14806 caller of allocate_vectorlike that could cause overflow.
14807 Check that the new vector's length is representable as a fixnum.
14808
14809 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14810 The previous code was bogus. For example, next_almost_prime (32)
14811 returned 39, which is undesirable as it is a multiple of 3; and
14812 next_almost_prime (24) returned 25, which is a multiple of 5 so
14813 why was the code bothering to check for multiples of 7?
14814
14815 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14816
14817 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14818
14819 Variadic C functions now count arguments with ptrdiff_t.
14820 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14821 Back then I didn't know that the Emacs coding style prefers signed int.
14822 Also, in the meantime I found a few more instances where arguments
14823 were being counted with int, which may truncate counts on 64-bit
14824 machines, or EMACS_INT, which may be unnecessarily wide.
14825 * lisp.h (struct Lisp_Subr.function.aMANY)
14826 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14827 Arg counts are now ptrdiff_t, not size_t.
14828 All variadic functions and their callers changed accordingly.
14829 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14830 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14831 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14832 * callint.c (Fcall_interactively): Check arg count for overflow,
14833 to avoid potential buffer overrun. Use signed char, not 'int',
14834 for 'varies' array, so that we needn't bother to check its size
14835 calculation for overflow.
14836 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14837 * eval.c (apply_lambda):
14838 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14839 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14840 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14841
14842 * callint.c (Fcall_interactively): Don't use index var as event count.
14843
14844 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14845 * mem-limits.h (SIZE): Remove; no longer used.
14846
14847 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14848
14849 Remove unnecessary casts.
14850 * xterm.c (x_term_init):
14851 * xfns.c (x_set_border_pixel):
14852 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14853 These aren't needed now that we assume ANSI C.
14854
14855 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14856 It's more likely to cause problems (due to unsigned overflow)
14857 than to cure them.
14858
14859 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14860
14861 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14862
14863 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14864
14865 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14866
14867 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14868
14869 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14870
14871 GLYPH_CODE_FACE returns EMACS_INT, not int.
14872 * dispextern.h (merge_faces):
14873 * xfaces.c (merge_faces):
14874 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14875 Don't assume EMACS_INT fits in int.
14876
14877 * character.h (CHAR_VALID_P): Remove unused parameter.
14878 * fontset.c, lisp.h, xdisp.c: All uses changed.
14879
14880 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14881
14882 * fns.c (concat): Minor tuning based on overflow analysis.
14883 This doesn't fix any bugs. Use int to hold character, instead
14884 of constantly refetching from Emacs object. Use XFASTINT, not
14885 XINT, for value known to be a character. Don't bother comparing
14886 a single byte to 0400, as it's always less.
14887
14888 * floatfns.c (Fexpt):
14889 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14890
14891 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14892 for characters.
14893
14894 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14895
14896 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14897 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14898 incorrectly succeed when S was a string, because 4294967386 was
14899 truncated before it was used.
14900
14901 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14902 Otherwise, an out-of-range integer could cause undefined behavior
14903 on a 64-bit host.
14904
14905 * composite.c: Use int, not EMACS_INT, for characters.
14906 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14907 EMACS_INT, for values that are known to be in character range.
14908 This doesn't fix any bugs but is the usual style inside Emacs and
14909 may generate better code on 32-bit machines.
14910
14911 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14912 This is for reasons similar to the recent CHAR_STRING fix.
14913 * charset.c (Fencode_char): Check that character arg is actually
14914 a character. Pass an int to ENCODE_CHAR.
14915 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14916 wider than 'int', as a compile-time check to prevent future regressions
14917 in this area.
14918
14919 * character.c (char_string): Remove unnecessary casts.
14920
14921 Make sure a 64-bit char is never passed to CHAR_STRING.
14922 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14923 by silently ignoring the top 32 bits, allowing some values
14924 that were far too large to be valid characters.
14925 * character.h: Include <verify.h>.
14926 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14927 arguments are no wider than unsigned, as a compile-time check
14928 to prevent future regressions in this area.
14929 * data.c (Faset):
14930 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14931 (Fsubst_char_in_region):
14932 * fns.c (concat):
14933 * xdisp.c (decode_mode_spec_coding):
14934 Adjust to CHAR_STRING's new requirement.
14935 * editfns.c (Finsert_char, Fsubst_char_in_region):
14936 * fns.c (concat): Check that character args are actually
14937 characters. Without this test, these functions did the wrong
14938 thing with wildly out-of-range values on 64-bit hosts.
14939
14940 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14941 These casts should not be needed on 32-bit hosts, either.
14942 * keyboard.c (read_char):
14943 * lread.c (Fload): Remove casts to unsigned.
14944
14945 * lisp.h (UNSIGNED_CMP): New macro.
14946 This fixes comparison bugs on 64-bit hosts.
14947 (ASCII_CHAR_P): Use it.
14948 * casefiddle.c (casify_object):
14949 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14950 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14951 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14952 * dispextern.h (FACE_FROM_ID):
14953 * keyboard.c (read_char): Use UNSIGNED_CMP.
14954
14955 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14956 not to EMACS_INT, to avoid GCC warning.
14957
14958 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14959
14960 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14961 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14962 isn't needed on 32-bit machines.
14963
14964 * buffer.c (Fgenerate_new_buffer_name):
14965 Use EMACS_INT for count, not int.
14966 (advance_to_char_boundary): Return EMACS_INT, not int.
14967
14968 * data.c (Qcompiled_function): Now static.
14969
14970 * window.c (window_body_lines): Now static.
14971
14972 * image.c (gif_load): Rename local to avoid shadowing.
14973
14974 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14975 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14976 * alloc.c (make_save_value): Integer argument is now of type
14977 ptrdiff_t, not int.
14978 (mark_object): Use ptrdiff_t, not int.
14979 * lisp.h (pD): New macro.
14980 * print.c (print_object): Use it.
14981
14982 * alloc.c: Use EMACS_INT, not int, to count objects.
14983 (total_conses, total_markers, total_symbols, total_vector_size)
14984 (total_free_conses, total_free_markers, total_free_symbols)
14985 (total_free_floats, total_floats, total_free_intervals)
14986 (total_intervals, total_strings, total_free_strings):
14987 Now EMACS_INT, not int. All uses changed.
14988 (Fgarbage_collect): Compute overall total using a double, so that
14989 integer overflow is less likely to be a problem. Check for overflow
14990 when converting back to an integer.
14991 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14992 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14993 These were 'int' variables that could overflow on 64-bit hosts;
14994 they were never used, so remove them instead of repairing them.
14995 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14996 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14997 Previously, this ceilinged at INT_MAX, but that doesn't work on
14998 64-bit machines.
14999 (allocate_pseudovector): Don't use EMACS_INT when int would do.
15000
15001 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
15002 (allocate_vectorlike): Check for ptrdiff_t overflow.
15003 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15004 when a (possibly-narrower) signed value would do just as well.
15005 We prefer using signed arithmetic, to avoid comparison confusion.
15006
15007 * alloc.c: Catch some string size overflows that we were missing.
15008 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15009 for convenience in STRING_BYTES_MAX.
15010 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15011 The definition here is exact; the one in lisp.h was approximate.
15012 (allocate_string_data): Check for string overflow. This catches
15013 some instances we weren't catching before. Also, it catches
15014 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15015 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15016 and ptrdiff_t and EMACS_INT are both 64 bits.
15017
15018 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15019 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
15020 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
15021
15022 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15023
15024 * alloc.c (Fmake_string): Check for out-of-range init.
15025
15026 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15027
15028 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15029
15030 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15031
15032 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15033 xg_get_default_scrollbar_width.
15034
15035 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15036 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15037 (style_changed_cb): Call update_theme_scrollbar_width and call
15038 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15039 all frames (Bug#8505).
15040 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15041 Call gtk_window_set_resizable if HAVE_GTK3.
15042 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15043 and height if HAVE_GTK3 (Bug#8505).
15044 (scroll_bar_width_for_theme): New variable.
15045 (update_theme_scrollbar_width): New function.
15046 (xg_get_default_scrollbar_width): Move code to
15047 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15048 (xg_initialize): Call update_theme_scrollbar_width.
15049
15050 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15051
15052 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15053
15054 2011-06-12 Martin Rudalics <rudalics@gmx.at>
15055
15056 * frame.c (make_frame): Call other_buffer_safely instead of
15057 other_buffer.
15058
15059 * window.c (temp_output_buffer_show): Call display_buffer with
15060 second argument Vtemp_buffer_show_specifiers and reset latter
15061 immediately after the call.
15062 (Vtemp_buffer_show_specifiers): New variable.
15063 (auto_window_vscroll_p, next_screen_context_lines)
15064 (Vscroll_preserve_screen_position): Remove leading asterisks from
15065 doc-strings.
15066
15067 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15068
15069 Fix minor problems found by GCC 4.6.0 static checking.
15070 * buffer.c (Qclone_number): Remove for now, as it's unused.
15071 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15072 (record_buffer): Remove unused local.
15073 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15074 (set_frame_buffer_list): Remove; unused.
15075 * frame.h (other_visible_frames): Remove decl.
15076 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15077 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15078 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15079 if HAVE_GPM.
15080 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15081 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15082 Define only if HAVE_GPM.
15083 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15084 (update_hints_inhibit): Remove; never set. All uses removed.
15085 * widgetprv.h (emacsFrameClassRec): Remove decl.
15086 * window.c (delete_deletable_window): Now returns void, since it
15087 wasn't returning anything.
15088 (compare_window_configurations): Remove unused locals.
15089 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15090 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15091 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15092 the same widths as pointers. This follows up on the 2011-05-06 patch.
15093 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15094 * xterm.h: Likewise.
15095 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15096
15097 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15098
15099 * makefile.w32-in: Update dependencies.
15100 (LISP_H): Add lib/intprops.h.
15101
15102 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15103
15104 * image.c (gif_load): Add animation frame delay to the metadata.
15105 (syms_of_image): Use DEFSYM. New symbol `delay'.
15106
15107 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15108
15109 * window.c (delete_deletable_window): Re-add.
15110 (Fset_window_configuration): Rewrite to handle dead buffers and
15111 consequently deletable windows.
15112 (window_tree, Fwindow_tree): Remove. Supply functionality in
15113 window.el.
15114 (compare_window_configurations): Simplify code.
15115
15116 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15117
15118 * image.c (imagemagick_load_image): Fix type mismatch.
15119 (Fimagemagick_types): Likewise.
15120
15121 * window.h (replace_buffer_in_windows): Declare.
15122
15123 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15124
15125 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15126 Qclone_number. Remove external declaration of Qdelete_window.
15127 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15128 code.
15129 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15130 Run Qbuffer_list_update_hook if allowed.
15131 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15132 buffer list implementation.
15133 (other_buffer_safely): New function.
15134 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15135 calls to replace_buffer_in_windows and
15136 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15137 if allowed.
15138 (record_buffer): Inhibit quitting and rewrite using quittable
15139 functions. Run Qbuffer_list_update_hook if allowed.
15140 (Frecord_buffer, Funrecord_buffer): New functions.
15141 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15142 Move switch-to-buffer to window.el.
15143 (bury-buffer): Move to window.el.
15144 (Vbuffer_list_update_hook): New variable.
15145
15146 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15147 section.
15148
15149 * window.h (resize_frame_windows): Move up in code.
15150 (Fwindow_frame): Remove EXFUN.
15151 (replace_buffer_in_all_windows): Remove prototype.
15152 (replace_buffer_in_windows_safely): Add prototype.
15153
15154 * window.c: Declare Qdelete_window static again. Move down
15155 declaration of select_count.
15156 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15157 (Fother_window): Move to window.el.
15158 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15159 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15160 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15161 window.el.
15162 (replace_buffer_in_windows): Implement by calling
15163 Qreplace_buffer_in_windows.
15164 (replace_buffer_in_all_windows): Remove with some functionality
15165 moved into replace_buffer_in_windows_safely.
15166 (replace_buffer_in_windows_safely): New function.
15167 (select_window_norecord, select_frame_norecord): Move in front
15168 of run_window_configuration_change_hook. Remove now obsolete
15169 declarations.
15170 (Fset_window_buffer): Rewrite doc-string.
15171 Call Qrecord_window_buffer.
15172 (keys_of_window): Move binding for other-window to window.el.
15173
15174 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15175
15176 * dispextern.h (struct image): Replace data member, whose int_val
15177 and ptr_val fields were not used by anything, with a single
15178 lisp_val object.
15179
15180 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15181 (gif_clear_image, gif_load, imagemagick_load_image)
15182 (gs_clear_image, gs_load): Callers changed.
15183
15184 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15185
15186 * buffer.h: Include <time.h>, for time_t.
15187 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15188
15189 Fix minor problems found by static checking.
15190
15191 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15192
15193 Make identifiers static if they are not used in other modules.
15194 * data.c (Qcompiled_function, Qframe, Qvector):
15195 * image.c (QimageMagick, Qsvg):
15196 * minibuf.c (Qmetadata):
15197 * window.c (resize_window_check, resize_root_window): Now static.
15198 * window.h (resize_window_check, resize_root_window): Remove decls.
15199
15200 * window.c (window_deletion_count, delete_deletable_window):
15201 Remove; unused.
15202 (window_body_lines): Now static.
15203 (Fdelete_other_windows_internal): Mark vars as initialized.
15204 Make sure 'resize_failed' is initialized.
15205 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15206 (resize_window_apply): Remove unused local.
15207 * window.h (delete_deletable_window): Remove decl.
15208
15209 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15210 (imagemagick_load_image): Fix pointer signedness problem by changing
15211 last arg from unsigned char * to char *. All uses changed.
15212 Also, fix a local for similar reasons.
15213 Remove unused locals. Remove locals to avoid shadowing.
15214 (fn_rsvg_handle_free): Remove; unused.
15215 (svg_load, svg_load_image): Fix pointer signedness problem.
15216 (imagemagick_load_image): Don't use garbage pointer image_wand.
15217
15218 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15219
15220 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15221
15222 * image.c (gif_load): Fix omitted cast error introduced by
15223 2011-06-06 change.
15224
15225 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15226
15227 * window.h (resize_proportionally, orig_total_lines)
15228 (orig_top_line): Remove from window structure.
15229 (set_window_height, set_window_width, change_window_heights)
15230 (Fdelete_window): Remove prototypes.
15231 (resize_frame_windows): Remove duplicate declaration.
15232
15233 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15234
15235 * window.h (resize_frame_windows, resize_window_check)
15236 (delete_deletable_window, resize_root_window)
15237 (resize_frame_windows): Declare prototypes.
15238
15239 * window.c (resize_window_apply): Make definition be "static" to
15240 match the prototype.
15241
15242 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15243
15244 * window.c: Remove declarations of Qwindow_size_fixed,
15245 window_min_size_1, window_min_size_2, window_min_size,
15246 size_window, window_fixed_size_p, enlarge_window, delete_window.
15247 Remove static from declaration of Qdelete_window, it's
15248 temporarily needed by Fbury_buffer.
15249 (replace_window): Don't assign orig_top_line and
15250 orig_total_lines.
15251 (Fdelete_window, delete_window): Remove. Window deletion is
15252 handled by window.el.
15253 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15254 Replace Fdelete_window calls with calls to Qdelete_window.
15255 (Fdelete_other_windows): Remove. Deleting other windows is
15256 handled by window.el.
15257 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15258 handled in window.el.
15259 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15260 Window minimum sizes are handled in window.el.
15261 (shrink_windows, size_window, set_window_height)
15262 (set_window_width, change_window_heights, window_height)
15263 (window_width, CURBEG, CURSIZE, enlarge_window)
15264 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15265 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15266 handled in window.el.
15267 (make_dummy_parent): Rename to make_parent_window and give it a
15268 second argument horflag.
15269 (make_window): Don't set resize_proportionally any more.
15270 (Fsplit_window): Remove. Windows are split in window.el.
15271 (save_restore_action, save_restore_orig_size)
15272 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15273 Resize mini windows in window.el.
15274 (grow_mini_window, shrink_mini_window): Implement by calling
15275 Qresize_root_window_vertically, resize_window_check and
15276 resize_window_apply.
15277 (saved_window, Fset_window_configuration, save_window_save):
15278 Do not handle orig_top_line, orig_total_lines, and
15279 resize_proportionally.
15280 (window_min_height, window_min_width): Move to window.el.
15281 (keys_of_window): Move bindings for delete-other-windows,
15282 split-window, delete-window and enlarge-window to window.el.
15283
15284 * buffer.c: Temporarily extern Qdelete_window.
15285 (Fbury_buffer): Temporarily call Qdelete_window instead of
15286 Fdelete_window (Fbury_buffer will move to window.el soon).
15287
15288 * frame.c (set_menu_bar_lines_1): Remove code handling
15289 orig_top_line and orig_total_lines.
15290
15291 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15292 set_window_height but set heights directly.
15293 (change_frame_size_1): Use resize_frame_windows.
15294
15295 * xdisp.c (init_xdisp): Don't use set_window_height but set
15296 heights directly.
15297
15298 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15299 Use resize_frame_windows instead of change_window_heights and run
15300 run_window_configuration_change_hook.
15301
15302 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15303 instead of change_window_heights and run
15304 run_window_configuration_change_hook.
15305
15306 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15307
15308 * window.c (replace_window): Rename second argument REPLACEMENT to
15309 NEW. New third argument SETFLAG. Rewrite.
15310 (delete_window, make_dummy_parent): Call replace_window with
15311 third argument 1.
15312 (window_list_1): Move down in code.
15313 (run_window_configuration_change_hook): Move set_buffer part
15314 before select_frame_norecord part in order to unwind correctly.
15315 Rename count1 to count.
15316 (recombine_windows, delete_deletable_window, resize_root_window)
15317 (Fdelete_other_windows_internal)
15318 (Frun_window_configuration_change_hook, make_parent_window)
15319 (resize_window_check, resize_window_apply, Fresize_window_apply)
15320 (resize_frame_windows, Fsplit_window_internal)
15321 (Fdelete_window_internal, Fresize_mini_window_internal):
15322 New functions.
15323 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15324
15325 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15326
15327 * window.h (window): Add some new members to window structure -
15328 normal_lines, normal_cols, new_total, new_normal, clone_number,
15329 splits, nest, prev_buffers, next_buffers.
15330 (WINDOW_TOTAL_SIZE): Move here from window.c.
15331 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15332
15333 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15334 Remove.
15335 (make_dummy_parent): Set new members of windows structure.
15336 (make_window): Move down in code. Handle new members of window
15337 structure.
15338 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15339 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15340 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15341 (Fset_window_prev_buffers, Fwindow_next_buffers)
15342 (Fset_window_next_buffers, Fset_window_clone_number):
15343 New functions.
15344 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15345 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15346 Doc-string fixes.
15347 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15348 Argument WINDOW can be now internal window too.
15349 (Fwindow_use_time): Move up in code.
15350 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15351 Rewrite doc-string.
15352 (Fset_window_configuration, saved_window)
15353 (Fcurrent_window_configuration, save_window_save): Handle new
15354 members of window structure.
15355 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15356 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15357 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15358 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15359 Qget_mru_window, Qresize_root_window,
15360 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15361 Qauto_buffer_name; staticpro them.
15362
15363 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15364
15365 * window.c (Fwindow_total_size, Fwindow_left_column)
15366 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15367 (Fwindow_list_1): New functions.
15368 (window_box_text_cols): Replace with window_body_cols.
15369 (Fwindow_width, Fscroll_left, Fscroll_right):
15370 Use window_body_cols instead of window_box_text_cols.
15371 (delete_window, Fset_window_configuration):
15372 Call delete_all_subwindows with window as argument.
15373 (delete_all_subwindows): Take a window as argument and not a
15374 structure. Rewrite.
15375 (window_loop): Remove handling of GET_LRU_WINDOW and
15376 GET_LARGEST_WINDOW.
15377 (Fget_lru_window, Fget_largest_window): Move to window.el.
15378
15379 * window.h: Extern window_body_cols instead of
15380 window_box_text_cols. delete_all_subwindows now takes a
15381 Lisp_Object as argument.
15382
15383 * indent.c (compute_motion, Fcompute_motion):
15384 Use window_body_cols instead of window_box_text_cols.
15385
15386 * frame.c (delete_frame): Call delete_all_subwindows with root
15387 window as argument.
15388
15389 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15390
15391 * fns.c (Fputhash): Document return value.
15392
15393 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15394
15395 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15396
15397 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15398
15399 Cons<->int and similar integer overflow fixes (Bug#8794).
15400
15401 Check for overflow when converting integer to cons and back.
15402 * charset.c (Fdefine_charset_internal, Fdecode_char):
15403 Use cons_to_unsigned to catch overflow.
15404 (Fencode_char): Use INTEGER_TO_CONS.
15405 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15406 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15407 * data.c (long_to_cons, cons_to_long): Remove.
15408 (cons_to_unsigned, cons_to_signed): New functions.
15409 These signal an error for invalid or out-of-range values.
15410 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15411 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15412 * font.c (Ffont_variation_glyphs):
15413 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15414 * lisp.h: Include <intprops.h>.
15415 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15416 (cons_to_signed, cons_to_unsigned): New decls.
15417 (long_to_cons, cons_to_long): Remove decls.
15418 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15419 (Fprimitive_undo): Use CONS_TO_INTEGER.
15420 * xfns.c (Fx_window_property): Likewise.
15421 * xselect.c: Include <limits.h>.
15422 (x_own_selection, selection_data_to_lisp_data):
15423 Use INTEGER_TO_CONS.
15424 (x_handle_selection_request, x_handle_selection_clear)
15425 (x_get_foreign_selection, Fx_disown_selection_internal)
15426 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15427 (lisp_data_to_selection_data): Use cons_to_unsigned.
15428 (x_fill_property_data): Use cons_to_signed.
15429 Report values out of range.
15430
15431 Check for buffer and string overflow more precisely.
15432 * buffer.h (BUF_BYTES_MAX): New macro.
15433 * lisp.h (STRING_BYTES_MAX): New macro.
15434 * alloc.c (Fmake_string):
15435 * character.c (string_escape_byte8):
15436 * coding.c (coding_alloc_by_realloc):
15437 * doprnt.c (doprnt):
15438 * editfns.c (Fformat):
15439 * eval.c (verror):
15440 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15441 since they may not be the same number.
15442 * editfns.c (Finsert_char):
15443 * fileio.c (Finsert_file_contents):
15444 Likewise for BUF_BYTES_MAX.
15445
15446 * image.c: Use ptrdiff_t, not int, for sizes.
15447 (slurp_file): Switch from int to ptrdiff_t.
15448 All uses changed.
15449 (slurp_file): Check that file size fits in both size_t (for
15450 malloc) and ptrdiff_t (for sanity and safety).
15451
15452 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15453 if b->modtime has its maximal value.
15454
15455 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15456
15457 Don't assume time_t can fit into int.
15458 * buffer.h (struct buffer.modtime): Now time_t, not int.
15459 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15460 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15461
15462 Minor fixes for signed vs unsigned integers.
15463 * character.h (MAYBE_UNIFY_CHAR):
15464 * charset.c (maybe_unify_char):
15465 * keyboard.c (read_char, reorder_modifiers):
15466 XINT -> XFASTINT, since the integer must be nonnegative.
15467 * ftfont.c (ftfont_spec_pattern):
15468 * keymap.c (access_keymap, silly_event_symbol_error):
15469 XUINT -> XFASTINT, since the integer must be nonnegative.
15470 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15471 since it makes no difference and we prefer signed.
15472 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15473 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15474 nonnegative.
15475
15476 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15477
15478 * window.h (Fwindow_frame): Declare.
15479
15480 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15481
15482 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15483 (SPARE_MEMORY): Always define.
15484 (LARGE_REQUEST): Remove.
15485 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15486
15487 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15488
15489 * lisp.h: Move EXFUNS for Fframe_root_window,
15490 Fframe_first_window and Fset_frame_selected_window to window.h.
15491
15492 * window.h: Move EXFUNS for Fframe_root_window,
15493 Fframe_first_window and Fset_frame_selected_window here from
15494 lisp.h.
15495
15496 * frame.c (Fwindow_frame, Fframe_first_window)
15497 (Fframe_root_window, Fframe_selected_window)
15498 (Fset_frame_selected_window): Move to window.c.
15499 (Factive_minibuffer_window): Move to minibuf.c.
15500 (Fother_visible_frames_p): New function.
15501
15502 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15503
15504 * window.c (decode_window, decode_any_window): Move up in code.
15505 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15506 (inhibit_frame_unsplittable): Remove unused variable.
15507 (Fwindow_buffer): Move up and rewrite doc-string.
15508 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15509 (Fwindow_prev): New functions.
15510 (Fwindow_frame): Move here from frame.c. Accept any window as
15511 argument.
15512 (Fframe_root_window, Fframe_first_window)
15513 (Fframe_selected_window): Move here from frame.c. Accept frame
15514 or arbitrary window as argument. Update doc-strings.
15515 (Fminibuffer_window): Move up in code.
15516 (Fwindow_minibuffer_p): Move up in code and simplify.
15517 (Fset_frame_selected_window): Move here from frame.c.
15518 Marginal rewrite.
15519 (Fselected_window, select_window, Fselect_window): Move up in
15520 code. Minor doc-string fixes.
15521
15522 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15523
15524 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15525 Do not assume that spare memory exists; that assumption is valid
15526 only if SYSTEM_MALLOC.
15527 (LARGE_REQUEST): New macro, so that the issue of large requests
15528 is separated from the issue of spare memory.
15529
15530 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15531
15532 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15533 format. (Bug#8806)
15534
15535 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15536
15537 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15538 before statements.
15539
15540 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15541
15542 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15543
15544 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15545
15546 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15547 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15548
15549 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15550
15551 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15552
15553 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15554
15555 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15556 (x_clipboard_manager_save): Add return value.
15557 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15558 New error handlers.
15559 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15560 Obey Vx_select_enable_clipboard_manager. Catch errors in
15561 x_clipboard_manager_save (Bug#8779).
15562 (Vx_select_enable_clipboard_manager): New variable.
15563 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15564
15565 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15566
15567 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15568
15569 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15570
15571 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15572 in the current matrix if keep_current_p is non-zero.
15573
15574 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15575
15576 * bidi.c (bidi_level_of_next_char): Fix last change.
15577
15578 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15579
15580 Support bidi reordering of text covered by display properties.
15581
15582 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15583 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15584 (bidi_cache_search, bidi_cache_iterator_state)
15585 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15586 (bidi_level_of_next_char, bidi_move_to_visually_next):
15587 Support character positions inside a run of characters covered by a
15588 display string.
15589 (bidi_paragraph_init, bidi_resolve_explicit_1)
15590 (bidi_level_of_next_char): Call bidi_fetch_char and
15591 bidi_fetch_char_advance instead of FETCH_CHAR and
15592 FETCH_CHAR_ADVANCE.
15593 (bidi_init_it): Initialize new members.
15594 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15595 definitions.
15596 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15597 instead of using explicit *_CHAR codes.
15598 (bidi_resolve_explicit, bidi_resolve_weak):
15599 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15600 bidirectional text is supported only in multibyte buffers.
15601 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15602 it to initialize the frame_window_p member of struct bidi_it.
15603 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15604 (bidi_resolve_explicit, bidi_resolve_weak)
15605 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15606 bidi_it->nchars is non-positive.
15607 (bidi_level_of_next_char): Don't try to lookup the cache for the
15608 next/previous character if nothing is cached there yet, or if we
15609 were just reseat()'ed to a new position.
15610
15611 * xdisp.c (set_cursor_from_row): Set start and stop points
15612 according to the row's direction when priming the loop that looks
15613 for the glyph on which to display cursor.
15614 (single_display_spec_intangible_p): Function deleted.
15615 (display_prop_intangible_p): Reimplement to call
15616 handle_display_spec instead of single_display_spec_intangible_p.
15617 Accept 3 additional arguments needed by handle_display_spec.
15618 This fixes incorrect cursor motion across display property with complex
15619 values: lists, `(when COND...)' forms, etc.
15620 (single_display_spec_string_p): Support property values that are
15621 lists with the argument STRING its top-level element.
15622 (display_prop_string_p): Fix the condition for processing a
15623 property that is a list to be consistent with handle_display_spec.
15624 (handle_display_spec): New function, refactored from the
15625 last portion of handle_display_prop.
15626 (compute_display_string_pos): Accept additional argument
15627 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15628 value of a `display' property is a "replacing spec".
15629 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15630 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15631 the display property, but just return a value indicating whether
15632 the display property will replace the characters it covers.
15633 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15634 frame_window_p members of struct bidi_it.
15635 (compute_display_string_pos, compute_display_string_end):
15636 New functions.
15637 (push_it): Accept second argument POSITION, where pop_it should
15638 jump to continue iteration.
15639 (reseat_1): Initialize bidi_it.disp_pos.
15640
15641 * keyboard.c (adjust_point_for_property): Adjust the call to
15642 display_prop_intangible_p to its new signature.
15643
15644 * dispextern.h (struct bidi_it): New member frame_window_p.
15645 (bidi_init_it): Update prototypes.
15646 (display_prop_intangible_p): Update prototype.
15647 (compute_display_string_pos, compute_display_string_end):
15648 Declare prototypes.
15649 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15650 EMACS_INT.
15651
15652 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15653
15654 Malloc failure behavior now depends on size of allocation.
15655 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15656 * lisp.h: Change signatures accordingly.
15657 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15658 All callers changed. (Bug#8762)
15659
15660 * gnutls.c: Use Emacs's memory allocators.
15661 Without this change, the gnutls library would invoke malloc etc.
15662 directly, which causes problems on non-SYNC_INPUT hosts, and which
15663 runs afoul of improving memory_full behavior. (Bug#8761)
15664 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15665 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15666 xfree instead of the default malloc, realloc, free.
15667 (Fgnutls_boot): No need to check for memory allocation failure,
15668 since xmalloc does that for us.
15669
15670 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15671 * category.c (hash_get_category_set):
15672 * ccl.c (ccl_driver):
15673 * charset.c (Fdefine_charset_internal):
15674 * charset.h (struct charset.hash_index):
15675 * composite.c (get_composition_id, gstring_lookup_cache)
15676 (composition_gstring_put_cache):
15677 * composite.h (struct composition.hash_index):
15678 * dispextern.h (struct image.hash):
15679 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15680 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15681 (hashfn_equal, hashfn_user_defined, make_hash_table)
15682 (maybe_resize_hash_table, hash_lookup, hash_put)
15683 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15684 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15685 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15686 * image.c (make_image, search_image_cache, lookup_image)
15687 (xpm_put_color_table_h):
15688 * lisp.h (struct Lisp_Hash_Table):
15689 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15690 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15691 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15692 * alloc.c (allocate_vectorlike):
15693 Check for overflow in vector size calculations.
15694 * ccl.c (ccl_driver):
15695 Check for overflow when converting EMACS_INT to int.
15696 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15697 need to be updated by these changes.
15698 * fns.c (make_hash_table, maybe_resize_hash_table):
15699 Check for integer overflow with large hash tables.
15700 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15701 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15702 (SXHASH_REDUCE): New macro.
15703 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15704 Use it instead of discarding useful hash info with large hash values.
15705 (sxhash_float): New function.
15706 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15707 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15708 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15709 Rewrite to use FIXNUM_BITS, as this simplifies things.
15710 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15711 Adjust signatures to match updated version of code.
15712 (consing_since_gc): Now EMACS_INT, since a single hash table can
15713 use more than INT_MAX bytes.
15714
15715 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15716
15717 Make it possible to build with GCC-4.6+ -O2 -flto.
15718
15719 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15720
15721 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15722
15723 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15724 Call minibuffer-inactive-mode.
15725
15726 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15727
15728 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15729 Update dependencies.
15730
15731 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15732
15733 * data.c (init_data): Remove code for UTS, this system is not
15734 supported anymore.
15735
15736 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15737
15738 Don't force ./temacs to start in terminal mode.
15739
15740 * frame.c (make_initial_frame): Initialize faces in all cases, not
15741 only when CANNOT_DUMP is defined.
15742 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15743
15744 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15745
15746 * dispnew.c (add_window_display_history): Use const for the string
15747 pointer. Remove declaration, not needed.
15748
15749 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15750
15751 Use 'inline', not 'INLINE'.
15752 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15753 * alloc.c, fontset.c (INLINE): Remove.
15754 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15755 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15756 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15757 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15758 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15759
15760 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15761
15762 Make it possible to run ./temacs.
15763
15764 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15765 syms_of_callproc does the same thing. Remove test for
15766 "initialized", do it in the caller.
15767 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15768
15769 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15770
15771 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15772 (read_minibuf): Use get_minibuffer.
15773 (syms_of_minibuf): Use DEFSYM.
15774 (Qmetadata): New var.
15775 * data.c (Qbuffer): Don't make it static.
15776 (syms_of_data): Use DEFSYM.
15777
15778 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15779
15780 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15781 (CCL_CODE_MIN): New macro.
15782
15783 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15784
15785 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15786
15787 * eval.c (Qdebug): Now static.
15788 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15789 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15790 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15791
15792 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15793
15794 * image.c: Various fixes to ImageMagick code comments.
15795 (Fimagemagick_types): Doc fix.
15796
15797 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15798
15799 Minor fixes prompted by GCC 4.6.0 warnings.
15800
15801 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15802
15803 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15804 (x_clipboard_manager_save_all): Move extern decl to ...
15805 * xterm.h: ... here, so that it can be checked for consistency.
15806
15807 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15808
15809 * xselect.c (x_clipboard_manager_save_frame)
15810 (x_clipboard_manager_save_all): New functions.
15811 (Fx_clipboard_manager_save): Lisp function deleted.
15812
15813 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15814 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15815
15816 * xterm.h: Update prototype.
15817
15818 2011-05-28 William Xu <william.xwl@gmail.com>
15819
15820 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15821 exiting (Bug#8239).
15822
15823 2011-05-28 Jim Meyering <meyering@redhat.com>
15824
15825 Avoid a sign-extension bug in crypto_hash_function.
15826 * fns.c (to_uchar): Define.
15827 (crypto_hash_function): Use it to convert some newly-signed
15828 variables to unsigned, to avoid sign-extension bugs. For example,
15829 without this change, (md5 "truc") would evaluate to
15830 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15831 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15832 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15833
15834 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15835
15836 Integer overflow fixes.
15837
15838 * dbusbind.c: Serial number integer overflow fixes.
15839 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15840 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15841 to hold a serial number that is too large for a fixnum.
15842 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15843 Check for serial numbers out of range. Decode any serial number
15844 that was so large that it became a float. (Bug#8722)
15845
15846 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15847 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15848 Use XFASTINT rather than XUINT when numbers are nonnegative.
15849 (xd_append_arg, Fdbus_method_return_internal):
15850 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15851 arguments, check that Lisp number is nonnegative, rather than
15852 silently wrapping negative numbers around. (Bug#8722)
15853 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15854 (Bug#8722)
15855
15856 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15857
15858 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15859
15860 ccl: Add integer overflow checks.
15861 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15862 (IN_INT_RANGE): New macros.
15863 (ccl_driver): Use them to check for integer overflow when
15864 decoding a CCL program. Many of the new checks are whether XINT (x)
15865 fits in int; it doesn't always, on 64-bit hosts. The new version
15866 doesn't catch all possible integer overflows, but it's an
15867 improvement. (Bug#8719)
15868
15869 * alloc.c (make_event_array): Use XINT, not XUINT.
15870 There's no need for unsigned here.
15871
15872 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15873 This follows up to the 2011-05-06 change that substituted uintptr_t
15874 for EMACS_INT. This case wasn't caught back then.
15875
15876 Rework Fformat to avoid integer overflow issues.
15877 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15878 now (part of C89). Include <verify.h>.
15879 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15880 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15881 (Fformat): Avoid the prepass trying to compute sizes; it was only
15882 approximate and thus did not catch overflow reliably. Instead, walk
15883 through the format just once, formatting and computing sizes as we go,
15884 checking for integer overflow at every step, and allocating a larger
15885 buffer as needed. Keep track separately whether the format is
15886 multibyte. Keep only the most-recently calculated precision, rather
15887 than them all. Record whether each argument has been converted to
15888 string. Use EMACS_INT, not int, for byte and char and arg counts.
15889 Support field widths and precisions larger than INT_MAX. Avoid
15890 sprintf's undefined behavior with conversion specifications such as %#d
15891 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15892 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15893 formatting out-of-range floating point numbers with int
15894 formats. (Bug#8668)
15895
15896 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15897
15898 * data.c: Avoid integer truncation in expressions involving floats.
15899 * data.c: Include <intprops.h>.
15900 (arith_driver): When there's an integer overflow in an expression
15901 involving floating point, convert the integers to floating point
15902 so that the resulting value does not suffer from catastrophic
15903 integer truncation. For example, on a 64-bit host (* 4
15904 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15905 Do not rely on undefined behavior after integer overflow.
15906
15907 merge count_size_as_multibyte, parse_str_to_multibyte
15908 * character.c, character.h (count_size_as_multibyte):
15909 Rename from parse_str_to_multibyte; all uses changed.
15910 Check for integer overflow.
15911 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15912 since it's now a duplicate of the other. This is more of
15913 a character than a buffer op, so better that it's in character.c.
15914 * fns.c, print.c: Adjust to above changes.
15915
15916 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15917
15918 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15919
15920 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15921
15922 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15923 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15924 (x_clipboard_manager_save): Now static.
15925 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15926
15927 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15928 (crypto_hash_function): Now static.
15929 Fix pointer signedness problems. Avoid unnecessary initializations.
15930
15931 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15932
15933 * termhooks.h (Vselection_alist): Make it terminal-local.
15934
15935 * terminal.c (create_terminal): Initialize it.
15936
15937 * xselect.c: Support for clipboard managers.
15938 (Vselection_alist): Move to termhooks.h as terminal-local var.
15939 (LOCAL_SELECTION): New macro.
15940 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15941 (symbol_to_x_atom): Remove gratuitous arg.
15942 (x_handle_selection_request, lisp_data_to_selection_data)
15943 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15944 (x_own_selection, x_get_local_selection, x_convert_selection):
15945 New arg, specifying work frame. Use terminal-local Vselection_alist.
15946 (some_frame_on_display): Delete unused function.
15947 (Fx_own_selection_internal, Fx_get_selection_internal)
15948 (Fx_disown_selection_internal, Fx_selection_owner_p)
15949 (Fx_selection_exists_p): New optional frame arg.
15950 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15951 (x_handle_selection_clear): Don't treat other terminals with the
15952 same keyboard specially. Use the terminal-local Vselection_alist.
15953 (x_clear_frame_selections): Use Frun_hook_with_args.
15954
15955 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15956
15957 * xterm.h: Add support for those atoms.
15958
15959 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15960
15961 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15962 (converted_selections, conversion_fail_tag): New global variables.
15963 (x_selection_request_lisp_error): Free the above.
15964 (x_get_local_selection): Remove unnecessary code.
15965 (x_reply_selection_request): Args changed; handle arbitrary array
15966 of converted selections stored in converted_selections.
15967 Separate the XChangeProperty and SelectionNotify steps.
15968 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15969 (x_convert_selection): New function.
15970 (x_handle_selection_event): Simplify.
15971 (x_get_foreign_selection): Don't ignore incoming requests while
15972 waiting for an answer; this will fail when we implement
15973 SAVE_TARGETS, and seems unnecessary anyway.
15974 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15975 (Vx_sent_selection_functions): Doc fix.
15976
15977 2011-05-26 Leo Liu <sdl.web@gmail.com>
15978
15979 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15980
15981 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15982
15983 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15984
15985 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15986 for fringe update if it has periodic bitmap.
15987 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15988 and fringe_bitmap_periodic_p.
15989
15990 * fringe.c (get_fringe_bitmap_data): New function.
15991 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15992 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15993 row. Mark glyph row for fringe update if periodicity changed.
15994
15995 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15996 for fringe update unless it has periodic bitmap.
15997
15998 2011-05-25 Kenichi Handa <handa@m17n.org>
15999
16000 * xdisp.c (get_next_display_element): Set correct it->face_id for
16001 a static composition.
16002
16003 2011-05-24 Leo Liu <sdl.web@gmail.com>
16004
16005 * deps.mk (fns.o):
16006 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16007
16008 * fns.c (crypto_hash_function, Fsha1): New function.
16009 (Fmd5): Use crypto_hash_function.
16010 (syms_of_fns): Add Ssha1.
16011
16012 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16013
16014 * gnutls.c: Remove unused macros.
16015 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16016 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16017 Remove macros that are defined and never used.
16018 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16019
16020 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16021
16022 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16023 (Fx_get_selection_internal): Minor cleanup.
16024 (Fx_own_selection_internal): Rename arguments for consistency with
16025 select.el.
16026
16027 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16028
16029 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16030
16031 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
16032
16033 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16034
16035 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16036
16037 * dispnew.c (scrolling_window): Don't exclude the case that the
16038 last enabled row in the desired matrix touches the bottom boundary.
16039
16040 2011-05-21 Glenn Morris <rgm@gnu.org>
16041
16042 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
16043 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16044 and add some more files.
16045
16046 2011-05-20 Eli Zaretskii <eliz@gnu.org>
16047
16048 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16049 report_file_error introduced by the change from 2011-05-07.
16050
16051 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16052
16053 * systime.h (Time): Define only if emacs is defined.
16054 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16055 where the include path doesn't have X11/X.h by default. See
16056 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16057
16058 2011-05-20 Kenichi Handa <handa@m17n.org>
16059
16060 * composite.c (find_automatic_composition): Fix previous change.
16061
16062 2011-05-20 Glenn Morris <rgm@gnu.org>
16063
16064 * lisp.mk: New file, split from Makefile.in.
16065 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16066 (shortlisp): Remove.
16067 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16068
16069 2011-05-19 Glenn Morris <rgm@gnu.org>
16070
16071 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16072 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16073 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16074 (lisp): Set the order to that of loadup.el.
16075 (shortlisp): Make it a copy of $lisp.
16076 (SOME_MACHINE_LISP): Remove.
16077 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16078 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16079
16080 2011-05-18 Kenichi Handa <handa@m17n.org>
16081
16082 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16083 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16084 (find_automatic_composition): Mostly rewrite for efficiency.
16085
16086 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16087
16088 * makefile.w32-in: Update dependencies.
16089
16090 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16091
16092 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16093 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16094
16095 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16096
16097 Fix some integer overflow issues, such as string length overflow.
16098
16099 * insdel.c (count_size_as_multibyte): Check for string overflow.
16100
16101 * character.c (lisp_string_width): Check for string overflow.
16102 Use EMACS_INT, not int, for string indexes and lengths; in
16103 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16104 the resulting string length overflows an EMACS_INT; instead,
16105 report a string overflow if no precision given. When checking for
16106 precision exhaustion, use a check that cannot possibly have
16107 integer overflow. (Bug#8675)
16108 * character.h (lisp_string_width): Adjust to new signature.
16109
16110 * alloc.c (string_overflow): New function.
16111 (Fmake_string): Use it. This doesn't change behavior, but saves
16112 a few bytes and will simplify future changes.
16113 * character.c (string_escape_byte8): Likewise.
16114 * lisp.h (string_overflow): New decl.
16115
16116 Fixups, following up to the user-interface timestamp change.
16117 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16118 for UI timestamps, instead of unsigned long.
16119 * msdos.c (mouse_get_pos): Likewise.
16120 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16121 * w32gui.h (Time): Define by including "systime.h" rather than by
16122 declaring it ourselves. (Bug#8664)
16123
16124 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16125 * image.c (clear_image_cache): Likewise.
16126
16127 * term.c (term_mouse_position): Don't assume time_t wraparound.
16128
16129 Be more systematic about user-interface timestamps.
16130 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16131 and sometimes 'EMACS_UINT', to represent these timestamps.
16132 This change causes it to use 'Time' uniformly, as that's what X uses.
16133 This makes the code easier to follow, and makes it easier to catch
16134 integer overflow bugs such as Bug#8664.
16135 * frame.c (Fmouse_position, Fmouse_pixel_position):
16136 Use Time, not unsigned long, for user-interface timestamps.
16137 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16138 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16139 * keyboard.h (last_event_timestamp): Likewise.
16140 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16141 * menu.h (xmenu_show): Likewise.
16142 * term.c (term_mouse_position): Likewise.
16143 * termhooks.h (struct input_event.timestamp): Likewise.
16144 (struct terminal.mouse_position_hook): Likewise.
16145 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16146 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16147 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16148 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16149 what it was before.
16150 * menu.h, termhooks.h: Include "systime.h", for Time.
16151
16152 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16153 Don't assume that the difference between two unsigned long values
16154 can fit into an integer. At this point, we know button_down_time
16155 <= event->timestamp, so the difference must be nonnegative, so
16156 there's no need to cast the result if double-click-time is
16157 nonnegative, as it should be; check that it's nonnegative, just in
16158 case. This bug is triggered when events are more than 2**31 ms
16159 apart (about 25 days). (Bug#8664)
16160
16161 * xselect.c (last_event_timestamp): Remove duplicate decl.
16162 (x_own_selection): Remove needless cast to unsigned long.
16163
16164 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16165 that always fit in int. Use a sentinel instead of a counter, to
16166 avoid a temp and to allay GCC's concerns about possible int overflow.
16167 * frame.h (struct frame): Use int for menu_bar_items_used
16168 instead of EMACS_INT, since it always fits in int.
16169
16170 * menu.c (grow_menu_items): Check for int overflow.
16171
16172 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16173
16174 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16175 Before, the code was not consistent. These values cannot exceed
16176 2**31 - 1 so there's no need to make them unsigned.
16177 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16178 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16179 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16180 as modifiers.
16181 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16182
16183 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16184 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16185 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16186 presumably because the widths might not match.
16187
16188 * window.c (size_window): Avoid needless test at loop start.
16189
16190 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16191
16192 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16193
16194 2011-05-12 Drew Adams <drew.adams@oracle.com>
16195
16196 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16197
16198 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16199
16200 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16201 `width' to `bar_area_x' and `bar_area_width', respectively.
16202 (x_scroll_run): Take account of fringe background extension.
16203
16204 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16205 Rename local vars `left' and `width' to `bar_area_x' and
16206 `bar_area_width', respectively.
16207 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16208 background extension.
16209
16210 2011-05-10 Jim Meyering <meyering@redhat.com>
16211
16212 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16213
16214 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16215
16216 * image.c (Finit_image_library): Return t for built-in image types,
16217 like pbm and xbm. (Bug#8640)
16218
16219 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16220
16221 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16222
16223 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16224
16225 * w32console.c (Fset_screen_color): Doc fix.
16226 (Fget_screen_color): New function.
16227 (syms_of_ntterm): Defsubr it.
16228
16229 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16230 unlink the temporary file if Fcall_process didn't create it in the
16231 first place.
16232 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16233 child process will be redirected to a file specified with `:file'.
16234 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16235 cue to call_process_cleanup not to close that handle.
16236
16237 2011-05-07 Ben Key <bkey76@gmail.com>
16238
16239 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16240 one of two shell specific rules, either bootstrap-temacs-CMD or
16241 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16242 to the previous implementation of the bootstrap-temacs rule.
16243 The bootstrap-temacs-CMD rule is similar to the previous
16244 implementation of the bootstrap-temacs rule except that it
16245 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16246 variable.
16247
16248 These changes, along with some changes to nt/configure.bat,
16249 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16250 earlier fix to add support for --cflags and --ldflags options
16251 that include quotes so that it works whether make uses cmd or
16252 sh as the shell.
16253
16254 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16255
16256 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16257 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16258 is a constant.
16259 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16260 a string. Handle both cases.
16261 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16262 (Fdbus_register_method): Use Qinvalid_function.
16263
16264 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16265
16266 * makefile.w32-in: Update dependencies.
16267 (LISP_H): Add inttypes.h and stdin.h.
16268 (PROCESS_H): Add unistd.h.
16269
16270 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16271
16272 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16273 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16274
16275 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16276
16277 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16278
16279 * term.c (vfatal): Remove stray call to va_end.
16280 It's not needed and the C Standard doesn't allow it here anyway.
16281
16282 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16283 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16284
16285 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16286 bytes.
16287
16288 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16289
16290 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16291
16292 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16293
16294 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16295
16296 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16297
16298 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16299 * charset.c (Fdefine_charset_internal): Don't initialize
16300 charset.code_space[15]. The value was garbage, on hosts with
16301 32-bit int (Bug#8600).
16302
16303 * lread.c (read_integer): Be more consistent with string-to-number.
16304 Use string_to_number to do the actual conversion; this avoids
16305 rounding errors and fixes some other screwups. Without this fix,
16306 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16307 (digit_to_number): Move earlier, for benefit of read_integer.
16308 Return -1 if the digit is out of range for the base, -2 if it is
16309 not a digit in any supported base. (Bug#8602)
16310
16311 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16312
16313 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16314 to match comment at start of function. This also removes a
16315 GCC warning about overflow in a 32+64-bit port.
16316
16317 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16318
16319 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16320 Reported by Stefan Monnier in
16321 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16322 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16323 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16324
16325 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16326 (EMACS_UINTPTR): Likewise, with uintptr_t.
16327
16328 * lisp.h: Prefer 64-bit EMACS_INT if available.
16329 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16330 on 32-bit hosts that have 64-bit int, so that they can access
16331 large files.
16332 However, temporarily disable this change unless the temporary
16333 symbol WIDE_EMACS_INT is defined.
16334
16335 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16336
16337 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16338 This removes an assumption that EMACS_INT and long are the same
16339 width as pointers. The assumption is true for Emacs porting targets
16340 now, but we want to make other targets possible.
16341 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16342 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16343 In the rest of the code, change types of integers that hold casted
16344 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16345 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16346 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16347 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16348 No need to cast type when ORing.
16349 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16350 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16351 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16352 assume EMACS_INT is the same width as char *.
16353 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16354 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16355 Remove no-longer-needed casts.
16356 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16357 (xg_tool_bar_help_callback, xg_make_tool_item):
16358 Use EMACS_INTPTR to hold an integer
16359 that will be cast to void *; this can avoid a GCC warning
16360 if EMACS_INT is not the same width as void *.
16361 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16362 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16363 (current_message_1, set_message_1):
16364 Use a local to convert to proper width without a cast.
16365 * xmenu.c (dialog_selection_callback): Likewise.
16366
16367 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16368 Also, don't assume VALBITS / RAND_BITS is less than 5,
16369 and don't rely on undefined behavior when shifting a 1 left into
16370 the sign bit.
16371 * lisp.h (get_random): Change signature to match.
16372
16373 * lread.c (hash_string): Use size_t, not int, for hash computation.
16374 Normally we prefer signed values; but hashing is special, because
16375 it's better to use unsigned division on hash table sizes so that
16376 the remainder is nonnegative. Also, size_t is the natural width
16377 for hashing into memory. The previous code used 'int', which doesn't
16378 retain enough info to hash well into very large tables.
16379 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16380
16381 * dbusbind.c: Don't possibly lose pointer info when converting.
16382 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16383 Use XPNTR rather than XHASH, so that the high-order bits of
16384 the pointer aren't lost when converting through void *.
16385
16386 * eval.c (Fautoload): Don't double-shift a pointer.
16387
16388 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16389
16390 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16391
16392 * gnutls.c (DEF_GNUTLS_FN):
16393 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16394
16395 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16396
16397 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16398 marker. (Bug#8610)
16399
16400 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16401
16402 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16403 New version that can reserve upto 2GB of heap space.
16404
16405 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16406
16407 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16408
16409 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16410
16411 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16412 `gnutls_certificate_set_x509_key_file'.
16413
16414 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16415
16416 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16417 Update dependencies.
16418
16419 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16420
16421 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16422 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16423 Remove unused parameter `fildes'.
16424 * process.c (read_process_output, send_process): Don't pass it.
16425
16426 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16427
16428 Fix previous change: the library cache is defined in w32.c.
16429 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16430 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16431
16432 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16433
16434 Implement dynamic loading of GnuTLS on Windows.
16435
16436 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16437 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16438 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16439 Declare.
16440
16441 * gnutls.c (Qgnutls_dll): Define.
16442 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16443 (gnutls_*): Declare function pointers.
16444 (init_gnutls_functions): New function to initialize function pointers.
16445 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16446 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16447 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16448 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16449 (emacs_gnutls_write, emacs_gnutls_read)
16450 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16451 (Fgnutls_available_p): New function.
16452 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16453 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16454 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16455
16456 * image.c: Include w32.h.
16457 (Vimage_type_cache): Delete.
16458 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16459 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16460 (w32_delayed_load): Move to w32.c.
16461
16462 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16463
16464 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16465 (w32_delayed_load): Move from image.c. When loading a library, record
16466 its filename in the :loaded-from property of the library id.
16467 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16468 Initialize and staticpro them.
16469 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16470
16471 * process.c: Include lisp.h before w32.h, not after.
16472 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16473 instead of gnutls_record_check_pending.
16474
16475 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16476
16477 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16478
16479 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16480 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16481 as passed in.
16482
16483 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16484
16485 * xterm.c (x_set_frame_alpha): Do not set property on anything
16486 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16487
16488 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16489
16490 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16491
16492 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16493
16494 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16495 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16496 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16497 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16498 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16499 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16500 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16501 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16502 (Qgnutls_bootprop_callbacks_verify): Make static.
16503
16504 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16505
16506 * callproc.c: Indentation fixup.
16507
16508 * sysdep.c (wait_for_termination_1): Make static.
16509 (wait_for_termination, interruptible_wait_for_termination):
16510 Move after wait_for_termination_1.
16511
16512 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16513
16514 * sysdep.c (interruptible_wait_for_termination): New function
16515 which is like wait_for_termination, but allows keyboard
16516 interruptions.
16517
16518 * callproc.c (Fcall_process): Add (:file "file") as an option for
16519 the STDOUT buffer.
16520 (Fcall_process_region): Ditto.
16521
16522 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16523
16524 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16525 rather than `XVECTOR (FOO)->size'.
16526
16527 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16528 inttypes.h, as a gnulib replacement is used if it not available in
16529 system headers.
16530
16531 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16532
16533 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16534 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16535 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16536
16537 * coding.c (coding_alloc_by_realloc): Error out if destination
16538 will grow beyond MOST_POSITIVE_FIXNUM.
16539 (decode_coding_emacs_mule): Abort if there isn't enough place in
16540 charbuf for the composition carryover bytes. Reserve an extra
16541 space for up to 2 characters produced in a loop.
16542 (decode_coding_iso_2022): Abort if there isn't enough place in
16543 charbuf for the composition carryover bytes.
16544
16545 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16546
16547 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16548 aborting when %lld or %lll format is passed.
16549 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16550 %llo or %llx format is passed. (Bug#8545)
16551
16552 * window.c (window_scroll_line_based): Use a marker instead of
16553 simple variables to record original value of point. (Bug#7952)
16554
16555 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16556 produced by %s or %c overflows available buffer space. (Bug#8545)
16557
16558 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16559
16560 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16561 (SIZE_MAX): Move defn after all includes, as they might #define it.
16562
16563 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16564
16565 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16566
16567 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16568
16569 * keyboard.c (Qdelayed_warnings_hook): Define.
16570 (command_loop_1): Run `delayed-warnings-hook'
16571 if Vdelayed_warnings_list is non-nil.
16572 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16573 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16574
16575 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16576
16577 * doprnt.c (doprnt): Don't return value smaller than the buffer
16578 size if the message was truncated. (Bug#8545).
16579
16580 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16581
16582 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16583 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16584
16585 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16586
16587 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16588
16589 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16590
16591 * makefile.w32-in: Update dependencies.
16592
16593 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16594
16595 Improve `doprnt' and its usage. (Bug#8545)
16596 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16597 `format_end'. Remove support for %l as a conversion specifier.
16598 Don't use xrealloc. Improve diagnostics when the %l size modifier
16599 is used. Update the commentary.
16600
16601 * eval.c (verror): Simplify calculation of size_t.
16602
16603 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16604 messages.
16605
16606 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16607
16608 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16609 change.
16610
16611 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16612
16613 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16614 This makes this file independent of the recent pseudovector change.
16615
16616 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16617
16618 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16619
16620 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16621 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16622 Remove unused local.
16623 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16624
16625 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16626 GCC 4.6.0 optimizes based on type-based alias analysis.
16627 For example, if b is of type struct buffer * and v of type struct
16628 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16629 != &v->size, and therefore "v->size = 1; b->size = 2; return
16630 v->size;" must therefore return 1. This assumption is incorrect
16631 for Emacs, since it type-puns struct Lisp_Vector * with many other
16632 types. To fix this problem, this patch adds a new type struct
16633 vectorlike_header that documents the constraints on layout of vectors
16634 and pseudovectors, and helps optimizing compilers not get fooled
16635 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16636 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16637 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16638 the size member.
16639 (XSETPVECTYPE): Rewrite in terms of new macro.
16640 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16641 This is a bit clearer, and further avoids the possibility of
16642 undesirable aliasing.
16643 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16644 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16645 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16646 since Lisp_Subr is a special case (no "next" field).
16647 (ASIZE): Now uses header.size rather than size.
16648 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16649 to avoid the hassle of writing XVECTOR (foo)->header.size.
16650 (struct vectorlike_header): New type.
16651 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16652 object, to help avoid aliasing.
16653 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16654 (SUBRP): Likewise, since Lisp_Subr is a special case.
16655 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16656 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16657 (struct Lisp_Hash_Table): Combine first two members into a single
16658 struct vectorlike_header member. All uses of "size" and "next" members
16659 changed to be "header.size" and "header.next".
16660 * buffer.h (struct buffer): Likewise.
16661 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16662 * frame.h (struct frame): Likewise.
16663 * process.h (struct Lisp_Process): Likewise.
16664 * termhooks.h (struct terminal): Likewise.
16665 * window.c (struct save_window_data, struct saved_window): Likewise.
16666 * window.h (struct window): Likewise.
16667 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16668 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16669 * buffer.c (init_buffer_once): Likewise.
16670 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16671 special case.
16672 * process.c (Fformat_network_address): Use local var for size,
16673 for brevity.
16674
16675 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16676
16677 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16678 * data.c (atof): Remove decl; no longer used or needed.
16679 (digit_to_number): Move to lread.c.
16680 (Fstring_to_number): Use new string_to_number function, to be
16681 consistent with how the Lisp reader treats infinities and NaNs.
16682 Do not assume that floating-point numbers represent EMACS_INT
16683 without losing information; this is not true on most 64-bit hosts.
16684 Avoid double-rounding errors, by insisting on integers when
16685 parsing non-base-10 numbers, as the documentation specifies.
16686 * lisp.h (string_to_number): New decl, replacing ...
16687 (isfloat_string): Remove.
16688 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16689 (read1): Do not accept +. and -. as integers; this
16690 appears to have been a coding error. Similarly, do not accept
16691 strings like +-1e0 as floating point numbers. Do not report
16692 overflow for integer overflows unless the base is not 10 which
16693 means we have no simple and reliable way to continue.
16694 Break out the floating-point parsing into a new
16695 function string_to_number, so that Fstring_to_number parses
16696 floating point numbers consistently with the Lisp reader.
16697 (digit_to_number): Move here from data.c. Make it static inline.
16698 (E_CHAR, EXP_INT): Remove, replacing with ...
16699 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16700 (string_to_number): New function, replacing isfloat_string.
16701 This function checks for valid syntax and produces the resulting
16702 Lisp float number too. Rework it so that string-to-number
16703 no longer mishandles examples like "1.0e+". Use strtoumax,
16704 so that overflow for non-base-10 numbers is reported only when
16705 there's no portable and simple way to convert to floating point.
16706
16707 * textprop.c (set_text_properties_1): Rewrite for clarity,
16708 and to avoid GCC warning about integer overflow.
16709
16710 * intervals.h (struct interval): Use EMACS_INT for members
16711 where EMACS_UINT might cause problems. See
16712 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16713 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16714 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16715 All uses changed.
16716 (offset_intervals): Tell GCC not to worry about length overflow
16717 when negating a negative length.
16718
16719 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16720 (overrun_check_free): Likewise.
16721
16722 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16723 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16724 word size.
16725
16726 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16727 (gnutls_make_error): Rename local to avoid shadowing.
16728 (gnutls_emacs_global_deinit): ifdef out; not used.
16729 (Fgnutls_boot): Use const for pointer to readonly storage.
16730 Comment out unused local. Fix pointer signedness problems.
16731
16732 * lread.c (openp): Don't stuff size_t into an 'int'.
16733 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16734 about possible signed overflow.
16735
16736 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16737 (GDK_KEY_g): Don't define if already defined.
16738 (xg_prepare_tooltip): Avoid pointer signedness problem.
16739 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16740
16741 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16742 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16743
16744 * xfns.c (Fx_window_property): Simplify a bit,
16745 to make a bit faster and to avoid GCC 4.6.0 warning.
16746 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16747
16748 * fns.c (internal_equal): Don't assume size_t fits in int.
16749
16750 * alloc.c (compact_small_strings): Tighten assertion a little.
16751
16752 Replace pEd with more-general pI, and fix some printf arg casts.
16753 * lisp.h (pI): New macro, generalizing old pEd macro to other
16754 conversion specifiers. For example, use "...%"pI"d..." rather
16755 than "...%"pEd"...".
16756 (pEd): Remove. All uses replaced with similar uses of pI.
16757 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16758 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16759 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16760 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16761 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16762 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16763 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16764 64-bit hosts.
16765 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16766 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16767 * print.c (safe_debug_print, print_object): Likewise.
16768 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16769 to int.
16770 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16771 avoiding the 0 flag, which is not portable.
16772 * process.c (Fmake_network_process): Use pI to avoid cast.
16773 * region-cache.c (pp_cache): Likewise.
16774 * xdisp.c (decode_mode_spec): Likewise.
16775 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16776 behavior on 64-bit hosts with printf arg.
16777 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16778 (x_stop_queuing_selection_requests): Likewise.
16779 (x_get_window_property): Don't truncate byte count to an 'int'
16780 when tracing.
16781
16782 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16783 here, since it parses constructs like leading '-' and spaces,
16784 which are not wanted; and it overflows with large numbers.
16785 Instead, simply match F[0-9]+, which is what is wanted anyway.
16786
16787 * alloc.c: Remove unportable assumptions about struct layout.
16788 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16789 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16790 (allocate_vectorlike, make_pure_vector): Use the new macros,
16791 plus offsetof, to remove unportable assumptions about struct layout.
16792 These assumptions hold on all porting targets that I know of, but
16793 they are not guaranteed, they're easy to remove, and removing them
16794 makes further changes easier.
16795
16796 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16797 This doesn't fix a bug but makes the code clearer.
16798 (string_overrun_cookie): Now const. Use initializers that
16799 don't formally overflow signed char, to avoid warnings.
16800 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16801 can cause Emacs to crash when string overrun checking is enabled.
16802 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16803 multiple of sizeof (EMACS_INT); it need not be, if
16804 alignof(EMACS_INT) < sizeof (EMACS_INT).
16805 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16806
16807 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16808
16809 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16810
16811 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16812
16813 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16814 supposed to be handshaking. (Bug#8556)
16815 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16816
16817 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16818
16819 * lisp.h (Qdebug): List symbol.
16820 * eval.c (Qdebug): Restore global linkage.
16821 * keyboard.c (debug-on-event): New variable.
16822 (handle_user_signal): Break into debugger when debug-on-event
16823 matches the current signal symbol.
16824
16825 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16826
16827 * alloc.c (check_sblock, check_string_bytes)
16828 (check_string_free_list): Convert to standard C.
16829
16830 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16831
16832 * w32.c (emacs_gnutls_push): Fix typo.
16833
16834 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16835
16836 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16837 "cast to pointer from integer of different size".
16838
16839 Improve doprnt and its use in verror. (Bug#8545)
16840 * doprnt.c (doprnt): Document the set of format control sequences
16841 supported by the function. Use SAFE_ALLOCA instead of always
16842 using `alloca'.
16843
16844 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16845 is one byte too soon. Don't use xrealloc; instead xfree and
16846 xmalloc anew.
16847
16848 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16849
16850 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16851 callbacks stage.
16852
16853 * gnutls.c: Renamed global_initialized to
16854 gnutls_global_initialized. Added internals for the
16855 :verify-hostname-error, :verify-error, and :verify-flags
16856 parameters of `gnutls-boot' and documented those parameters in the
16857 docstring. Start callback support.
16858 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16859 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16860 on error. Return error code.
16861 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16862 (emacs_gnutls_read): Likewise.
16863 (Fgnutls_boot): Return handshake error code.
16864 (emacs_gnutls_handle_error): New function.
16865 (wsaerror_to_errno): Likewise.
16866
16867 * w32.h (emacs_gnutls_pull): Add prototype.
16868 (emacs_gnutls_push): Likewise.
16869
16870 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16871 (emacs_gnutls_push): Likewise.
16872
16873 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16874
16875 * process.c (wait_reading_process_output): Check if GnuTLS
16876 buffered some data internally if no FDs are set for TLS
16877 connections.
16878
16879 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16880 (LIBS): Link to USER_LIBS.
16881 ($(BLD)/gnutls.$(0)): New target.
16882
16883 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16884
16885 * xdisp.c (handle_single_display_spec): Rename the
16886 display_replaced_before_p argument into display_replaced_p, to
16887 make it consistent with the commentary. Fix typos in the
16888 commentary.
16889
16890 * textprop.c (syms_of_textprop): Remove dead code.
16891 (copy_text_properties): Delete obsolete commentary about an
16892 interface that was deleted long ago. Fix typos in the description
16893 of arguments.
16894
16895 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16896 to changes in oldXMenu/XMenu.h from 2011-04-16.
16897 <menu_help_message, prev_menu_help_message>: Constify.
16898 (IT_menu_make_room): menu->help_text is now `const char **';
16899 adjust.
16900
16901 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16902 to changes in oldXMenu/XMenu.h from 2011-04-16.
16903 (struct XMenu): Declare `help_text' `const char **'.
16904
16905 * xfaces.c <Qunspecified>: Make extern again.
16906
16907 * syntax.c: Include sys/types.h before including regex.h, as
16908 required by POSIX.
16909
16910 * doc.c (get_doc_string): Improve the format passed to `error'.
16911
16912 * doprnt.c (doprnt): Improve commentary.
16913
16914 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16915
16916 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16917 them with etags.
16918
16919 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16920 changes in globals.h immediately force recompilation.
16921 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16922 $(CURDIR)/s/ms-w32.h.
16923 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16924
16925 * character.c (Fchar_direction): Function deleted.
16926 (syms_of_character): Don't defsubr it.
16927 <char-direction-table>: Deleted.
16928
16929 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16930
16931 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16932 * doprnt.c: Include limits.h.
16933 (SIZE_MAX): New macro.
16934 (doprnt): Return a size_t value. 2nd arg is now size_t.
16935 Many local variables are now size_t instead of int or unsigned.
16936 Improve overflow protection. Support `l' modifier for integer
16937 conversions. Support %l conversion. Don't assume an EMACS_INT
16938 argument for integer conversions and for %c.
16939
16940 * lisp.h (doprnt): Restore prototype.
16941
16942 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16943 $(SRC)/character.h.
16944
16945 * Makefile.in (base_obj): Add back doprnt.o.
16946
16947 * deps.mk (doprnt.o): Add back prerequisites.
16948 (callint.o): Depend on character.h.
16949
16950 * eval.c (internal_lisp_condition_case): Include the handler
16951 representation in the error message.
16952 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16953 when breaking from the loop.
16954
16955 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16956
16957 * callint.c (Fcall_interactively): When displaying error message
16958 about invalid control letter, pass the character's codepoint, not
16959 a pointer to its multibyte form. Improve display of the character
16960 in octal and display also its hex code.
16961
16962 * character.c (char_string): Use %x to display the (unsigned)
16963 codepoint of an invalid character, to avoid displaying a bogus
16964 negative value.
16965
16966 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16967 `error', not SYMBOL_NAME itself.
16968
16969 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16970 character arguments to `error'.
16971
16972 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16973 to `error' in error message about FINAL_CHAR argument. Make sure
16974 FINAL_CHAR is a character, and use %c when it is passed as
16975 argument to `error'.
16976
16977 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16978
16979 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16980
16981 * w32.c: Include <time.h>.
16982 (sys_localtime): New function.
16983
16984 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16985
16986 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16987
16988 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16989
16990 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16991
16992 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16993 zombies (Bug#8467).
16994
16995 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16996
16997 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16998 gl_state.e_property when gl_state.object is Qt.
16999
17000 * insdel.c (make_gap_larger): Remove limitation of buffer size
17001 to <= INT_MAX.
17002
17003 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
17004
17005 * xdisp.c (lookup_glyphless_char_display)
17006 (produce_glyphless_glyph): Handle cons cell entry in
17007 glyphless-char-display.
17008 (Vglyphless_char_display): Document it.
17009
17010 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17011 glyphless-char-display.
17012
17013 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
17014
17015 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17016
17017 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17018
17019 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17020 definition for no-X builds.
17021
17022 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
17023
17024 Static checks with GCC 4.6.0 and non-default toolkits.
17025
17026 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17027
17028 * process.c (keyboard_bit_set): Define only if SIGIO.
17029 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17030 (send_process): Repair possible setjmp clobbering.
17031
17032 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17033
17034 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17035
17036 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17037
17038 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17039 Define only if needed.
17040
17041 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17042 by pacifying GCC about it. Maybe it's time to retire it?
17043 * xfaces.c (USG, __TIMEVAL__): Likewise.
17044
17045 * dispextern.h (struct redisplay_interface): Rename param
17046 to avoid shadowing.
17047 * termhooks.h (struct terminal): Likewise.
17048 * xterm.c (xembed_send_message): Likewise.
17049
17050 * insdel.c (make_gap_smaller): Define only if
17051 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17052
17053 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17054 it.
17055
17056 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17057 so that we aren't warned about unused symbols.
17058
17059 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17060
17061 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17062
17063 * xfns.c (x_real_positions): Mark locals as initialized.
17064
17065 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17066
17067 * xterm.c: Fix problems found by static analysis with other toolkits.
17068 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17069 (x_dispatch_event): Declare static if USE_GTK, and
17070 define if USE_GTK || USE_X_TOOLKIT.
17071 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17072 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17073 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17074 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17075
17076 * xmenu.c (menu_help_callback): Pointer type fixes.
17077 Use const pointers when pointing at readonly data. Avoid pointer
17078 signedness clashes.
17079 (FALSE): Remove unused macro.
17080 (update_frame_menubar): Remove unused decl.
17081
17082 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17083
17084 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17085 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17086 (single_menu_item): Rename local to avoid shadowing.
17087
17088 * keyboard.c (make_lispy_event): Remove unused local var.
17089
17090 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17091 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17092
17093 * bitmaps: Change bitmaps from unsigned char back to the X11
17094 compatible char. Avoid the old compiler warnings about
17095 out-of-range initializers by using, for example, '\xab' rather
17096 than 0xab.
17097
17098 * xgselect.c (xgselect_initialize): Check vs interface
17099 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17100
17101 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17102
17103 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17104 to read-only memory.
17105
17106 * fns.c (vector): Remove; this old hack is no longer needed.
17107
17108 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17109 Remove unused var.
17110 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17111
17112 * xrdb.c (x_load_resources): Omit unused local.
17113
17114 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17115 (x_window): Rename locals to avoid shadowing.
17116 (USG): Use the kludged USG macro, to pacify gcc.
17117
17118 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17119 (x_term_init): Remove local to avoid shadowing.
17120
17121 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17122
17123 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17124 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17125
17126 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17127
17128 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17129
17130 Fix regex.c, syntax.c and friends for buffers > 2GB.
17131 * syntax.h (struct gl_state_s): Declare character position members
17132 EMACS_INT.
17133
17134 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17135
17136 * textprop.c (verify_interval_modification, interval_of):
17137 Declare arguments EMACS_INT.
17138
17139 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17140 EMACS_INT.
17141
17142 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17143
17144 * indent.c (Fvertical_motion): Local variable it_start is now
17145 EMACS_INT.
17146
17147 * regex.c (re_match, re_match_2, re_match_2_internal)
17148 (bcmp_translate, regcomp, regexec, print_double_string)
17149 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17150 (re_compile_pattern, re_exec): Declare arguments and local
17151 variables `size_t' and `ssize_t' and return values `regoff_t', as
17152 appropriate.
17153 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17154 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17155 <compile_stack_type>: `size' and `avail' are now `size_t'.
17156
17157 * regex.h <regoff_t>: Use ssize_t, not int.
17158 (re_search, re_search_2, re_match, re_match_2): Arguments that
17159 specify buffer/string position and length are now ssize_t and
17160 size_t. Return type is regoff_t.
17161
17162 2011-04-16 Ben Key <bkey76@gmail.com>
17163
17164 * nsfont.m: Fixed bugs in ns_get_family and
17165 ns_descriptor_to_entity that were caused by using free to
17166 deallocate memory blocks that were allocated by xmalloc (via
17167 xstrdup). This caused Emacs to crash when compiled with
17168 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17169 --enable-checking=xmallocoverrun). xfree is now used to
17170 deallocate these memory blocks.
17171
17172 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17173
17174 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17175
17176 emacs_write: Accept and return EMACS_INT for sizes.
17177 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17178 et seq.
17179 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17180 Accept and return EMACS_INT.
17181 (emacs_gnutls_write): Return the number of bytes written on
17182 partial writes.
17183 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17184 (emacs_read, emacs_write): Remove check for negative size, as the
17185 Emacs source code has been audited now.
17186 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17187 (emacs_read, emacs_write): Use it.
17188 * process.c (send_process): Adjust to the new signatures of
17189 emacs_write and emacs_gnutls_write. Do not attempt to store
17190 a byte offset into an 'int'; it might overflow.
17191 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17192
17193 * sound.c: Don't assume sizes fit in 'int'.
17194 (struct sound_device.period_size, alsa_period_size):
17195 Return EMACS_INT, not int.
17196 (struct sound_device.write, vox_write, alsa_write):
17197 Accept EMACS_INT, not int.
17198 (wav_play, au_play): Use EMACS_INT to store sizes and to
17199 record read return values.
17200
17201 2011-04-15 Ben Key <bkey76@gmail.com>
17202
17203 * keyboard.c (Qundefined): Don't declare static since it is used
17204 in nsfns.m.
17205 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17206 static since they are used in nsfont.m.
17207
17208 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17209
17210 * process.c (Qprocessp): Don't declare static.
17211 * lisp.h (Qprocessp): Declare again.
17212
17213 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17214
17215 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17216
17217 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17218
17219 Improve C-level modularity by making more things 'static'.
17220
17221 Don't publish debugger-only interfaces to other modules.
17222 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17223 (verify_bytepos, count_markers): Move decls to the only modules
17224 that need them.
17225 * region-cache.h (pp_cache): Likewise.
17226 * window.h (check_all_windows): Likewise.
17227 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17228
17229 * sysdep.c (croak): Now static, if
17230 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17231 * syssignal.h (croak): Declare only if not static.
17232
17233 * alloc.c (refill_memory_reserve): Now static if
17234 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17235 * lisp.h (refill_memory_reserve): Declare only if not static.
17236
17237 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17238 Define only if USE_LUCID.
17239
17240 * xrdb.c (x_customization_string, x_rm_string): Now static.
17241
17242 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17243 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17244
17245 * xdisp.c (draw_row_with_mouse_face): Now static.
17246 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17247
17248 * window.h (check_all_windows): Mark externally visible.
17249
17250 * window.c (window_deletion_count): Now static.
17251
17252 * undo.c: Make symbols static if they're not exported.
17253 (last_undo_buffer, last_boundary_position, pending_boundary):
17254 Now static.
17255
17256 * textprop.c (interval_insert_behind_hooks): Now static.
17257 (interval_insert_in_front_hooks): Likewise.
17258
17259 * term.c: Make symbols static if they're not exported.
17260 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17261 (max_frame_lines, tty_set_terminal_modes):
17262 (tty_reset_terminal_modes, tty_turn_off_highlight):
17263 (get_tty_terminal): Now static.
17264 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17265 * termhooks.h (term_mouse_moveto): Do not declare if
17266 HAVE_WINDOW_SYSTEM.
17267 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17268 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17269
17270 * sysdep.c: Make symbols static if they're not exported.
17271 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17272 Now static.
17273 (sigprocmask_set, full_mask): Remove; unused.
17274 (wait_debugging): Mark as visible.
17275 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17276 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17277
17278 * syntax.c (syntax_temp): Define only if !__GNUC__.
17279
17280 * sound.c (current_sound_device, current_sound): Now static.
17281
17282 * search.c (searchbufs, searchbuf_head): Now static.
17283
17284 * scroll.c (scroll_cost): Remove; unused.
17285 * dispextern.h (scroll_cost): Remove decl.
17286
17287 * region-cache.h (pp_cache): Mark as externally visible.
17288
17289 * process.c: Make symbols static if they're not exported.
17290 (process_tick, update_tick, create_process, chan_process):
17291 (Vprocess_alist, proc_buffered_char, datagram_access):
17292 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17293 (deactivate_process): Mark defn as static, as well as decl.
17294 * lisp.h (create_process): Remove decl.
17295 * process.h (chan_process, Vprocess_alist): Remove decls.
17296
17297 * print.c: Make symbols static if they're not exported.
17298 (print_depth, new_backquote_output, being_printed, print_buffer):
17299 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17300 (print_interval, print_number_index, initial_stderr_stream):
17301 Now static.
17302 * lisp.h (Fprinc): Remove decl.
17303 (debug_output_compilation_hack): Mark as externally visible.
17304
17305 * sysdep.c (croak): Move decl from here to syssignal.h.
17306 * syssignal.h (croak): Put it here, so the API can be checked when
17307 'croak' is called from dissociate_if_controlling_tty.
17308
17309 * minibuf.c: Make symbols static if they're not exported.
17310 (minibuf_save_list, choose_minibuf_frame): Now static.
17311 * lisp.h (choose_minibuf_frame): Remove decl.
17312
17313 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17314
17315 * lread.c: Make symbols static if they're not exported.
17316 (read_objects, initial_obarray, oblookup_last_bucket_number):
17317 Now static.
17318 (make_symbol): Remove; unused.
17319 * lisp.h (initial_obarray, make_symbol): Remove decls.
17320
17321 * keyboard.c: Make symbols static if they're not exported.
17322 (single_kboard, recent_keys_index, total_keys, recent_keys):
17323 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17324 (this_single_command_key_start, echoing, last_auto_save):
17325 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17326 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17327 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17328 (Vlispy_mouse_stem, double_click_count):
17329 Now static.
17330 (force_auto_save_soon): Define only if SIGDANGER.
17331 (ignore_mouse_drag_p): Now static if
17332 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17333 (print_help): Remove; unused.
17334 (stop_character, last_timer_event): Mark as externally visible.
17335 * keyboard.h (ignore_mouse_drag_p): Declare only if
17336 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17337 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17338 * lisp.h (echoing): Remove decl.
17339 (force_auto_save_soon): Declare only if SIGDANGER.
17340 * xdisp.c (redisplay_window): Simplify code, to make it more
17341 obvious that ignore_mouse_drag_p is not accessed if !defined
17342 USE_GTK && !defined HAVE_NS.
17343
17344 * intervals.c: Make symbols static if they're not exported.
17345 (merge_properties_sticky, merge_interval_right, delete_interval):
17346 Now static.
17347 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17348
17349 * insdel.c: Make symbols static if they're not exported.
17350 However, leave prepare_to_modify_buffer alone. It's never
17351 called from outside this function, but that appears to be a bug.
17352 (combine_after_change_list, combine_after_change_buffer):
17353 (adjust_after_replace, signal_before_change): Now static.
17354 (adjust_after_replace_noundo): Remove; unused.
17355 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17356 (signal_before_change): Remove decls.
17357
17358 * indent.c (val_compute_motion, val_vmotion): Now static.
17359
17360 * image.c: Make symbols static if they're not exported.
17361 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17362 if USE_GTK.
17363 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17364 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17365
17366 * fringe.c (standard_bitmaps): Now static.
17367 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17368
17369 * frame.c: Make symbols static if they're not exported.
17370 (x_report_frame_params, make_terminal_frame): Now static.
17371 (get_frame_param): Now static, unless HAVE_NS.
17372 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17373 (x_get_resource_string): Remove; not used.
17374 * frame.h (make_terminal_frame, x_report_frame_params):
17375 (x_get_resource_string); Remove decls.
17376 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17377 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17378
17379 * font.c, fontset.c: Make symbols static if they're not exported.
17380 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17381 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17382 * font.c (font_close_object): Now static.
17383 * font.h (font_close_object): Remove.
17384 * fontset.c (FONTSET_OBJLIST): Remove.
17385 (free_realized_fontset) #if-0 the body, which does nothing.
17386 (face_suitable_for_char_p): #if-0, as it's never called.
17387 * fontset.h (face_suitable_for_char_p): Remove decl.
17388 * xfaces.c (face_at_string_position):
17389 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17390 since 0 is always ASCII.
17391
17392 * fns.c (weak_hash_tables): Now static.
17393
17394 * fileio.c: Make symbols static if they're not exported.
17395 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17396 (Vwrite_region_annotation_buffers): Now static.
17397
17398 * eval.c: Make symbols static if they're not exported.
17399 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17400 * lisp.h (backtrace_list): Remove decl.
17401
17402 * emacs.c: Make symbols static if they're not exported.
17403 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17404 (fatal_error_code, fatal_error_signal_hook, standard_args):
17405 Now static.
17406 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17407 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17408 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17409 * lisp.h (fatal_error_signal_hook): Remove decl.
17410 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17411
17412 * editfns.c: Move a (normally-unused) function to its only use.
17413 * editfns.c, lisp.h (get_operating_system_release): Remove.
17414 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17415 worth the hassle of breaking this out.
17416
17417 * xterm.c: Make symbols static if they're not exported.
17418 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17419 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17420 (x_destroy_window, x_delete_display):
17421 Now static.
17422 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17423 (x_mouse_leave): Remove; unused.
17424 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17425 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17426 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17427 Remove decls.
17428 (x_mouse_leave): Declare only if WINDOWSNT.
17429 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17430 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17431 USE_X_TOOLKIT.
17432
17433 * ftxfont.c: Make symbols static if they're not exported.
17434 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17435 HAVE_FREETYPE.
17436 * font.h (ftxfont_driver): Likewise.
17437
17438 * xfns.c: Make symbols static if they're not exported.
17439 (x_last_font_name, x_display_info_for_name):
17440 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17441 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17442 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17443 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17444 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17445 (last_show_tip_args): Now static.
17446 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17447 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17448 (x_screen_planes): Remove; unused.
17449 * dispextern.h (x_screen_planes): Remove decl.
17450
17451 * dispnew.c: Make symbols static if they're not exported.
17452 * dispextern.h (redraw_garbaged_frames, scrolling):
17453 (increment_row_positions): Remove.
17454 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17455 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17456 Now static.
17457 (redraw_garbaged_frames): Remove; unused.
17458
17459 * xfaces.c: Make symbols static if they're not exported.
17460 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17461 Remove decls.
17462 * xterm.h (defined_color): Remove decls.
17463 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17464 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17465 (menu_face_changed_default, defined_color, free_realized_face):
17466 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17467 (ascii_face_of_lisp_face): Remove; unused.
17468
17469 * xdisp.c: Make symbols static if they're not exported.
17470 * dispextern.h (scratch_glyph_row, window_box_edges):
17471 (glyph_to_pixel_coords, set_cursor_from_row):
17472 (get_next_display_element, set_iterator_to_next):
17473 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17474 (show_mouse_face): Remove decls
17475 * frame.h (message_buf_print): Likewise.
17476 * lisp.h (pop_message, set_message, check_point_in_composition):
17477 Likewise.
17478 * xterm.h (set_vertical_scroll_bar): Likewise.
17479 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17480 (message_buf_print, scratch_glyph_row, displayed_buffer):
17481 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17482 (get_next_display_element, show_mouse_face, window_box_edges):
17483 (frame_to_window_pixel_xy, check_point_in_composition):
17484 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17485 (glyph_to_pixel_coords): Remove; unused.
17486
17487 * dired.c (file_name_completion): Now static.
17488
17489 * dbusbind.c (xd_in_read_queued_messages): Now static.
17490
17491 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17492 * data.c (circular_list_error): Remove.
17493
17494 * commands.h (last_point_position, last_point_position_buffer):
17495 (last_point_position_window): Remove decls.
17496 * keyboard.c: Make these variables static.
17497
17498 * coding.h (coding, code_convert_region, encode_coding_gap):
17499 Remove decls.
17500 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17501 (iso_code_class, detect_coding, code_convert_region): Now static.
17502 (encode_coding_gap): Remove; unused.
17503
17504 * chartab.c (chartab_chars, chartab_bits): Now static.
17505
17506 * charset.h (charset_iso_8859_1): Remove decl.
17507 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17508 Now static.
17509
17510 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17511 * ccl.c (Vccl_program_table): Now static.
17512 (check_ccl_update): Remove; unused.
17513
17514 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17515 * category.h: ... from here.
17516 * category.c (check_category_table, set_category_set): Now static.
17517
17518 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17519 * lisp.h: Remove these decls.
17520
17521 * buffer.c (buffer_count): Remove unused var.
17522
17523 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17524 so that it's not optimized away.
17525 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17526 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17527 exported only to the debugger.
17528
17529 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17530 * atimer.h (run_all_atimers): Remove; not exported.
17531
17532 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17533 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17534 was inaccessible from Lisp.
17535 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17536 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17537
17538 alloc.c: Import and export fewer symbols, and remove unused items.
17539 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17540 is defined.
17541 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17542 it's not optimized away by whole-program optimization.
17543 (message_enable_multibyte, free_misc): Remove.
17544 (catchlist, handlerlist, mark_backtrace):
17545 Declare only if BYTE_MARK_STACK.
17546 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17547 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17548 (message_enable_multibyte): Remove decl.
17549 (free_misc, interval_free_list, float_block, float_block_index):
17550 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17551 (cons_free_list, last_marked_index):
17552 Now static.
17553 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17554 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17555 (mark_backtrace): Define only if BYTE_MARK_STACK.
17556 * xdisp.c (message_enable_multibyte): Now static.
17557
17558 Declare Lisp_Object Q* variables to be 'static' if not exported.
17559 This makes it easier for human readers (and static analyzers)
17560 to see whether these variables are used from other modules.
17561 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17562 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17563 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17564 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17565 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17566 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17567 * xmenu.c, xselect.c:
17568 Declare Q* vars static if they are not used in other modules.
17569 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17570 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17571 Remove decls of unexported vars.
17572 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17573
17574 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17575
17576 Make Emacs functions such as Fatom 'static' by default.
17577 This makes it easier for human readers (and static analyzers)
17578 to see whether these functions can be called from other modules.
17579 DEFUN now defines a static function. To make the function external
17580 so that it can be used in other C modules, use the new macro DEFUE.
17581 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17582 (Finit_image_library):
17583 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17584 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17585 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17586 Remove decls, since these functions are now static.
17587 (Funintern, Fget_internal_run_time): New decls, since these functions
17588 were already external.
17589
17590 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17591 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17592 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17593 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17594 * keyboard.c, keymap.c, lread.c:
17595 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17596 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17597 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17598 Mark functions with DEFUE instead of DEFUN,
17599 if they are used in other modules.
17600 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17601 decls for now-static functions.
17602 * buffer.h (Fdelete_overlay): Remove decl.
17603 * callproc.c (Fgetenv_internal): Mark as internal.
17604 * composite.c (Fremove_list_of_text_properties): Remove decl.
17605 (Fcomposition_get_gstring): New forward static decl.
17606 * composite.h (Fcomposite_get_gstring): Remove decl.
17607 * dired.c (Ffile_attributes): New forward static decl.
17608 * doc.c (Fdocumntation_property): New forward static decl.
17609 * eval.c (Ffetch_bytecode): New forward static decl.
17610 (Funintern): Remove extern decl; now in .h file where it belongs.
17611 * fileio.c (Fmake_symbolic_link): New forward static decl.
17612 * image.c (Finit_image_library): New forward static decl.
17613 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17614 * intervals.h (Fprevious_property_change):
17615 (Fremove_list_of_text_properties): Remove decls.
17616 * keyboard.c (Fthis_command_keys): Remove decl.
17617 (Fcommand_execute): New forward static decl.
17618 * keymap.c (Flookup_key): New forward static decl.
17619 (Fcopy_keymap): Now static.
17620 * keymap.h (Flookup_key): Remove decl.
17621 * process.c (Fget_process): New forward static decl.
17622 (Fprocess_datagram_address): Mark as internal.
17623 * syntax.c (Fsyntax_table_p): New forward static decl.
17624 (skip_chars): Remove duplicate decl.
17625 * textprop.c (Fprevious_property_change): New forward static decl.
17626 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17627 Now internal.
17628 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17629 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17630
17631 * editfns.c (Fformat): Remove unreachable code.
17632
17633 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17634
17635 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17636 change. (Bug#8496)
17637
17638 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17639
17640 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17641 when at ZV. (Bug#8487)
17642
17643 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17644
17645 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17646 (Bug#8437)
17647 * keyboard.c (parse_tool_bar_item): Likewise.
17648 * sound.c (sound_cleanup, alsa_close): Likewise.
17649 * termcap.c (tgetent): Likewise.
17650 * xfns.c (x_default_font_parameter): Likewise.
17651 * xsettings.c (read_and_apply_settings): Likewise.
17652
17653 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17654 (overrun_check_free): Protoize.
17655
17656 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17657
17658 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17659 since callers should never pass a negative size.
17660 Change the signature to match that of plain 'read' and 'write'; see
17661 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17662 * lisp.h: Update prototypes of emacs_write and emacs_read.
17663
17664 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17665
17666 * xdisp.c (redisplay_window): Don't try to determine the character
17667 position of the scroll margin if the window start point w->startp
17668 is outside the buffer's accessible region. (Bug#8468)
17669
17670 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17671
17672 Fix write-region and its subroutines for buffers > 2GB.
17673 * fileio.c (a_write, e_write): Modify declaration of arguments and
17674 local variables to support buffers larger than 2GB.
17675 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17676
17677 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17678 argument, local variables, and return value.
17679
17680 * lisp.h: Update prototypes of emacs_write and emacs_read.
17681
17682 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17683
17684 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17685
17686 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17687
17688 Fix more problems found by GCC 4.6.0's static checks.
17689
17690 * xdisp.c (vmessage): Use a better test for character truncation.
17691
17692 * charset.c (load_charset_map): <, not <=, for optimization,
17693 and to avoid potential problems with integer overflow.
17694 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17695 * casetab.c (set_identity, shuffle): Likewise.
17696 * editfns.c (Fformat): Likewise.
17697 * syntax.c (skip_chars): Likewise.
17698
17699 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17700 This also lets GCC 4.6.0 generate slightly better loop code.
17701
17702 * callint.c (Fcall_interactively): <, not <=, for optimization.
17703 (Fcall_interactively): Count the number of arguments produced,
17704 not the number of arguments given. This is simpler and lets GCC
17705 4.6.0 generate slightly better code.
17706
17707 * ftfont.c: Distingish more carefully between FcChar8 and char.
17708 The previous code passed unsigned char * to a functions like
17709 strlen and xstrcasecmp that expect char *, which does not
17710 conform to the C standard.
17711 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17712 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17713 char * when the C standard requires it.
17714
17715 * keyboard.c (read_char): Remove unused var.
17716
17717 * eval.c: Port to Windows vsnprintf (Bug#8435).
17718 Include <limits.h>.
17719 (SIZE_MAX): Define if the headers do not.
17720 (verror): Do not give up if vsnprintf returns a negative count.
17721 Instead, grow the buffer. This ports to Windows vsnprintf, which
17722 does not conform to C99. Problem reported by Eli Zaretskii.
17723 Also, simplify the allocation scheme, by avoiding the need for
17724 calling realloc, and removing the ALLOCATED variable.
17725
17726 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17727
17728 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17729 But keep the doprint source code for now, as we might revamp it
17730 and use it again (Bug#8435).
17731 * lisp.h (doprnt): Remove.
17732 * Makefile.in (base_obj): Remove doprnt.o.
17733 * deps.mk (doprnt.o): Remove.
17734
17735 error: Print 32- and 64-bit integers portably (Bug#8435).
17736 Without this change, on typical 64-bit hosts error ("...%d...", N)
17737 was used to print both 32- and 64-bit integers N, which relied on
17738 undefined behavior.
17739 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17740 * lisp.h (error, verror): Mark as printf-like functions.
17741 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17742 Report overflow in size calculations when allocating printf buffer.
17743 Do not truncate output string at its first null byte.
17744 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17745 Truncate the output at a character boundary, since vsnprintf does not
17746 do that.
17747 * charset.c (check_iso_charset_parameter): Convert internal
17748 character to string before calling 'error', since %c now has the
17749 printf meaning.
17750 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17751 overflow when computing char to be passed to 'error'. Do not
17752 pass Lisp_Object to 'error'; pass the integer instead.
17753 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17754 formatted with plain %d.
17755
17756 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17757
17758 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17759
17760 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17761
17762 * xterm.c (x_catch_errors): Remove duplicate declaration.
17763
17764 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17765
17766 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17767
17768 2011-04-10 Jim Meyering <meyering@redhat.com>
17769
17770 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17771 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17772 return ssize_t not "int", and use size_t as the buffer length.
17773 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17774 * gnutls.h: Update declarations.
17775 * process.c (read_process_output): Use ssize_t, to match.
17776 (send_process): Likewise.
17777
17778 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17779
17780 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17781
17782 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17783
17784 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17785 Use unsigned char, to match FcChar8 type definition.
17786
17787 * xterm.c (handle_one_xevent):
17788 * xmenu.c (create_and_show_popup_menu):
17789 * xselect.c (x_decline_selection_request)
17790 (x_reply_selection_request): Avoid type-punned deref of X events.
17791
17792 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17793
17794 Fix some uses of `int' instead of EMACS_INT.
17795 * search.c (string_match_1, fast_string_match)
17796 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17797 (scan_buffer, find_next_newline_no_quit)
17798 (find_before_next_newline, search_command, Freplace_match)
17799 (Fmatch_data): Make some `int' variables be EMACS_INT.
17800
17801 * xdisp.c (display_count_lines): 3rd argument and return value now
17802 EMACS_INT. All callers changed.
17803 (pint2hrstr): Last argument is now EMACS_INT.
17804
17805 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17806 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17807 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17808 (decode_coding_utf_16, decode_coding_emacs_mule)
17809 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17810 (decode_coding_ccl, decode_coding_charset)
17811 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17812 (decode_coding_iso_2022, decode_coding_emacs_mule)
17813 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17814 <char_offset, last_offset>: Declare EMACS_INT.
17815 (encode_coding_utf_8, encode_coding_utf_16)
17816 (encode_coding_emacs_mule, encode_invocation_designation)
17817 (encode_designation_at_bol, encode_coding_iso_2022)
17818 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17819 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17820 Declare EMACS_INT.
17821 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17822 (encode_invocation_designation): Last argument P_NCHARS is now
17823 EMACS_INT.
17824 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17825 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17826
17827 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17828 All users changed.
17829
17830 * ccl.c (Fccl_execute_on_string): Declare some variables
17831 EMACS_INT.
17832
17833 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17834
17835 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17836
17837 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17838
17839 * process.c (Fformat_network_address): Doc fix.
17840
17841 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17842
17843 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17844
17845 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17846
17847 * keyboard.c (read_char): Call Lisp function help-form-show,
17848 instead of using internal_with_output_to_temp_buffer.
17849 (Qhelp_form_show): New var.
17850 (syms_of_keyboard): Use DEFSYM macro.
17851
17852 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17853
17854 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17855
17856 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17857
17858 * process.c (Flist_processes): Remove to Lisp.
17859 (list_processes_1): Delete.
17860
17861 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17862
17863 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17864
17865 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17866
17867 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17868
17869 Fix more problems found by GCC 4.6.0's static checks.
17870
17871 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17872
17873 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17874
17875 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17876
17877 * xdisp.c (vmessage): Mark as a printf-like function.
17878
17879 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17880
17881 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17882
17883 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17884 printf-like functions.
17885 (tiff_load): Add casts to remove these marks before passing them
17886 to system-supplied API.
17887
17888 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17889
17890 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17891 This avoids several warnings with gcc -Wstrict-overflow.
17892 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17893 directly, rather than having caller test rule sign. This avoids
17894 some unnecessary tests.
17895 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17896 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17897 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17898
17899 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17900 (xfont_open): Avoid unnecessary tests.
17901
17902 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17903
17904 * composite.h, composite.c (composition_gstring_put_cache):
17905 Use EMACS_INT, not int, for length.
17906
17907 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17908 breaking out part of COMPOSITION_DECODE_RULE.
17909 (COMPOSITION_DECODE_RULE): Use it.
17910 * composite.c (get_composition_id): Remove unused local vars,
17911 by using the new macro.
17912
17913 * textprop.c (set_text_properties_1): Change while to do-while,
17914 since the condition is always true at first.
17915
17916 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17917 (interval_deletion_adjustment): Return unsigned value.
17918 All uses changed.
17919
17920 * process.c (list_processes_1, create_pty, read_process_output):
17921 (exec_sentinel): Remove vars that were set but not used.
17922 (create_pty): Remove unnecessary "volatile"s.
17923 (Fnetwork_interface_info): Avoid possibility of int overflow.
17924 (read_process_output): Do adaptive read buffering even if carryover.
17925 (read_process_output): Simplify nbytes computation if buffered.
17926
17927 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17928
17929 * syntax.c (scan_words): Remove var that was set but not used.
17930 (update_syntax_table): Use unsigned instead of int.
17931
17932 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17933 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17934 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17935
17936 * print.c (print_error_message): Avoid int overflow.
17937
17938 * font.c (font_list_entities): Redo for clarity,
17939 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17940
17941 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17942 (font_score): Avoid potential overflow in diff calculation.
17943
17944 * fns.c (substring_both): Remove var that is set but not used.
17945 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17946
17947 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17948
17949 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17950 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17951 can always succeed if overflow has undefined behavior.
17952
17953 * search.c (boyer_moore, wordify): Remove vars set but not used.
17954 (wordify): Omit three unnecessary tests.
17955
17956 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17957 All callers changed. This avoids the need for an unused var.
17958
17959 * casefiddle.c (casify_region): Remove var that is set but not used.
17960
17961 * dired.c (file_name_completion): Remove var that is set but not used.
17962
17963 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17964
17965 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17966 (Finsert_file_contents): Remove unnecessary code checking fd.
17967
17968 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17969 Check for integer overflow on size calculations.
17970
17971 * buffer.c (Fprevious_overlay_change): Remove var that is set
17972 but not used.
17973
17974 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17975 Remove vars that are set but not used.
17976 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17977 (timer_check_2): Mark vars as initialized.
17978
17979 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17980
17981 * image.c (lookup_image): Remove var that is set but not used.
17982 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17983
17984 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17985 that are set but not used.
17986
17987 * xfns.c (make_invisible_cursor): Don't return garbage
17988 if XCreateBitmapFromData fails (Bug#8410).
17989
17990 * xselect.c (x_get_local_selection, x_handle_property_notify):
17991 Remove vars that are set but not used.
17992
17993 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17994 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17995
17996 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17997 Remove var that is set but not used.
17998 (scroll_bar_windows_size): Now size_t, not int.
17999 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18000 Check for overflow.
18001
18002 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18003 (map_tty_color) [!defined MSDOS]: Likewise.
18004
18005 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18006
18007 * coding.c: Remove vars that are set but not used.
18008 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18009 All callers changed.
18010 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18011 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18012 (decode_coding_charset): Remove vars that are set but not used.
18013
18014 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18015 that is set but not used.
18016
18017 * print.c (print_object): Remove var that is set but not used.
18018
18019 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
18020 The gnulib version avoids calling malloc in the usual case,
18021 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18022 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18023 * filelock.c (current_lock_owner): Likewise.
18024 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18025 * sysdep.c: Include allocator.h, careadlinkat.h.
18026 (emacs_no_realloc_allocator): New static constant.
18027 (emacs_readlink): New function.
18028 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18029 ../lib/careadlinkat.h.
18030
18031 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18032
18033 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18034 first non-nil return value).
18035
18036 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18037
18038 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18039 if not defined (Bug#8403).
18040
18041 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18042
18043 * xdisp.c (display_count_lines): Remove parameter `start',
18044 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18045 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18046 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18047 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18048 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18049 and thereabouts. All callers changed.
18050 (get_per_char_metric): Remove parameter `f', unused since
18051 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18052
18053 2011-04-02 Jim Meyering <meyering@redhat.com>
18054
18055 do not dereference NULL upon failed strdup
18056 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18057 (ns_get_family): Likewise.
18058
18059 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18060
18061 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18062
18063 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18064
18065 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18066 later (Bug#8403).
18067
18068 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18069
18070 Add lexical binding.
18071
18072 * window.c (Ftemp_output_buffer_show): New fun.
18073 (Fsave_window_excursion):
18074 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18075
18076 * lread.c (lisp_file_lexically_bound_p): New function.
18077 (Fload): Bind Qlexical_binding.
18078 (readevalloop): Remove `evalfun' arg.
18079 Bind Qinternal_interpreter_environment.
18080 (Feval_buffer): Bind Qlexical_binding.
18081 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18082 Mark as dynamic.
18083 (syms_of_lread): Declare `lexical-binding'.
18084
18085 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18086
18087 * keyboard.c (eval_dyn): New fun.
18088 (menu_item_eval_property): Use it.
18089
18090 * image.c (parse_image_spec): Use Ffunctionp.
18091
18092 * fns.c (concat, mapcar1): Accept byte-code-functions.
18093
18094 * eval.c (Fsetq): Handle lexical vars.
18095 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18096 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18097 (FletX, Flet): Obey lexical binding.
18098 (Fcommandp): Handle closures.
18099 (Feval): New `lexical' arg.
18100 (eval_sub): New function extracted from Feval. Use it almost
18101 everywhere where Feval was used. Look up vars in lexical env.
18102 Handle closures.
18103 (Ffunctionp): Move from subr.el.
18104 (Ffuncall): Handle closures.
18105 (apply_lambda): Remove `eval_flags'.
18106 (funcall_lambda): Handle closures and new byte-code-functions.
18107 (Fspecial_variable_p): New function.
18108 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18109 but without exporting it to Lisp.
18110
18111 * doc.c (Fdocumentation, store_function_docstring):
18112 * data.c (Finteractive_form): Handle closures.
18113
18114 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18115 interactive spec.
18116
18117 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18118 New byte-codes.
18119 (exec_byte_code): New function extracted from Fbyte_code to handle new
18120 calling convention for byte-code-functions. Add new byte-codes.
18121
18122 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18123
18124 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18125
18126 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18127
18128 * xdisp.c (redisplay_internal): Fix prototype.
18129
18130 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18131
18132 * xdisp.c (SCROLL_LIMIT): New macro.
18133 (try_scrolling): Use it when setting scroll_limit.
18134 Limit scrolling to 100 screen lines.
18135 (redisplay_window): Even when falling back on "recentering",
18136 position point in the window according to scroll-conservatively,
18137 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18138
18139 (try_scrolling): When point is above the window, allow searching
18140 as far as scroll_max, or one screenful, to compute vertical
18141 distance from PT to the scroll margin position. This prevents
18142 try_scrolling from unnecessarily failing when
18143 scroll-conservatively is set to a value slightly larger than the
18144 window height. Clean up the case of PT below the margin at bottom
18145 of window: scroll_max can no longer be INT_MAX. When aggressive
18146 scrolling is in use, don't let point enter the opposite scroll
18147 margin as result of the scroll.
18148 (syms_of_xdisp) <scroll-conservatively>: Document the
18149 threshold of 100 lines for never-recentering scrolling.
18150
18151 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18152
18153 * dispextern.h (move_it_by_lines):
18154 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18155 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18156 (message_log_check_duplicate): Remove parameters `prev_bol' and
18157 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18158 (redisplay_internal): Remove parameter `preserve_echo_area',
18159 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18160
18161 * indent.c (Fvertical_motion):
18162 * window.c (window_scroll_pixel_based, Frecenter):
18163 Don't pass `need_y_p' to `move_it_by_lines'.
18164
18165 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18166
18167 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18168 steal a few bits to be more compact.
18169 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18170 Remove unneeded casts.
18171
18172 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18173
18174 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18175
18176 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18177 binding" message (bug#7967).
18178
18179 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18180
18181 Fix more problems found by GCC 4.6.0's static checks.
18182
18183 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18184 Remove unused local var.
18185
18186 * editfns.c (Fmessage_box): Remove unused local var.
18187
18188 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18189 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18190 Omit unused local vars.
18191 * window.c (shrink_windows): Omit unused local var.
18192 * menu.c (digest_single_submenu): Omit unused local var.
18193 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18194 Omit unused local var.
18195
18196 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18197 Don't assume string length fits in int.
18198 (keyremap_step, read_key_sequence): Use size_t for sizes.
18199 (read_key_sequence): Don't check last_real_key_start redundantly.
18200
18201 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18202 instead of alloca (Bug#8344).
18203
18204 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18205 (Fbacktrace_frame): Don't assume nframes fits in int.
18206
18207 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18208
18209 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18210 concerns.
18211
18212 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18213
18214 * cm.c (calccost): Turn while-do into do-while, for clarity.
18215
18216 * keyboard.c (syms_of_keyboard): Use the same style as later
18217 in this function when indexing through an array. This also
18218 works around GCC bug 48267.
18219
18220 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18221
18222 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18223
18224 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18225 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18226
18227 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18228 This avoids undefined behavior on integer overflow, and is a bit
18229 more convenient anyway since it is compared to a size_t variable.
18230
18231 Variadic C functions now count arguments with size_t, not int.
18232 This avoids an unnecessary limitation on 64-bit machines, which
18233 caused (substring ...) to crash on large vectors (Bug#8344).
18234 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18235 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18236 All variadic functions and their callers changed accordingly.
18237 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18238 * data.c (arith_driver, float_arith_driver): Likewise.
18239 * editfns.c (general_insert_function): Likewise.
18240 * eval.c (struct backtrace.nargs, interactive_p)
18241 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18242 (funcall_lambda, mark_backtrace): Likewise.
18243 * fns.c (concat): Likewise.
18244 * frame.c (x_set_frame_parameters): Likewise.
18245 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18246 0 if not found, not -1. All callers changed.
18247
18248 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18249 (stack_copy_size): Now size_t, not int.
18250 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18251
18252 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18253
18254 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18255 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18256 All callers changed.
18257
18258 * lisp.h (multibyte_char_to_unibyte):
18259 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18260 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18261 * character.h (CHAR_TO_BYTE8):
18262 * cmds.c (internal_self_insert):
18263 * editfns.c (general_insert_function):
18264 * keymap.c (push_key_description):
18265 * search.c (Freplace_match):
18266 * xdisp.c (message_dolog, set_message_1): All callers changed.
18267
18268 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18269
18270 * keyboard.c (safe_run_hook_funcall): New function.
18271 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18272 don't set the hook to nil, but remove the offending function instead.
18273 (Qcommand_hook_internal): Remove, unused.
18274 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18275 Vcommand_hook_internal.
18276
18277 * eval.c (enum run_hooks_condition): Remove.
18278 (funcall_nil, funcall_not): New functions.
18279 (run_hook_with_args): Call each function through a `funcall' argument.
18280 Remove `cond' argument, now redundant.
18281 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18282 (Frun_hook_with_args_until_failure): Adjust accordingly.
18283 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18284
18285 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18286
18287 * dispextern.h (string_buffer_position): Remove declaration.
18288
18289 * print.c (strout): Remove parameter `multibyte', unused since
18290 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18291
18292 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18293 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18294 All callers changed.
18295
18296 * w32.c (_wsa_errlist): Use braces for struct initializers.
18297
18298 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18299 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18300 All callers changed.
18301 (string_buffer_position): Likewise. Also, make static (it's never
18302 used outside xdisp.c).
18303 (cursor_row_p): Remove parameter `w', unused since
18304 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18305 (decode_mode_spec): Remove parameter `precision', introduced during
18306 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18307 All callers changed.
18308
18309 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18310
18311 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18312
18313 2011-03-27 Anders Lindgren <andlind@gmail.com>
18314
18315 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18316 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18317 (ns_update_auto_hide_menu_bar): New functions.
18318 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18319 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18320 ns_constrain_all_frames.
18321 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18322 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18323
18324 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18325
18326 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18327
18328 2011-03-27 Glenn Morris <rgm@gnu.org>
18329
18330 * syssignal.h: Replace RETSIGTYPE with void.
18331 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18332 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18333 Replace SIGTYPE with void everywhere.
18334 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18335 * s/template.h (SIGTYPE): Remove commented out definition.
18336
18337 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18338
18339 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18340 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18341
18342 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18343
18344 * w32.c (read_unc_volume): Use parameter `henum', instead of
18345 global variable `wget_enum_handle'.
18346
18347 * keymap.c (describe_vector): Remove parameters `indices' and
18348 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18349 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18350
18351 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18352
18353 * keyboard.c (timer_check): Remove parameter `do_it_now',
18354 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18355 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18356 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18357
18358 * keyboard.c (read_char):
18359 * w32menu.c (w32_menu_display_help):
18360 * xmenu.c (show_help_event, menu_help_callback):
18361 Adjust calls to `show_help_echo'.
18362
18363 * gtkutil.c (xg_maybe_add_timer):
18364 * keyboard.c (readable_events):
18365 * process.c (wait_reading_process_output):
18366 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18367
18368 * insdel.c (adjust_markers_gap_motion):
18369 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18370 (gap_left, gap_right): Don't call it.
18371
18372 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18373
18374 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18375 incurred during fontification.
18376
18377 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18378
18379 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18380 (DEFVAR_PER_BUFFER): Don't pass it.
18381
18382 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18383 (scrolling_window): Don't pass it.
18384
18385 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18386
18387 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18388
18389 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18390 and `suffix'.
18391 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18392 of variables specific to SELinux and computation of `encoded_absname'.
18393
18394 * image.c (XPutPixel): Remove unused variable `height'.
18395
18396 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18397
18398 * unexw32.c (get_section_info): Remove unused variable `section'.
18399
18400 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18401 (system_process_attributes): Remove unused variable `sess'.
18402 (sys_read): Remove unused variable `err'.
18403
18404 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18405 (w32_wnd_proc): Remove unused variable `isdead'.
18406 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18407 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18408 (x_create_tip_frame): Remove unused variable `tem'.
18409
18410 * w32inevt.c (w32_console_read_socket):
18411 Remove unused variable `no_events'.
18412
18413 * w32term.c (x_draw_composite_glyph_string_foreground):
18414 Remove unused variable `width'.
18415
18416 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18417
18418 * w32term.c (x_set_glyph_string_clipping):
18419 Don't pass uninitialized region to CombineRgn.
18420
18421 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18422
18423 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18424 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18425 (Fx_close_connection): Remove unused variable `i'.
18426
18427 * w32font.c (w32font_draw): Return number of glyphs.
18428 (w32font_open_internal): Remove unused variable `i'.
18429 (w32font_driver): Add missing initializer.
18430
18431 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18432 (fill_in_menu): Remove unused variable `items_added'.
18433
18434 * w32term.c (last_mouse_press_frame): Remove static global variable.
18435 (w32_clip_to_row): Remove unused variable `f'.
18436 (x_delete_terminal): Remove unused variable `i'.
18437
18438 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18439 (NOTHING): Remove unused static global variable.
18440 (uniscribe_check_otf): Remove unused variable `table'.
18441 (uniscribe_font_driver): Add missing initializers.
18442
18443 2011-03-23 Julien Danjou <julien@danjou.info>
18444
18445 * term.c (Fsuspend_tty, Fresume_tty):
18446 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18447 * window.c (temp_output_buffer_show):
18448 * insdel.c (signal_before_change):
18449 * frame.c (Fhandle_switch_frame):
18450 * fileio.c (Fdo_auto_save):
18451 * emacs.c (Fkill_emacs):
18452 * editfns.c (save_excursion_restore):
18453 * cmds.c (internal_self_insert):
18454 * callint.c (Fcall_interactively):
18455 * buffer.c (Fkill_all_local_variables):
18456 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18457 Use Frun_hooks.
18458 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18459 unconditionally since it does the check itself.
18460
18461 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18462
18463 Fix more problems found by GCC 4.5.2's static checks.
18464
18465 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18466 the first time through the loop, since we know p0 < p1 then.
18467 This also avoids a gcc -Wstrict-overflow warning.
18468
18469 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18470 leading to a memory leak, possible in functions like
18471 load_charset_map_from_file that can allocate an unbounded number
18472 of objects (Bug#8318).
18473
18474 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18475 that could (at least in theory) be that large.
18476
18477 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18478 This is less likely to overflow, and avoids undefined behavior if
18479 overflow does occur. All callers changed. Use strtoul to scan
18480 for the unsigned long integer.
18481 (pint2hrstr): Simplify and tune code slightly.
18482 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18483
18484 * scroll.c (do_scrolling): Work around GCC bug 48228.
18485 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18486
18487 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18488 This also avoids a warning with gcc -Wstrict-overflow.
18489 (validate_x_resource_name): Simplify count usage.
18490 This also avoids a warning with gcc -Wstrict-overflow.
18491
18492 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18493 fail (Bug#8306).
18494
18495 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18496
18497 * process.c (Fmake_network_process): Use socklen_t, not int,
18498 where POSIX says socklen_t is required in portable programs.
18499 This fixes a porting bug on hosts like 64-bit HP-UX, where
18500 socklen_t is wider than int (Bug#8277).
18501 (Fmake_network_process, server_accept_connection):
18502 (wait_reading_process_output, read_process_output):
18503 Likewise.
18504
18505 * process.c: Rename or move locals to avoid shadowing.
18506 (list_processes_1, Fmake_network_process):
18507 (read_process_output_error_handler, exec_sentinel_error_handler):
18508 Rename or move locals.
18509 (Fmake_network_process): Define label "retry_connect" only if needed.
18510 (Fnetwork_interface_info): Fix pointer signedness.
18511 (process_send_signal): Add cast to avoid pointer signedness problem.
18512 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18513 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18514
18515 Make tparam.h and terminfo.c consistent.
18516 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18517 Include tparam.h instead, since it declares them.
18518 * cm.h (PC): Remove extern decl; tparam.h now does this.
18519 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18520 * terminfo.c: Include tparam.h, to check interfaces.
18521 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18522 (tparam): Adjust signature to match interface in tparam.h;
18523 this removes some undefined behavior. Check that outstring and len
18524 are zero, which they always are with Emacs.
18525 * tparam.h (PC, BC, UP): New extern decls.
18526
18527 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18528 (xftfont_open): Rename locals to avoid shadowing.
18529
18530 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18531 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18532 (OTF_TAG_SYM): Omit macro if not needed.
18533 (ftfont_list): Remove unused local.
18534 (get_adstyle_property, ftfont_pattern_entity):
18535 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18536 Rename locals to avoid shadowing.
18537
18538 * xfont.c (xfont_list_family): Mark var as initialized.
18539
18540 * xml.c (make_dom): Now static.
18541
18542 * composite.c (composition_compute_stop_pos): Rename local to
18543 avoid shadowing.
18544 (composition_reseat_it): Remove unused locals.
18545 (find_automatic_composition, composition_adjust_point): Likewise.
18546 (composition_update_it): Mark var as initialized.
18547 (find_automatic_composition): Mark vars as initialized,
18548 with a FIXME (Bug#8290).
18549
18550 character.h: Rename locals to avoid shadowing.
18551 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18552 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18553 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18554 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18555 to avoid shadowing.
18556
18557 * textprop.c (property_change_between_p): Remove; unused.
18558
18559 * intervals.c (interval_start_pos): Now static.
18560
18561 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18562
18563 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18564 Rename locals to avoid shadowing.
18565
18566 * sound.c (wav_play, au_play, Fplay_sound_internal):
18567 Fix pointer signedness.
18568 (alsa_choose_format): Remove unused local var.
18569 (wav_play): Initialize a variable to 0, to prevent undefined
18570 behavior (Bug#8278).
18571
18572 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18573
18574 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18575
18576 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18577 clobbering (Bug#8298).
18578 * sysdep.c (sys_subshell): Likewise.
18579 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18580
18581 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18582 This should get cleaned up, so that child_setup has the
18583 same signature on all platforms.
18584
18585 * callproc.c (call_process_cleanup): Now static.
18586 (relocate_fd): Rename locals to avoid shadowing.
18587
18588 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18589
18590 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18591 not to be necessary, and produces flickering.
18592
18593 2011-03-20 Glenn Morris <rgm@gnu.org>
18594
18595 * config.in: Remove file.
18596
18597 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18598
18599 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18600 are now in src/globals.h.
18601 (syms_of_minibuf): Remove spurious & from previous change.
18602
18603 2011-03-20 Leo Liu <sdl.web@gmail.com>
18604
18605 * minibuf.c (completing-read-function): New variable.
18606 (completing-read-default): Rename from completing-read.
18607 (completing-read): Call completing-read-function.
18608
18609 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18610
18611 * xfaces.c (Fx_load_color_file):
18612 Read color file from absolute filename (bug#8250).
18613
18614 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18615
18616 * makefile.w32-in: Update dependencies.
18617
18618 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18619
18620 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18621
18622 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18623
18624 Fix more problems found by GCC 4.5.2's static checks.
18625
18626 * process.c (make_serial_process_unwind, send_process_trap):
18627 (sigchld_handler): Now static.
18628
18629 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18630 That way, the code declares only the vars that it needs.
18631 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18632 * s/cygwin.h (PTY_ITERATION): Likewise.
18633 * s/darwin.h (PTY_ITERATION): Likewise.
18634 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18635
18636 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18637 * process.c (allocate_pty): Don't declare stb unless it's needed.
18638
18639 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18640 (CONSTANTLIM): Remove; unused.
18641 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18642 Define only if needed.
18643
18644 * unexelf.c (unexec): Name an expression,
18645 to avoid gcc -Wbad-function-cast warning.
18646 Use a different way to cause a compilation error if anyone uses
18647 n rather than nn, a way that does not involve shadowing.
18648 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18649
18650 * deps.mk (unexalpha.o): Remove; unused.
18651
18652 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18653 * unexec.h: New file.
18654 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18655 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18656 Depend on unexec.h.
18657 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18658 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18659 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18660 Change as necessary to match prototype in unexec.h.
18661
18662 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18663 shadowing.
18664 (back_comment, skip_chars): Mark vars as initialized.
18665
18666 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18667 Rename locals to avoid shadowing.
18668
18669 * lread.c (read1): Rewrite so as not to use empty "else".
18670 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18671
18672 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18673
18674 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18675 warning when compiling print.c.
18676
18677 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18678 instead of using an uninitialized var.
18679 (font_sort_entities): Mark var as initialized.
18680
18681 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18682
18683 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18684 pointers to constants.
18685 (font_parse_fcname): Remove unused vars.
18686 (font_delete_unmatched): Now static.
18687 (font_get_spec): Remove; unused.
18688 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18689 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18690 Rename or move locals to avoid shadowing.
18691
18692 * fns.c (require_nesting_list, require_unwind): Now static.
18693 (Ffillarray): Rename locals to avoid shadowing.
18694
18695 * floatfns.c (domain_error2): Define only if needed.
18696 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18697
18698 * alloc.c (mark_backtrace): Move decl from here ...
18699 * lisp.h: ... to here, so that it can be checked.
18700
18701 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18702 (Fdefvar): Rewrite so as not to use empty "else".
18703 (lisp_indirect_variable): Name an expression,
18704 to avoid gcc -Wbad-function-cast warning.
18705 (Fdefvar): Rename locals to avoid shadowing.
18706
18707 * callint.c (quotify_arg, quotify_args): Now static.
18708 (Fcall_interactively): Rename locals to avoid shadowing.
18709 Use const pointer when appropriate.
18710
18711 * lisp.h (get_system_name, get_operating_system_release):
18712 Move decls here, to check interfaces.
18713 * process.c (get_operating_system_release): Move decl to lisp.h.
18714 * xrdb.c (get_system_name): Likewise.
18715 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18716 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18717 some of which prompt warnings from gcc -Wbad-function-cast.
18718 (Fformat_time_string, Fencode_time, Finsert_char):
18719 (Ftranslate_region_internal, Fformat):
18720 Rename or remove local vars to avoid shadowing.
18721 (Ftranslate_region_internal): Mark var as initialized.
18722
18723 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18724 avoid shadowing.
18725
18726 * lisp.h (eassert): Check that the argument compiles, even if
18727 ENABLE_CHECKING is not defined.
18728
18729 * data.c (Findirect_variable): Name an expression, to avoid
18730 gcc -Wbad-function-cast warning.
18731 (default_value, arithcompare, arith_driver, arith_error): Now static.
18732 (store_symval_forwarding): Rename local to avoid shadowing.
18733 (Fmake_variable_buffer_local, Fmake_local_variable):
18734 Mark variables as initialized.
18735 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18736
18737 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18738 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18739 Rename locals to avoid shadowing.
18740 (mark_stack): Move local variables into the #ifdef region where
18741 they're used.
18742 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18743 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18744 needed otherwise.
18745 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18746 (GC_STRING_CHARS): Remove; not used.
18747 (Fmemory_limit): Cast sbrk's returned value to char *.
18748
18749 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18750 avoids undefined behavior in theory.
18751
18752 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18753
18754 Use functions, not macros, for up- and down-casing (Bug#8254).
18755 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18756 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18757 to use the following functions instead of these macros.
18758 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18759 EMACS_INT, since callers assume the returned value fits in int.
18760 (upcase1): Likewise, for UPCASE_TABLE.
18761 (uppercasep, lowercasep, upcase): New static inline functions.
18762 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18763 the race-condition problem in the old DOWNCASE.
18764
18765 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18766 Rename locals to avoid shadowing.
18767 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18768 (regex_compile, re_search_2, re_match_2_internal):
18769 Remove unused local vars.
18770 (FREE_VAR): Rewrite so as not to use empty "else",
18771 which gcc can warn about.
18772 (regex_compile, re_match_2_internal): Mark locals as initialized.
18773 (RETALLOC_IF): Define only if needed.
18774 (WORDCHAR_P): Likewise. This one is never needed, but is used
18775 only in a comment talking about a compiler bug, so put inside
18776 the #if 0 of that comment.
18777 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18778 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18779 Remove; unused.
18780
18781 * search.c (boyer_moore): Rename locals to avoid shadowing.
18782 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18783 (PREV_CHAR_BOUNDARY): Likewise.
18784
18785 * search.c (simple_search): Remove unused var.
18786
18787 * dired.c (compile_pattern): Move decl from here ...
18788 * lisp.h: ... to here, so that it can be checked.
18789 (struct re_registers): New forward decl.
18790
18791 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18792
18793 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18794 All uses changed.
18795 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18796 Rename locals to avoid shadowing.
18797 (Fvertical_motion): Mark locals as initialized.
18798
18799 * casefiddle.c (casify_object, casify_region): Now static.
18800 (casify_region): Mark local as initialized.
18801
18802 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18803
18804 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18805 New macros, so that the caller can use some names other than
18806 gcpro1, gcpro2, etc.
18807 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18808 of the new macros.
18809 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18810 argument, for consistency with GCPRO2_VAR, etc: it is now the
18811 prefix of the variable, not the variable itself. All uses
18812 changed.
18813 * dired.c (directory_files_internal, file_name_completion):
18814 Rename locals to avoid shadowing.
18815
18816 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18817 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18818 dired.c's scmp function, had undefined behavior.
18819 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18820 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18821 * buffer.h: ... to here, because these macros use current_buffer,
18822 and the new implementation with inline functions needs to have
18823 current_buffer in scope now, rather than later when the macros
18824 are used.
18825 (downcase, upcase1): New static inline functions.
18826 (DOWNCASE, UPCASE1): Reimplement using these functions.
18827 This avoids undefined behavior in expressions like
18828 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18829 from race conditions in accessing the global variables
18830 case_temp1 and case_temp2.
18831 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18832 * lisp.h (case_temp1, case_temp2): Remove their decls.
18833 * character.h (ASCII_CHAR_P): Move from here ...
18834 * lisp.h: ... to here, so that the inline functions mentioned
18835 above can use them.
18836
18837 * dired.c (directory_files_internal_unwind): Now static.
18838
18839 * fileio.c (file_name_as_directory, directory_file_name):
18840 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18841 Now static.
18842 (file_name_as_directory): Use const pointers when appropriate.
18843 (Fexpand_file_name): Likewise. In particular, newdir might
18844 point at constant storage, so make it a const pointer.
18845 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18846 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18847 signedness issues.
18848 (Fset_file_times, Finsert_file_contents, auto_save_error):
18849 Rename locals to avoid shadowing.
18850
18851 * minibuf.c (choose_minibuf_frame_1): Now static.
18852 (Ftry_completion, Fall_completions): Rename or remove locals
18853 to avoid shadowing.
18854
18855 * marker.c (bytepos_to_charpos): Remove; unused.
18856
18857 * lisp.h (verify_bytepos, count_markers): New decls,
18858 so that gcc does not warn that these functions aren't declared.
18859
18860 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18861 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18862 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18863 (copy_text): Remove unused local var.
18864
18865 * filelock.c (within_one_second): Now static.
18866 (lock_file_1): Rename local to avoid shadowing.
18867
18868 * buffer.c (fix_overlays_before): Mark locals as initialized.
18869 (fix_start_end_in_overlays): Likewise. This function should be
18870 simplified by using pointers-to-pointers, but that's a different
18871 matter.
18872 (switch_to_buffer_1): Now static.
18873 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18874 (report_overlay_modification): Rename locals to avoid shadowing.
18875
18876 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18877 Fix pointer signedness issue.
18878 (sys_subshell): Mark local as volatile if checking for lint,
18879 to suppress a gcc -Wclobbered warning that does not seem to be right.
18880 (MAXPATHLEN): Define only if needed.
18881
18882 * process.c (serial_open, serial_configure): Move decls from here ...
18883 * systty.h: ... to here, so that they can be checked.
18884
18885 * fns.c (get_random, seed_random): Move extern decls from here ...
18886 * lisp.h: ... to here, so that they can be checked.
18887
18888 * sysdep.c (reset_io): Now static.
18889 (wait_for_termination_signal): Remove; unused.
18890
18891 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18892 (copy_keymap_item, append_key, push_text_char_description):
18893 Now static.
18894 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18895 (DENSE_TABLE_SIZE): Remove; unused.
18896 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18897 (describe_map_tree):
18898 Rename locals to avoid shadowing.
18899
18900 * keyboard.c: Declare functions static if they are not used elsewhere.
18901 (echo_char, echo_dash, cmd_error, top_level_2):
18902 (poll_for_input, handle_async_input): Now static.
18903 (read_char, kbd_buffer_get_event, make_lispy_position):
18904 (make_lispy_event, make_lispy_movement, apply_modifiers):
18905 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18906 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18907 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18908 (read_key_sequence, read_char): Mark locals as initialized.
18909 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18910
18911 * keyboard.h (make_ctrl_char): New decl.
18912 (mark_kboards): Move decl here ...
18913 * alloc.c (mark_kboards): ... from here.
18914
18915 * lisp.h (force_auto_save_soon): New decl.
18916
18917 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18918 (DEFINE_DUMMY_FUNCTION): New macro.
18919 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18920 Use it.
18921 (main): Add casts to avoid warnings
18922 if GCC considers string literals to be constants.
18923
18924 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18925
18926 * dbusbind.c: Pointer signedness fixes.
18927 (xd_signature, xd_append_arg, xd_initialize):
18928 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18929 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18930 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18931 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18932
18933 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18934 if GCC considers string literals to be constants.
18935 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18936
18937 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18938
18939 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18940 (print_preprocess, print_object): New macro to fix last change.
18941
18942 * print.c (print_preprocess): Don't forget font objects.
18943
18944 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18945
18946 * emacs.c (USAGE3): Doc fixes.
18947
18948 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18949
18950 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18951 structure.
18952
18953 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18954
18955 * lisp.h (VWindow_system, Qfile_name_history):
18956 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18957 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18958 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18959
18960 * w32select.c: Don't #include "keyboard.h".
18961 (run_protected): Add extern declaration for waiting_for_input.
18962
18963 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18964 * w32console.c (detect_input_pending, read_input_pending)
18965 (encode_terminal_code):
18966 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18967 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18968 (w32_system_caret_y, Qfile_name_history):
18969 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18970 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18971 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18972 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18973 * w32proc.c (Qlocal, report_file_error):
18974 * w32term.c (Vwindow_system, updating_frame):
18975 * w32uniscribe.c (initialized, uniscribe_font_driver):
18976 Remove unneeded extern declarations.
18977
18978 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18979
18980 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18981
18982 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18983
18984 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18985 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18986 These macros can no longer be used for assignment.
18987
18988 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18989 Assign struct members directly, instead of using BUF_BEGV etc.
18990 (record_buffer_markers, fetch_buffer_markers): New functions for
18991 recording and fetching special buffer markers.
18992 (set_buffer_internal_1, set_buffer_temp): Use them.
18993
18994 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18995
18996 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18997
18998 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18999 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19000
19001 * xdisp.c (hscroll_window_tree):
19002 (reconsider_clip_changes): Use PT instead of BUF_PT.
19003
19004 2011-03-13 Eli Zaretskii <eliz@gnu.org>
19005
19006 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19007 $(EMACS_ROOT)/lib/intprops.h.
19008
19009 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19010
19011 Fix more problems found by GCC 4.5.2's static checks.
19012
19013 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19014 to unsigned char * to avoid compiler diagnostic.
19015 (xg_free_frame_widgets): Make it clear that a local variable is
19016 needed only if USE_GTK_TOOLTIP.
19017 (gdk_window_get_screen): Make it clear that this macro is needed
19018 only if USE_GTK_TOOLTIP.
19019 (int_gtk_range_get_value): New function, which avoids a diagnostic
19020 from gcc -Wbad-function-cast.
19021 (xg_set_toolkit_scroll_bar_thumb): Use it.
19022 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19023 diagnostic from gcc -Wbad-function-cast.
19024 (get_utf8_string, xg_get_file_with_chooser):
19025 Rename locals to avoid shadowing.
19026 (create_dialog): Move locals to avoid shadowing.
19027
19028 * xgselect.c (xg_select): Remove unused var.
19029
19030 * image.c (four_corners_best): Mark locals as initialized.
19031 (gif_load): Initialize transparent_p to zero (Bug#8238).
19032 Mark another local as initialized.
19033 (my_png_error, my_error_exit): Mark with NO_RETURN.
19034
19035 * image.c (clear_image_cache): Now static.
19036 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
19037 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
19038 (x_edge_detection): Remove unnecessary cast that
19039 gcc -Wbad-function-cast diagnoses.
19040 (gif_load): Fix pointer signedness.
19041 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19042 (jpeg_load, gif_load): Rename locals to avoid shadowing.
19043
19044 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
19045
19046 Improve quality of tests for time stamp overflow.
19047 For example, without this patch (encode-time 0 0 0 1 1
19048 1152921504606846976) returns the obviously-bogus value (-948597
19049 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19050 reports time overflow. See
19051 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
19052 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19053 * editfns.c: Include limits.h and intprops.h.
19054 (TIME_T_MIN, TIME_T_MAX): New macros.
19055 (time_overflow): Move earlier, to before first use.
19056 (hi_time, lo_time): New functions, for an accurate test for
19057 out-of-range times.
19058 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19059 (Fget_internal_run_time): Don't assume time_t fits in int.
19060 (make_time): Use list2 instead of Fcons twice.
19061 (Fdecode_time): More accurate test for out-of-range times.
19062 (check_tm_member): New function.
19063 (Fencode_time): Use it, to test for out-of-range times.
19064 (lisp_time_argument): Don't rely on undefined left-shift and
19065 right-shift behavior when checking for time stamp overflow.
19066
19067 * editfns.c (time_overflow): New function, refactoring common code.
19068 (Fformat_time_string, Fdecode_time, Fencode_time):
19069 (Fcurrent_time_string): Use it.
19070
19071 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19072 * dired.c (make_time): Move to ...
19073 * editfns.c (make_time): ... here.
19074 * systime.h: Note the move.
19075
19076 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19077
19078 * fringe.c (update_window_fringes): Remove unused variables.
19079
19080 * unexmacosx.c (copy_data_segment): Also copy __got section.
19081 (Bug#8223)
19082
19083 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19084
19085 * termcap.c [MSDOS]: Include "msdos.h".
19086 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19087 Constify `char *' arguments and their references according to
19088 prototypes in tparam.h.
19089
19090 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19091
19092 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19093 Adapt all references accordingly.
19094
19095 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19096
19097 2011-03-11 Tom Tromey <tromey@redhat.com>
19098
19099 * buffer.c (syms_of_buffer): Remove obsolete comment.
19100
19101 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19102
19103 * termhooks.h (encode_terminal_code): Declare prototype.
19104
19105 * msdos.c (encode_terminal_code): Don't declare prototype.
19106
19107 * term.c (encode_terminal_code): Now external again, used by
19108 w32console.c and msdos.c.
19109
19110 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19111 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19112
19113 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19114
19115 Fix some minor problems found by GCC 4.5.2's static checks.
19116
19117 * fringe.c (update_window_fringes): Mark locals as initialized
19118 (Bug#8227).
19119 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19120
19121 * alloc.c (mark_fringe_data): Move decl from here ...
19122 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19123 to check its interface.
19124 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19125
19126 * fontset.c (free_realized_fontset): Now static.
19127 (Fset_fontset_font): Rename local to avoid shadowing.
19128 (fontset_font): Mark local as initialized.
19129 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19130
19131 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19132
19133 * xselect.c (x_disown_buffer_selections): Remove; not used.
19134 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19135 (x_own_selection, Fx_disown_selection_internal): Rename locals
19136 to avoid shadowing.
19137 (x_handle_dnd_message): Remove local to avoid shadowing.
19138
19139 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19140 so that the caller can use some name other than gcpro1.
19141 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19142 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19143 (Fx_backspace_delete_keys_p):
19144 Use them to avoid shadowing, and rename vars to avoid shadowing.
19145 (x_decode_color, x_set_name, x_window): Now static.
19146 (Fx_create_frame): Add braces to silence GCC warning.
19147 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19148 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19149 Remove unused locals.
19150 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19151 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19152 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19153 macros.
19154
19155 * xterm.h (x_mouse_leave): New decl.
19156
19157 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19158 Remove unused functions.
19159 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19160 (x_calc_absolute_position): Now static.
19161 (XTread_socket): Don't define label "out" unless it's used.
19162 Don't declare local "event" unless it's used.
19163 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19164 unless they are used.
19165 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19166 (x_fatal_error_signal): Remove; not used.
19167 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19168 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19169 (x_error_catcher, x_connection_closed, x_error_handler):
19170 (x_error_quitter, xembed_send_message, x_iconify_frame):
19171 (my_log_handler): Rename locals to avoid shadowing.
19172 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19173 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19174
19175 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19176 Rename or move locals to avoid shadowing.
19177 (tty_defined_color, merge_face_heights): Now static.
19178 (free_realized_faces_for_fontset): Remove; not used.
19179 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19180 does not deduce is never used uninitialized.
19181 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19182 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19183
19184 * terminal.c (store_terminal_param): Now static.
19185
19186 * xmenu.c (menu_highlight_callback): Now static.
19187 (set_frame_menubar): Remove unused local.
19188 (xmenu_show): Rename parameter to avoid shadowing.
19189 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19190 since they might point to immutable storage.
19191 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19192 since it's unused otherwise.
19193
19194 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19195 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19196 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19197 avoids a gcc -Wuninitialized diagnostic.
19198 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19199 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19200 does not deduce are never used uninitialized.
19201
19202 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19203
19204 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19205 * window.c (window_loop, size_window):
19206 (run_window_configuration_change_hook, enlarge_window): Likewise.
19207
19208 * window.c (display_buffer): Now static.
19209 (size_window): Mark variables that gcc -Wuninitialized
19210 does not deduce are never used uninitialized.
19211 * window.h (check_all_windows): New decl, to forestall
19212 gcc -Wmissing-prototypes diagnostic.
19213 * dispextern.h (bidi_dump_cached_states): Likewise.
19214
19215 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19216 shadowing.
19217 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19218 Include <limits.h>.
19219 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19220 and to avoid gcc -Wuninitialized warning.
19221 (load_charset_map): Mark variables that gcc -Wuninitialized
19222 does not deduce are never used uninitialized.
19223 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19224
19225 * coding.c (coding_set_source, coding_set_destination):
19226 Use "else { /* comment */ }" rather than "else /* comment */;"
19227 for clarity, and to avoid gcc -Wempty-body warning.
19228 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19229 a block, when the outer 'i' will do.
19230 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19231 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19232 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19233 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19234 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19235 Rename locals to avoid shadowing.
19236 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19237 * coding.c (emacs_mule_char, encode_invocation_designation):
19238 Now static, since they're not used elsewhere.
19239 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19240 (decode_coding_object, encode_coding_object, detect_coding_system):
19241 (decode_coding_emacs_mule): Mark variables that gcc
19242 -Wuninitialized does not deduce are never used uninitialized.
19243 (detect_coding_iso_2022): Initialize a local variable that might
19244 be used uninitialized. Leave a FIXME because it's not clear that
19245 this initialization is needed. (Bug#8211)
19246 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19247 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19248 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19249 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19250 Remove unused macros.
19251
19252 * category.c (hash_get_category_set): Remove unused local var.
19253 (copy_category_table): Now static, since it's not used elsewhere.
19254 * character.c (string_count_byte8): Likewise.
19255
19256 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19257 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19258
19259 * chartab.c (copy_sub_char_table): Now static, since it's not used
19260 elsewhere.
19261 (sub_char_table_ref_and_range, char_table_ref_and_range):
19262 Rename locals to avoid shadowing.
19263 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19264
19265 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19266 (BIDI_BOB): Remove unused macro.
19267
19268 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19269 deduce are never used uninitialized.
19270 * term.c (encode_terminal_code): Likewise.
19271
19272 * term.c (encode_terminal_code): Now static. Remove unused local.
19273
19274 * tparam.h: New file.
19275 * term.c, tparam.h: Include it.
19276 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19277 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19278 Move these decls to tparam.h, and make them agree with what
19279 is actually in tparam.c. The previous trick of using incompatible
19280 decls in different modules does not conform to the C standard.
19281 All callers of tparam changed to use tparam's actual API.
19282 * tparam.c (tparam1, tparam, tgoto):
19283 Use const pointers where appropriate.
19284
19285 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19286 * cm.h (struct cm): Likewise.
19287 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19288 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19289 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19290 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19291 (turn_on_face, init_tty): Likewise.
19292 * termchar.h (struct tty_display_info): Likewise.
19293
19294 * term.c (term_mouse_position): Rename local to avoid shadowing.
19295
19296 * alloc.c (mark_ttys): Move decl from here ...
19297 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19298
19299 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19300
19301 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19302
19303 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19304
19305 * search.c (compile_pattern_1): Remove argument regp, unused since
19306 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19307 (compile_pattern): Don't pass it.
19308
19309 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19310
19311 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19312 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19313 for ! HAVE_GTK3.
19314 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19315
19316 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19317
19318 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19319 gdk_window_get_screen, gdk_window_get_geometry,
19320 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19321 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19322 (xg_get_pixbuf_from_pixmap): New function.
19323 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19324 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19325 Call xg_get_pixbuf_from_pixmap instead of
19326 gdk_pixbuf_get_from_drawable.
19327 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19328 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19329 (xg_check_special_colors): Use GtkStyleContext and its functions
19330 for HAVE_GTK3.
19331 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19332 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19333 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19334 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19335 Call gtk_widget_get_preferred_size.
19336 (xg_frame_resized): gdk_window_get_geometry only takes 5
19337 parameters.
19338 (xg_win_to_widget, xg_event_is_for_menubar):
19339 Call gdk_x11_window_lookup_for_display.
19340 (xg_set_widget_bg): New function.
19341 (delete_cb): New function.
19342 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19343 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19344 (xg_set_background_color): Call xg_set_widget_bg.
19345 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19346 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19347 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19348 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19349 if ! HAVE_GTK3.
19350 (update_frame_tool_bar): Call gtk_widget_hide.
19351 (xg_initialize): Use GDK_KEY_g.
19352
19353 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19354 if ! HAVE_GTK3
19355 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19356
19357 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19358 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19359 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19360
19361 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19362
19363 * w32xfns.c (select_palette): Check success of RealizePalette against
19364 GDI_ERROR, not zero.
19365
19366 See ChangeLog.11 for earlier changes.
19367
19368 ;; Local Variables:
19369 ;; coding: utf-8
19370 ;; End:
19371
19372 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19373
19374 This file is part of GNU Emacs.
19375
19376 GNU Emacs is free software: you can redistribute it and/or modify
19377 it under the terms of the GNU General Public License as published by
19378 the Free Software Foundation, either version 3 of the License, or
19379 (at your option) any later version.
19380
19381 GNU Emacs is distributed in the hope that it will be useful,
19382 but WITHOUT ANY WARRANTY; without even the implied warranty of
19383 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19384 GNU General Public License for more details.
19385
19386 You should have received a copy of the GNU General Public License
19387 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.