]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix crash when using Emacs as commit editor for git.
[gnu-emacs] / src / ChangeLog
1 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix crash when using Emacs as commit editor for git (Bug#12697).
4 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5 and it is configured in conf_post.h.
6 (Fcall_process): Don't invoke both setsid and setpgid; the former
7 is enough, if it exists.
8 * callproc.c (Fcall_process, child_setup):
9 * process.c (create_process): Use setpgid.
10 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
11 for the real thing.
12 * dispnew.c (init_display): Initialize the foreground group
13 if we are running a tty display.
14 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
15 * lisp.h (init_foreground_group): New decl.
16 * sysdep.c (inherited_pgroup): New static var.
17 (init_foreground_group, tcsetpgrp_without_stopping)
18 (narrow_foreground_group, widen_foreground_group): New functions.
19 (init_sys_modes): Narrow foreground group.
20 (reset_sys_modes): Widen foreground group.
21
22 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
23
24 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
25
26 2012-10-31 Martin Rudalics <rudalics@gmx.at>
27
28 * minibuf.c (read_minibuf): Restore current buffer since
29 choose_minibuf_frame calling Fset_frame_selected_window may
30 change it (Bug#12766).
31
32 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
33
34 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
35
36 2012-10-30 Kenichi Handa <handa@gnu.org>
37
38 * font.c (Ffont_at): If WINDOW is specified and it is not
39 displaying the current buffer, signal an error.
40
41 2012-10-29 Daniel Colascione <dancol@dancol.org>
42
43 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
44 preparation for fixing bug#12739, move these functions from
45 here...
46
47 * coding.h, coding.c: ... to here, and compile them only when
48 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
49 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
50
51 2012-10-28 Eli Zaretskii <eliz@gnu.org>
52
53 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
54 (timer_loop, getitimer, setitimer): Use it instead of
55 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
56 'clock'.
57 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
58 literal 10000.
59
60 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
61
62 * nsterm.m (NO_APPDEFINED_DATA): New define.
63 (last_appdefined_event_data): New variable
64 (last_appdefined_event): Remove.
65 (ns_select): Initialize t from last_appdefined_event_data instead
66 of [last_appdefined_event data1].
67 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
68 remove last_appdefined_event (Bug#12698).
69
70 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
71
72 * frame.c (x_set_font): Catch internal error.
73
74 2012-10-27 Eli Zaretskii <eliz@gnu.org>
75
76 Avoid overflow in w32 implementation of interval timers.
77 When possible, for ITIMER_PROF count only times the main thread
78 actually executes.
79 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
80 'volatile ULONGLONG' types. All the other data which was
81 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
82 (GetThreadTimes_Proc): New typedef.
83 (w32_get_timer_time): New function, returns a suitable time value
84 for the timer.
85 (timer_loop): Enter critical section when accessing ULONGLONG
86 values of the itimer_data struct, as these accesses are no longer
87 atomic. Call 'w32_get_timer_time' instead of 'clock'.
88 Remove unused variable.
89 (init_timers): Initialize s_pfn_Get_Thread_Times.
90 (start_timer_thread): Don't assign itimer->caller_thread here.
91 (getitimer): Assign itimer->caller_thread here.
92 (setitimer): Always call getitimer to get the value of ticks_now.
93 (sys_spawnve): Avoid compiler warning about format mismatch.
94
95 2012-10-26 Eli Zaretskii <eliz@gnu.org>
96
97 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
98 mouse movement events if the menu bar is active. This avoids
99 producing a busy "hour-glass" cursor by Windows if the mouse
100 pointer is positioned over a tooltip shown for some menu item.
101
102 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
103
104 Don't assume process IDs fit in int.
105 * emacs.c (shut_down_emacs) [!DOS_NT]:
106 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
107 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
108 Use pid_t, not int, to store process IDs, as 'int'
109 is not wide enough on a few platforms (e.g., AIX and IRIX).
110
111 2012-10-23 Kenichi Handa <handa@gnu.org>
112
113 The following change is to make face-font-rescale-alist work
114 correctly for non-ASCII fonts.
115
116 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
117 (font_open_for_lface): Handle Vface_font_rescale_alist.
118
119 2012-10-23 Chong Yidong <cyd@gnu.org>
120
121 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
122
123 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
124
125 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
126 for screen font.
127 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
128
129 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
130 event (Bug#12681).
131
132 2012-10-21 Glenn Morris <rgm@gnu.org>
133
134 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
135
136 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
137
138 Port to OpenBSD 5.1.
139 * frame.c (Fmouse_position, Fmouse_pixel_position):
140 * xdisp.c (produce_stretch_glyph):
141 Declare local vars only when they're needed.
142 This is clearer and avoids a warning on OpenBSD about unused vars.
143 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
144 This is safer, and avoids OpenBSD warnings about unused vars.
145 * keyboard.c (record_menu_key): Remove unnecessary decl.
146 (poll_timer): Define only if POLL_FOR_INPUT is defined.
147 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
148 as our definition clashes with OpenBSD's.
149 * xfaces.c (load_face_colors, check_lface_attrs)
150 (get_lface_attributes_no_remap, get_lface_attributes)
151 (lface_fully_specified_p, x_supports_face_attributes_p)
152 (tty_supports_face_attributes_p, face_fontset, realize_face)
153 (realize_x_face, realize_tty_face):
154 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
155 merely Lisp_Object *. This is more informative and avoids
156 a warning on OpenBSD about accessing beyond an object's size.
157
158 2012-10-20 Chong Yidong <cyd@gnu.org>
159
160 * lread.c (Fload): Doc fix (Bug#12592).
161
162 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
163
164 * font.c (Ffont_at): Fix previous change.
165
166 2012-10-19 Eli Zaretskii <eliz@gnu.org>
167
168 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
169 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
170 for the reasons.
171
172 * alloc.c (NSTATICS): Decrease to 0x800.
173
174 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
175
176 * fns.c (Fnreverse): Include the problem element when signalling an
177 error (bug#12677).
178
179 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
180
181 * nsterm.m (ns_select): Check writefds before call to
182 FD_ISSET (Bug#12668).
183
184 2012-10-18 Daniel Colascione <dancol@dancol.org>
185
186 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
187 (staticpro): If we run out of staticpro slots, die with an
188 informative error instead of just calling emacs_abort.
189
190 2012-10-18 Martin Rudalics <rudalics@gmx.at>
191
192 Fix two flaws reported by Dmitry Antipov.
193 * window.c (Ftemp_output_buffer_show): Remove.
194 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
195 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
196
197 2012-10-17 Eli Zaretskii <eliz@gnu.org>
198
199 * makefile.w32-in ($(BLD)/w32.$(O)):
200 ($(BLD)/vm-limit.$(O)):
201 ($(BLD)/term.$(O)):
202 ($(BLD)/unexw32.$(O)):
203 ($(BLD)/fileio.$(O)):
204 ($(BLD)/dispnew.$(O)): Update dependencies.
205
206 * w32term.h (w32_initialize_display_info, initialize_w32_display):
207 Add prototypes.
208
209 * w32proc.c: Include ctype.h.
210
211 * w32.h (init_environment, check_windows_init_file)
212 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
213 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
214 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
215 (sys_link): Add prototypes.
216
217 * w32.c: Include w32select.h.
218 (sys_access, e_malloc, sys_select): Add prototypes.
219 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
220
221 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
222
223 * unexw32.c: Include lisp.h and w32.h.
224
225 * term.c [WINDOWSNT]: Include w32term.h.
226
227 * process.c [WINDOWSNT]: Add prototype of sys_select.
228
229 * fileio.c [WINDOWSNT]: Include w32.h.
230
231 * dispnew.c [WINDOWSNT]: Include w32.h.
232
233 * cygw32.c (Fcygwin_convert_path_to_windows)
234 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
235 Lisp_Object values. (Bug#12661)
236
237 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
238 to Lisp_Object. (Bug#12661)
239
240 2012-10-17 Kenichi Handa <handa@gnu.org>
241
242 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
243 invalidate.
244
245 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
246
247 * buffer.c (Fkill_buffer): When unchaining the marker,
248 reset its buffer pointer to NULL (Bug#12652).
249
250 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
251
252 Do not verify indirection counters of killed buffers (Bug#12579).
253 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
254 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
255
256 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
257
258 * alloc.c (Fmake_byte_code): Fix typo in comment.
259 * print.c (print_interval): Define as static to match prototype.
260 * indent.c (disptab_matches_widthtab, recompute_width_table):
261 Convert to eassert.
262
263 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
264
265 * editfns.c (get_system_name): Remove.
266 * lisp.h (get_system_name): Remove prototype.
267 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
268 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
269
270 2012-10-15 Daniel Colascione <dancol@dancol.org>
271
272 * dbusbind.c: Add comment explaining reason for previous change.
273
274 2012-10-15 Martin Rudalics <rudalics@gmx.at>
275
276 * window.c (Fwindow_end): Rewrite check whether cached position
277 can be used (Bug#12600).
278 (resize_frame_windows, grow_mini_window, shrink_mini_window):
279 Set windows_or_buffers_changed.
280
281 2012-10-15 Daniel Colascione <dancol@dancol.org>
282
283 * dbusbind.c: Fix cygw32 build break when compiling with dbus
284 enabled by undefining the symbol "interface", which the platform
285 headers define to something incompatible.
286
287 2012-10-14 Daniel Colascione <dancol@dancol.org>
288
289 * image.c (init_tiff_functions, init_imagemagick_functions)
290 (init_svg_functions): Fix cygw32 build break by using these
291 functions only when WINDOWSNT _and_ HAVE_NTGUI.
292
293 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
294
295 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
296
297 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
298
299 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
300
301 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
302
303 * coding.c (detect_coding): Set coding->id before calling
304 this->detector.
305
306 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
307
308 * fileio.c: Formatting fixes.
309
310 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
311
312 Fix some stat-related races.
313 * fileio.c (Fwrite_region): Avoid race condition if a file is
314 removed or renamed by some other process immediately after Emacs
315 writes it but before Emacs stats it. Do not assume that stat (or
316 fstat) succeeds.
317 * image.c (slurp_file): Resolve the file name with fopen + fstat
318 rather than stat + fopen.
319 (pbm_read_file) [0]: Remove unused code with stat race.
320 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
321 Remove ineffective code with stat race.
322
323 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
324
325 * doc.c (get_doc_string): Don't signal an error if the file is missing.
326
327 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
328
329 * nsterm.m (hold_event_q): New static variable.
330 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
331 ! q_event_ptr.
332 (hold_event): New function.
333 (ns_read_socket): If hold_event_q have events, store them and
334 return (Bug#12384).
335 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
336 is zero (Bug#12384).
337
338 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
339
340 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
341
342 2012-10-12 Eli Zaretskii <eliz@gnu.org>
343
344 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
345
346 * fileio.c (check_existing): New function.
347 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
348 instead of calling 'stat', when what's needed is to check whether
349 a file exists. This avoids expensive system calls on MS-Windows.
350 (Bug#12587)
351
352 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
353
354 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
355 determine whether a file exists and is not a directory.
356
357 * lisp.h (check_existing): Add prototype.
358
359 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
360
361 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
362
363 2012-10-12 Glenn Morris <rgm@gnu.org>
364
365 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
366
367 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
368
369 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
370
371 * eval.c (Fautoload): Remember previous autoload status in load-history.
372
373 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
374
375 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
376 * lread.c (load_each_byte, new_backquote_flag, readchar)
377 (read_filtered_event, lisp_file_lexically_bound_p)
378 (safe_to_load_version, Fload, complete_filename_p, openp)
379 (build_load_history, readevalloop, read_escape, read1)
380 (string_to_number, read_vector, read_list):
381 * macros.c (Fstart_kbd_macro):
382 * marker.c (CONSIDER):
383 * menu.c (parse_single_submenu, digest_single_submenu)
384 (find_and_return_menu_selection, Fx_popup_menu):
385 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
386 (Ftry_completion):
387 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
388 (ns_menu_show):
389 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
390 (xmenu_show, xdialog_show):
391 Use bool for booleans.
392 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
393 as it's not a predicate. All uses changed. Omit unnecessary
394 buffer termination.
395
396 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
397
398 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
399 (save_excursion_restore): Do not restore mark if it was not saved.
400
401 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
402
403 * marker.c (cached_modiff): EMACS_INT, not int.
404
405 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
406 instead of having a wrong decl.
407 * nsmenu.m (waiting_for_input): Remove wrong decl.
408
409 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
410
411 keyboard.c, keymap.c: Use bool for booleans.
412 * dispnew.c (sit_for): Distinguish between 3-way display_option
413 and boolean do_display.
414 * keyboard.c (single_kboard, this_command_key_count_reset)
415 (waiting_for_input, echoing, immediate_quit, input_pending)
416 (interrupt_input, interrupts_deferred, pop_kboard)
417 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
418 (command_loop_1, adjust_point_for_property)
419 (safe_run_hooks_error, input_polling_used, read_char):
420 (help_char_p, readable_events, kbd_buffer_events_waiting)
421 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
422 (lucid_event_type_list_p, get_input_pending):
423 (gobble_input, menu_separator_name_p, menu_bar_item)
424 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
425 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
426 (keyremap_step, test_undefined, read_key_sequence)
427 (detect_input_pending, detect_input_pending_ignore_squeezables)
428 (detect_input_pending_run_timers, requeued_events_pending_p)
429 (quit_throw_to_read_char, Fset_input_interrupt_mode):
430 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
431 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
432 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
433 (accessible_keymaps_1, Fkey_description, push_key_description):
434 (shadow_lookup, struct where_is_internal_data)
435 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
436 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
437 (describe_map, describe_vector):
438 * menu.c (single_menu_item):
439 * nsmenu.m (ns_update_menubar):
440 * process.c (wait_reading_process_output):
441 * search.c (scan_buffer, scan_newline):
442 Use bool for boolean.
443 * keyboard.c (timers_run, swallow_events)
444 (detect_input_pending_run_timers):
445 * process.c (wait_reading_process_output):
446 Use unsigned for counter where wraparound-on-overflow is desired,
447 since unsigned is guaranteed to have that behavior and signed is not.
448 (read_char): Use ptrdiff_t for string length.
449 (get_input_pending): Remove first argument, since it was always
450 the same pointer-to-int (now pointer-to-boolean) &input_pending,
451 and behave as if it had that value. Return new value of
452 input_pending. All callers changed.
453 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
454 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
455 a string length.
456 * keymap.c (push_key_description): Omit last arg, which was always 1.
457 All callers changed.
458
459 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
460
461 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
462
463 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
464 ($(BLD)/term.$(O)): Update dependencies.
465
466 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
467
468 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
469 * lisp.h (enum pvec_type): Adjust comments and omit explicit
470 initializer for PVEC_NORMAL_VECTOR.
471
472 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
473
474 Clean out old termopts cruft.
475 * termopts.h (flow_control, meta_key): Remove unused decls.
476 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
477 Don't include termopts.h.
478
479 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
480
481 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
482
483 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
484
485 * commands.h (immediate_quit): Remove duplicate decl.
486
487 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
488
489 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
490 caching.
491 (nsfont_open): Remove setting of Vfonts_in_cache.
492 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
493
494 2012-10-09 Eli Zaretskii <eliz@gnu.org>
495
496 * w32fns.c (w32_last_error): Change the return value to DWORD, to
497 match what GetLastError returns. Explain why the function is
498 needed.
499
500 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
501 'is_tooltip_frame', to avoid confusion with its global namesake.
502
503 2012-10-08 Daniel Colascione <dancol@dancol.org>
504
505 * xdisp.c (start_hourglass): Call w32_note_current_window when
506 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
507 build that caused Emacs to display the hourglass cursor forever.
508
509 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
510 which is broken under remote desktop, calculate the number of
511 colors available for a display based on the display's number of
512 planes and number of bits per pixel per plane. (bug#10397).
513
514 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
515
516 * nsfont.m (Vfonts_in_cache): New variable.
517 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
518 are used. Add cached fonts to Vfonts_in_cache.
519 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
520
521 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
522
523 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
524 in nt/config.nt.
525 (FONT_H): Define after FRAME_H.
526 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
527 Update dependencies.
528
529 * w32term.c: Remove leftover declaration of keyboard_codepage.
530
531 2012-10-08 Eli Zaretskii <eliz@gnu.org>
532
533 * makefile.w32-in (FONT_H): Add $(FRAME_H).
534 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
535 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
536 (GLOBAL_SOURCES): Add cygw32.c.
537 ($(BLD)/unexw32.$(O)):
538 ($(BLD)/w32.$(O)):
539 ($(BLD)/w32console.$(O)):
540 ($(BLD)/w32fns.$(O)):
541 ($(BLD)/w32heap.$(O)):
542 ($(BLD)/w32menu.$(O)):
543 ($(BLD)/w32proc.$(O)): Add w32common.h.
544
545 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
546 'const char *'.
547 (x_to_w32_color): Don't modify the argument, modify a copy instead.
548
549 2012-10-08 Daniel Colascione <dancol@dancol.org>
550
551 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
552 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
553 accidental message numbering hole. Change other messages to
554 match.
555
556 * w32select.h (HAVE_W32SELECT): Remove.
557
558 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
559 w32common.h instead of w32heap.h.
560
561 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
562 (get_allocation_unit, get_processor_type, get_w32_major_version)
563 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
564 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
565 (OS_NT, os_subtype, cache_system_info): Move declarations to
566 w32common.
567
568 * w32heap.c: Include w32common.h.
569 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
570 (w32_minor_version, w32_build_number, w32_subtype):
571 Remove duplicate definitions.
572
573 * w32fns.c: Include w32common.h; include w32heap.h only in
574 WINDOWSNT.
575
576 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
577 Use `report_file_error' instead of `error' in order to better
578 inform users of what went wrong. Increase NTGUI_UNICODE file
579 dialog box file name length to 32k, the maximum allowed by the NT
580 kernel.
581
582 * w32common.h: New file.
583 (ROUND_UP, ROUND_DOWN, get_page_size)
584 (get_allocation_unit, get_processor_type, get_w32_major_version)
585 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
586 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
587 (OS_NT, os_subtype, cache_system_info): Move here.
588
589 * unexw32.c, unexcw.c: Include w32common.h.
590
591 * emacs.c (main): Use (defined (WINDOWSNT) || defined
592 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
593 to call syms_of_w32select.
594
595 * cygw32.h: Remove obsolete EXFUN declarations.
596
597 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
598
599 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
600 of w32inevt.o from SOME_MACHINE_OBJECTS.
601
602 2012-10-08 Daniel Colascione <dancol@dancol.org>
603
604 * image.c: Permanent fix for JPEG compilation issue --- limit
605 jpeglib `boolean' redefinition to Cygwin builds.
606
607 2012-10-08 Eli Zaretskii <eliz@gnu.org>
608
609 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
610
611 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
612 Cygwin.
613
614 2012-10-08 Daniel Colascione <dancol@dancol.org>
615
616 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
617 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
618 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
619 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
620 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
621 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
622 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
623 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
624 now a supported configuration.
625
626 * Makefile.in: consolidate image variables into LIBIMAGE; add
627 W32_OBJ and W32_LIBS. Compile new files.
628
629 * conf_post.h:
630 (_DebPrint) declare tracing facility for W32 debugging. We need
631 to unify tracing later.
632
633 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
634 unconditional use of W32 Unicode functions. Cygwin runs only on
635 100% Unicode operating systems.
636
637 * cygw32.c: New file. Define Cygwin-specific facilities.
638 (Fcygwin_convert_path_to_windows)
639 (Fcygwin_convert_path_from_windows): New user functions for
640 accessing Cygwin path-munging routines.
641
642 * cygw32.h: New file.
643 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
644 UTF-16LE strings temporarily inside non-Lisp-visible string
645 objects.
646
647 (w32_strerror): Just what it says on the tin.
648
649 * emacs.c: Make the NS fork-then-exec code for daemon-launching
650 also run for Cygwin; both systems have the same problem with using
651 GUI facilities in a forked child. Also call syms_of_cygw32,
652 syms_of_w32select in correct places.
653
654 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
655 needs fork-then-exec for daemon launching.
656
657 * font.h: Include frame.h.
658
659 * image.c: Use the image library cache machinery only when we're
660 compiling for native WINDOWSNT; Cygwin can use shared libraries
661 like any other Unixlike system.
662
663 * keyboard.c: Clarify a comment regarding the input loop.
664
665 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
666 functions directly instead of trying to detect at runtime that our
667 host operating system supports them. We make this change for two
668 reasons: Cygwin lacks support for the multibyte character
669 conversion functions used by the legacy menu code, and Cygwin
670 never needs to rely on non-Unicode APIs.
671
672 * unexw32.c (hinst): Declare extern.
673
674 * w32.c: Change header order;
675 (w32_strerror): Move to w32fns.c because we need it for
676 non-WINDOWSNT builds.
677
678 * w32.h: Add #error macro to make sure we don't include w32.h for
679 Cygwin builds. Remove w32select declarations.
680
681 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
682 w32fns.c. w32console.c is WINDOWSNT-only.
683
684 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
685 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
686 POSIXy alternative.
687 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
688 (w32_major_version, w32_minor_version, w32_build_number)
689 (os_subtype, sound_type): Define here
690 (w32_defined_color): Make color parameter const for consistency
691 with other _defined_color functions.
692 (w32_createwindow): Unconditionally call w32_init_class instead of
693 doing so only when hprevinst is non-NULL. Plumbing hprevinst
694 through the code is complex and unnecessary because class
695 registration is practically free.
696 (w32_name_of_message): New EMACSDEBUG-only function.
697 (Fset_message_beep): Move here
698 (Fx_open_connection): Require that the display name for Windows be
699 "w32" for consistency, emacsclient disambiguation, and maybe, one
700 day, multi-window-system support.
701 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
702 Cygwin files for W32 GUI facilities, since these clearly don't
703 expect Cygwin names.
704 (_DebPrint): Define.
705 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
706 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
707 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
708 (w32_last_error): Remove.
709
710 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
711
712 * w32heap.c (syspage_mask): Declare here.
713 (cache_system_info): Remove.
714
715 * w32inevt.c (faked_key): Define globally, not statically.
716 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
717 (w32_console_toggle_lock_key): Move to w32fns.c.
718
719 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
720
721 * w32proc.c (_DebPrint): Move to w32fns.c.
722 * w32select.c: Include string.h, stdio.h for Cygwin.
723 * w32select.h: New File.
724
725 * w32term.c: Include io.h for non-CYGWIN builds; needed for
726 get_osfhandle.
727 (w32_message_fd): New variable. Under Cygwin, holds the file
728 descriptor the system used to tell us about pending thread
729 messages.
730
731 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
732 that prevented compilation under non-WINDOWSNT systems.
733
734 (w32_initialize): Open /dev/windows and assign it to
735 w32_message_fd. Provide w32 feature.
736
737 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
738 (WM_EMACS_INPUT_READY): add.
739 (prepend_msg, w32_message_fd): Declare globally.
740
741 * w32xfns.c:
742 (keyboard_handle): Use only when WINDOWSNT.
743 (notify_msg_ready): New function. Posts a message to the main
744 thread's message queue under CYGWIN, which wakes up the main
745 thread from select(2) by making the /dev/windows file descriptor
746 ready. Under WINDOWSNT, it sets an event the same way the old
747 code did.
748
749 (post, prepend_msg): Actually call notify_msg_ready instead of
750 setting the input event directly.
751
752 2012-10-07 Eli Zaretskii <eliz@gnu.org>
753
754 * ralloc.c (relinquish): If a heap is ready to be relinquished,
755 but it still has blocs in it, don't return it to the system,
756 instead of aborting. (Bug#12402)
757
758 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
759
760 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
761
762 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
763 MAC_OS_X_VERSION_10_6.
764 (syms_of_nsterm): Remove comment about Panther and above for
765 ns-antialias-text.
766 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
767 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
768 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
769
770 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
771 MAC_OS_X_VERSION_10_4.
772
773 * nsmenu.m (fillWithWidgetValue:): Remove code for <
774 MAC_OS_X_VERSION_10_2.
775
776 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
777
778 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
779 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
780
781 * nsterm.m (ns_in_resize): Remove (Bug#12479).
782 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
783 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
784 Remove ns_in_resize check.
785 (ns_clear_frame_area): Remove resize handle code.
786
787 * nsfns.m (ns_in_resize): Remove.
788 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
789 Remove ns_in_resize check.
790
791 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
792
793 Improve sys_siglist detection.
794 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
795 defined as a macro, as is done in Solaris.
796 (sys_siglist_entries): New macro.
797 (save_strsignal): Use it.
798 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
799 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
800
801 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
802
803 * nsfns.m (Fx_create_frame): Call x_default_parameter with
804 fullscreen/Fullscreen.
805
806 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
807 tobar_height is new.
808
809 * nsterm.m (x_make_frame_visible): Check for fullscreen.
810 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
811 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
812 (windowDidResize:): Check for correct window if old style fullscreen.
813 Capitalize word in comment. Remove incorrect comment.
814 (initFrameFromEmacs:): tbar_height renamed tibar_height.
815 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
816 error in drawing background.
817 (toggleFullScreen:): Remove comment. Rearrange calls.
818 Set toolbar values to zero, save old height in tobar_height.
819 Restore tool bar height when leaving fullscreen.
820 (canBecomeMainWindow): New function.
821
822 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
823
824 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
825
826 2012-10-05 Eli Zaretskii <eliz@gnu.org>
827
828 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
829
830 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
831 that time stamps of directories could also be changed.
832 Don't request the too broad GENERIC_WRITE, only the more restrictive
833 FILE_WRITE_ATTRIBUTES access rights.
834
835 * fileio.c (Fset_file_times): Special-case ignoring errors for
836 directories only on MSDOS, not on MS-Windows.
837
838 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
839
840 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
841
842 2012-10-04 Eli Zaretskii <eliz@gnu.org>
843
844 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
845 see whether CreateFile failed.
846
847 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
848
849 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
850 to avoid similar races.
851 * keyboard.c (pending_signals): Now bool, not int.
852
853 Port timers to OpenBSD, plus check for timer failures.
854 OpenBSD problem reported by Han Boetes.
855 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
856 and/or setitimer.
857 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
858 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
859 like OpenBSD, which has timer_settime but does not declare it.
860 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
861 whether to use itimerspec-related primitives. All uses of
862 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
863
864 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
865
866 * profiler.c (handle_profiler_signal): Fix a malloc race
867 that caused Emacs to hang on Fedora 17 when profiling Lisp.
868
869 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
870
871 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
872
873 2012-10-02 Eli Zaretskii <eliz@gnu.org>
874
875 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
876 consistent with the change in return value of 'safe_strsignal'.
877
878 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
879
880 Prefer plain 'static' to 'static inline' (Bug#12541).
881 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
882 (bidi_set_sor_type, bidi_push_embedding_level)
883 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
884 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
885 (bidi_cache_search, bidi_cache_ensure_space)
886 (bidi_cache_iterator_state, bidi_cache_find)
887 (bidi_peek_at_next_level, bidi_set_paragraph_end)
888 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
889 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
890 Now 'static', not 'static inline'.
891
892 Count overruns when profiling; change units to ns.
893 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
894 Give extra weight to samples after overruns, to attempt to count
895 the time more accurately.
896 (setup_cpu_timer): Change sampling interval units from ms to ns, since
897 the underlying primitives nominally do ns.
898 (Fprofiler_cpu_start): Document the change. Mention that
899 the sampling intervals are only approximate.
900
901 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
902
903 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
904
905 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
906 case for the special 0 coding-system.
907
908 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
909 (Fmake_overlay): Remove redundant tests.
910 (fix_start_end_in_overlays): Remove redundant recentering.
911
912 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
913
914 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
915 Update dependencies.
916
917 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
918
919 Fix a malloc race condition involving strsignal.
920 A signal can arrive in the middle of a malloc, and Emacs's signal
921 handler can invoke strsignal, which can invoke malloc, which is
922 not portable. This race condition bug makes Emacs hang on GNU/Linux.
923 Fix it by altering the signal handler so that it does not invoke
924 strsignal.
925 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
926 * process.c (status_message): Use const pointer, in case strsignal
927 is #defined to safe_strsignal.
928 * sysdep.c (sys_siglist, init_signals): Always define and
929 initialize a substitute sys_siglist if the system does not define
930 one, even if HAVE_STRSIGNAL.
931 (safe_strsignal): Rename from strsignal. Always define,
932 using sys_siglist. Return a const pointer.
933 * syssignal.h (safe_strsignal): New decl.
934 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
935
936 2012-10-01 Eli Zaretskii <eliz@gnu.org>
937
938 * w32proc.c (timer_loop): Fix code that waits for timer
939 expiration, to avoid high CPU usage.
940
941 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
942
943 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
944 (sweep_weak_table): Remove redundant prototypes.
945
946 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
947
948 * emacs.c: Move the inclusion of TERM_HEADER after including
949 windows.h on WINDOWSNT. This avoids compilation problems with
950 MSVC.
951
952 2012-10-01 Eli Zaretskii <eliz@gnu.org>
953
954 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
955 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
956 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
957 as the previous version used 'void *'.
958
959 * ralloc.c (ROUNDUP): Fix last change.
960 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
961 'size_t'.
962
963 * w32proc.c <disable_itimers>: New static flag.
964 (init_timers): Initialize it to zero, after creating the critical
965 sections used by the timer threads.
966 (term_timers): Set to 1 before deleting the critical sections.
967 (getitimer, setitimer): If disable_itimers is non-zero, return an
968 error indication without doing anything. Reported by Fabrice
969 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
970 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
971 return results.
972 [!HAVE_SETITIMER]: Behave as the previous version that didn't
973 support timers.
974
975 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
976 term_ntproc after all the other bookkeeping, to get timers working
977 as long as possible.
978
979 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
980
981 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
982 Suggested by Juri Linkov in
983 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
984
985 Prefer plain 'static' to 'static inline' (Bug#12541).
986 With static functions, modern compilers inline pretty well by
987 themselves; advice from programmers often hurts as much as it helps.
988 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
989 this change shrinks the text size of the Emacs executable by 1.1%
990 without affecting CPU significantly in my benchmark.
991 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
992 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
993 (mark_maybe_object, mark_maybe_pointer, bounded_number):
994 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
995 (bset_auto_fill_function, bset_auto_save_file_format)
996 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
997 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
998 (bset_cache_long_line_scans, bset_case_fold_search)
999 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1000 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1001 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1002 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1003 (bset_header_line_format, bset_indicate_buffer_boundaries)
1004 (bset_indicate_empty_lines, bset_invisibility_spec)
1005 (bset_left_fringe_width, bset_major_mode, bset_mark)
1006 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1007 (bset_name, bset_overwrite_mode, bset_pt_marker)
1008 (bset_right_fringe_width, bset_save_length)
1009 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1010 (bset_scroll_up_aggressively, bset_selective_display)
1011 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1012 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1013 (set_buffer_overlays_after):
1014 * category.c (bset_category_table):
1015 * charset.c (read_hex):
1016 * coding.c (produce_composition, produce_charset)
1017 (handle_composition_annotation, handle_charset_annotation)
1018 (char_encodable_p):
1019 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1020 (assign_row, set_frame_matrix_frame, make_current)
1021 (add_row_entry):
1022 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1023 * fns.c (maybe_resize_hash_table):
1024 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1025 * gmalloc.c (register_heapinfo):
1026 * image.c (lookup_image_type):
1027 * intervals.c (set_interval_object, set_interval_left)
1028 (set_interval_right, copy_interval_parent, rotate_right)
1029 (rotate_left, balance_possible_root_interval):
1030 * keyboard.c (kset_echo_string, kset_kbd_queue)
1031 (kset_keyboard_translate_table, kset_last_prefix_arg)
1032 (kset_last_repeatable_command, kset_local_function_key_map)
1033 (kset_overriding_terminal_local_map, kset_real_last_command)
1034 (kset_system_key_syms, clear_event, set_prop):
1035 * lread.c (digit_to_number):
1036 * marker.c (attach_marker, live_buffer, set_marker_internal):
1037 * nsterm.m (ns_compute_glyph_string_overhangs):
1038 * process.c (pset_buffer, pset_command)
1039 (pset_decode_coding_system, pset_decoding_buf)
1040 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1041 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1042 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1043 * syntax.c (bset_syntax_table, dec_bytepos):
1044 * terminal.c (tset_param_alist):
1045 * textprop.c (interval_has_some_properties)
1046 (interval_has_some_properties_list):
1047 * window.c (wset_combination_limit, wset_dedicated)
1048 (wset_display_table, wset_hchild, wset_left_fringe_width)
1049 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1050 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1051 (wset_right_fringe_width, wset_right_margin_cols)
1052 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1053 (wset_vertical_scroll_bar_type, wset_window_parameters):
1054 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1055 (wset_column_number_displayed, wset_region_showing)
1056 (window_box_edges, run_window_scroll_functions)
1057 (append_glyph_string_lists, prepend_glyph_string_lists)
1058 (append_glyph_string, set_glyph_string_background_width)
1059 (append_glyph, append_composite_glyph)
1060 (take_vertical_position_into_account):
1061 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1062 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1063 (lface_hash, lface_same_font_attributes_p, lookup_face):
1064 * xml.c (libxml2_loaded_p):
1065 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1066 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1067 Now 'static', not 'static inline'.
1068
1069 * bidi.c: Tune.
1070 (bidi_copy_it): Do the whole copy with a single memcpy.
1071 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1072
1073 Revert the FOLLOW-SYMLINKS change for file-attributes.
1074 Doing it right would require several changes to Tramp, and there's
1075 not enough time to get that tested before the freeze today.
1076 * dired.c (directory_files_internal, Ffile_attributes):
1077 Undo last change.
1078
1079 * frame.c (x_report_frame_params): Port better to wider ints.
1080 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1081 or that pointers can be printed in 15 decimal digits.
1082 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1083
1084 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1085
1086 Support x64 build on MS-Windows.
1087 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1088 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1089 compatibility with x64.
1090 (x_get_focus_frame): Add prototype.
1091
1092 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1093 defining an XRectangle structure.
1094
1095 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1096 arithmetics for compatibility with x64.
1097
1098 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1099 compatibility with x64.
1100
1101 * w32heap.h: Adjust prototypes and declarations.
1102
1103 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1104 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1105 DWORD, long, and unsigned long, for compatibility with x64.
1106 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1107 (sbrk): Argument is now of type ptrdiff_t.
1108
1109 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1110 less than 0x0500.
1111 (w32_msg_pump): Use WPARAM type for 'result'.
1112
1113 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1114 architecture.
1115 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1116 compatibility with x64.
1117
1118 * vm-limit.c (lim_data): Now size_t.
1119 (check_memory_limits): Adjust prototypes of real_morecore and
1120 __morecore to receive argument of type ptrdiff_t. Use size_t for
1121 five_percent and data_size.
1122
1123 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1124 variables, for compatibility with x64.
1125 (rva_to_section, offset_to_section, relocate_offset)
1126 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1127 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1128 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1129 for compatibility with x64.
1130
1131 * sysdep.c (STDERR_FILENO): Define if not already defined.
1132
1133 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1134 (__morecore): Argument type is now ptrdiff_t.
1135 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1136 (relinquish): Use ptrdiff_t type for 'excess'.
1137 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1138
1139 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1140 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1141 instead of a literal number.
1142
1143 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1144 (min): Define only if not already defined.
1145
1146 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1147 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1148 hosts.
1149
1150 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1151 'bitmaps' is a pointer.
1152
1153 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1154
1155 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1156
1157 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1158
1159 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1160 * dired.c (directory_files_internal, Ffile_attributes):
1161 New arg follow_symlinks. All uses changed.
1162
1163 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1164
1165 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1166
1167 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1168
1169 Support atimers and CPU profiler via profile.c on MS-Windows.
1170 * w32proc.c (sig_mask, crit_sig): New static variables.
1171 (sys_signal): Support SIGALRM and SIGPROF.
1172 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1173 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1174 sigfillset, and sigprocmask are no longer no-ops.
1175 (sigismember): New function.
1176 (struct itimer_data): New definition.
1177 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1178 (crit_prof): New static variables.
1179 (MAX_SINGLE_SLEEP): New definition.
1180 (timer_loop, stop_timer_thread, term_timers, init_timers)
1181 (start_timer_thread, getitimer, setitimer): New functions.
1182 (alarm): No longer a no-op, calls setitimer.
1183
1184 * w32.c (term_ntproc): Call term_timers.
1185 (init_ntproc): Make sure all signals are unblocked at startup, to
1186 erase any traces of dumping. Call init_timers.
1187
1188 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1189 Windows-specific code to display the hourglass mouse pointer is no
1190 longer used.
1191 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1192 to hourglass timer expiration.
1193 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1194 Remove, no longer used.
1195 (w32_note_current_window, show_hourglass, hide_hourglass):
1196 New functions, in support of hourglass cursor display similar to other
1197 window systems.
1198 (syms_of_w32fns): Don't initialize hourglass_timer.
1199
1200 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1201 WINDOWSNT as well.
1202 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1203
1204 * w32.h (init_timers, term_timers): Add prototypes.
1205
1206 2012-09-30 Kenichi Handa <handa@gnu.org>
1207
1208 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1209 to the buffer relocation which may be caused by ccl_driver.
1210
1211 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1212
1213 * xfns.c (Fx_file_dialog): Update comment.
1214
1215 * w32fns.c (Fx_file_dialog): Update comment.
1216
1217 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1218 Initialize panel name field if OSX >= 10.6.
1219
1220 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1221
1222 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1223
1224 * nsterm.m (NEW_STYLE_FS): New define.
1225 (ns_fullscreen_hook, windowWillEnterFullScreen)
1226 (windowDidEnterFullScreen, windowWillExitFullScreen)
1227 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1228 (setFSValue): New functions.
1229 (EmacsFSWindow): New implementation.
1230 (canBecomeKeyWindow): New function for EmacsFSWindow.
1231 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1232 (dealloc): Release nonfs_window if in fullscreen.
1233 (updateFrameSize:): Call windowDidMove to update top/left.
1234 (windowWillResize:toSize:): Check if frame is still maximized.
1235 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1236 next_maximized, maximized_width, maximized_height and nonfs_window.
1237 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1238 tbar_height.
1239 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1240 fullscreen. Set maximized_width/height. Act on next_maximized.
1241
1242 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1243 (EmacsView): Add variables for fullscreen.
1244 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1245 (EmacsFSWindow): New interface for fullscreen.
1246
1247 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1248
1249 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1250
1251 2012-09-30 Chong Yidong <cyd@gnu.org>
1252
1253 * fns.c (Frandom): Doc fix.
1254
1255 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1256
1257 * window.c (Vwindow_combination_limit): New default value.
1258 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1259
1260 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1261
1262 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1263 Suggested by Eli Zaretskii in
1264 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1265
1266 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1267
1268 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1269 HAVE_TIMER_SETTIME is defined.
1270
1271 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1272
1273 Profiler improvements: more-accurate timers, overflow checks.
1274 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1275 signal.h, setjmp.h. Include systime.h instead.
1276 (saturated_add): New function.
1277 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1278 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1279 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1280 New static vars.
1281 (enum profiler_cpu_running): New enum.
1282 (profiler_cpu_running): Now of that enum type, not bool.
1283 All uses changed to store the new value.
1284 (handle_profiler_signal): Rename from sigprof_handler_1,
1285 for consistency with other handlers. Do not check whether
1286 cpu_log is a hash-table if garbage collecting, since it
1287 doesn't matter in that case.
1288 (deliver_profiler_signal): Rename from sigprof_handler,
1289 for consistency with other handlers.
1290 (setup_cpu_timer): New function, with much of what used to be in
1291 Fprofiler_cpu_start. Check for out-of-range argument.
1292 Prefer timer_settime if available, and prefer
1293 thread cputime clocks, then process cputime clocks, then
1294 monotonic clocks, to the old realtime clock. Use make_timeval
1295 to round more-correctly when falling back to setitimer.
1296 (Fprofiler_cpu_start): Use it.
1297 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1298 Don't assume that passing NULL as the 2nd argument of setitimer
1299 is the same as passing a pointer to all-zero storage.
1300 Ignore SIGPROF afterwards.
1301 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1302 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1303 non-fatal signal handlers. Ignore SIGPROF on startup.
1304 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1305 in profiler.c, since sysdep.c now uses it.
1306
1307 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1308 Suggested by Eli Zaretskii in
1309 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1310
1311 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1312
1313 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1314
1315 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1316
1317 * lisp.h (struct backtrace): Remove indirection for `function' field.
1318 * xdisp.c (redisplay_internal):
1319 * profiler.c (record_backtrace, sigprof_handler_1):
1320 * alloc.c (Fgarbage_collect):
1321 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1322 (Fbacktrace_frame): Adjust accordingly.
1323
1324 2012-09-28 Glenn Morris <rgm@gnu.org>
1325
1326 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1327 (Frun_hook_with_args_until_failure): Doc fixes.
1328
1329 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1330
1331 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1332 Qautomatic_redisplay and change the symbol name. All users changed.
1333
1334 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1335
1336 * profiler.c (sigprof_handler): Fix race condition.
1337
1338 2012-09-28 Glenn Morris <rgm@gnu.org>
1339
1340 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1341
1342 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1343
1344 Check more robustly for timer_settime.
1345 * Makefile.in (LIB_TIMER_TIME): New macro.
1346 (LIBES): Add it.
1347 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1348 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1349 call timer_settime.
1350
1351 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1352
1353 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1354
1355 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1356
1357 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1358
1359 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1360
1361 * character.h (MAYBE_UNIFY_CHAR): Remove.
1362 * charset.c, charset.h (maybe_unify_char): Now static.
1363 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1364 Since this stuff is now private to charset.c, there's no need for
1365 a public macro and no need to inline by hand.
1366
1367 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1368 Stefan Monnier <monnier@iro.umontreal.ca>
1369 Juanma Barranquero <lekktu@gmail.com>
1370
1371 * profiler.c: New file.
1372 * Makefile.in (base_obj): Add profiler.o.
1373 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1374 ($(BLD)/profiler.$(O)): New target.
1375 * emacs.c (main): Call syms_of_profiler.
1376 * alloc.c (Qautomatic_gc): New constant.
1377 (MALLOC_PROBE): New macro.
1378 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1379 (total_bytes_of_live_objects): New function.
1380 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1381 Call malloc_probe for the memory profiler.
1382 (syms_of_alloc): Define Qautomatic_gc.
1383 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1384 race condition.
1385 (struct backtrace): Move definition...
1386 * lisp.h (struct backtrace): ..here.
1387 (Qautomatic_gc, profiler_memory_running): Declare vars.
1388 (malloc_probe, syms_of_profiler): Declare functions.
1389 * xdisp.c (Qautomatic_redisplay): New constant.
1390 (redisplay_internal): Record itself in backtrace_list.
1391 (syms_of_xdisp): Define Qautomatic_redisplay.
1392
1393 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1394 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1395
1396 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1397
1398 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1399
1400 Prefer POSIX timers if available.
1401 They avoid a race if the timer is too close to the current time.
1402 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1403 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1404 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1405
1406 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1407
1408 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1409 CHAR_STRING_ADVANCE.
1410 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1411 STRING_CHAR_ADVANCE.
1412
1413 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1414
1415 Move Vlibrary_cache to emacs.c and reset before dumping.
1416
1417 * lisp.h (reset_image_types): Declare.
1418 [WINDOWSNT] (Vlibrary_cache): Declare.
1419
1420 * image.c (reset_image_types): New function.
1421
1422 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1423 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1424 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1425
1426 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1427 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1428
1429 * w32.h (Vlibrary_cache): Do not declare.
1430
1431 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1432
1433 * w32proc.c (sys_signal): Handle all signals defined by the
1434 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1435 handlers for signals supported by Windows. Don't override
1436 term_ntproc as the handler for SIGABRT.
1437 (sigaction): Rewrite to call sys_signal instead of duplicating its
1438 code.
1439 (sys_kill): Improve commentary.
1440
1441 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1442 consistency with a signature of a signal handler. All callers
1443 changed.
1444 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1445 install term_ntproc as a signal handler for SIGABRT, as that
1446 should be done by the dumped Emacs.
1447
1448 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1449
1450 * w32select.c (term_w32select): Protect against repeated
1451 invocation by setting clipboard_owner to NULL after calling
1452 DestroyWindow.
1453
1454 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1455 and term_ntproc to their modified signatures.
1456
1457 * character.c (char_string, string_char): Remove calls to
1458 MAYBE_UNIFY_CHAR. See the discussion starting at
1459 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1460 for the details.
1461
1462 2012-09-25 Chong Yidong <cyd@gnu.org>
1463
1464 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1465
1466 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1467
1468 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1469 when encountering an unknown bytecode.
1470
1471 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1472
1473 image.c, indent.c: Use bool for booleans.
1474 * dispextern.h (struct image_type): Members valid_p, load, init
1475 now return bool, not int. All uses changed.
1476 * image.c: Omit unnecessary static decls.
1477 (x_create_bitmap_mask, x_build_heuristic_mask):
1478 Return void, not int, since callers don't care about the return value.
1479 (x_create_bitmap_mask, define_image_type, valid_image_p)
1480 (struct image_keyword, parse_image_spec, image_spec_value)
1481 (check_image_size, image_background)
1482 (image_background_transparent, x_clear_image_1)
1483 (postprocess_image, lookup_image, x_check_image_size)
1484 (x_create_x_image_and_pixmap, xbm_image_p)
1485 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1486 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1487 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1488 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1489 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1490 (png_image_p, init_png_functions, png_load_body, png_load)
1491 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1492 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1493 (init_gif_functions, gif_load, imagemagick_image_p)
1494 (imagemagick_load_image, imagemagick_load, svg_image_p)
1495 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1496 (gs_load):
1497 * nsimage.m (ns_load_image):
1498 * nsterm.m (ns_defined_color):
1499 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1500 * xfns.c (x_defined_color):
1501 * xterm.c (x_alloc_lighter_color_for_widget)
1502 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1503 (x_alloc_lighter_color):
1504 * indent.c (disptab_matches_widthtab, current_column)
1505 (scan_for_column, string_display_width, indented_beyond_p)
1506 (compute_motion, vmotion, Fvertical_motion):
1507 Use bool for booleans.
1508
1509 2012-09-24 Chong Yidong <cyd@gnu.org>
1510
1511 * chartab.c (Fset_char_table_default): Obsolete function removed.
1512
1513 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1514
1515 Move pid_t related decls out of lisp.h.
1516 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1517 (interruptible_wait_for_termination):
1518 Move these decls from lisp.h to syswait.h, since they use pid_t.
1519 Needed on FreeBSD; see Herbert J. Skuhra in
1520 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1521 * callproc.c: Include syswait.h.
1522
1523 gnutls.c, gtkutil.c: Use bool for boolean.
1524 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1525 (emacs_gnutls_handle_error):
1526 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1527 (xg_hide_tooltip, xg_create_frame_widgets)
1528 (create_dialog, xg_uses_old_file_dialog)
1529 (xg_get_file_with_chooser, xg_get_file_with_selection)
1530 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1531 (xg_item_label_same_p, xg_update_menubar)
1532 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1533 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1534 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1535 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1536 (update_frame_tool_bar, free_frame_tool_bar):
1537 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1538 * nsmenu.m (ns_update_menubar):
1539 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1540 * xfns.c (Fx_show_tip) [USE_GTK]:
1541 Use bool for boolean.
1542 * gtkutil.c (xg_update_frame_menubar):
1543 * xmenu.c (update_frame_menubar):
1544 Return void, not int, since caller ignores return value.
1545 * gtkutil.c (xg_change_toolbar_position):
1546 Return void, not 1.
1547
1548 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1549
1550 * makefile.w32-in (BLOCKINPUT_H): Remove.
1551 (SYSSIGNAL_H): New macro.
1552 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1553 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1554 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1555 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1556 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1557 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1558 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1559 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1560 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1561 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1562 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1563 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1564 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1565 ($(BLD)/w32xfns.$(O)): Update dependencies.
1566
1567 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1568
1569 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1570 fatal_error_backtrace.
1571
1572 * w32proc.c (sys_kill): Undo last change: don't do anything when
1573 invoked to deliver SIGABRT to our own process. This is now
1574 handled by emacs_raise.
1575
1576 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1577
1578 * w32term.c (w32_read_socket): Remove leftover reference to
1579 interrupt_input_pending.
1580
1581 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1582
1583 Do not use SA_NODEFER.
1584 Problem reported by Dani Moncayo in
1585 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1586 * alloc.c (die):
1587 * sysdep.c (emacs_abort): Do not reset signal handler.
1588 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1589 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1590 wanted even on POSIXish hosts, and it doesn't work on Windows.
1591
1592 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1593
1594 * xterm.c (x_term_init): Call fixup_locale before and after calling
1595 gtk_init (Bug#12392).
1596
1597 2012-09-23 Chong Yidong <cyd@gnu.org>
1598
1599 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1600 Vdynamic_library_alist.
1601
1602 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1603 (Fgnutls_available_p): Caller changed.
1604
1605 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1606 (Flibxml_parse_xml_region): Likewise.
1607
1608 * dispextern.h (struct image_type): Remove arg from init function.
1609
1610 * image.c (Finit_image_library, lookup_image_type)
1611 (define_image_type): Remove now-unneeded second arg.
1612 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1613 (init_tiff_functions, init_gif_functions, init_svg_functions):
1614 Arglist and w32_delayed_load calling convention changed.
1615 (gs_type): Remove init_gs_functions; there is no such function.
1616 (valid_image_p, make_image): Fix caller to lookup_image_type.
1617
1618 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1619
1620 Simplify and avoid signal-handling races (Bug#12471).
1621 * alloc.c (die):
1622 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1623 Avoid recursive loop if there's a fatal error in the function itself.
1624 * atimer.c (pending_atimers):
1625 * blockinput.h: Don't include "atimer.h"; no longer needed.
1626 (interrupt_input_pending): Remove. All uses removed.
1627 pending_signals now counts both atimers and ordinary interrupts.
1628 This is less racy than having three separate pending-signal flags.
1629 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1630 (input_blocked_p):
1631 Rename from their upper-case counterparts BLOCK_INPUT,
1632 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1633 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1634 This makes it easier to access volatile variables more accurately.
1635 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1636 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1637 that's more reliable if the code is buggy and sets
1638 interrupt_input_blocked to a negative value. All uses changed.
1639 * atimer.c (deliver_alarm_signal):
1640 Remove. No need to deliver this to the parent; any thread can
1641 handle this signal now. All uses replaced by underlying handler.
1642 * atimer.c (turn_on_atimers):
1643 * dispnew.c (handle_window_change_signal):
1644 * emacs.c (handle_danger_signal):
1645 * keyboard.c (kbd_buffer_get_event):
1646 Don't reestablish signal handler; not needed with sigaction.
1647 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1648 (UNBLOCK_INPUT_TO):
1649 Rework to avoid unnecessary accesses to volatile variables.
1650 (UNBLOCK_INPUT_TO): Now a function.
1651 (totally_unblock_input, unblock_input): New decls.
1652 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1653 (init_data): Remove. Necessary stuff now done in init_signal.
1654 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1655 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1656 (fatal_error_code): Remove; no longer needed.
1657 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1658 it doesn't always backtrace. All uses changed. No need to reset
1659 signal to default, since sigaction and/or die does that for us now.
1660 Use emacs_raise (FOO), not kill (getpid (), FOO).
1661 (main): Check more-accurately whether we're dumping.
1662 Move fatal-error setup to sysdep.c
1663 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1664 * gtkutil.c (xg_get_file_name, xg_get_font):
1665 Remove no-longer-needed signal-mask manipulation.
1666 * keyboard.c, process.c (POLL_FOR_INPUT):
1667 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1668 * keyboard.c (read_avail_input): Remove.
1669 All uses replaced by gobble_input.
1670 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1671 (kbd_buffer_store_event_hold, gobble_input):
1672 (record_asynch_buffer_change) [USABLE_SIGIO]:
1673 (store_user_signal_events):
1674 No need to mess with signal mask.
1675 (gobble_input): If blocking input and there are terminals, simply
1676 set pending_signals to 1 and return. All hooks changed to not
1677 worry about whether input is blocked.
1678 (process_pending_signals): Clear pending_signals before processing
1679 them, in case a signal comes in while we're processing.
1680 By convention callers now test pending_signals before calling us.
1681 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1682 New functions, to support changes to blockinput.h.
1683 (handle_input_available_signal): Now extern.
1684 (reinvoke_input_signal): Remove. All uses replaced by
1685 handle_async_input.
1686 (quit_count): Now volatile, since a signal handler uses it.
1687 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1688 All callers changed. Block SIGINT only if not already blocked.
1689 Clear sigmask reliably, even if Fsignal returns, which it can.
1690 Omit unnecessary accesses to volatile var.
1691 (quit_throw_to_read_char): No need to restore sigmask.
1692 * keyboard.c (gobble_input, handle_user_signal):
1693 * process.c (wait_reading_process_output):
1694 Call signal-handling code rather than killing ourselves.
1695 * lisp.h: Include <float.h>, for...
1696 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1697 (pending_signals): Now volatile.
1698 (syms_of_data): Now const if IEEE floating point.
1699 (handle_input_available_signal) [USABLE_SIGIO]:
1700 (terminate_due_to_signal, record_child_status_change): New decls.
1701 * process.c (create_process): Avoid disaster if memory is exhausted
1702 while we're processing a vfork, by tightening the critical section
1703 around the vfork.
1704 (send_process_frame, process_sent_to, handle_pipe_signal)
1705 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1706 ignores SIGPIPE.
1707 (send_process): No need for setjmp/longjmp any more, since the
1708 SIGPIPE stuff is now gone. Instead, report an error if errno
1709 is EPIPE.
1710 (record_child_status_change): Now extern. PID and W are now args.
1711 Return void, not bool. All callers changed.
1712 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1713 Remove. All uses removed. This bug should be fixed now in a
1714 different way.
1715 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1716 and record the child status change directly. This avoids the
1717 need to futz with the signal mask.
1718 (process_fatal_action): Move here from emacs.c.
1719 (emacs_sigaction_flags): New function, containing
1720 much of what used to be in emacs_sigaction_init.
1721 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1722 caught by emacs, to make races less likely.
1723 (deliver_process_signal): Rename from handle_on_main_thread.
1724 All uses changed.
1725 (BACKTRACE_LIMIT_MAX): Now at top level.
1726 (thread_backtrace_buffer, threadback_backtrace_pointers):
1727 New static vars.
1728 (deliver_thread_signal, deliver_fatal_thread_signal):
1729 New functions, for more-accurate delivery of thread-specific signals.
1730 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1731 (deliver_arith_signal): Handle in this thread, not
1732 in the main thread, since it's triggered by this thread.
1733 (maybe_fatal_sig): New function.
1734 (init_signals): New arg DUMPING so that we can be more accurate
1735 about whether we're dumping. Caller changed.
1736 Treat thread-specific signals differently from process-general signals.
1737 Block all signals while handling fatal error; that's safer.
1738 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1739 on IEEE hosts.
1740 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1741 Ignore SIGPIPE unless batch.
1742 (emacs_backtrace): Output backtrace for the appropriate thread,
1743 which is not necessarily the main thread.
1744 * syssignal.h: Include <stdbool.h>.
1745 (emacs_raise): New macro.
1746 * xterm.c (x_connection_signal): Remove; no longer needed
1747 now that we use sigaction.
1748 (x_connection_closed): No need to mess with sigmask now.
1749 (x_initialize): No need to reset SIGPIPE handler here, since
1750 init_signals does this for us now.
1751
1752 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1753
1754 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1755 background rect may be larger (Bug#12245).
1756
1757 2012-09-23 Chong Yidong <cyd@gnu.org>
1758
1759 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1760
1761 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1762
1763 * .gdbinit: Just stop at fatal_error_backtrace.
1764 See Stefan Monnier's request in
1765 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1766 Remove no-longer-used query of system type.
1767
1768 2012-09-22 Chong Yidong <cyd@gnu.org>
1769
1770 * search.c (Freplace_match): Doc fix (Bug#12325).
1771
1772 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1773
1774 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1775 (Fline_end_position): Doc fix.
1776
1777 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1778
1779 2012-09-22 Chong Yidong <cyd@gnu.org>
1780
1781 * dispextern.h (struct image_type): Add new slot, storing a type
1782 initialization function.
1783
1784 * image.c (define_image_type): Call the image initializer function
1785 if it is defined. Arguments and return value changed.
1786 (valid_image_p, make_image): Callers changed.
1787 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1788 (gif_type, imagemagick_type, svg_type, gs_type):
1789 Add initialization functions.
1790 (Finit_image_library): Call lookup_image_type.
1791 (CHECK_LIB_AVAILABLE): Macro deleted.
1792 (lookup_image_type): Call define_image_type here, rather than via
1793 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1794 (syms_of_image): Move define_image_type calls for xbm_type and
1795 pbm_type to lookup_image_type.
1796
1797 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1798
1799 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1800 'idle_timers' from here ...
1801 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1802 lists, to avoid infloops when the timer does something stupid,
1803 like reinvoke itself with the same or smaller time-out.
1804 (Bug#12447)
1805
1806 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1807
1808 * window.c (Fsplit_window_internal): Handle only Qt value of
1809 Vwindow_combination_limit separately.
1810 (Qtemp_buffer_resize): New symbol.
1811 (Vwindow_combination_limit): New default value.
1812 Rewrite doc-string.
1813
1814 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1815
1816 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1817 the new overlay string. (Bug#10159)
1818
1819 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1820
1821 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1822 or that fprintf is async-signal-safe. POSIX doesn't require
1823 either assumption.
1824
1825 2012-09-22 Chong Yidong <cyd@gnu.org>
1826
1827 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1828 (Bug#8207).
1829
1830 2012-09-22 Kenichi Handa <handa@gnu.org>
1831
1832 * composite.c (composition_reseat_it): Handle the case that a
1833 grapheme cluster is not covered by a single font (Bug#12352).
1834
1835 2012-09-21 Chong Yidong <cyd@gnu.org>
1836
1837 * image.c (define_image_type): Avoid adding duplicate types to
1838 image_types (Bug#12463). Suggested by Jörg Walter.
1839
1840 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1841
1842 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1843 (print_load_command_name): Add case LC_DATA_IN_CODE.
1844 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1845
1846 2012-09-21 Glenn Morris <rgm@gnu.org>
1847
1848 * eval.c (Frun_hook_with_args_until_success)
1849 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1850
1851 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1852
1853 * fileio.c (Ffile_selinux_context): Only call freecon when
1854 lgetfilecon succeeded.
1855 (Fset_file_selinux_context): Likewise. (Bug#12444)
1856
1857 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1858
1859 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1860 reordering, locate the cursor by calling set_cursor_from_row; if
1861 that fails, clear the desired glyph matrix before returning a
1862 failure indication to the caller. Fixes leaving garbled display
1863 when fast scrolling with a down-key. (Bug#12403)
1864 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1865 scrolling through multibyte text.
1866
1867 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1868
1869 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1870 calling mark_vectorlike since that's the one that marks the window.
1871 (mark_discard_killed_buffers): Mark the final cdr.
1872 * window.h (struct window): Move prev/next_buffers to the
1873 non-standard fields.
1874 * window.c (make_window): Initialize prev/next_buffers manually.
1875
1876 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1877
1878 Omit unused arg EXPECTED from socket hooks.
1879 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1880 * nsterm.m (ns_term_init):
1881 * termhooks.h (struct terminal.read_socket_hook):
1882 * w32inevt.c (w32_console_read_socket):
1883 * w32term.c (w32_read_socket):
1884 * xterm.c (XTread_socket):
1885 Omit unused arg EXPECTED. All callers changed.
1886 (store_user_signal_events): Return void, not int, since callers no
1887 longer care about the return value. All uses changed.
1888
1889 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1890
1891 * w32gui.h (XParseGeometry): Do not declare.
1892
1893 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1894
1895 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1896 Ignore 'expected'. See Eli Zaretskii in
1897 <http://bugs.gnu.org/12471#8> (last line).
1898
1899 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1900 (XParseGeometry): Now static. Substitute extremal values for
1901 values that are out of range.
1902
1903 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1904
1905 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1906
1907 * nsfns.m (XParseGeometry): Remove.
1908 (Fx_create_frame): Call x_set_offset to correctly interpret
1909 top_pos in geometry.
1910
1911 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1912 (Fx_parse_geometry): If there is a space in string, call
1913 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1914
1915 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1916
1917 * search.c (scan_buffer): Use character positions in calls to
1918 region_cache_forward and region_cache_backward, not byte
1919 positions. (Bug#12196)
1920
1921 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1922 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1923
1924 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1925 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1926 emacs_blocked_malloc, now deleted.
1927
1928 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1929
1930 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1931 The workaround was for improving performance on Solaris 2.4, but
1932 is getting in the way now. Emacs will still work if someone is
1933 still running Solaris 2.4 in a museum somewhere; Sun dropped
1934 support for Solaris 2.4 in 2003.
1935 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1936 * process.c (create_process) [HAVE_WORKING_VFORK]:
1937 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1938 since Emacs no longer uses vfork on that platform.
1939
1940 2012-09-17 Glenn Morris <rgm@gnu.org>
1941
1942 * emacs.c: Use COPYRIGHT.
1943
1944 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 Remove configure's --without-sync-input option (Bug#12450).
1947 When auditing signal-handling in preparation for cleaning it up,
1948 I found that SYNC_INPUT has race conditions and would be a real
1949 pain to fix. Since it's an undocumented and deprecated
1950 configure-time option, now seems like a good time to remove it.
1951 Also see <http://bugs.gnu.org/11080#16>.
1952 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1953 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1954 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1955 (malloc_hysteresis):
1956 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1957 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1958 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1959 (dont_register_blocks, bytes_used_when_reconsidered)
1960 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1961 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1962 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1963 Remove. All uses removed.
1964 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1965 implementation, one that depends on whether the new macro
1966 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1967 is defined.
1968 * atimer.c (run_timers, handle_alarm_signal):
1969 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1970 (handle_async_input, process_pending_signals)
1971 (handle_input_available_signal, init_keyboard):
1972 * nsterm.m (ns_read_socket):
1973 * process.c (wait_reading_process_output):
1974 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1975 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1976 (emacs_write):
1977 * xterm.c (XTread_socket):
1978 Assume SYNC_INPUT.
1979 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1980 * eval.c (handling_signal): Remove. All uses removed.
1981 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1982 All uses replaced with the SYNC_INPUT version.
1983 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1984 Remove decls.
1985 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1986 Now static.
1987
1988 * font.c (Ffont_shape_gstring): Remove unused local.
1989
1990 2012-09-16 Glenn Morris <rgm@gnu.org>
1991
1992 * Makefile.in (clean): No longer run nextstep's clean.
1993
1994 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1995 (ns_frag): Remove.
1996 (ns-app): Move here from ns.mk, and simplify.
1997 (clean): Simplify nextstep entry.
1998 * ns.mk: Remove file.
1999
2000 2012-09-17 Kenichi Handa <handa@gnu.org>
2001
2002 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2003 not covert the last few charactes.
2004
2005 2012-09-16 Kenichi Handa <handa@gnu.org>
2006
2007 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2008 here, but just check the validity of glyphs in the glyph-string.
2009
2010 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2011
2012 * window.c (Fwindow_parameter, Fset_window_parameter):
2013 Accept any window as argument (Bug#12452).
2014
2015 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2016
2017 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2018 to ns_term_init to avoid memory leak.
2019
2020 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2021 explicit retain/release.
2022 (ns_term_init): Only allow one display. Initialize outerpool and
2023 ns_*_types.
2024
2025 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2028 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2029 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2030 the Microsoft problem in a different way, by altering ../nt/config.nt.
2031
2032 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2033
2034 * w32xfns.c:
2035 * w32uniscribe.c:
2036 * w32term.c:
2037 * w32select.c:
2038 * w32reg.c:
2039 * w32proc.c:
2040 * w32menu.c:
2041 * w32inevt.c:
2042 * w32heap.c:
2043 * w32font.c:
2044 * w32fns.c:
2045 * w32console.c:
2046 * w32.c:
2047 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2048 by lisp.h. This completes removal of setjmp.h inclusion
2049 erroneously announced in the previous commit. (Bug#12446)
2050
2051 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2052 more accurate.
2053
2054 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2055 not defined as a macro. The latter happens on MS-Windows.
2056 (Bug#12446)
2057
2058 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2059
2060 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2061 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2062 Some instances of '#include <setjmp.h>' removed, if the
2063 only reason for the instance was because "lisp.h" was included.
2064 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2065 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2066 and _longjmp with the new symbols. Emacs already uses _setjmp if
2067 available, so this change affects only POSIXish hosts that have
2068 sigsetjmp but not _setjmp, such as some versions of Solaris and
2069 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2070 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2071 (png_load_body) [HAVE_PNG]:
2072 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2073 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2074 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2075 since PNG requires jmp_buf. This is the only exception to the
2076 general rule that we now use sys_setjmp and sys_longjmp.
2077 This exception is OK since this code does not change the signal
2078 mask or longjmp out of a signal handler.
2079
2080 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2081
2082 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2083 Include "syssignal.h", for 'main_thread'.
2084
2085 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2086
2087 Avoid out-of-range marker position (Bug#12426).
2088 * insdel.c (replace_range, replace_range_2):
2089 Adjust markers before overlays, as suggested by comments.
2090 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2091 Remove redundant check before calling offset_intervals.
2092
2093 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2094
2095 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2096 current buffer (Bug#12387).
2097
2098 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2099
2100 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2101
2102 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2103
2104 Use a more backwards-compatible timer format (Bug#12430).
2105 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2106 vector element, not from the 4th, since PSECS is now at the end.
2107 (Fcurrent_idle_time): Doc fix.
2108
2109 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2110
2111 Function to mark objects and remove killed buffers at once.
2112 * alloc.c (discard_killed_buffers): Rename to ...
2113 (mark_discard_killed buffers) ... new name. Add marking
2114 of remaining objects. Fix comment. Adjust users.
2115 (mark_object): Do not touch frame buffer lists here.
2116 * frame.c (delete_frame): Reset frame buffer lists here.
2117
2118 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2119
2120 Better workaround for GNOME bug when --enable-gcc-warnings.
2121 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2122 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2123 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2124
2125 Simplify SIGIO usage (Bug#12408).
2126 The code that dealt with SIGIO was crufty and confusing, e.g., it
2127 played tricks like "#undef SIGIO" but these tricks were not used
2128 consistently. Simplify mostly by not #undeffing standard symbols,
2129 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2130 or not as we please) rather than "defined SIGIO" (standard symbol
2131 that we probably shouldn't #undef).
2132 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2133 Modules that need it can include it.
2134 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2135 * dispextern.h (ignore_sigio): New decl.
2136 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2137 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2138 * emacs.c (shut_down_emacs):
2139 * keyboard.c (kbd_buffer_store_event_hold):
2140 Use ignore_sigio rather than invoking 'signal' directly.
2141 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2142 for FIONREAD.
2143 (FIONREAD, SIGIO): Do not #undef.
2144 (tty_read_avail_input): Use #error rather than a syntax error.
2145 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2146 for I_PIPE, used by SETUP_SLAVE_PTY.
2147 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2148 * sysdep.c (croak): Remove; no longer needed. This bit of
2149 temporary code, with Fred N. Fish's comment that it's temporary,
2150 has been in Emacs since at least 1992!
2151 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2152 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2153 * syssignal.h (croak): Remove decl.
2154 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2155 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2156 now that we're termios-only.
2157 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2158 * term.c (dissociate_if_controlling_tty): Use #error rather than
2159 a run-time error.
2160
2161 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2162 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2163 to work around GNOME bug 683906.
2164 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2165 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2166 This works around GCC bug 54561.
2167
2168 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2169
2170 More fixes for 'volatile' and setjmp/longjmp.
2171 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2172 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2173 (png_load_body) [HAVE_PNG]:
2174 (jpeg_load_body) [HAVE_JPEG]:
2175 New function, with most of the old parent function's body.
2176 (png_load) [HAVE_PNG]:
2177 (jpeg_load) [HAVE_JPEG]:
2178 Invoke the new function, to avoid longjmp munging our locals.
2179 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2180 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2181 longjmp is passed 2, as the C standard doesn't guarantee this.
2182 Instead, store the failure code into mgr->failure_code.
2183
2184 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2185
2186 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2187 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2188 (syms_of_keyboard): Remove support for unread-command-char.
2189
2190 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2191
2192 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2193 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2194 violation. (Bug#12426)
2195
2196 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2197
2198 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2199
2200 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2201
2202 * eval.c: Add `inhibit-debugger'.
2203 (Qinhibit_debugger): New symbol.
2204 (call_debugger): Bind it instead of Qdebug_on_error.
2205 (maybe_call_debugger): Test Vinhibit_debugger.
2206 (syms_of_eval): Define inhibit-debugger.
2207 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2208 (syms_of_xdisp): Remove inhibit-debug-on-message.
2209
2210 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2211
2212 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2213 If a nonvolatile local variable is written before a _longjmp to
2214 the frame containing the variable, and is read after the _longjmp,
2215 the value read is indeterminate. Some local variables of type
2216 'struct handler' and 'struct catchtag' are used in this way, so
2217 mark each of their slots as volatile if the slot can be set before
2218 _longjmp and read afterwards.
2219 * lisp.h (struct handler): var and chosen_clause are now volatile.
2220 (struct catchtag): val, next, and pdlcount are now volatile.
2221
2222 * bidi.c (bidi_push_it, bidi_pop_it):
2223 * fns.c (copy_hash_table):
2224 * image.c (define_image_type):
2225 * keyboard.c (kbd_buffer_store_event_hold):
2226 * process.c (Fprocess_send_eof):
2227 * xfaces.c (x_create_gc) [HAVE_NS]:
2228 * xgselect.c (xg_select):
2229 Prefer assignment to memcpy when either will do.
2230
2231 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2232 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2233 time an item is removed. No need to mark this function 'inline';
2234 the compiler knows better than we do.
2235
2236 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2237
2238 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2239 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2240 to change_frame_size (Bug#12388).
2241 (windowDidResize:): Pass YES to updateFrameSize.
2242
2243 * nsterm.h: Add delay parameter to updateFrameSize.
2244
2245 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2246
2247 Discard killed buffers from deleted window and frame objects.
2248 This reduces an amount of references to killed buffers and
2249 helps GC to reclaim them faster.
2250 * alloc.c (discard_killed_buffers): New function.
2251 (mark_object): Use it for deleted windows and frames.
2252 (mark_object): If symbol's value is set up for a killed buffer
2253 or deleted frame, restore its global binding.
2254 * data.c (swap_in_global_binding): Add GC notice.
2255 (swap_in_symval_forwarding): Use convenient set_blv_where.
2256 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2257 * window.h: ... to here.
2258
2259 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2260
2261 Convenient macro to check whether the buffer is live.
2262 * buffer.h (BUFFER_LIVE_P): New macro.
2263 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2264 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2265
2266 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2267
2268 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2269 composition cases (Bug#12364).
2270
2271 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2272 overhang of succeeding glyphs overlapping box cursor.
2273
2274 * w32term.c (x_draw_glyph_string): Likewise.
2275
2276 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2277
2278 Simplify, document, and port floating-point (Bug#12381).
2279 The porting part of this patch fixes bugs on non-IEEE platforms
2280 with frexp, ldexp, logb.
2281 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2282 Now static.
2283 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2284 support, by removing commented-out code and briefly listing the
2285 C89 functions excluded. The commented-out stuff was confusing
2286 maintenance, e.g., we thought we needed cbrt but it was commented out.
2287 (logb): Remove decl; no longer needed.
2288 (isfinite): New macro, if not already supplied.
2289 (isnan): Don't replace any existing macro.
2290 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2291 are present on all C89 platforms.
2292 (Ffrexp): Do not special-case zero, as frexp does the right thing
2293 for that case.
2294 (Flogb): Do not use logb, as it doesn't have the desired meaning
2295 on hosts that use non-base-2 floating point. Instead, stick with
2296 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2297 frexp, to avoid getting an unspecified result.
2298
2299 * xdisp.c (Qinhibit_debug_on_message): Now static.
2300
2301 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2302
2303 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2304 NSBezierPath (Bug#12131).
2305
2306 2012-09-10 Chong Yidong <cyd@gnu.org>
2307
2308 * fns.c (Fdelq, Fdelete): Doc fix.
2309
2310 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2311
2312 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2313 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2314
2315 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2316
2317 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2318 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2319 Use it.
2320
2321 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2322
2323 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2324 left fringe if the window has a left margin. This avoids leaving
2325 traces of the cursor because its leftmost pixel is not drawn over.
2326
2327 * dispnew.c (update_window_line): When the left margin area of a
2328 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2329 that screen line. (Bug#12277)
2330
2331 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 Assume C89 or later for math functions (Bug#12381).
2334 This simplifies the code, and makes it a bit smaller and faster,
2335 and (most important) makes it easier to clean up signal handling
2336 since we can stop worring about floating-point exceptions in
2337 library code. That was a problem before C89, but the problem
2338 went away many years ago on all practical Emacs targets.
2339 * data.c, image.c, lread.c, print.c:
2340 Don't include <math.h>; no longer needed.
2341 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2342 might be autoconfigured, as that never happens.
2343 * data.c (fmod):
2344 * doprnt.c (DBL_MAX_10_EXP):
2345 * print.c (DBL_DIG):
2346 Remove. C89 or later always defines these.
2347 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2348 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2349 (arith_error, domain_error, domain_error2):
2350 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2351 no longer needed -- we simply return what C returns. All uses removed.
2352 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2353 the wrapped code.
2354 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2355 Remove. All uses expanded, as these macros are no longer used
2356 more than once and are now more trouble than they're worth.
2357 (Ftan): Use tan, not sin / cos.
2358 (Flogb): Assume C89 frexp.
2359 (fmod_float): Assume C89 fmod.
2360 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2361 (init_floatfns): Remove. All uses removed.
2362
2363 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2364
2365 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2366 compositeToPoint for OSX < 10.6 (Bug#12390).
2367
2368 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2369
2370 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2371 This produces more-accurate results.
2372
2373 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2374
2375 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2376 changes (Bug#12088).
2377
2378 2012-09-08 Chong Yidong <cyd@gnu.org>
2379
2380 * syntax.c (Fstring_to_syntax): Doc fix.
2381
2382 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2383
2384 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2385 in the internal border.
2386 (x_set_window_size): Remove static variables and their usage.
2387 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2388 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2389 Remove fringe/internal border adjustment (Bug#11052).
2390 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2391 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2392 (ns_fix_rect_ibw): Remove.
2393 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2394 (ns_dumpglyphs_box_or_relief): Ditto.
2395 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2396 adjustment.
2397 (ns_dumpglyphs_image): Ditto.
2398 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2399 border adjustment.
2400 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2401 their usage. Add fringe_extended_p and its use as in other terms.
2402 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2403 scroll bar was removed.
2404 (updateFrameSize): New function.
2405 (windowDidResize): Move code to updateFrameSize and call it.
2406
2407 * nsterm.h (EmacsView): Add updateFrameSize.
2408
2409 2012-09-07 Chong Yidong <cyd@gnu.org>
2410
2411 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2412
2413 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2414
2415 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2416
2417 More signal-handler cleanup (Bug#12327).
2418 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2419 Problem introduced when merging patches. Noted by Eli Zaretskii in
2420 <http://bugs.gnu.org/12327#67>.
2421 * floatfns.c: Comment fix.
2422 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2423 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2424 and anyway the declaration is harmless even if SIGDANGER is not defined.
2425 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2426 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2427 source files not surprisingly expected syssignal.h to define, or
2428 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2429 Include <sys/ioctl.h>, for FIONREAD.
2430 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2431 This eliminates a problem whereby other files mysteriously had
2432 to include "syssignal.h" before including "systty.h" if they
2433 wanted to use "#ifdef SIGIO".
2434
2435 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2436
2437 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2438
2439 * w32.c (sigemptyset): Empty the set.
2440 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2441
2442 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2443
2444 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2445
2446 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2447 (mark_object): Likewise for frame objects.
2448
2449 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2450
2451 * syssignal.h (handle_on_main_thread): Always declare,
2452 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2453 This ports to platforms without HAVE_PTHREAD.
2454
2455 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2456
2457 Signal-handler cleanup (Bug#12327).
2458 Emacs's signal handlers were written in the old 4.2BSD style with
2459 sigblock and sigmask and so forth, and this led to some
2460 inefficiencies and confusion. Rewrite these to use
2461 pthread_sigmask etc. without copying signal sets around. Also,
2462 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2463 'signal', and instead use functions that do not attempt to take
2464 over the system name space. This patch causes Emacs's text
2465 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2466 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2467 Do not include <signal.h> or "syssignal.h", as these
2468 modules do not use signals.
2469 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2470 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2471 Do not include <signal.h>, as "syssignal.h" does that for us now.
2472 * atimer.c (sigmask_atimers): New function.
2473 (block_atimers, unblock_atimers): New functions,
2474 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2475 All uses replaced.
2476 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2477 no longer needed here.
2478 * emacs.c (main): Inspect existing signal handler with sigaction,
2479 so that there's no need to block and unblock SIGHUP.
2480 * sysdep.c (struct save_signal): New member 'action', replacing
2481 old member 'handler'.
2482 (save_signal_handlers, restore_signal_handlers):
2483 Use sigaction instead of 'signal' to save and restore.
2484 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2485 New function. All users of 'signal' modified to use set_sighandler
2486 if they're writeonly, and to use sys_signal if they're read+write.
2487 (emacs_sigaction_init, forwarded_signal): New functions.
2488 (sys_signal): Remove. All uses replaced by calls to sigaction
2489 and emacs_sigaction_init, or by direct calls to 'signal'.
2490 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2491 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2492 all uses replaced by pthread_sigmask etc. calls.
2493 * syssignal.h: Include <signal.h>.
2494 (emacs_sigaction_init, forwarded_signal): New decls.
2495 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2496 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2497 (sigmask, sys_sigmask): Remove; no longer needed.
2498 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2499 (sigblock, sigunblock, sigfree):
2500 (sigsetmask) [!defined sigsetmask]:
2501 Remove. All uses replaced by pthread_sigmask.
2502 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2503 no longer need to be replaced, and its typical old uses
2504 are now done via emacs_sigaction_init and sigaction.
2505 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2506 (sys_sigdel): Remove; unused.
2507 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2508
2509 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2510
2511 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2512 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2513
2514 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2515
2516 Explicitly mark buffer_defaults and buffer_local_symbols.
2517 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2518 mark_local_symbols here.
2519 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2520 since special buffers aren't marked here any more.
2521 (allocate_buffer): Chain new buffer with all_buffers here...
2522 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2523 not here.
2524 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2525 (syms_of_buffer): Remove staticpro of the above.
2526 (init_buffer_once): Set names for buffer_defaults and
2527 buffer_local_symbols.
2528
2529 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2530
2531 Use bool for booleans in font-related modules.
2532 * font.c (font_intern_prop, font_style_to_value)
2533 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2534 (generate_otf_features, font_check_otf_features, font_check_otf)
2535 (font_match_p, font_list_entities, font_at):
2536 * fontset.c (fontset_id_valid_p, reorder_font_vector
2537 (fontset_find_font, Fset_fontset_font)
2538 (face_suitable_for_char_p) [0]:
2539 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2540 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2541 (m17n_flt_initialized, ftfont_shape_by_flt):
2542 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2543 * nsfont.m (nsfont_draw):
2544 * w32font.c (w32font_draw):
2545 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2546 Use bool for booleans.
2547 * font.h: Adjust to above API changes.
2548 (struct font, struct font_driver, struct font_driver_list):
2549 Use bool for booleans.
2550 (struct font): Remove useless member encoding_type.
2551 All users removed.
2552 * fontset.c, xftfont.c: Omit unnecessary static decls.
2553
2554 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2555
2556 * alloc.c (mark_object): Revert window marking code
2557 since it's unsafe for the Fset_window_configuration.
2558
2559 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2560
2561 Fix race conditions with signal handlers and errno (Bug#12327).
2562 Be more systematic about preserving errno whenever a signal
2563 handler returns, even if it's not in the main thread. Do this by
2564 renaming signal handlers to distinguish between signal delivery
2565 and signal handling. All uses changed.
2566 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2567 * data.c (deliver_arith_signal): Rename from arith_error.
2568 * dispnew.c (deliver_window_change_signal): Rename from
2569 window_change_signal.
2570 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2571 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2572 * keyboard.c (deliver_input_available_signal): Rename from
2573 input_available_signal.
2574 (deliver_user_signal): Rename from handle_user_signal.
2575 (deliver_interrupt_signal): Rename from interrupt_signal.
2576 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2577 (deliver_child_signal): Rename from sigchld_handler.
2578 * atimer.c (handle_alarm_signal):
2579 * data.c (handle_arith_signal):
2580 * dispnew.c (handle_window_change_signal):
2581 * emacs.c (handle_fatal_signal, handle_danger_signal):
2582 * keyboard.c (handle_input_available_signal):
2583 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2584 * process.c (handle_pipe_signal, handle_child_signal):
2585 New functions, with the actual signal-handling code taken from the
2586 original respective signal handlers, sans the sporadic attempts to
2587 preserve errno, since that's now done by handle_on_main_thread.
2588 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2589 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2590 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2591 Move to sysdep.c.
2592 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2593 Move initialization of main_thread to sysdep.c's init_signals.
2594 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2595 our usage, and simplifies the mainline code.
2596 (record_child_status_change): New static function, as a helper
2597 for handle_child_signal, and with most of the old child handler's
2598 contents.
2599 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2600 (handle_child_signal): Use the above.
2601 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2602 Moved here from emacs.c.
2603 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2604 code moved here from emacs.c's main function.
2605 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2606 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2607 This lets callers save and restore errno properly.
2608
2609 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2610
2611 Remove redundant or unused things here and there.
2612 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2613 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2614 * editfns.c (Fcompare_buffer_substrings): Likewise.
2615 * frame.h (struct terminal, struct font_driver_list):
2616 Remove redundant declarations.
2617 * window.h (Qleft, Qright): Likewise.
2618
2619 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2620
2621 Do not mark objects from deleted buffers, windows and frames.
2622 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2623 (mark_object): Likewise for windows and frames.
2624
2625 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2626
2627 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2628 buffer_defaults and buffer_local_symbols as valid objects.
2629 Return special value to denote them.
2630
2631 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2632
2633 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2634 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2635 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2636 (file_name_absolute_p, Fsubstitute_in_file_name):
2637 (check_executable, check_writable, Ffile_accessible_directory_p)
2638 (Fset_file_selinux_context, Fdefault_file_modes)
2639 (Finsert_file_contents, choose_write_coding_system)
2640 (Fwrite_region, build_annotations, a_write, e_write)
2641 (Fdo_auto_save):
2642 * filelock.c (boot_time_initialized, get_boot_time)
2643 (get_boot_time_1, lock_file_1, within_one_second):
2644 * floatfns.c (in_float):
2645 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2646 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2647 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2648 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2649 * window.c (compare_window_configurations):
2650 Use bool for booleans.
2651 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2652 (Fdefault_file_modes): Now mode_t, not int, for modes.
2653 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2654 (internal_delete_file): Now returns void, not a (boolean) int,
2655 since nobody was looking at the return value.
2656 * lisp.h, window.h: Adjust to above API changes.
2657
2658 * xdisp.c (set_message): Simplify and reindent last change.
2659
2660 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2661
2662 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2663
2664 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2665
2666 * eval.c (call_debugger): Make the function non-static so that we
2667 can call it from set_message.
2668
2669 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2670 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2671
2672 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2673
2674 Give more-useful info on a fatal error (Bug#12328).
2675 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2676 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2677 of doing the work ourselves.
2678 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2679 do most of the work.
2680 (fatal_error_backtrace): New function, taken from the guts
2681 of the old fatal_error_signal, but with a new option to output
2682 a backtrace.
2683 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2684 info about the signal than just its number.
2685 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2686 * sysdep.c: Include <execinfo.h>
2687 (emacs_backtrace): New function, taken partly from the previous
2688 code of the 'die' function.
2689 (emacs_abort): Call fatal_error_backtrace rather than abort.
2690
2691 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2692
2693 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2694 eager (load-time) macro-expansion.
2695 * lisp.mk (lisp): Add macroexp.
2696
2697 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2698
2699 Simplify redefinition of 'abort' (Bug#12316).
2700 Do not try to redefine the 'abort' function. Instead, redo
2701 the code so that it calls 'emacs_abort' rather than 'abort'.
2702 This removes the need for the NO_ABORT configure-time macro
2703 and makes it easier to change the abort code to do a backtrace.
2704 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2705 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2706 Remove; sysdep.c's emacs_abort now takes its place.
2707 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2708 'abort' changed to use 'emacs_abort'.
2709 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2710 (abort) [!defined abort]: Rename to ...
2711 (emacs_abort): ... new name.
2712 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2713 the place of the old 'abort' in emacs.c.
2714 * w32.c, w32fns.c (abort): Do not #undef.
2715 * w32.c (emacs_abort): Rename from w32_abort.
2716
2717 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2718
2719 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2720 offsets[j].dv, since the y axis of the screen coordinates points
2721 down, while the y axis of the font definition coordinates points
2722 up. This fixes display of Arabic diacritics such as KASRA and
2723 KASRATAN. (Bug#11860)
2724
2725 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2726
2727 Be more systematic about _setjmp vs setjmp.
2728 * alloc.c (test_setjmp, mark_stack):
2729 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2730 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2731 (png_load, my_error_exit, jpeg_load):
2732 * process.c (send_process_trap, send_process):
2733 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2734 The underscored versions are up to 30x faster on some hosts.
2735 Formerly, the code used setjmp+longjmp sometimes and
2736 _setjmp+_longjmp at other times, with no particular reason to
2737 prefer setjmp+longjmp.
2738
2739 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2740
2741 Fix minor problem found by static checking.
2742 * buffer.c (Fdelete_all_overlays): Return nil.
2743
2744 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2745
2746 * buffer.c (Fdelete_all_overlays): New function.
2747
2748 2012-09-03 Chong Yidong <cyd@gnu.org>
2749
2750 * gtkutil.c: Add extern decl for Qxft.
2751
2752 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2753
2754 * emacs.c, eval.c: Use bool for boolean.
2755 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2756 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2757 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2758 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2759 (main, decode_env_path, Fdaemon_initialized):
2760 * eval.c (call_debugger, Finteractive_p, interactive_p):
2761 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2762 (maybe_call_debugger, Fbacktrace):
2763 * process.c (read_process_output, exec_sentinel):
2764 Use bool for booleans.
2765 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2766 All callers changed.
2767 * eval.c (interactive_p): Omit always-true boolean argument
2768 EXCLUDE_SUBRS_P. All callers changed.
2769 * dispextern.h, lisp.h: Reflect above API changes.
2770 * firstfile.c (dummy): Use the address of 'main', whose signature
2771 won't change, instead of the address of 'initialize', whose
2772 signature just changed from int to bool.
2773 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2774 * msdos.c (fatal_error_in_progress): ... from here.
2775 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2776 of incrementing it.
2777 (redisplay_internal, unwind_redisplay): Simply clear
2778 REDISPLAYING_P when unwinding, instead of saving its previous,
2779 always-false value and then restoring it.
2780
2781 Clean up some extern decls.
2782 Mostly, this hoists extern decls out of .c files and into .h files.
2783 That way, we're more likely to catch errors if the interfaces change.
2784 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2785 declare xg_mark_data.
2786 * dispextern.h (x_frame_parm_handlers):
2787 * font.h (Qxft):
2788 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2789 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2790 (Qultra_bold, Qoblique, Qitalic):
2791 Move extern decl here from .c file.
2792 * alloc.c (xg_mark_data) [USE_GTK]:
2793 * doc.c (Qclosure):
2794 * eval.c (Qlexical_binding):
2795 * fns.c (time) [!HAVE_UNISTD_H]:
2796 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2797 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2798 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2799 * lread.c (Qinternal_interpreter_environment):
2800 * minibuf.c (Qbuffer):
2801 * process.c (QCfamily, QCfilter):
2802 * widget.c (free_frame_faces):
2803 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2804 * xfont.c (x_clear_errors):
2805 * xterm.c (x_frame_parm_handlers):
2806 Remove now-redundant extern decls.
2807 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2808 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2809 Now static.
2810 * xfaces.c: Remove unnecessary static decls.
2811 * xterm.c (updating_frame): Remove decl of nonexistent object.
2812
2813 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2814 when building globals.h, as the objects that are not built on
2815 this host are not needed to compile C files on this host.
2816
2817 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2818
2819 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2820
2821 * frame.h: Add missing prototype for x_wm_set_size_hint.
2822
2823 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2824
2825 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2826 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2827 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2828 (Fsubstitute_command_keys):
2829 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2830 (save_excursion_save, save_excursion_restore)
2831 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2832 (format_time_string, general_insert_function)
2833 (make_buffer_string, make_buffer_string_both)
2834 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2835 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2836 (copy_text, insert_1, insert_1_both, insert_from_string)
2837 (insert_from_string_before_markers, insert_from_string_1)
2838 (insert_from_buffer, insert_from_buffer_1, replace_range)
2839 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2840 (del_range_2, modify_region):
2841 * intervals.c (intervals_equal, balance_possible_root_interval)
2842 (adjust_intervals_for_insertion, merge_properties_sticky)
2843 (graft_intervals_into_buffer, lookup_char_property)
2844 (adjust_for_invis_intang, set_point_both)
2845 (get_property_and_range, compare_string_intervals)
2846 (set_intervals_multibyte_1, set_intervals_multibyte):
2847 * keyboard.c (decode_timer):
2848 Use bool for boolean.
2849 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2850 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2851
2852 2012-09-02 Chong Yidong <cyd@gnu.org>
2853
2854 * keymap.c (push_key_description): Print M-TAB as C-M-i
2855 (Bug#11758).
2856
2857 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2858
2859 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2860 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2861 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2862 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2863 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2864 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2865 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2866
2867 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2868
2869 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2870 more than one grapheme cluster passed to the shaper: compute the
2871 offset adjustment values separately for each cluster. (Bug#11860)
2872
2873 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2874 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2875 about implicit conversions from integer to pointer.
2876
2877 2012-09-01 Daniel Colascione <dancol@dancol.org>
2878
2879 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2880 system used too early.
2881
2882 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2883
2884 Better seed support for (random).
2885 * emacs.c (main): Call init_random.
2886 * fns.c (Frandom): Set the seed from a string argument, if given.
2887 Remove long-obsolete Gentzel cruft.
2888 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2889 (init_random): New function.
2890
2891 2012-09-01 Daniel Colascione <dancol@dancol.org>
2892
2893 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2894 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2895 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2896 x_wm_set_size_hint, x_query_colors, x_real_positions,
2897 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2898 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2899 all of which have been moved to common code.
2900
2901 * xfaces.c: Include TERM_HEADER instead of listing all possible
2902 window-system headers.
2903
2904 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2905 to match header.
2906
2907 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2908 directly accessing frame internals.
2909
2910 * w32font.h: Include font.h. Define syms_of_w32font and
2911 globals_of_w32font.
2912
2913 * process.c: Include TERM_HEADER instead of listing all possible
2914 window-system headers.
2915
2916 * nsterm.h: Remove declarations now in frame.h.
2917 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2918
2919 * menu.c: Include TERM_HEADER instead of listing all possible
2920 window-system headers.
2921
2922 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2923 window system.
2924
2925 * keyboard.c: Include TERM_HEADER instead of listing all possible
2926 window-system headers.
2927
2928 * image.c: Include TERM_HEADER instead of listing all possible
2929 window-system headers. Declare Vlibrary_cache when compiling for
2930 Windows.
2931
2932 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2933 window system declarations.
2934
2935 * frame.h: Move common functions here: set_frame_menubar,
2936 x_set_window_size, x_sync, x_get_focus_frame,
2937 x_set_mouse_position, x_set_mouse_pixel_position,
2938 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2939 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2940 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2941 x_activate_menubar, x_real_positions, x_bitmap_icon,
2942 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2943 and x_query_colors.
2944
2945 * frame.c: Include TERM_HEADER instead of listing all possible
2946 window-system headers.
2947
2948 * font.c: Include TERM_HEADER instead of listing all possible
2949 window-system headers.
2950
2951 * emacs.c: Include TERM_HEADER.
2952
2953 * dispnew.c: Include TERM_HEADER instead of listing all possible
2954 window-system headers.
2955
2956 * ccl.h: Include character.h.
2957
2958 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2959 the current window system; include in list of objects to link into
2960 Emacs.
2961
2962 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2963
2964 Remove mark_ttys function and fix tty_display_info initialization.
2965 * lisp.h (mark_ttys): Remove prototype.
2966 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2967 to mark_ttys because all possible values of 'top_frame' slot are
2968 the frames which are reachable from Vframe_list.
2969 * term.c (mark_ttys): Remove.
2970 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2971
2972 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 Change struct frame bitfields from unsigned char to unsigned.
2975 * frame.h (struct frame): Change type of 'display_preempted',
2976 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2977 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2978 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2979 bitfields from unsigned char to unsigned.
2980
2981 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2982
2983 Remove unused member of struct x_output and struct w32_output.
2984 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2985 * w32term.h (struct w32_output): Likewise.
2986
2987 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2988
2989 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2990 does not become zero (Bug#12234).
2991
2992 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2993
2994 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2995 for GCC 4.7.1 x86-64.
2996
2997 2012-08-30 Glenn Morris <rgm@gnu.org>
2998
2999 * lread.c (init_lread): For out-of-tree builds, only add the
3000 source directory's site-lisp dir to the load-path if it exists,
3001 consistent with in-tree builds. (Bug#12302)
3002
3003 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3004
3005 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3006 button_values to NULL. Call setStykeMask so dialogs get a close button.
3007 (windowShouldClose:): Set window_closed.
3008 (dealloc): New member, free button_values.
3009 (process_dialog:): Make member function. Remove window argument,
3010 replace window with self. Count buttons and allocate and store values
3011 in button_values.
3012 (addButton:value:row:): value is int with the name tag. Call setTag
3013 with tag. Remove return self, declare return value as void.
3014 (addString:row:): Remove return self, declare return value as void.
3015 (addSplit): Remove return self, declare return value as void.
3016 (clicked:): Remove return self, declare return value as void.
3017 Set dialog_return to button_values[seltag]. Code formatting change.
3018 (initFromContents:isQuestion:): Adjust call to process_dialog.
3019 Code formatting change.
3020 (timeout_handler:): Set timer_fired to YES.
3021 (runDialogAt:): Set timer_fired to NO.
3022 Handle click on close button as quit.
3023
3024 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3025 Add window_closed and button_values. Add void as return value for
3026 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3027 Add process_dialog as new member.
3028
3029 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3030
3031 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3032 is not one of the heaps we manage. (Bug#12242)
3033
3034 2012-08-28 Glenn Morris <rgm@gnu.org>
3035
3036 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3037
3038 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3039
3040 * window.c (Fset_window_configuration): Remove handling of
3041 auto-buffer-name window parameter. Install revision of reverted
3042 fix.
3043
3044 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3045
3046 Do not allow to set major mode for a dead buffer.
3047 * buffer.c (Fset_buffer_major_mode): Signal an error
3048 if the buffer is dead.
3049 (Fother_buffer, other_buffer_safely): Remove redundant
3050 nested declaration.
3051
3052 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3053
3054 Always use set_buffer_if_live to restore original buffer at unwind.
3055 * buffer.h (record_unwind_current_buffer): New function.
3056 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3057 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3058 * undo.c, window.c: Adjust users.
3059 * buffer.c (set_buffer_if_live): Fix comment.
3060
3061 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3062
3063 Fix usage of set_buffer_internal.
3064 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3065 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3066 * coding.c (decode_coding): Omit redundant test.
3067 * fileio.c (decide_coding_unwind): Likewise.
3068 * fns.c (secure_hash): Likewise.
3069 * insdel.c (modify_region): Likewise.
3070 * keyboard.c (command_loop_1): Likewise.
3071 * print.c (PRINTFINISH): Likewise.
3072 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3073
3074 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3075
3076 * dispnew.c: Use bool for boolean.
3077 (frame_garbaged, display_completed, delayed_size_change)
3078 (fonts_changed_p, add_window_display_history)
3079 (add_frame_display_history, verify_row_hash)
3080 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3081 (row_equal_p, realloc_glyph_pool)
3082 (allocate_matrices_for_frame_redisplay)
3083 (showing_window_margins_p)
3084 (adjust_frame_glyphs_for_frame_redisplay)
3085 (build_frame_matrix_from_leaf_window, make_current)
3086 (mirrored_line_dance, mirror_line_dance, update_frame)
3087 (update_window_tree, update_single_window)
3088 (check_current_matrix_flags, update_window, update_text_area)
3089 (update_window_line, set_window_update_flags, scrolling_window)
3090 (update_frame_1, scrolling, buffer_posn_from_coords)
3091 (do_pending_window_change, change_frame_size)
3092 (change_frame_size_1, sit_for):
3093 Use bool for boolean.
3094 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3095 and remove last int (actually boolean) argument, which was always 0.
3096 All callers changed.
3097 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3098 * dispextern.h (struct composition_it): Use bool for boolean.
3099 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3100 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3101 * dired.c (file_name_completion):
3102 Use bool for boolean. (This was missed in an earlier change.)
3103
3104 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3105
3106 * window.c (Fset_window_configuration): Revert first part of
3107 last change.
3108
3109 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3110
3111 * nsterm.h (NSPanel): New class variable dialog_return.
3112
3113 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3114 Initialize dialog_return.
3115 (windowShouldClose:): Use stop instead of stopModalWithCode.
3116 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3117 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3118 event.
3119 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3120 modal loop returns.
3121
3122 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3123
3124 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3125 * composite.c (find_composition, composition_gstring_p)
3126 (composition_reseat_it, find_automatic_composition):
3127 * data.c (let_shadows_buffer_binding_p)
3128 (let_shadows_global_binding_p, set_internal, make_blv)
3129 (Fmake_variable_buffer_local, Fmake_local_variable)
3130 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3131 (cons_to_signed, arith_driver):
3132 * dbusbind.c (xd_in_read_queued_messages):
3133 * dired.c (directory_files_internal, file_name_completion):
3134 Use bool for booleans.
3135 * dired.c (file_name_completion):
3136 * process.h (fd_callback):
3137 Omit int (actually boolean) argument. It wasn't being used.
3138 All uses changed.
3139 * composite.h, lisp.h: Reflect above API changes.
3140
3141 * cmds.c, coding.c: Use bool for booleans.
3142 * cmds.c (move_point, Fself_insert_command):
3143 * coding.h (struct composition status, struct coding_system):
3144 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3145 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3146 (emacs_mule_char, decode_coding_emacs_mule)
3147 (encode_coding_emacs_mule, detect_coding_iso_2022)
3148 (decode_coding_iso_2022, encode_invocation_designation)
3149 (encode_designation_at_bol, encode_coding_iso_2022)
3150 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3151 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3152 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3153 (encode_coding_raw_text, detect_coding_charset)
3154 (decode_coding_charset, encode_coding_charset, detect_eol)
3155 (detect_coding, get_translation_table, produce_chars)
3156 (consume_chars, reused_workbuf_in_use)
3157 (make_conversion_work_buffer, code_conversion_save)
3158 (decode_coding_object, encode_coding_object)
3159 (detect_coding_system, char_encodable_p)
3160 (Funencodable_char_position, code_convert_region)
3161 (code_convert_string, code_convert_string_norecord)
3162 (Fset_coding_system_priority):
3163 * fileio.c (Finsert_file_contents):
3164 Use bool for booleans.
3165 * coding.h, lisp.h: Reflect above API changes.
3166 * coding.c: Remove unnecessary static function decls.
3167 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3168 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3169 not a boolean 'int', since callers never look at the return value.
3170 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3171 * coding.h (decoding_buffer_size, encoding_buffer_size)
3172 (emacs_mule_string_char): Remove unused extern decls.
3173 (struct iso_2022_spec, struct coding_system):
3174 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3175 (struct emacs_mule_spec): Remove unused field 'full_support'.
3176 All initializations removed.
3177 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3178
3179 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3180
3181 Fix spare memory change (Bug#12286).
3182 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3183 (valid_lisp_object_p): Likewise.
3184
3185 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3186
3187 * window.c (Fset_window_configuration): Record any window's old
3188 buffer if it's replaced (see Bug#8789). If the new current
3189 buffer doesn't appear in the selected window, go to its old
3190 point (Bug#12208).
3191
3192 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3193
3194 Special MEM_TYPE_SPARE to denote reserved memory.
3195 * alloc.c (enum mem_type): New memory type.
3196 (refill_memory_reserve): Use new type for spare memory.
3197 This prevents live_cons_p and live_string_p from incorrect
3198 detection of uninitialized objects from spare memory as live.
3199
3200 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3201
3202 Spelling fixes.
3203 * Makefile.in (.PHONY): versioclean -> versionclean.
3204
3205 Remove unused external symbols.
3206 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3207 * window.c (Qwindow_valid_p, decode_valid_window):
3208 Now static, not extern.
3209 * data.c (Qinterval): Remove; unused.
3210 (syms_of_data): Do not define 'interval'.
3211 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3212 * window.h (decode_valid_window):
3213 Remove decls.
3214
3215 * character.c, charset.c, chartab.c: Use bool for booleans.
3216 * character.c (lisp_string_width, string_count_byte8)
3217 (string_escape_byte8):
3218 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3219 (load_charset_map_from_file, map_charset_chars)
3220 (Fdefine_charset_internal, define_charset_internal)
3221 (Fdeclare_equiv_charset, find_charsets_in_text)
3222 (Ffind_charset_region, char_charset, Fiso_charset):
3223 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3224 (sub_char_table_set, sub_char_table_set_range)
3225 (char_table_set_range, optimize_sub_char_table)
3226 (map_sub_char_table):
3227 Use bool for boolean.
3228 * character.c (str_to_unibyte): Omit last boolean argument; it was
3229 always 0. All callers changed.
3230 * character.h, charset.h: Adjust to match previous changes.
3231 * character.h (char_printable_p): Remove decl of nonexistent function.
3232 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3233 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3234 are all boolean, so make them single-bit bitfields.
3235
3236 * lisp.h (ASET): Remove attempt to detect side effects.
3237 It was meant to be temporary and it often doesn't work,
3238 because when IDX has side effects the behavior of IDX==IDX
3239 is undefined. See Stefan Monnier in
3240 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3241
3242 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3243
3244 * lisp.h (functionp): New function (extracted from Ffunctionp).
3245 (FUNCTIONP): Use it.
3246 * eval.c (Ffunctionp): Use it.
3247
3248 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3251 as that's faster and simpler than static storage. Don't bother
3252 with the g_main_context_query overhead if g_main_context_pending
3253 says no events are pending.
3254 (gfds, gfds_size): Remove these static vars.
3255 (xgselect_initialize): Remove; no longer needed.
3256 All uses and decls removed.
3257
3258 * emacs.c (fatal_error_signal_hook): Remove.
3259 All uses removed. This leftover from old code was always 0.
3260
3261 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3262 * casefiddle.c (casify_object, casify_region):
3263 * casetab.c (set_case_table):
3264 * category.c, category.h (word_boundary_p):
3265 * category.h (CHAR_HAS_CATEGORY):
3266 Use bool for booleans, instead of int.
3267
3268 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3269
3270 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3271
3272 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3273
3274 On assertion failure, print backtrace if available.
3275 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3276 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3277 * Makefile.in (LIB_EXECINFO): New macro.
3278 (LIBES): Use it.
3279
3280 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3281 * bytecode.c (exec_byte_code):
3282 * callint.c (check_mark, Fcall_interactively):
3283 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3284 (getenv_internal, sync_process_alive, call_process_exited):
3285 * lisp.h (USE_SAFE_ALLOCA):
3286 Use bool for booleans, instead of int.
3287 * lisp.h, process.h: Adjust prototypes to match above changes.
3288 * callint.c (Fcall_interactively): Don't assume the mark's
3289 offset fits in 'int'.
3290
3291 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3292
3293 * buffer.c, buffer.h: Use bool for boolean.
3294 * buffer.c (reset_buffer_local_variables)
3295 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3296 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3297 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3298 (overlay_touches_p, overlay_strings, Foverlay_put)
3299 (report_overlay_modification, call_overlay_mod_hooks):
3300 (mmap_enlarge, mmap_set_vars):
3301 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3302 Use bool for booleans, instead of int.
3303 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3304 since the 1-or-0 return value is always ignored anyway.
3305 (mmap_initialized_p):
3306 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3307 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3308
3309 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3310
3311 * bidi.c: Use bool for boolean.
3312 This is a bit more readable, and makes the text segment of bidi.o
3313 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3314 Presumably it's faster too.
3315 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3316 Now bool.
3317 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3318 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3319 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3320 (bidi_explicit_dir_char, bidi_level_of_next_char)
3321 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3322 Use bool for booleans, instead of int.
3323 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3324 (bidi_unshelve_cache): Adjust decls to match code.
3325
3326 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3327
3328 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3329 argument.
3330
3331 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3332
3333 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3334 * atimer.h: Include <stdbool.h>.
3335
3336 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3337
3338 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3339 compile time tests instead of run time tests on systems that do
3340 not use them.
3341 (FRAME_MAC_P): Remove leftover from deleted code.
3342 * frame.c (syms_of_frame): Remove leftover from deleted code.
3343
3344 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3345
3346 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3347
3348 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3349
3350 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3351 Otherwise, the compiler complains about (A?B:C) where B is void
3352 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3353 (fontset_add): Return void, for FONTSET_ADD.
3354
3355 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3356
3357 * alloc.c: Use bool for booleans.
3358 (gc_in_progress, abort_on_gc)
3359 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3360 (dont_register_blocks) [GC_MALLOC_CHECK]:
3361 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3362 (check_string_bytes, make_specified_string, memory_full)
3363 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3364 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3365 (mark_stack, valid_pointer_p, make_pure_string)
3366 (Fgarbage_collect, survives_gc_p, gc_sweep):
3367 Use bool for booleans, instead of int.
3368 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3369 Remove unused local.
3370 * alloc.c (PURE_POINTER_P):
3371 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3372 * editfns.c (Fformat):
3373 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3374 (Fdo_auto_save):
3375 * fns.c (sweep_weak_table):
3376 * lisp.h (suppress_checking, push_message, survives_gc_p)
3377 (make_pure_string, gc_in_progress, abort_on_gc):
3378 * lread.c (readchar, read1):
3379 * print.c (Fprin1_to_string):
3380 * xdisp.c (push_message):
3381 Use bool for booleans affected directly or indirectly by
3382 alloc.c's changes.
3383
3384 Make recently-introduced setters macros.
3385 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3386 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3387 (set_fontset_default, set_fontset_fallback): Rename from their
3388 upper-case counterparts, and make them functions rather than macros.
3389 This is more consistent with the other recently-introduced setters.
3390 These don't need to be inline, since they're local.
3391
3392 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3393
3394 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3395 the loop (Bug#12247).
3396
3397 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3398
3399 * lisp.h (vcopy): Use memcpy rather than our own loop.
3400 This fixes a performance regression introduced by the recent
3401 addition of vcopy. This means 'vcopy' will need to be modified
3402 for a copying collector, but that's OK. Also, tighten the
3403 checking in the assertion.
3404
3405 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3406
3407 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3408 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3409 non-base glyph for the width of the base character, according to
3410 what x_draw_composite_glyph_string_foreground expects.
3411 Generate WADJUST value according to composition_gstring_width's
3412 expectations, to produce correct width of the composed character.
3413 Reverse the sign of the DU offset produced by ScriptPlace.
3414
3415 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3416
3417 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3418
3419 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3420
3421 Avoid direct writes to contents member of struct Lisp_Vector.
3422 * lisp.h (vcopy): New function to copy data into vector.
3423 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3424 * fns.c (Ffillarray): Use ASET.
3425 * keyboard.c (timer_check_2): Use AREF and ASET.
3426 (append_tool_bar_item, Frecent_keys): Use vcopy.
3427 * lread.c (read_vector): Use ASET.
3428 * msdos.c (Frecent_doskeys): Use vcopy.
3429 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3430 (Finternal_merge_in_global_face): Use ASET and vcopy.
3431 * xfont.c (xfont_list_pattern): Likewise.
3432
3433 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3434
3435 * window.c (Fwindow_point): For the selected window always return
3436 the position of its buffer's point.
3437 (Fset_window_point): For the selected window always go in its
3438 buffer to the specified position.
3439
3440 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3441
3442 Setter macros for fontsets.
3443 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3444 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3445 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3446 Adjust users.
3447
3448 2012-08-20 Glenn Morris <rgm@gnu.org>
3449
3450 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3451 Don't assume that `ln -f' works.
3452
3453 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3454
3455 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3456 and later about non-assignments with no effect. See discussion at
3457 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3458 details.
3459
3460 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3461
3462 Inline setter functions for Lisp_Objects slots of struct specbinding.
3463 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3464 Adjust users.
3465
3466 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3467
3468 * window.c (select_window): Always make selected window's buffer
3469 current.
3470
3471 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3472
3473 Use AREF and ASET for docstrings of category tables.
3474 * category.h (CATEGORY_DOCSTRING): Use AREF.
3475 (SET_CATEGORY_DOCSTRING): Use ASET.
3476 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3477
3478 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3479
3480 Inline setter functions for hash table members.
3481 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3482 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3483 (set_hash_key_and_value, set_hash_index, set_hash_next)
3484 (set_hash_hash): New functions.
3485 * charset.c, fns.c: Adjust users.
3486
3487 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3488
3489 Inline getter and setter functions for per-buffer values.
3490 * buffer.h (per_buffer_default, set_per_buffer_default)
3491 (per_buffer_value, set_per_buffer_value): New functions.
3492 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3493 * buffer.c, data.c: Adjust users.
3494
3495 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3496
3497 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3498
3499 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3500
3501 Rely on <config.h> + <unistd.h> to declare 'environ',
3502 as gnulib does this if the system doesn't.
3503 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3504 Remove declaration. MS-Windows declares it on stdlib.h which is
3505 included by conf_post.h.
3506 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3507 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3508 * vm-limit.c: Include <unistd.h>, for 'environ'.
3509
3510 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3511 (start_of_data): Remove decl; mem-limits.h provides it.
3512
3513 * xdisp.c (handle_invisible_prop): Make it a bit faster
3514 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3515
3516 2012-08-19 Chong Yidong <cyd@gnu.org>
3517
3518 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3519 ends (Bug#3874).
3520
3521 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3522
3523 * .gdbinit: Use call instead of set when calling a function in the
3524 inferior.
3525
3526 * data.c (set_internal): Don't use set_blv_found.
3527 (Fkill_local_variable): Likewise.
3528
3529 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3530
3531 * nsfont.m (ns_ascii_average_width): Ensure the string
3532 ascii_printable is initialized with a null-terminated character
3533 array. Otherwise, it can contain undesired extra characters.
3534
3535 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3536
3537 port new setting code to Sun C 5.8 2005/10/13
3538 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3539 Return void, not Lisp_Object. Otherwise, the compiler
3540 complains about (A?B:C) where B is void and C is Lisp_Object
3541 when compiling CHAR_TABLE_SET, due to the recent change to
3542 the API of sub_char_table_set_contents.
3543
3544 2012-08-18 Chong Yidong <cyd@gnu.org>
3545
3546 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3547 for the string case (Bug#3874).
3548
3549 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * buffer.h (BSET): Remove (Bug#12215).
3552 Replace all uses with calls to new setter functions.
3553 (bset_bidi_paragraph_direction, bset_case_canon_table)
3554 (bset_case_eqv_table, bset_directory, bset_display_count)
3555 (bset_display_time, bset_downcase_table)
3556 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3557 (bset_last_selected_window, bset_local_var_alist)
3558 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3559 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3560 (bset_width_table):
3561 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3562 (bset_auto_fill_function, bset_auto_save_file_format)
3563 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3564 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3565 (bset_cache_long_line_scans, bset_case_fold_search)
3566 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3567 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3568 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3569 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3570 (bset_header_line_format, bset_indicate_buffer_boundaries)
3571 (bset_indicate_empty_lines, bset_invisibility_spec)
3572 (bset_left_fringe_width, bset_major_mode, bset_mark)
3573 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3574 (bset_name, bset_overwrite_mode, bset_pt_marker)
3575 (bset_right_fringe_width, bset_save_length)
3576 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3577 (bset_scroll_up_aggressively, bset_selective_display)
3578 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3579 (bset_word_wrap, bset_zv_marker):
3580 * category.c (bset_category_table):
3581 * syntax.c (bset_syntax_table):
3582 New setter functions.
3583
3584 * process.h (PSET): Remove (Bug#12215).
3585 Replace all uses with calls to new setter functions.
3586 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3587 (PROCESS_INLINE): New macro.
3588 (pset_childp): New setter function.
3589 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3590 * process.c (PROCESS_INLINE):
3591 Define to EXTERN_INLINE, so that the corresponding functions
3592 are compiled into code.
3593 (pset_buffer, pset_command, pset_decode_coding_system)
3594 (pset_decoding_buf, pset_encode_coding_system)
3595 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3596 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3597 (pset_type, pset_write_queue): New setter functions.
3598
3599 * window.h (WSET): Remove (Bug#12215).
3600 Replace all uses with calls to new setter functions.
3601 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3602 (WINDOW_INLINE): New macro.
3603 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3604 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3605 (wset_total_lines, wset_vertical_scroll_bar)
3606 (wset_window_end_pos, wset_window_end_valid)
3607 (wset_window_end_vpos): New setter functions.
3608 * window.c (WINDOW_INLINE):
3609 Define to EXTERN_INLINE, so that the corresponding functions
3610 are compiled into code.
3611 (wset_combination_limit, wset_dedicated, wset_display_table)
3612 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3613 (wset_new_normal, wset_new_total, wset_next_buffers)
3614 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3615 (wset_prev_buffers, wset_right_fringe_width)
3616 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3617 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3618 (wset_window_parameters):
3619 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3620 (wset_column_number_displayed, wset_region_showing):
3621 New setter functions.
3622
3623 * termhooks.h (TSET): Remove (Bug#12215).
3624 Replace all uses with calls to new setter functions.
3625 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3626 (TERMHOOKS_INLINE): New macro.
3627 (tset_charset_list, tset_selection_alist): New setter functions.
3628 * terminal.c (TERMHOOKS_INLINE):
3629 Define to EXTERN_INLINE, so that the corresponding functions
3630 are compiled into code.
3631 (tset_param_alist): New setter function.
3632
3633 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3634
3635 * keyboard.h (KSET): Remove (Bug#12215).
3636 Replace all uses with calls to new setter functions.
3637 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3638 (KEYBOARD_INLINE): New macro.
3639 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3640 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3641 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3642 New setter functions.
3643 * keyboard.c (KEYBOARD_INLINE):
3644 Define to EXTERN_INLINE, so that the corresponding functions
3645 are compiled into code.
3646 (kset_echo_string, kset_kbd_queue)
3647 (kset_keyboard_translate_table, kset_last_prefix_arg)
3648 (kset_last_repeatable_command, kset_local_function_key_map)
3649 (kset_overriding_terminal_local_map, kset_real_last_command)
3650 (kset_system_key_syms): New setter functions.
3651
3652 * frame.h (FSET): Remove (Bug#12215).
3653 Replace all uses with calls to new setter functions.
3654 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3655 (FRAME_INLINE): New macro.
3656 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3657 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3658 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3659 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3660 (fset_param_alist, fset_root_window, fset_scroll_bars)
3661 (fset_selected_window, fset_title, fset_tool_bar_items)
3662 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3663 * frame.c (FRAME_INLINE):
3664 Define to EXTERN_INLINE, so that the corresponding functions
3665 are compiled into code.
3666 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3667
3668 A few more naming-convention fixes for getters and setters.
3669 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3670 and rename from buffer_overlays_set_before.
3671 (set_buffer_overlays_after): Move here from buffer.h, and rename
3672 from buffer_overlays_set_after.
3673 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3674 All uses changed.
3675 (set_buffer_intervals): Rename from buffer_set_intervals.
3676 * intervals.c (set_interval_object): Move here from intervals.h,
3677 and rename from interval_set_object.
3678 (set_interval_left): Move here from intervals.h, and rename from
3679 interval_set_left.
3680 (set_interval_right): Move here from intervals.h, and rename from
3681 interval_set_right.
3682 (copy_interval_parent): Move here from intervals.h, and rename from
3683 interval_copy_parent.
3684 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3685 (set_interval_plist): Rename from interval_set_plist.
3686 Return void, not Lisp_Object, since no caller uses the result.
3687 * lisp.h (string_intervals): Rename from string_get_intervals.
3688 (set_string_intervals): Rename from string_set_intervals.
3689
3690 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3691 (set_char_table_contents): Rename from char_table_set_contents.
3692 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3693 All uses changed. See the end of
3694 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3695
3696 * lisp.h (CSET): Remove (Bug#12215).
3697 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3698 (set_char_table_purpose): New functions,
3699 replacing CSET. All uses changed. For example, replace
3700 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3701 "set_char_table_parent (char_table, parent);".
3702 The old version was confusing because it used the same name
3703 'parent' for two different things.
3704
3705 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3706
3707 Functions to get and set Lisp_Object fields of buffer-local variables.
3708 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3709 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3710 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3711 * data.c, eval.c, frame.c: Adjust users.
3712
3713 2012-08-17 Chong Yidong <cyd@gnu.org>
3714
3715 * xfaces.c (merge_face_vectors): If the target font specfies a
3716 font spec, make the font's attributes take precedence over
3717 directly-specified attributes.
3718 (merge_face_ref): Recognize :font.
3719
3720 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3721
3722 Do not use memcpy for copying intervals.
3723 * intervals.c (reproduce_interval): New function.
3724 (reproduce_tree, reproduce_tree_obj): Use it.
3725 (reproduce_tree_obj): Remove prototype.
3726
3727 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3728
3729 * lisp.h (duration_to_sec_usec): Remove unused decl.
3730
3731 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3732
3733 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3734 to an allocated instance of NSString, not to the class itself.
3735
3736 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3737
3738 * makefile.w32-in (C_CTYPE_H): New macro.
3739 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3740 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3741 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3742
3743 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3744
3745 Use ASCII tests for character types.
3746 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3747 * xfns.c, xterm.c:
3748 Don't include <ctype.h>; was not needed.
3749 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3750 * sysdep.c, xfaces.c:
3751 Include <c-ctype.h> instead of <ctype.h>.
3752 * nsterm.m: Include <c-ctype.h>.
3753 * charset.c (read_hex):
3754 * doc.c (Fsnarf_documentation):
3755 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3756 (DRIVE_LETTER) [DOS_NT]:
3757 (Ffile_name_directory, Fexpand_file_name)
3758 (Fsubstitute_in_file_name):
3759 * font.c (font_parse_xlfd, font_parse_fcname):
3760 * frame.c (x_set_font_backend):
3761 * gtkutil.c (xg_get_font):
3762 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3763 * nsimage.m (hexchar):
3764 * nsterm.m (ns_xlfd_to_fontname):
3765 * sysdep.c (system_process_attributes):
3766 * xfaces.c (hash_string_case_insensitive):
3767 Use C-locale tests instead of locale-specific tests for character
3768 types, since we want the ASCII interpretation here, not the
3769 interpretation suitable for whatever happens to be the current locale.
3770
3771 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3772
3773 Consistently check windows for validity/liveness
3774 (Bug#11984, Bug#12025, Bug#12026).
3775 * lisp.h (CHECK_VALID_WINDOW): New macro.
3776 * window.c (decode_window): Rename to decode_live_window.
3777 (decode_valid_window, Fwindow_valid_p): New functions.
3778 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3779 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3780 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3781 (Fwindow_prev_sibling, Fwindow_combination_limit)
3782 (Fset_window_combination_limit, Fwindow_use_time)
3783 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3784 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3785 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3786 (Fwindow_hscroll, Fset_window_hscroll)
3787 (Fwindow_redisplay_end_trigger)
3788 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3789 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3790 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3791 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3792 (Fwindow_end, Fset_window_point, Fset_window_start)
3793 (Fpos_visible_in_window_p, Fwindow_line_height)
3794 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3795 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3796 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3797 (Fset_window_parameter, Fwindow_display_table)
3798 (Fset_window_display_table, Fdelete_other_windows_internal)
3799 (Fset_window_buffer, Fset_window_new_total)
3800 (Fset_window_new_normal, Fdelete_window_internal)
3801 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3802 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3803 (Fwindow_scroll_bars): Check whether argument window is a valid or
3804 live window. Update doc-strings.
3805 (syms_of_window): New symbol Qwindow_valid_p.
3806 * keyboard.c (Fposn_at_x_y): Check whether argument
3807 frame_or_window denotes a valid window.
3808
3809 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3810
3811 Fix previous char table change.
3812 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3813 * chartab.c (optimize_sub_char_table): Likewise.
3814
3815 2012-08-16 Chong Yidong <cyd@gnu.org>
3816
3817 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3818
3819 * xfont.c (xfont_open):
3820 * xftfont.c (xftfont_open): Set the font's max_width field.
3821
3822 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3823 min_width to space_width and average_width to the average over
3824 printable ASCII characters.
3825 (ns_char_width): Code cleanup.
3826 (ns_ascii_average_width): New utility function.
3827
3828 * font.h (struct font): Update comments.
3829
3830 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3831
3832 Simple interface to set Lisp_Object fields of character tables.
3833 * lisp.h (CSET): New macro.
3834 (char_table_set_extras, char_table_set_contents)
3835 (sub_char_table_set_contents): New function.
3836 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3837 * syntax.c: Adjust users.
3838
3839 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3840
3841 * eval.c (eval_sub): Bind lexical-binding.
3842 * lread.c (Qlexical_binding): Make non-static.
3843
3844 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3845
3846 * nsmenu.m (popupSession): Remove.
3847 (pop_down_menu): Remove endModalSession.
3848 (timeout_handler:): New method.
3849 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3850 Call runModalForWindow. Check timer_fired when it returns.
3851 If not set, cancel timer and break out of loop.
3852 Otherwise loop again, with a new timeout.
3853
3854 * nsterm.m: Include fcntl.h if present.
3855 (fd_entry, t_readfds, inNsSelect): Remove.
3856 (select_writefds, select_valid, select_timeout, selfds)
3857 (select_mutex, apploopnr): Add.
3858 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3859 Otherwise call kbd_buffer_store_event.
3860 (ns_send_appdefined): Remove release of fd_entry.
3861 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3862 Increment and decrement apploopnr.
3863 (ns_select): If no file descriptors, just do a NSTimer.
3864 Otherwise copy read/write masks and start select thread (fd_handler).
3865 Start main loop and wait for application defined event.
3866 Inform select thread to stop selecting after main loop is exited.
3867 (ns_term_init): Create selfds pipe and set non-blocking.
3868 Initialize select_mutex. Start the select thread (fd_handler).
3869 (fd_handler:): Loop forever, wait for info from the main thread
3870 to either start or stop selecting. When select returns, send
3871 and appdefined event.
3872 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3873 If not call kbd_buffer_store_event.
3874
3875 * nsterm.h (EmacsApp): fd_handler takes id argument.
3876 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3877
3878 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3879
3880 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3881
3882 * region-cache.c (move_cache_gap): Update gap_len using the actual
3883 growth of the boundaries array. Do not change cache_len.
3884 (Bug#12196)
3885
3886 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3887
3888 Generalize and cleanup font subsystem checks.
3889 * font.h (FONT_DEBUG, font_assert): Remove.
3890 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3891 Change font_assert to eassert. Use eassert where appropriate.
3892
3893 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3896
3897 2012-08-15 Chong Yidong <cyd@gnu.org>
3898
3899 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3900 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3901 extract the font descriptor instead of just the font name.
3902 In that case, return a font spec instead of a string.
3903 (x_last_font_name): Move to this file from xfns.c.
3904
3905 * xfns.c (Fx_select_font): The return value can also be a font
3906 spec. Move x_last_font_name management to gtkutil.c.
3907
3908 * xfaces.c: Make font weight and style symbols non-static.
3909
3910 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3911
3912 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3913 (bug#12117).
3914
3915 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3916
3917 * alloc.c (Fgarbage_collect): Use plural form consistently.
3918
3919 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3920
3921 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3922 iteration through the command loop. Fixes a problem whereby mouse
3923 movements are ignored until the first mouse click.
3924
3925 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 Use bool, not int, for Lisp booleans.
3928 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3929 makes Emacs a bit smaller and presumably a bit faster.
3930 * lisp.h: Include <stdbool.h>.
3931 (struct Lisp_Boolfwd, defvar_bool):
3932 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3933 * regex.c [!emacs]: Include <stdbool.h>.
3934 (false, true): Remove; <stdbool.h> does this for us now.
3935
3936 2012-08-14 Chong Yidong <cyd@gnu.org>
3937
3938 * character.c (Fcharacterp): Doc fix (Bug#12076).
3939
3940 * data.c (Findirect_variable): Doc fix (Bug#11040).
3941
3942 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3943
3944 * editfns.c (Fformat): Doc fix (Bug#12059).
3945 (Fsave_current_buffer): Doc fix (Bug#11542).
3946
3947 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3948
3949 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3950 (bug#12022).
3951
3952 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3953
3954 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3955 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3956 * minibuf.c (choose_minibuf_frame, read_minibuf):
3957 * w32fns.c (x_create_tip_frame):
3958 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3959 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3960
3961 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3962
3963 * intervals.c (offset_intervals): Remove obsolete comment.
3964
3965 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3966
3967 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3968
3969 2012-08-14 Gergely Risko <gergely@risko.hu>
3970
3971 * coding.c (decode_coding): Record buffer modification before
3972 disabling undo_list (Bug#11773).
3973
3974 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3975
3976 Revert and cleanup some recent overlay changes.
3977 * buffer.h (enum overlay_type): Remove.
3978 (buffer_get_overlays, buffer_set_overlays): Likewise.
3979 (buffer_set_overlays_before, buffer_set_overlays_after):
3980 New function. Adjust users.
3981 (unchain_both): Add eassert.
3982
3983 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3984
3985 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3986
3987 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 * gtkutil.c (xg_mark_data): Don't assume C99.
3990
3991 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3992
3993 * gtkutil.c (xg_frame_tb_info): New struct.
3994 (TB_INFO_KEY): New define.
3995 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3996 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3997 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3998 if not present.
3999 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4000 is up to date. Otherwise store new data.
4001 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4002
4003 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4004
4005 Use KSET for write access to Lisp_Object members of struct kboard.
4006 * keyboard.h (KSET): New macro.
4007 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4008 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4009 * xterm.c: Adjust users.
4010
4011 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4012
4013 Use BSET for write access to Lisp_Object members of struct buffer.
4014 * buffer.h (BSET): New macro.
4015 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4016 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4017 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4018 * window.c, xdisp.c, xfns.c: Adjust users.
4019
4020 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4021
4022 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4023
4024 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4025
4026 * nsterm.m (not_in_argv): New function.
4027 (application:openFile, application:openTempFile:):
4028 (application:openFileWithoutUI:, application:openFiles:): Open file
4029 if not_in_argv returns non-zero (bug#12171).
4030
4031 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4032 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4033 Define for Gtk+ versions less than 3.2.
4034 (xg_get_font_name): Use those functions/macros here.
4035 Reported by Frans Oilinki <moilinki@gmail.com>.
4036
4037 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4038
4039 * unexmacosx.c (copy_data_segment): Copy initialized data in
4040 statically linked libraries from input file rather than memory.
4041
4042 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4043 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4044 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4045
4046 2012-08-10 Glenn Morris <rgm@gnu.org>
4047
4048 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4049 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4050
4051 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4052
4053 Fix last change to allow compilation with low optimization levels.
4054 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4055 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4056
4057 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4058
4059 Use common inline syntax in intervals.h.
4060 * intervals.h (INTERVALS_INLINE): New macro.
4061 Change all users from LISP_INLINE.
4062
4063 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4064
4065 Define Qnone once for all platforms.
4066 * frame.c (Qnone): Define here.
4067 (syms_of_frame): DEFSYM it.
4068 * lisp.h (Qnone): New declaration.
4069 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4070 * xfns.c: Remove duplication. Adjust users.
4071
4072 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4073
4074 Remove unused macros from intervals.h.
4075 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4076 * intervals.c: Adjust comment.
4077
4078 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4079
4080 * w32fns.c <w32_unicode_gui>: New static variable.
4081 (globals_of_w32fns): Initialize it according to os_subtype.
4082 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4083 testing os_subtype.
4084
4085 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4086 Eli Zaretskii <eliz@gnu.org>
4087
4088 Fix bug #10299 with Unicode characters sent by customized
4089 keyboards created by MSKLC.
4090 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4091 (w32_init_class): Use it to initialize the Emacs class with either
4092 ANSI or Unicode API calls.
4093 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4094 later.
4095 (w32_wnd_proc): If the character code sent by WM_CHAR or
4096 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4097 original message. Call DefWindowProcW on NT and later.
4098
4099 2012-08-10 Glenn Morris <rgm@gnu.org>
4100
4101 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4102
4103 * lisp.h (DIRECTORY_SEP): Let configure set it.
4104
4105 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4106
4107 Use TSET for write access to Lisp_Object slots of struct terminal.
4108 * termhooks.h (TSET): New macro.
4109 * coding.c, terminal.c, xselect.c: Adjust users.
4110
4111 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4112
4113 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4114 the failing expression, include them in the error message.
4115 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4116 * lisp.h (internal_condition_case_n): Update declaration.
4117
4118 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4119
4120 Inline functions to examine and change buffer overlays.
4121 * buffer.c (unchain_both): New function.
4122 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4123 (buffer_has_overlays): New function.
4124 (enum overlay_type): New enum.
4125 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4126 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4127
4128 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4129
4130 Inline functions to examine and change buffer intervals.
4131 * alloc.c (mark_interval_tree): Remove.
4132 (MARK_INTERVAL_TREE): Simplify.
4133 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4134 * intervals.c (buffer_balance_intervals): New function.
4135 (graft_intervals_into_buffer): Adjust indentation.
4136 (set_intervals_multibyte): Simplify.
4137 * buffer.h (BUF_INTERVALS): Remove.
4138 (buffer_get_intervals, buffer_set_intervals): New function.
4139 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4140 * intervals.c, textprop.c: Adjust users.
4141
4142 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4143
4144 Inline functions to examine and change string intervals.
4145 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4146 (string_get_intervals, string_set_intervals): New function.
4147 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4148 * lread.c, print.c, textprop.c: Adjust users.
4149
4150 2012-08-08 Glenn Morris <rgm@gnu.org>
4151
4152 * lisp.mk (lisp): Remove language/persian.elc.
4153
4154 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4155
4156 Cleanup intervals.
4157 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4158 (NULL_INTERVAL_P): Likewise. Adjust users.
4159 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4160 Adjust comment. Move under #if 0.
4161 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4162 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4163
4164 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4165
4166 Check total length of intervals with eassert.
4167 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4168 * intervals.c: Change all users to eassert.
4169
4170 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4171
4172 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4173 Rename fields to match removal of FGET and WGET and disuse of
4174 INTERNAL_FIELD in Lisp_Cons.
4175
4176 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4177
4178 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4179 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4180 name since all xname users are fixed long time ago. Do not
4181 use INTERNAL_FIELD.
4182 (set_symbol_name, set_symbol_function, set_symbol_plist):
4183 (set_symbol_next, set_overlay_plist): New function.
4184 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4185 (struct Lisp_Overlay): Likewise.
4186 (CVAR, MVAR, SVAR): Remove.
4187 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4188 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4189 * xterm.c: Adjust users.
4190 * .gdbinit: Change to use name field of struct Lisp_Symbol
4191 where appropriate.
4192
4193 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4194
4195 Basic functions to set Lisp_Object and pointer slots of intervals.
4196 * intervals.h (interval_set_parent, interval_set_object):
4197 (interval_set_left, interval_set_right, interval_set_plist):
4198 (interval_copy_parent): New function.
4199 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4200 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4201 Adjust indentation.
4202 (INTERVAL_SIZE): Remove. Adjust users.
4203 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4204
4205 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4206
4207 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4208 * process.h (PGET): Remove.
4209 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4210 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4211
4212 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4213
4214 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4215 * window.h (WGET): Remove.
4216 (struct window): Do not use INTERNAL_FIELD.
4217 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4218 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4219 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4220 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4221 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4222 Adjust users.
4223
4224 2012-08-07 Chong Yidong <cyd@gnu.org>
4225
4226 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4227 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4228 (Fdelete_window_internal): Signal an error if the window is not on
4229 a live frame (Bug#12025).
4230
4231 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4232
4233 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4234 * frame.h (FGET): Remove.
4235 (struct frame): Do not use INTERNAL_FIELD.
4236 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4237 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4238 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4239 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4240
4241 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4242
4243 * w32.c: Silence compiler warnings.
4244 (map_w32_filename): Remove unused variable `is_fat'.
4245 (chase_symlinks): Add parentheses around expression.
4246
4247 2012-08-06 Glenn Morris <rgm@gnu.org>
4248
4249 * sysdep.c: Respect BROKEN_GETWD.
4250
4251 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4252 Let configure handle it.
4253 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4254
4255 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4256
4257 Use GCALIGNMENT where appropriate.
4258 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4259 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4260 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4261
4262 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4263
4264 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4265 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4266
4267 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4268
4269 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4270 that should be sufficient for everyone.
4271
4272 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4273
4274 * keyboard.c (timer_check_2): Add break so timer_check returns next
4275 timeout.
4276
4277 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4278
4279 Fix Windows build errors introduced after converting to WGET and WSET.
4280 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4281 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4282
4283 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4284
4285 * nsterm.m (ns_frame_rehighlight): Use FSET.
4286
4287 * nsmenu.m (ns_update_menubar): Use FSET.
4288
4289 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4290
4291 Separate read and write access to Lisp_Object slots of Lisp_Process.
4292 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4293 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4294
4295 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4296
4297 Separate read and write access to Lisp_Object slots of struct window.
4298 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4299 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4300 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4301 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4302 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4303 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4304 Adjust users.
4305
4306 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4307
4308 Fix Windows build errors introduced after converting to FGET and FSET.
4309 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4310 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4311 (w32_judge_scroll_bars): Change to use FSET.
4312 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4313
4314 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4315
4316 Fix replacement typo.
4317 * window.c (replace_window): Set root_window instead of
4318 selected_window. This fixes a total window subsystem
4319 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4320
4321 2012-08-06 Glenn Morris <rgm@gnu.org>
4322
4323 * lisp.mk (lisp): Add language/persian.elc.
4324
4325 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4326
4327 Separate read and write access to Lisp_Object slots of struct frame.
4328 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4329 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4330 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4331 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4332 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4333
4334 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4335
4336 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4337
4338 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4339
4340 Generalize common compile-time constants.
4341 * lisp.h (header_size, bool_header_size, word_size): Now here.
4342 (struct Lisp_Vector): Add comment.
4343 (struct Lisp_Bool_Vector): Move up to define handy constants.
4344 (VECSIZE, PSEUDOVECSIZE): Simplify.
4345 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4346 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4347 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4348 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4349 * xfont.c, xmenu.c: Use word_size where appropriate.
4350
4351 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4352
4353 * search.c (Freplace_match): Treat \? in the replacement text
4354 literally (Bug#8161).
4355
4356 2012-08-05 Chong Yidong <cyd@gnu.org>
4357
4358 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4359 * frame.c (Vdelete_frame_functions):
4360 * emacs.c (Vkill_emacs_hook): Doc fix.
4361
4362 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4363
4364 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4365 --with-x-toolkit=no builds.
4366 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4367
4368 2012-08-04 Chong Yidong <cyd@gnu.org>
4369
4370 * syntax.c (Fmodify_syntax_entry): Doc fix.
4371
4372 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4373
4374 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4375 * w32.c (init_environment): Change the default values of many
4376 environment variables in dflt_envvars[] to NULL, to avoid pushing
4377 them into environment when they were not already defined.
4378 Remove the code that deletes site-lisp subdirectories from the default
4379 value of EMACSLOADPATH, as it is no longer needed.
4380 (check_windows_init_file): Now external, not static.
4381 Use Vload_path as is, without adding anything, as this function is now
4382 called when Vload_path is already set up.
4383
4384 * w32.h (check_windows_init_file): Add prototype.
4385
4386 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4387 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4388 compatibility with Posix platforms.
4389 (main): Move the call to check_windows_init_file to here from
4390 w32.c.
4391 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4392 any, in the DEFALT argument into the root of the Emacs build or
4393 installation tree, as appropriate.
4394
4395 * callproc.c (init_callproc_1): Call decode_env_path instead of
4396 doing its equivalent by hand.
4397 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4398 the code that sets Vexec_path run on MS-Windows.
4399
4400 * lread.c (init_lread): Add comments to #ifdef's.
4401
4402 * msdos.c (dos_set_window_size, IT_update_begin)
4403 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4404 instead of direct references.
4405
4406 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4407
4408 Export DEFAULT_REHASH_* to GDB.
4409 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4410 Now constants, not macros.
4411
4412 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4413
4414 Remove unnecessary casts involving pointers.
4415 These casts are no longer needed now that we assume C89 or later,
4416 since they involve casting to or from void *.
4417 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4418 (make_pure_float, make_pure_vector):
4419 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4420 * macros.c (Fstart_kbd_macro):
4421 * menu.c (find_and_return_menu_selection):
4422 * minibuf.c (read_minibuf_noninteractive):
4423 * sysdep.c (closedir):
4424 * xdisp.c (x_produce_glyphs):
4425 * xfaces.c (compare_fonts_by_sort_order):
4426 * xfns.c (x_real_positions, select_visual):
4427 * xselect.c (x_stop_queuing_selection_requests)
4428 (x_get_window_property, x_get_window_property_as_lisp_data):
4429 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4430 Remove unnecessary pointer casts.
4431 * alloc.c (record_xmalloc): New function.
4432 * lisp.h (record_xmalloc): New decl.
4433 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4434 more like a function. This is because the pointer cast is not
4435 needed. All uses changed.
4436 * print.c (print_string, print_error_message): Avoid length recalc.
4437
4438 Improve fix for macroexp crash with debugging (Bug#12118).
4439 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4440 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4441 not supposed to be invoked from the garbage collector.
4442 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4443 (gc_aset): New function, which is like ASET but can be
4444 used in the garbage collector.
4445 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4446 (set_hash_index): Use it instead of ASET.
4447
4448 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4449
4450 Support symlinks on latest versions of MS-Windows.
4451 * w32.c: Include winioctl.h and aclapi.h.
4452 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4453 (revert_to_self): Forward declarations of static functions.
4454 <static BOOL g_b_init_get_security_info>:
4455 <g_b_init_create_symbolic_link>: New static flags.
4456 (globals_of_w32): Initialize them to zero.
4457 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4458 (map_w32_filename): Improve commentary. Simplify switch.
4459 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4460 headers (most versions of MinGW w32api don't).
4461 (get_security_info, create_symbolic_link)
4462 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4463 New functions.
4464 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4465 in the argument file name.
4466 (sys_access): Call unc_volume_file_attributes only if
4467 GetFileAttributes fails with network-related error codes.
4468 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4469 have the required privileges.
4470 (get_file_security_desc_by_name): Rename from
4471 get_file_security_desc.
4472 (stat_worker): New function, with most of the guts of 'stat', and
4473 with addition of handling of symlinks and support for 'lstat'.
4474 If possible, get file's attributes and security information by
4475 handle, not by name. Produce S_IFLNK bit for symlinks, when
4476 called from 'lstat'.
4477 (stat, lstat): New functions, call 'stat_worker'.
4478 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4479 symlinks when the underlying filesystem supports them.
4480
4481 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4482
4483 Fix macroexp crash on Windows with debugging (Bug#12118).
4484 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4485 checking subscripts; problem introduced with the recent
4486 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4487 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4488 since it's used in non-static inline functions now.
4489
4490 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4491 Don't assume buffer size fits in 'int'. Remove unused local.
4492
4493 Use C99-style 'extern inline' if available.
4494 * buffer.h (BUFFER_INLINE):
4495 * category.h (CATEGORY_INLINE):
4496 * character.h (CHARACTER_INLINE):
4497 * charset.h (CHARSET_INLINE):
4498 * composite.h (COMPOSITE_INLINE):
4499 * dispextern.h (DISPEXTERN_INLINE):
4500 * lisp.h (LISP_INLINE):
4501 * systime.h (SYSTIME_INLINE):
4502 New macro, replacing 'static inline' in this header.
4503 * buffer.h, category.h, character.h, charset.h, composite.h:
4504 * dispextern.h, lisp.h, systime.h:
4505 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4506 * alloc.c (LISP_INLINE):
4507 * buffer.c (BUFFER_INLINE):
4508 * category.c (CATEGORY_INLINE):
4509 * character.c (CHARACTER_INLINE):
4510 * charset.c (CHARSET_INLINE):
4511 * composite.c (COMPOSITE_INLINE):
4512 * dispnew.c (DISPEXTERN_INLINE):
4513 * sysdep.c (SYSTIME_INLINE):
4514 Define to EXTERN_INLINE, so that the corresponding functions
4515 are compiled into code.
4516 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4517 (INLINE_HEADER_END): New macros.
4518 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4519 since it's used in non-static inline functions now.
4520 (VALMASK) [!USE_LSB_TAG]: Likewise.
4521
4522 2012-08-02 Glenn Morris <rgm@gnu.org>
4523
4524 * s/: Remove empty directory.
4525
4526 * s/ms-w32.h: Move to ../nt/inc.
4527 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4528 Update for new ms-w32.h location.
4529
4530 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4531
4532 Port to Solaris 8.
4533 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4534
4535 2012-08-02 Glenn Morris <rgm@gnu.org>
4536
4537 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4538 hard-coding the path separator.
4539
4540 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4541
4542 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4543 This how ASET and AREF are supposed to work, and makes
4544 it easier to think about future improvements. See
4545 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4546 * charset.h (set_charset_attr): New function.
4547 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4548 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4549 (aref_addr): New function. All uses of &AREF(...) changed.
4550 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4551 (set_hash_index): New functions. All lvalue-style uses of
4552 HASH_KEY etc. changed.
4553 * keyboard.c (set_prop): New function. All lvalue-style uses
4554 of PROP changed.
4555
4556 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4557
4558 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4559 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4560 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4561 * nsfns.m (ns_set_name_as_filename): Likewise.
4562 * nsmenu.m (ns_update_menubar): Likewise.
4563 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4564
4565 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4566
4567 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4568 Adapt to latest changes in field names of the corresponding Lisp
4569 objects.
4570
4571 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4572
4573 2012-08-01 Glenn Morris <rgm@gnu.org>
4574
4575 * s/msdos.h: Remove file.
4576 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4577 * Makefile.in (S_FILE): Remove.
4578 (config_h): Remove S_FILE.
4579
4580 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4581
4582 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4583 Remove; moved to nt/config.nt.
4584
4585 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4586
4587 Use INTERNAL_FIELD for conses and overlays.
4588 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4589 Remove obsolete comment.
4590 (MVAR): New macro.
4591 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4592 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4593
4594 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4595
4596 Use INTERNAL_FIELD for symbols.
4597 * lisp.h (SVAR): New macro. Adjust users.
4598 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4599 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4600
4601 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4602
4603 Use INTERNAL_FIELD for processes.
4604 * process.h (PVAR): New macro. Adjust style.
4605 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4606 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4607
4608 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4609
4610 Use INTERNAL_FIELD for windows.
4611 * window.h (WVAR): New macro.
4612 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4613 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4614 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4615 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4616 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4617 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4618
4619 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4620
4621 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4622
4623 2012-08-01 Glenn Morris <rgm@gnu.org>
4624
4625 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4626 Move to configure.ac.
4627
4628 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4629
4630 * makefile.w32-in (CONFIG_H): Update dependencies.
4631 (CONF_POST_H): New macro.
4632
4633 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4634
4635 2012-07-31 Glenn Morris <rgm@gnu.org>
4636
4637 * Makefile.in (S_FILE): No longer set by configure.
4638
4639 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4640 is available.
4641 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4642
4643 * process.h (NULL_DEVICE):
4644 * emacs.c (SEPCHAR):
4645 * editfns.c (USER_FULL_NAME): Let configure set them.
4646
4647 * s/README, s/template.h: Remove files.
4648
4649 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4650
4651 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4652 Move to configure.ac.
4653
4654 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4655
4656 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4657 resulting renaming of 'struct frame' members.
4658
4659 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4660
4661 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4662 after introduction of FVAR.
4663
4664 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4665
4666 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4667
4668 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4669 instead of compositeToPoint.
4670 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4671
4672 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4673
4674 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4675
4676 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4677 * lisp.h (INTERNAL_FIELD): New macro.
4678 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4679 (BVAR): Change to use INTERNAL_FIELD.
4680 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4681 (KVAR): Change to use INTERNAL_FIELD.
4682 * frame.h (FVAR): New macro.
4683 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4684 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4685 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4686 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4687 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4688
4689 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4690
4691 Miscellaneous fixes for non-default X toolkits.
4692 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4693 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4694 Move under #ifdef USE_LUCID.
4695 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4696 definition and usage to avoid warnings.
4697
4698 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4699
4700 * nsterm.m (openFiles): Fix previous checkin.
4701
4702 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4703
4704 * indent.c (compute_motion): Remove unused local.
4705
4706 2012-07-31 Glenn Morris <rgm@gnu.org>
4707
4708 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4709
4710 * conf_post.h [USG5_4]:
4711 Move remaining contents of s/usg5-4-common.h here.
4712 * s/usg5-4-common.h: Remove file.
4713
4714 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4715 * s/irix6-5.h: Remove file.
4716
4717 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4718 * s/darwin.h: Remove file.
4719
4720 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4721 * s/hpux10-20.h: Remove file, which is now empty.
4722
4723 2012-07-30 Glenn Morris <rgm@gnu.org>
4724
4725 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4726 * Makefile.in (config_h): Add conf_post.h.
4727 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4728
4729 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4730
4731 * nsterm.m (ns_do_open_file): New variable.
4732 (ns_term_init): Set ns_do_open_file to YES after run returns.
4733 (openFile, openTempFile, openFileWithoutUI, openFiles):
4734 Open files only if ns_do_open_file.
4735
4736 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4737
4738 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4739 This no-op macro hasn't been needed for many years.
4740 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4741
4742 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4743 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4744 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4745 gdb_make_enums_visible.
4746 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4747 (DIRECTORY_SEP): Now a constant, not a macro.
4748
4749 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4750
4751 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4752 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4753
4754 * w32term.c <w32_keyboard_codepage>: Renamed from
4755 keyboard_codepage and now external. All users changed.
4756
4757 * w32term.h: Add declaration of w32_keyboard_codepage.
4758
4759 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4760 the codepage to translate keys to Unicode. If this argument is
4761 -1, use the value returned by GetConsoleCP. All callers changed.
4762
4763 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4764
4765 Update .PHONY listings in makefiles.
4766 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4767 bootstrap-clean, distclean, maintainer-clean, versioclean,
4768 extraclean, frc.
4769
4770 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4771 This is a bit clearer. Fix some commentary typos.
4772
4773 2012-07-30 Glenn Morris <rgm@gnu.org>
4774
4775 * s/netbsd.h: Let configure include signal.h if needed.
4776 Remove file, which is now empty.
4777
4778 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4779 Let configure set them.
4780 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4781 No more need to undefine.
4782
4783 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4784
4785 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4786 non-single-byte char when adding meta modifier. (Bug#12090)
4787
4788 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4789
4790 Convert safe_call to use variable number of arguments.
4791 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4792 (safe_call2): Fix comment.
4793 * lisp.h (safe_call): Adjust prototype.
4794 * coding.c (encode_coding_object): Change to use safe_call2.
4795 * xfaces.c (merge_face_heights): Change to use safe_call1.
4796
4797 2012-07-30 Glenn Morris <rgm@gnu.org>
4798
4799 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4800 does that unconditionally. Remove file, which is now empty.
4801
4802 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4803 Remove empty files.
4804
4805 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4806
4807 Export to GDB most of lisp.h's remaining object-like macros.
4808 * lisp.h (min, max): Move earlier, because they're used earlier now.
4809 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4810 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4811 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4812 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4813 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4814 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4815 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4816 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4817 Now constants, for GDB. They need not be macros.
4818 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4819 Now constants, for GDB, as well as macros, for static initializers.
4820 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4821 Move to after the definition of struct Lisp_Char_Table,
4822 since the former now needs that type defined.
4823 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4824 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4825 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4826 New enums, for gdb_make_enums_visible.
4827 (GLYPH_MODE_LINE_FACE): Remove; unused.
4828 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4829 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4830 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4831 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4832 enum maxargs, enum MAX_ALLOCA.
4833 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4834 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4835 no longer needed, now that they are done in lisp.h.
4836
4837 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4838
4839 Cleanup string bytes checking.
4840 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4841 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4842 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4843 (check_sblock, compact_small_strings): Simplify.
4844
4845 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4846
4847 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4848 These macros are confusing and no longer need to be defined, as
4849 the enum values now suffice. All uses replaced with definiens.
4850 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4851
4852 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4853
4854 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4855 ($(BLD)/w32console.$(O)): Update dependencies.
4856
4857 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4858
4859 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4860 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4861 time. Adjust users.
4862 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4863
4864 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4865
4866 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4867 setting sitelisp (Bug#12010).
4868
4869 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4870
4871 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4872
4873 * w32heap.c (cache_system_info):
4874 * w32.c (sys_rename):
4875 * w32proc.c (find_child_console, sys_kill): All users changed.
4876
4877 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4880
4881 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4882
4883 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4884
4885 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4886
4887 Cleanup statistics calculation in Fgarbage_collect.
4888 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4889 Fix zombies percentage calculation. Simplify elapsed time calculation.
4890
4891 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4892
4893 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4894 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4895 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4896 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4897 (replace_range, replace_range_2, del_range_2): Change to eassert.
4898 * marker.c (byte_char_debug_check): Adjust style.
4899
4900 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4901
4902 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4903 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4904 long-ago-commented-out code that talks about "WIN32".
4905 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4906 All uses changed.
4907
4908 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4911 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4912 Simplify by using alignof.
4913 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4914 * lisp.h: Include <stdalign.h>.
4915 (GCALIGNMENT): New macro and constant.
4916 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4917 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4918 (stdalign): New macro, if not already defined.
4919
4920 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4921
4922 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4923 * w32inevt.c: Include w32inevt.h.
4924 (w32_read_console_input): New inline function, calls either
4925 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4926 w32_console_unicode_input.
4927 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4928 (w32_kbd_patch_key, key_event): Use the codepage returned by
4929 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4930 (key_event): use uChar.UnicodeChar only if
4931 w32_console_unicode_input is non-zero.
4932
4933 * w32console.c: Include w32heap.h.
4934 <w32_console_unicode_input>: New global variable.
4935 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4936 family of Windows, zero otherwise.
4937
4938 * w32inevt.h: Declare w32_console_unicode_input.
4939
4940 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4941 --without-x. (Bug#11742)
4942
4943 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 Adjust GDB to reflect pvec_type changes (Bug#12036).
4946 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4947 2012-07-04 changes to pseudovector representation.
4948 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4949
4950 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4951
4952 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4953 bus address.
4954 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4955
4956 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4957
4958 * alloc.c (listn): Fix the order the arguments are consed onto the
4959 list.
4960
4961 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4962 enumeration constants, as PURE and HEAP are too general, and clash
4963 with other headers and sources, such as gmalloc.c and the
4964 MS-Windows system headers. All users changed.
4965
4966 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4967
4968 Revert last save_excursion_save and save_excursion_restore changes.
4969 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4970 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4971
4972 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4973
4974 Fix recently-introduced typos in Windows port.
4975 Reported by Martin Rudalics <rudalics@gmx.at>.
4976 * w32.c (init_environment): Replace comma with semicolon.
4977 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4978
4979 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 Improve GDB symbol export (Bug#12036).
4982 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4983 arms of an 'if', not using conditional expressions; otherwise GDB
4984 complains about the types in the unevaluated arm when the argument
4985 is an integer literal.
4986 (xgetint): Simplify expression.
4987 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4988 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4989 Zaretskii in <http://bugs.gnu.org/12036#13>.
4990 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4991 needed now that we have gdb_make_enums_visible.
4992 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4993 (enum enum_USE_LSB_TAG):
4994 New enum types, packaging up enums that need to be exported to GDB.
4995
4996 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4997
4998 Utility function to make a list from specified amount of objects.
4999 * lisp.h (enum constype): New datatype.
5000 (listn): New prototype.
5001 * alloc.c (listn): New function.
5002 (Fmemory_use_count, syms_of_alloc): Use it.
5003 * buffer.c (syms_of_buffer): Likewise.
5004 * callint.c (syms_of_callint): Likewise.
5005 * charset.c (define_charset_internal): Likewise.
5006 * coding.c (syms_of_coding): Likewise.
5007 * keymap.c (syms_of_keymap): Likewise.
5008 * search.c (syms_of_search): Likewise.
5009 * syntax.c (syms_of_syntax): Likewise.
5010 * w32.c (init_environment): Likewise.
5011 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5012 * xdisp.c (syms_of_xdisp): Likewise.
5013 * xfns.c (syms_of_xfns): Likewise.
5014
5015 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5016
5017 Fast save_excursion_save and save_excursion_restore.
5018 * lisp.h (struct Lisp_Excursion): New data type.
5019 (PVEC_EXCURSION): New pseudovector type.
5020 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5021 to deal with it. Adjust comments.
5022 (init_marker, attach_marker): New prototype.
5023 (unchain_marker): Adjust prototype.
5024 * marker.c (attach_marker): Change to global.
5025 (init_marker): New function.
5026 * alloc.c (Fmake_marker, build_marker): Use it.
5027 (build_marker): More easserts.
5028 (mark_object): Handle struct Lisp_Excursion.
5029 * editfns.c (save_excursion_save, save_excursion_restore):
5030 Reimplement to use struct Lisp_Excursion. Add comments.
5031
5032 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5033
5034 Fix export of symbols to GDB (Bug#12036).
5035 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5036 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5037 emacs.c, as this is a more-suitable home. Had this been done earlier
5038 the fix for 12036 would have avoided some of the problems noted in
5039 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5040 would have been more obvious.
5041 * emacs.c: Do not include <verify.h>; no longer needed.
5042 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5043 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5044 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5045 Remove; now done in lisp.h.
5046 * lisp.h (PUBLISH_TO_GDB): New macro.
5047 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5048 (DATA_SEG_BITS): Use it.
5049 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5050 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5051 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5052 not be usable in #if. This simplifies things.
5053
5054 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5055
5056 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5057
5058 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 Simplify export of symbols to GDB (Bug#12036).
5061 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5062 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5063 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5064 Adjust to changes in lisp.h and emacs.c, by using
5065 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5066 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5067 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5068 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5069 instead of gdb_valbits.
5070 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5071 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5072 instead of gdb_array_mark_flag.
5073 (xboolvector): Get size from $->size, not $->header.size.
5074 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5075 (xreload, hook-run, hookpost-run): Remove.
5076 * emacs.c: Include <verify.h>.
5077 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5078 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5079 Remove.
5080 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5081 (gdb_USE_LSB_TAG): New enum constants.
5082 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5083 Also define these as enum constants, so they're visible to GDB.
5084 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5085 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5086 as constants, so they're visible to GDB.
5087 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5088 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5089 Now enum constants, not macros, so they're visible to GDB.
5090 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5091 more convenient now. All uses changed.
5092 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5093 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5094
5095 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5096
5097 Explicitly free restriction data that are not needed anymore.
5098 * editfns.c (save_restriction_restore): Free restriction data.
5099
5100 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5101
5102 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5103 add argument, tune behavior, and adjust all callers.
5104
5105 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5106
5107 Use typedef for EMACS_INT, EMACS_UINT.
5108 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5109 than macros. This simplifies debugging in the usual case, since
5110 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5111 and it allows expressions involving EMACS_INT casts.
5112 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5113
5114 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5115
5116 * nsterm.m (ns_read_socket): Return early if there is a modal
5117 window (Bug#12043).
5118
5119 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5120
5121 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5122 that FOCUS-FRAME can be omitted.
5123
5124 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5125
5126 Adjust buffer text indirection counters at the end of Fkill_buffer.
5127 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5128 buffer is definitely dead. This should really fix an issue reported
5129 by Christoph Scholtes again. (Bug#12007).
5130 (init_buffer_once): Initialize indirection counters of
5131 buffer_defaults and buffer_local_symbols (for sanity and safety).
5132
5133 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5134
5135 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5136 and continuation glyphs on tooltip frames, leave them at zero.
5137 Avoids continued lines in tooltips. (Bug#11832)
5138
5139 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5140
5141 Simplify copy_overlay.
5142 * buffer.c (copy_overlay): Simplify. Use build_marker.
5143 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5144
5145 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5146
5147 * print.c (print_object): Don't crash when a frame's name is nil
5148 or invalid. (Bug#12025)
5149
5150 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5151 it signals an error when a tooltip frame is being created.
5152
5153 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5154
5155 Cleanup miscellaneous objects allocation and initialization.
5156 * alloc.c (allocate_misc): Change to static. Add argument to
5157 specify the subtype. Adjust comment and users.
5158 (build_overlay): New function.
5159 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5160 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5161 (allocate_misc): Remove prototype.
5162 (build_overlay): Add prototype.
5163
5164 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5165
5166 Swap buffer text indirection counters in Fbuffer_swap_text.
5167 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5168 This avoids crash reported by Christoph Scholtes at
5169 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5170
5171 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5172
5173 * nsmenu.m (Popdown_data): New struct.
5174 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5175 free Popdown_data.
5176 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5177 (initWithContentRect): Make imgView and contentView non-static
5178 and autorelease them. Also autorelease img and matrix (Bug#12005).
5179 (dealloc): Remove (Bug#12005).
5180
5181 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5182
5183 Adjust consing_since_gc when objects are explicitly freed.
5184 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5185 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5186 (free_cons, free_misc): Subtract object size from consing_since_gc.
5187
5188 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5189
5190 Simplify and cleanup markers positioning code.
5191 * marker.c (attach_marker): More useful eassert.
5192 (live_buffer, set_marker_internal): New function.
5193 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5194 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5195
5196 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5197
5198 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5199 as it's limited by the amount of memory, not by INT_MAX.
5200
5201 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5202
5203 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5204 in special-event-map. See the discussion at
5205 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5206 for the reasons.
5207
5208 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5209 info.dwItemData. Fixes crashes on 64-bit Windows.
5210 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5211
5212 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5213
5214 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5215 (conversationIdentifier): Return value is NSInteger.
5216 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5217
5218 2012-07-21 Chong Yidong <cyd@gnu.org>
5219
5220 * window.c (decode_any_window): Signal an error if the window is
5221 on a dead frame (Bug#11984).
5222
5223 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5224
5225 Add indirection counting to speed up Fkill_buffer.
5226 * buffer.h (struct buffer): New member.
5227 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5228 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5229 base buffer indirection counter.
5230 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5231 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5232 through buffer list if indirection counter is 0.
5233
5234 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5235
5236 Extend the value returned by Fgarbage_collect with heap statistics.
5237 * alloc.c (Qheap): New symbol.
5238 (syms_of_alloc): DEFSYM it.
5239 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5240 (Fmemory_free): Remove.
5241 (syms_of_alloc): Don't defsubr it.
5242 * buffer.c (Fcompact_buffer): Remove.
5243 (syms_of_buffer): Don't defsubr it.
5244
5245 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5246
5247 Make maybe_gc inline.
5248 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5249 * lisp.h (consing_since_gc, gc_relative_threshold)
5250 (memory_full_cons_threshold): Revert declaration.
5251 (maybe_gc): Remove prototype, define as inline.
5252 * alloc.c: Remove old commented-out code.
5253 (consing_since_gc, gc_relative_threshold)
5254 (memory_full_cons_threshold): Revert to global.
5255 (maybe_gc): Remove.
5256
5257 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5258
5259 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5260 * lisp.h (build_unibyte_string): New function.
5261 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5262 * sysdep.c, w32fns.c, xfns.c: Use it.
5263 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5264 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5265 Adjust users accordingly.
5266 * font.h (font_open_by_name): Adjust prototype.
5267
5268 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5269
5270 Cleanup calls to Fgarbage_collect.
5271 * lisp.h (maybe_gc): New prototype.
5272 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5273 Remove declarations.
5274 * alloc.c (maybe_gc): New function.
5275 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5276 Make them static.
5277 * bytecode.c (MAYBE_GC): Use maybe_gc.
5278 * eval.c (eval_sub, Ffuncall): Likewise.
5279 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5280 to avoid dependency from auto-save feature.
5281
5282 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5283
5284 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5285 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5286 'for_each_per_buffer_object_at'.
5287 All uses changed. It's better to use upper-case for macros that
5288 cannot be implemented as functions, to give the reader a clue
5289 that they're special.
5290
5291 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5292
5293 * alloc.c (Fgarbage_collect): Tweak docstring.
5294
5295 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5296
5297 Tweak the value returned from Fgarbage_collect again.
5298 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5299 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5300 Adjust documentation.
5301 (total_vector_bytes): Rename to total_vector_slots, adjust
5302 accounting.
5303 (total_free_vector_bytes): Rename to total_free_vector_slots,
5304 adjust accounting.
5305 (Qstring_bytes, Qvector_slots): New symbols.
5306 (syms_of_alloc): DEFSYM them.
5307
5308 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5309
5310 Buffer compaction primitive which may be used from Lisp.
5311 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5312 (syms_of_buffer): Register Fcompact_buffer.
5313 * alloc.c (Fgarbage_collect): Use compact_buffer.
5314 * buffer.h (compact_buffer): New prototype.
5315 (struct buffer_text): New member.
5316
5317 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5318
5319 New macro to iterate over all buffers, miscellaneous cleanups.
5320 * lisp.h (all_buffers): Remove declaration.
5321 * buffer.h (all_buffers): Add declaration, with comment.
5322 (for_each_buffer): New macro.
5323 * alloc.c (Fgarbage_collect, mark_object): Use it.
5324 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5325 (init_buffer): Likewise.
5326 * data.c (Fset_default): Likewise.
5327 * coding.c (code_conversion_restore): Remove redundant check
5328 for dead buffer.
5329 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5330
5331 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5332
5333 Fix bug that created negative-length intervals.
5334 * intervals.c (merge_interval_right, merge_interval_left):
5335 Do not zero out this interval if it is absorbed by its children,
5336 as this interval's total length doesn't change in that case. See
5337 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5338
5339 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5340
5341 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5342 when invoking (make-bool-vector N t) and N is a positive
5343 multiple of 8 -- the last 8 bits were mistakenly cleared.
5344
5345 Remove some struct layout assumptions in bool vectors.
5346 * alloc.c (bool_header_size): New constant.
5347 (header_size, word_size): Move earlier, as they're now used earlier.
5348 Use 'word_size' in a few more places, where it's appropriate.
5349 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5350 padding before the data member of a bool vector.
5351 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5352 than doing the check by hand with an abort ().
5353
5354 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5355
5356 * eval.c (Fdefvar): Don't check constants since we only set the var if
5357 it's not yet defined anyway (bug#11904).
5358
5359 * lisp.h (last_undo_boundary): Declare new var.
5360 * keyboard.c (command_loop_1): Set it.
5361 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5362 were auto-added by the command loop (bug#11774).
5363
5364 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5365
5366 * w32font.c (Qsymbol): Remove local definition.
5367 (syms_of_w32font): Don't DEFSYM it.
5368
5369 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5370
5371 Fix sweep_vectors to handle large bool vectors correctly.
5372 * alloc.c (sweep_vectors): Account total_vector_bytes for
5373 bool vectors larger than VBLOCK_BYTES_MAX.
5374
5375 2012-07-18 Chong Yidong <cyd@gnu.org>
5376
5377 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5378 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5379
5380 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5381
5382 Return more descriptive data from Fgarbage_collect.
5383 Suggested by Stefan Monnier in
5384 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5385 * alloc.c (bounded_number): New function.
5386 (total_buffers, total_vectors): New variable.
5387 (total_string_size): Rename to total_string_bytes, adjust users.
5388 (total_vector_size): Rename to total_vector_bytes, adjust users.
5389 (sweep_vectors): Account total_vectors and total_vector_bytes.
5390 (Fgarbage_collect): New return value. Adjust documentation.
5391 (gc_sweep): Account total_buffers.
5392 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5393 (VECTOR_SIZE): Remove.
5394 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5395 (Qinterval, Qmisc): New symbols.
5396 (syms_of_data): Initialize them.
5397 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5398 (Qcons, Qbuffer): New declarations.
5399
5400 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5401
5402 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5403 Round up, not down. Improve doc.
5404
5405 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5406
5407 Restore old code in allocate_string_data to avoid Faset breakage.
5408 Reported by Julien Danjou <julien@danjou.info> in
5409 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5410 * alloc.c (allocate_string_data): Restore old code with minor
5411 adjustments, fix comment to explain this subtle issue.
5412
5413 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5414
5415 Remove FILE_SYSTEM_CASE.
5416 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5417
5418 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5419 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5420 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5421 call-process-region passes it through expand-file-name.
5422
5423 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5424
5425 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5426
5427 Fix crash when creating indirect buffer (Bug#11917)
5428 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5429 Don't handle unbound variables specially if non-zero.
5430 (Fbuffer_local_variables): Pass zero.
5431 (clone_per_buffer_values): Pass non-zero.
5432
5433 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5434
5435 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5436 to make the loop interruptible.
5437
5438 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5439
5440 * gnutls.c (emacs_gnutls_handshake): Only retry if
5441 GNUTLS_E_INTERRUPTED.
5442
5443 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5444
5445 Cleanup and convert miscellaneous checks to eassert.
5446 * alloc.c (mark_interval): Fix comment, partially rephrase
5447 old comment from intervals.h (see below).
5448 * intervals.c (find_interval, adjust_intervals_for_insertion)
5449 (delete_interval, adjust_intervals_for_deletion)
5450 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5451 Convert to eassert.
5452 (adjust_intervals_for_insertion, make_new_interval):
5453 Remove obsolete and unused code.
5454 * intervals.h (struct interval): Remove obsolete comment.
5455 * textprotp.c (erase_properties): Remove unused code.
5456 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5457 (Fremove_list_of_text_properties): Convert to eassert.
5458
5459 2012-07-17 Chong Yidong <cyd@gnu.org>
5460
5461 * editfns.c (Finsert_char): Doc fix.
5462
5463 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5464
5465 Fix previous change to make Fmemory_free always accurate.
5466 * alloc.c (make_interval): Update total_free_intervals.
5467 (make_float): Likewise for total_free_floats.
5468 (free_cons, Fcons): Likewise for total_free_conses.
5469 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5470 Likewise for total_free_vector_bytes.
5471 (Fmake_symbol): Likewise for total_free_symbols.
5472 (bytes_free): Remove.
5473
5474 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5475
5476 Simple free memory accounting feature.
5477 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5478 (sweep_vectors): Accumulate size of free vectors.
5479 (Fgarbage_collect): Setup bytes_free.
5480 (Fmemory_free): New function.
5481 (syms_of_alloc): Register it.
5482
5483 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5484
5485 Cleanup overlays checking.
5486 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5487 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5488 eassert and OVERLAYP.
5489 (sort_overlays): Change to use OVERLAYP.
5490
5491 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5492
5493 * editfns.c (Finsert_char): Make it interactive, and make the
5494 second arg optional. Copy interactive spec and docstring from
5495 ucs-insert.
5496
5497 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5500 Unlike the other wrapped functions, fabs has an unspecified
5501 effect on errno.
5502
5503 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5504
5505 * nsterm.m (keyDown): Interpret flags without left/right bits
5506 as the left key (Bug#11670).
5507
5508 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5509
5510 Remove empty and useless init functions.
5511 * lisp.h (init_character_once, init_fns, init_image)
5512 (init_filelock, init_sound): Remove prototype.
5513 * character.c (init_character_once): Remove.
5514 * filelock.c (init_filelock): Likewise.
5515 * fns.c (init_fns): Likewise.
5516 * image.c (init_image): Likewise.
5517 * sound.c (init_sound): Likewise.
5518 * emacs.c (main): Adjust accordingly.
5519
5520 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5521
5522 * gtkutil.h: Tiny cleanups.
5523 (use_old_gtk_file_dialog): Remove useless declaration.
5524 (xg_uses_old_file_dialog): Add suggested const attribute.
5525
5526 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5527
5528 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5529 (bidi_paragraph_init): Use it to limit search forward for a strong
5530 directional character in abnormally large paragraphs full of
5531 neutral or weak characters. (Bug#11943)
5532
5533 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5534
5535 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5536 the toolbar (Bug#9451).
5537 (xg_make_tool_item): Give the widget event box a transparent
5538 background.
5539
5540 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5541
5542 Cleanup basic allocation variables and functions.
5543 * alloc.c (ignore_warnings, init_intervals, init_float)
5544 (init_cons, init_symbol, init_marker): Remove.
5545 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5546 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5547 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5548 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5549 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5550 (staticidx, init_alloc_once, init_strings, free_ablock):
5551 Remove redundant initialization.
5552 * fns.c (init_weak_hash_tables): Remove.
5553 * lisp.h (init_weak_hash_tables): Remove prototype.
5554
5555 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5556
5557 Use zero_vector where appropriate.
5558 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5559 accordingly.
5560 * lisp.h (zero_vector): New declaration.
5561 * font.c (null_vector): Remove.
5562 (syms_of_font): Remove initialization and staticpro.
5563 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5564 * keymap.c (Faccessible_keymaps): Likewise.
5565
5566 2012-07-15 Leo Liu <sdl.web@gmail.com>
5567
5568 * fringe.c: Fix typo in comments.
5569
5570 2012-07-14 Leo Liu <sdl.web@gmail.com>
5571
5572 * fringe.c: Add a new bitmap exclamation-mark.
5573
5574 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5575
5576 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5577
5578 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5579 (HAVE_MENUS): Don't define, defined by editing config.in with
5580 msdos/sed2v2.inp.
5581 (GMALLOC_INHIBIT_VALLOC): Don't define.
5582 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5583
5584 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5585
5586 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5587
5588 2012-07-14 Glenn Morris <rgm@gnu.org>
5589
5590 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5591 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5592 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5593
5594 2012-07-13 Glenn Morris <rgm@gnu.org>
5595
5596 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5597
5598 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5599 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5600
5601 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5602
5603 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5604 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5605 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5606 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5607 where appropriate.
5608 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5609 as boolean expression.
5610 (x_set_window_size): Remove unused variable toolbar.
5611 (ns_get_color_default, ns_mod_to_lisp): Remove.
5612 (ns_mouse_position): Remove unused variables xchar and ychar.
5613 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5614 (ns_set_vertical_scroll_bar): Remove unused variable count.
5615 (ns_delete_terminal): Remove unused variable i.
5616 (ns_term_init): Remove unused variables r, g and b.
5617 (mouseDown): Remove unused variable window.
5618 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5619 (initFrameFromEmacs): Remove unused variable vbextra.
5620 (mouseEntered): Remove unused variables p and dpyinfo.
5621 (mouseExited): Remove unused variables p and r.
5622 (ns_define_frame_cursor, ns_clear_frame_area)
5623 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5624 (menuDown): Assign [sender tag] to variable and cast the variable.
5625
5626 * nsterm.h (menuDown): Add id as type to argument sender.
5627 (ns_display_info_for_name): Add Lisp_Object argument.
5628 (ns_term_init): Add Lisp_Object argument.
5629 (ns_map_event_to_object): Add void argument.
5630 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5631 prototype with arguments and only declare if __OBJC__.
5632 (nxatoms_of_nsselect): Add void argument.
5633 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5634 (ns_alloc_autorelease_pool): Add void argument.
5635 (ns_release_autorelease_pool): Add void* argument.
5636 (ns_get_defaults_value): Add const char* argument.
5637
5638 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5639 (initFromContents): Use SSDATA where appropriate.
5640 (ns_update_menubar): Add braces to ambigous if-else.
5641 (initWithTitle): Put () around assignment in if statement.
5642 (ns_menu_show): Remove unused variables window and keymap.
5643 (update_frame_tool_bar): Remove unused variable selected_p.
5644 (initWithContentRect): Remove unused variable this_cmd_name.
5645
5646 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5647 appropriate.
5648 (setXBMColor): Remove unused variable len.
5649 (setPixmapData): Put () around assignment in loop statement.
5650
5651 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5652 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5653 where appropriate.
5654 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5655 around assignment in loop statement.
5656 (nsfont_open): Remove unused variable i.
5657 (nsfont_open): Remove unused variable len.
5658 (nsfont_draw): Remove unused variable cs.
5659
5660 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5661 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5662 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5663 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5664 (Fns_font_name, Fns_perform_service)
5665 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5666 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5667 (ns_set_name): Remove unused variable view.
5668 (x_set_menu_bar_lines): Remove unused variable olines.
5669 (x_set_tool_bar_lines): Remove unused variable root_window.
5670 (Fns_list_colors): Put () around assignment in while statement.
5671 (Fns_perform_service): Remove unused variable len.
5672 (Fns_display_usable_bounds): Remove unused variable top.
5673 (syms_of_nsfns): Remove unused variable i.
5674
5675 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5676 memcpy (Bug#11907).
5677
5678 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5679
5680 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5681 and free it with DestroyExceptionInfo (Bug#11558).
5682
5683 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5684
5685 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5686 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5687 Set here, not in nt/config.nt.
5688
5689 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5690
5691 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5692 cursor overflow into the last glyph on display line when the right
5693 fringe is off. (Bug#11832)
5694
5695 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5696
5697 * xdisp.c (produce_special_glyphs): Now static.
5698 * dispextern.h (produce_special_glyphs): Remove decl.
5699
5700 2012-07-13 Glenn Morris <rgm@gnu.org>
5701
5702 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5703 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5704
5705 * s/usg5-4-common.h (USG, USG5):
5706 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5707 * s/sol2-6.h (SOLARIS2):
5708 * s/irix6-5.h (IRIX6_5):
5709 * s/hpux10-20.h (USG, USG5, HPUX):
5710 * s/gnu-linux.h (USG, GNU_LINUX):
5711 * s/freebsd.h (BSD_SYSTEM):
5712 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5713 * s/cygwin.h (CYGWIN):
5714 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5715 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5716
5717 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5718
5719 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5720
5721 2012-07-13 Glenn Morris <rgm@gnu.org>
5722
5723 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5724
5725 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5726
5727 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5728 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5729
5730 2012-07-12 Glenn Morris <rgm@gnu.org>
5731
5732 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5733
5734 * process.c (init_process_emacs): Rename from init_process.
5735 The old name is also the name of a Mach system call.
5736 * lisp.h, emacs.c: Update for this name change.
5737 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5738 longer needed.
5739
5740 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5741
5742 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5743 memmove call that removes glyphs covered by the left truncation
5744 glyph. Improve commentary.
5745 (display_line): Fix display of continuation glyphs on GUI frames
5746 when the right fringe is turned off and variable-size fonts are
5747 used in the window. Move the code that appends a stretch glyph to
5748 produce_special_glyphs, so that it could be used for truncation
5749 and continuation glyphs alike.
5750 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5751 glyph of a suitably computed width, to align the special glyphs at
5752 the window margin. Code moved from display_line. (Bug#11832)
5753
5754 2012-07-12 Glenn Morris <rgm@gnu.org>
5755
5756 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5757
5758 * s/gnu-linux.h, s/hpux10-20.h:
5759 Do not unconditionally define HAVE_XRMSETDATABASE.
5760
5761 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5762
5763 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5764
5765 Fix typos that broke OS X build.
5766 Reported by Randal L. Schwartz in
5767 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5768 * nsterm.m (ns_timeout): Add missing local decl.
5769 (ns_get_color): snprintf -> sprintf, to fix typo.
5770
5771 2012-07-12 Glenn Morris <rgm@gnu.org>
5772
5773 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5774 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5775 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5776 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5777
5778 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5779 Move PTY_OPEN to configure.
5780
5781 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5782 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5783 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5784
5785 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5786
5787 Use empty_unibyte_string where applicable.
5788 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5789 * lread.c (read1): Likewise.
5790 * xsettings.c (syms_of_xsettings): Likewise.
5791
5792 2012-07-12 Glenn Morris <rgm@gnu.org>
5793
5794 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5795 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5796 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5797 * s/hpux10-20.h (RUN_TIME_REMAP):
5798 * s/bsd-common.h (TABDLY): Move to configure.
5799
5800 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5801
5802 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5803
5804 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5805 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5806
5807 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5808
5809 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5810 * s/template.h: Move NARROWPROTO to configure.
5811
5812 2012-07-11 Glenn Morris <rgm@gnu.org>
5813
5814 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5815 unused since 2011-01-17 change to systty.h.
5816
5817 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5818 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5819 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5820
5821 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5824
5825 2012-07-11 Glenn Morris <rgm@gnu.org>
5826
5827 * s/darwin.h, s/gnu-linux.h, s/template.h:
5828 Move INTERRUPT_INPUT to configure.
5829
5830 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5831
5832 Minor adjustments to interning code.
5833 * lisp.h (intern, intern_c_string): Redefine as static inline
5834 wrappers for intern_1 and intern_c_string_1, respectively.
5835 (intern_1, intern_c_string_1): Rename prototypes.
5836 * lread.c (intern_1, intern_c_string_1, oblookup):
5837 Simplify Vobarray checking.
5838 * font.c (font_intern_prop): Likewise. Adjust comment.
5839 * w32font.c (intern_font_name): Likewise.
5840
5841 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5842
5843 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5844
5845 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5846 of Fcar/Fcdr if possible.
5847 * font.c (check_otf_features): Likewise.
5848 * fontset.c (Fnew_fontset): Likewise.
5849 * gnutls.c (Fgnutls_boot): Likewise.
5850 * minibuf.c (read_minibuf): Likewise.
5851 * msdos.c (IT_set_frame_parameters): Likewise.
5852 * xmenu.c (Fx_popup_dialog): Likewise.
5853 * w32menu.c (Fx_popup_dialog): Likewise.
5854
5855 2012-07-11 Glenn Morris <rgm@gnu.org>
5856
5857 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5858 since nothing has defined it on these platforms.
5859
5860 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5861 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5862
5863 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5864 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5865 Move CLASH_DETECTION to configure.
5866
5867 * s/gnu.h: Remove file, which is now empty.
5868
5869 * s/gnu.h, s/gnu-linux.h:
5870 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5871
5872 2012-07-11 John Wiegley <johnw@newartisans.com>
5873
5874 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5875 function attribute, so we only use it if it exists in the
5876 compiler.
5877
5878 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5879
5880 Avoid call to strlen in fast_c_string_match_ignore_case.
5881 * search.c (fast_c_string_match_ignore_case): Change to use
5882 length argument. Adjust users accordingly.
5883 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5884
5885 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5886
5887 Assume mkdir, rmdir.
5888 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5889 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5890
5891 Assume rename.
5892 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5893
5894 Assume perror.
5895 * s/hpux10-20.h (HAVE_PERROR): Remove.
5896 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5897 Remove dummy definition, as this problem was obsolete long ago.
5898
5899 Assume strerror.
5900 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5901
5902 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5903
5904 Avoid calls to strlen in font processing functions.
5905 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5906 (font_open_by_name): Change to use length argument.
5907 Adjust users accordingly.
5908 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5909 Adjust prototypes.
5910 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5911 Change to return ptrdiff_t.
5912 (xfont_list_pattern, xfont_match): Use length returned by
5913 xfont_decode_coding_xlfd.
5914 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5915
5916 2012-07-11 Glenn Morris <rgm@gnu.org>
5917
5918 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5919 Move DONT_REOPEN_PTY to configure.
5920
5921 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5922 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5923
5924 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5925
5926 Remove "#define unix" that is no longer needed (Bug#11905).
5927 * s/aix4-2.h (unix): Remove; no longer needed.
5928
5929 EMACS_TIME simplification (Bug#11875).
5930 This replaces macros (which typically do not work in GDB)
5931 with functions, typedefs and enums, making the code easier to debug.
5932 The functional style also makes code easier to read and maintain.
5933 * systime.h: Include <sys/time.h> on all hosts, not just if
5934 WINDOWSNT, since 'struct timeval' is needed in general.
5935 (EMACS_TIME): Now a typedef, not a macro.
5936 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5937 not macros.
5938 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5939 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5940 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5941 (EMACS_TIME_LE): Now functions, not macros.
5942 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5943 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5944 which are not functions. All uses rewritten to use:
5945 (make_emacs_time): New function.
5946 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5947 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5948 not functions. All uses rewritten to use the following, respectively:
5949 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5950 (add_emacs_time, sub_emacs_time): New functions.
5951 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5952 * fileio.c (Fcopy_file):
5953 * xterm.c (XTflash): Get the current time closer to when it's used.
5954 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5955
5956 * bytecode.c (targets): Suppress -Woverride-init warnings.
5957
5958 Simplify by avoiding confusing use of strncpy etc.
5959 * doc.c (Fsnarf_documentation):
5960 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5961 * frame.c (Fmake_terminal_frame):
5962 * gtkutil.c (get_utf8_string):
5963 * lread.c (openp):
5964 * nsmenu.m (ns_update_menubar):
5965 * regex.c (regerror):
5966 Prefer memcpy to strncpy and strncat when either will do.
5967 * fileio.c (Fsubstitute_in_file_name):
5968 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5969 (menu_separator_name_p):
5970 * nsmenu.m (ns_update_menubar):
5971 Prefer memcmp to strncmp when either will do.
5972 * nsterm.m: Include <ftoastr.h>.
5973 (ns_get_color):
5974 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5975 Prefer snprintf to strncpy.
5976 * nsterm.m (ns_term_init):
5977 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5978 * nsterm.m (ns_term_init):
5979 Avoid the need for strncpy, by using build_string or
5980 make_unibyte_string directly. Use dtoastr, not snprintf.
5981 * process.c (Fmake_network_process): Diagnose service names that
5982 are too long, rather than silently truncating them or creating
5983 non-null-terminated names.
5984 (Fnetwork_interface_info): Likewise, for interface names.
5985 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5986 Prefer sprintf to strncat.
5987 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5988 Prefer vsnprintf to vsprintf + strncpy.
5989
5990 2012-07-10 Glenn Morris <rgm@gnu.org>
5991
5992 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5993 Clarify fallback case.
5994
5995 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5996
5997 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5998 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5999 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6000 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6001 where argument type is known to be a Lisp_Cons.
6002
6003 2012-07-10 Tom Tromey <tromey@redhat.com>
6004
6005 * bytecode.c (BYTE_CODE_THREADED): New macro.
6006 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6007 (enum byte_code_op): New type.
6008 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6009 (exec_byte_code): Use them. Use token threading when applicable.
6010
6011 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6012
6013 Optimize pure C strings initialization.
6014 * lisp.h (make_pure_string): Fix prototype.
6015 (build_pure_c_string): New function, defined as static inline. This
6016 provides a better opportunity to optimize away calls to strlen when
6017 the function is called with compile-time constant argument.
6018 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6019 argument, adjust users accordingly. Use build_pure_c_string where
6020 appropriate.
6021 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6022 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6023 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6024
6025 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6026
6027 Avoid calls to strlen in miscellaneous functions.
6028 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6029 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6030 * lread.c (openp): Likewise.
6031
6032 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6033
6034 Avoid calls to strlen in path processing functions.
6035 * fileio.c (file_name_as_directory): Add comment. Change to add
6036 srclen argument and return the length of result. Adjust users
6037 accordingly.
6038 (directory_file_name): Fix comment. Change to add srclen argument,
6039 swap 1st and 2nd arguments to obey the common convention.
6040 Adjust users accordingly.
6041 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6042
6043 2012-07-10 Glenn Morris <rgm@gnu.org>
6044
6045 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6046 Move PENDING_OUTPUT_COUNT definition to configure.
6047
6048 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6049 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6050 * s/gnu.h (DATA_START): Move definitions to configure.
6051
6052 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6053 We include usg5-4-common.h, which defines them both.
6054
6055 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6056 O_RDONLY already includes it).
6057
6058 Stop ns builds setting the EMACSLOADPATH environment variable.
6059 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6060 Now it does not set EMACSLOADPATH, just returns the load-path string.
6061 * nsterm.h: Update accordingly.
6062 * lread.c [HAVE_NS]: Include nsterm.h.
6063 (init_lread) [HAVE_NS]: Use ns_load_path.
6064 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6065
6066 2012-07-09 Glenn Morris <rgm@gnu.org>
6067
6068 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6069 since the included bsd-common.h does so.
6070
6071 Stop ns builds setting the EMACSPATH environment variable.
6072 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6073 (ns_init_paths): Do not set EMACSPATH.
6074 * nsterm.h (ns_exec_path): Add it.
6075 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6076 Use ns_exec_path.
6077
6078 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6079
6080 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 * process.c (wait_reading_process_output): 'waitchannels' was unset
6083 when read_kbd || !NILP (wait_for_cell); fix this.
6084
6085 Add GCC-style 'const' attribute to functions that can use it.
6086 * character.h (char_resolve_modifier_mask):
6087 * keyboard.h (make_ctrl_char):
6088 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6089 (init_character_once, next_almost_prime, init_fns, init_image)
6090 (flush_pending_output, init_sound):
6091 * mem-limits.h (start_of_data):
6092 * menu.h (finish_menu_items):
6093 Add ATTRIBUTE_CONST.
6094 * emacs.c (DEFINE_DUMMY_FUNCTION):
6095 Declare the dummy function with ATTRIBUTE_CONST.
6096 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6097 Add decls with ATTRIBUTE_CONST.
6098
6099 Minor improvements to make_formatted_string.
6100 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6101 where int is good enough, as vsprintf returns an int.
6102 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6103
6104 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6105
6106 Use make_formatted_string to avoid double length calculation.
6107 * lisp.h (make_formatted_string): New prototype.
6108 * alloc.c (make_formatted_string): New function.
6109 * buffer.c (Fgenerate_new_buffer_name): Use it.
6110 * dbusbind.c (syms_of_dbusbind): Likewise.
6111 * editfns.c (Fcurrent_time_zone): Likewise.
6112 * filelock.c (get_boot_time): Likewise.
6113 * frame.c (make_terminal_frame, set_term_frame_name)
6114 (x_report_frame_params): Likewise.
6115 * image.c (gs_load): Likewise.
6116 * minibuf.c (get_minibuffer): Likewise.
6117 * msdos.c (dos_set_window_size): Likewise.
6118 * process.c (make_process): Likewise.
6119 * xdisp.c (ensure_echo_area_buffers): Likewise.
6120 * xsettings.c (apply_xft_settings): Likewise.
6121
6122 2012-07-09 Glenn Morris <rgm@gnu.org>
6123
6124 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6125 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6126 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6127 * nsterm.h (ns_etc_directory): Add it.
6128 * callproc.c [HAVE_NS]: Include nsterm.h.
6129 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6130
6131 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6132
6133 Move marker debugging code under MARKER_DEBUG.
6134 * marker.c (MARKER_DEBUG): Move marker debugging code under
6135 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6136 for bootstrap with --enable-checking (~3x slowdown reported
6137 by Juanma Barranquero <lekktu@gmail.com>).
6138 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6139
6140 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6141
6142 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6143 See <http://bugs.gnu.org/11825#29>.
6144
6145 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6146
6147 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6148 has no font, use the frame's font. (Bug#11813)
6149 (display_line): Add commentary about displaying truncation glyphs
6150 on GUI frames.
6151 (produce_special_glyphs): Move here from term.c.
6152
6153 * term.c (produce_special_glyphs): Move to xdisp.c.
6154
6155 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6156 section.
6157
6158 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6159
6160 * xdisp.c (display_line): Avoid warning about implicit declaration
6161 of FRAME_FONT.
6162
6163 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6164
6165 * lisp.h: Remove empty conditional.
6166
6167 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6168
6169 * lread.c (load_path_check): Now static.
6170
6171 Fix some minor --with-ns problems found by static checking.
6172 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6173 (x_set_font) [!HAVE_X_WINDOWS]:
6174 * image.c (xpm_load_image) [HAVE_NS]:
6175 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6176 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6177 Remove unused local.
6178 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6179 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6180 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6181 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6182 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6183 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6184 Fix pointer signedness problem.
6185 * xfaces.c (FRAME_X_FONT_TABLE):
6186 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6187
6188 2012-07-07 Glenn Morris <rgm@gnu.org>
6189
6190 * lread.c (load_path_check): New function, split from init_lread.
6191 (init_lread): Reorganize. Motivation:
6192 If EMACSLOADPATH is set, check/warn about that rather than the
6193 defaults, which we are not going to use. Hence we can remove
6194 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6195 Don't warn if site-lisp directories are missing.
6196 If not installed, start from a blank load-path, since
6197 PATH_LOADSEARCH refers to the eventual installation directories.
6198
6199 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6200
6201 Support truncation and continuation glyphs on GUI frames, when
6202 fringes are disabled. (Bug#11832)
6203 * xdisp.c (init_iterator): Get dimensions of truncation and
6204 continuation glyphs even if on GUI frames.
6205 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6206 or both, are absent.
6207 (start_display, move_it_in_display_line_to): Handle the case of a
6208 GUI frame without a fringe to display continuation or truncation
6209 glyphs.
6210 (insert_left_trunc_glyphs): Support GUI frames: make sure
6211 truncation glyphs overwrite enough glyphs from the current line to
6212 have sufficient space in pixels.
6213 (display_line): Support truncation and continuation glyphs on GUI
6214 frames. If some spare pixels are left on the line after inserting
6215 the truncation glyphs, fill that space with a stretch glyph of a
6216 suitably computed width.
6217
6218 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6219 produce_glyphs, to support GUI sessions.
6220
6221 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6222
6223 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6224
6225 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6226
6227 Do not require float-time's arg to fit in time_t (Bug#11825).
6228 This works better on hosts where time_t is unsigned, and where
6229 float-time is applied to the (negative) difference between two times.
6230 * editfns.c (decode_time_components): Last arg is now double *,
6231 not int *, and means to store all the result as a double, without
6232 worrying about whether the seconds part fits in time_t.
6233 All callers changed.
6234 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6235 All callers changed.
6236 (Ffloat_time): Do not fail merely because the specified time falls
6237 outside of time_t range.
6238
6239 2012-07-07 Glenn Morris <rgm@gnu.org>
6240
6241 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6242 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6243 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6244
6245 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6246
6247 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6248 Update dependencies.
6249
6250 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6251
6252 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6253
6254 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6255 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6256 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6257 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6258 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6259 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6260
6261 * xfont.c (compare_font_names): Redo to omit the need for casts.
6262
6263 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6264
6265 * xfns.c (Fx_change_window_property): Doc fix.
6266 * w32fns.c (Fx_change_window_property): Doc fix.
6267
6268 * w32fns.c (Fx_window_property): Accept the same arguments as the
6269 X Windows version. Doc fix.
6270 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6271
6272 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6273 Eli Zaretskii <eliz@gnu.org>
6274
6275 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6276 Windows-specific code from nt/config.nt moved here.
6277 Obsolete settings removed.
6278
6279 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6280
6281 * process.c: Avoid unnecessary calls to gettime.
6282 (wait_reading_process_output): Don't get the time of day
6283 when gobbling data immediately and not waiting, as there's no need
6284 for it in that case. This removes a FIXME.
6285
6286 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6287
6288 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6289 is defined (Bug#11768).
6290
6291 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6292
6293 Fix marker debugging code.
6294 * marker.c (byte_char_debug_check): Do not perform the check
6295 if buffer is not multibyte.
6296 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6297 Call byte_char_debug_check with correct arguments.
6298
6299 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6300
6301 Compile marker debugging code only if ENABLE_CHECKING is defined.
6302 * marker.c (byte_char_debug_check, count_markers):
6303 Use only if ENABLE_CHECKING is defined.
6304 (byte_debug_flag): Remove.
6305 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6306 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6307
6308 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6309
6310 Avoid code repetition in marker-related functions.
6311 * marker.c (attach_marker): New function.
6312 (Fset_marker, set_marker_restricted, set_marker_both)
6313 (set_marker_restricted_both): Use it.
6314 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6315 Consistently rename charno to charpos.
6316 (marker_position): Add eassert.
6317 (marker_byte_position): Convert to eassert.
6318
6319 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6320
6321 Simplify list operations in unchain_overlay and unchain_marker.
6322 * buffer.c (unchain_overlay): Simplify. Add comment.
6323 * marker.c (unchain_marker): Simplify. Fix comments.
6324
6325 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6326
6327 Introduce fast path for the widely used marker operation.
6328 * alloc.c (build_marker): New function.
6329 * lisp.h (build_marker): New prototype.
6330 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6331 * composite.c (autocmp_chars): Likewise.
6332 * editfns.c (buildmark): Remove.
6333 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6334 (save_restriction_save): Use build_marker.
6335 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6336 * window.c (save_window_save): Likewise.
6337
6338 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6339
6340 Do not use Fdelete_overlay in delete_all_overlays
6341 to avoid redundant calls to unchain_overlay.
6342 * buffer.c (drop_overlay): New function.
6343 (delete_all_overlays, Fdelete_overlay): Use it.
6344 * minibuf.c (get_minibuffer): Fix comment.
6345
6346 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6347
6348 Port to OpenBSD 5.1 amd64.
6349 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6350 This is needed for OpenBSD, and should be harmless on all BSD systems.
6351 Also, include <sys/sysctl.h>, as it should be available on all
6352 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6353 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6354 use p_pid member, not kp_proc.pid.
6355
6356 2012-07-06 Glenn Morris <rgm@gnu.org>
6357
6358 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6359
6360 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6361
6362 More xmalloc and related cleanup.
6363 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6364 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6365 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6366 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6367 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6368 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6369 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6370 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6371 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6372 * xterm.c:
6373 Omit needless casts involving void * pointers and allocation.
6374 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6375 as the former is more robust if P's type is changed.
6376 Prefer xzalloc to xmalloc + memset 0.
6377 Simplify malloc-or-realloc to realloc.
6378 Don't worry about xmalloc returning a null pointer.
6379 Prefer xstrdup to xmalloc + strcpy.
6380 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6381 growing it.
6382 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6383 alloca of a constant.
6384
6385 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6386
6387 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6388 hscroll is larger than the line width. Fixes long and futile
6389 looping inside extend_face_to_end_of_line (on a TTY) producing
6390 glyphs that are not needed and thrown away.
6391
6392 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6393
6394 * marker.c (set_marker_restricted_both): Simplify by using
6395 clip_to_bounds.
6396
6397 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6398
6399 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6400
6401 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6402
6403 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6404 not defined (Bug#11768).
6405 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6406 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6407 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6408 followed by gtk_box_set_homogeneous (Bug#11768).
6409 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6410 (update_theme_scrollbar_width, xg_create_scroll_bar):
6411 Use gtk_scrollbar_new (Bug#11768).
6412 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6413 (is_box_type): New function (Bug#11768).
6414 (xg_tool_item_stale_p): Call is_box_type.
6415 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6416 with default display (Bug#11768).
6417
6418 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6419
6420 * xdisp.c (window_hscroll_limited): New function.
6421 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6422 coordinates when window's hscroll is set to insanely large
6423 values. (Bug#11857)
6424
6425 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6426
6427 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6428 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6429
6430 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6431
6432 Cleanup xmalloc.
6433 * lisp.h (xzalloc): New prototype. Omit needless casts.
6434 * alloc.c (xzalloc): New function. Omit needless casts.
6435 * charset.c: Omit needless casts. Convert all calls to
6436 xmalloc with following memset to xzalloc.
6437 * dispnew.c: Likewise.
6438 * fringe.c: Likewise.
6439 * image.c: Likewise.
6440 * sound.c: Likewise.
6441 * term.c: Likewise.
6442 * w32fns.c: Likewise.
6443 * w32font.c: Likewise.
6444 * w32term.c: Likewise.
6445 * xfaces.c: Likewise.
6446 * xfns.c: Likewise.
6447 * xterm.c: Likewise.
6448 * atimer.c: Omit needless casts.
6449 * buffer.c: Likewise.
6450 * callproc.c: Likewise.
6451 * ccl.c: Likewise.
6452 * coding.c: Likewise.
6453 * composite.c: Likewise.
6454 * doc.c: Likewise.
6455 * doprnt.c: Likewise.
6456 * editfns.c: Likewise.
6457 * emacs.c: Likewise.
6458 * eval.c: Likewise.
6459 * filelock.c: Likewise.
6460 * fns.c: Likewise.
6461 * gtkutil.c: Likewise.
6462 * keyboard.c: Likewise.
6463 * lisp.h: Likewise.
6464 * lread.c: Likewise.
6465 * minibuf.c: Likewise.
6466 * msdos.c: Likewise.
6467 * print.c: Likewise.
6468 * process.c: Likewise.
6469 * region-cache.c: Likewise.
6470 * search.c: Likewise.
6471 * sysdep.c: Likewise.
6472 * termcap.c: Likewise.
6473 * terminal.c: Likewise.
6474 * tparam.c: Likewise.
6475 * w16select.c: Likewise.
6476 * w32.c: Likewise.
6477 * w32reg.c: Likewise.
6478 * w32select.c: Likewise.
6479 * w32uniscribe.c: Likewise.
6480 * widget.c: Likewise.
6481 * xdisp.c: Likewise.
6482 * xmenu.c: Likewise.
6483 * xrdb.c: Likewise.
6484 * xselect.c: Likewise.
6485
6486 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6487
6488 * fileio.c (time_error_value): Check the right error number.
6489 Problem reported by Troels Nielsen in
6490 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6491
6492 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6493
6494 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6495 This should be fixed in a better way; see Eli Zaretskii in
6496 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6497 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6498
6499 * fileio.c (time_error_value): Rename from special_mtime.
6500 The old name's problems were noted by Eli Zaretskii in
6501 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6502
6503 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6504 This variable's comment says Emacs needs at least one GDB-visible
6505 symbol of type enum pvec_type, to work around GDB problems.
6506 The symbol's value doesn't matter.
6507
6508 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6509 that causes compilation to fail on pre-C99 compilers.
6510
6511 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6512
6513 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6514 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6515
6516 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6517
6518 * buffer.c (init_buffer_once): Fix initialization of
6519 headers for buffer_defaults and buffer_local_symbols.
6520 Reported by Juanma Barranquero <lekktu@gmail.com>.
6521
6522 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6523
6524 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6525 * lisp.h (enum pvec_type): Use fewer bits.
6526 (PSEUDOVECTOR_SIZE_BITS): New constant.
6527 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6528 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6529 change in pvec_type.
6530 (PSEUDOVECTOR_TYPEP): New macro.
6531 (TYPED_PSEUDOVECTORP): Use it.
6532 * fns.c (internal_equal): Adapt code to extract pvectype.
6533 * emacs.c (gdb_pvec_type): Update type.
6534 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6535 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6536 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6537 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6538 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6539 abusing vector->header.next.nbytes.
6540 (live_vector_p): Use PVEC_TYPE.
6541 (mark_object): Adapt code to extract pvectype. Use switch.
6542
6543 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6544
6545 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6546 Tighten new eassert a bit.
6547
6548 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6549
6550 Fix compilation with --enable-gcc-warnings and -O1
6551 optimization level.
6552 * doprnt.c (doprnt): Change type of tem to int, initialize
6553 to avoid compiler warning. Add eassert.
6554 * search.c (simple_search): Initialize match_byte to avoid
6555 compiler warning. Add eassert.
6556
6557 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6558
6559 Avoid weird behavior with large horizontal scrolls.
6560 Without this change, for example, large hscroll values would
6561 mess up Emacs's display on Fedora 15 x86, presumably due to
6562 overflows in int calculations in the display code.
6563 Also, if buffers had long lines, Emacs would freeze.
6564 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6565 (set_window_hscroll): New function, containing the old guts of
6566 Fset_window_hscroll. Return the clipped value.
6567 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6568 This avoids the need to check against PTRDIFF_MAX.
6569
6570 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6571
6572 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6573
6574 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6575
6576 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6577
6578 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6579 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6580 since GCC 4.4.6 issues a bogus warning for them.
6581
6582 Fix bugs in file timestamp newness comparisons.
6583 * fileio.c (Ffile_newer_than_file_p):
6584 * lread.c (Fload): Use full timestamp resolution of files,
6585 not just the 1-second resolution, so that files that are only
6586 slightly newer still count as newer.
6587 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6588 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6589
6590 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6591
6592 * fileio.c: Improve handling of file time marker. (Bug#11852)
6593 (special_mtime): New function.
6594 (Finsert_file_contents, Fverify_visited_file_modtime):
6595 Use it to set special mtime values consistently.
6596
6597 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6598
6599 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6600 marker for non-existing file. (Bug#11852)
6601
6602 2012-07-03 Glenn Morris <rgm@gnu.org>
6603
6604 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6605 and did not make it into globals.h).
6606
6607 2012-07-03 Tom Tromey <tromey@redhat.com>
6608
6609 * window.c (Fset_window_margins, Fset_window_fringes)
6610 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6611 * textprop.c (Fprevious_property_change): No longer static.
6612 * syntax.c (Fsyntax_table_p): No longer static.
6613 * process.c (Fget_process, Fprocess_datagram_address): No longer
6614 static.
6615 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6616 * keyboard.c (Fcommand_execute): No longer static.
6617 Remove EXFUN.
6618 * insdel.c (Fcombine_after_change_execute): No longer static.
6619 * image.c (Finit_image_library): No longer static.
6620 * fileio.c (Fmake_symbolic_link): No longer static.
6621 * eval.c (Ffetch_bytecode): No longer static.
6622 * editfns.c (Fuser_full_name): No longer static.
6623 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6624 No longer static.
6625 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6626 static.
6627 * dired.c (Ffile_attributes): No longer static.
6628 * composite.c (Fcomposition_get_gstring): No longer static.
6629 * callproc.c (Fgetenv_internal): No longer static.
6630
6631 * ccl.h: Remove EXFUNs.
6632 * buffer.h: Remove EXFUNs.
6633 * dispextern.h: Remove EXFUNs.
6634 * intervals.h: Remove EXFUNs.
6635 * fontset.h: Remove EXFUN.
6636 * font.h: Remove EXFUNs.
6637 * dosfns.c (system_process_attributes): Remove EXFUN.
6638 * keymap.h: Remove EXFUNs.
6639 * lisp.h: Remove EXFUNs.
6640 * w32term.h: Remove EXFUNs.
6641 * window.h: Remove EXFUNs.
6642 * xsettings.h: Remove EXFUN.
6643 * xterm.h: Remove EXFUN.
6644
6645 2012-07-03 Glenn Morris <rgm@gnu.org>
6646
6647 * lisp.h (Frandom): Make it visible to C.
6648 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6649 buffer for invisible buffers. (Bug#1229)
6650
6651 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6652
6653 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6654 values which aren't power of 2.
6655 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6656 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6657 accordingly.
6658
6659 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6660
6661 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6662
6663 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6664
6665 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6666
6667 * alloc.c (allocate_vector_block): Remove redundant
6668 calls to mallopt if DOUG_LEA_MALLOC is defined.
6669 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6670 avoid calls to mallopt if zero_vector is returned.
6671
6672 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6673
6674 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6675 is enabled, avoid dereferencing NULL current_sblock if
6676 running undumped.
6677
6678 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6679
6680 Cleanup basic buffer management.
6681 * buffer.h (struct buffer): Change layout to use generic vector
6682 marking code. Fix some comments. Change type of 'clip_changed'
6683 to bitfield. Remove unused #ifndef old.
6684 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6685 (GET_OVERLAYS_AT): Fix indentation.
6686 (for_each_per_buffer_object_at): New macro.
6687 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6688 (Fbuffer_local_variables): Use it.
6689 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6690 * alloc.c (allocate_buffer): Adjust to match new layout of
6691 struct buffer. Fix comment.
6692 (mark_overlay): New function.
6693 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6694 Lisp area of struct buffer.
6695 (mark_object): Use it. Adjust marking of misc objects
6696 and related comments.
6697
6698 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6699
6700 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6701 wrapper that is not needed because the wrapped code is a no-op (zero
6702 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6703 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6704
6705 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6706
6707 * alloc.c (mark_buffer): Simplify. Remove prototype.
6708 (mark_object): Add comment. Reorganize marking of vector-like
6709 objects. Use CHECK_LIVE for all vector-like objects except buffers
6710 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6711 Avoid redundant calls to mark_vectorlike for bool vectors.
6712
6713 2012-06-30 Glenn Morris <rgm@gnu.org>
6714
6715 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6716
6717 * epaths.in (PATH_SITELOADSEARCH): New.
6718 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6719 This is rather than relying on --enable-locallisppath elements
6720 having "site-lisp" in their names. (Bug#10208#25, 11658)
6721
6722 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6723
6724 * w32proc.c (sys_select): Accept and ignore one more argument.
6725
6726 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6727
6728 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6729 (pselect) [!MS_DOS]: Redirect to sys_select.
6730
6731 * sysdep.c: Don't include dos.h and dosfns.h.
6732
6733 * process.c (sys_select):
6734 * msdos.c (sys_select): Accept one more argument and ignore it.
6735
6736 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6737 adapt data types and code to that.
6738
6739 * dosfns.c:
6740 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6741 which clashes with the gnulib function of the same name.
6742
6743 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6744
6745 * font.c (font_style_to_value, font_style_symbolic)
6746 (font_prop_validate_style): Add type checks for values in
6747 font_style_table.
6748
6749 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6750 argument.
6751 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6752 uses.
6753
6754 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6755
6756 * xdisp.c (try_window_id): Undo last change.
6757
6758 * w32.c (getwd): Adjust commentary about startup_dir.
6759 (init_environment): Always call sys_access, even in non-MSVC
6760 builds. Don't chdir to the directory of the Emacs executable.
6761 This undoes code from 1997 which was justified by the need to
6762 "avoid conflicts when removing and renaming directories". But its
6763 downside was that every relative file name was being interpreted
6764 relative to the directory of the Emacs executable, which can never
6765 be TRT. In particular, it broke sys_access when called with
6766 relative file names.
6767 (sys_access): Map GetLastError to errno.
6768
6769 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6770
6771 * window.h (struct window): Change type of 'fringes_outside_margins'
6772 to bitfield. Fix comment. Adjust users accordingly.
6773 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6774 Adjust comment.
6775 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6776 to ptrdiff_t.
6777
6778 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6779
6780 * gnutls.c (emacs_gnutls_handshake):
6781 Add QUIT to make the loop interruptible.
6782
6783 2012-06-29 Glenn Morris <rgm@gnu.org>
6784
6785 * charset.c (init_charset): Make lack of etc/charsets fatal.
6786
6787 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6788
6789 * editfns.c (region_limit): Fix type mismatch.
6790
6791 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6792
6793 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6794 undefined. Convert from xassert to eassert.
6795 * nsmenu.m: Convert from xassert to eassert.
6796 * nsterm.m: Likewise.
6797
6798 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6799
6800 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6801
6802 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6803
6804 Avoid integer overflow on scroll-left and scroll-right.
6805 * window.c (HSCROLL_MAX): New macro.
6806 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6807 overflow when requested scroll falls outside ptrdiff_t range.
6808
6809 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6810
6811 * window.h (struct window): Change type of 'hscroll',
6812 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6813 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6814 Adjust users accordingly.
6815 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6816 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6817 from EMACS_INT to ptrdiff_t.
6818 (make_window): Omit redundant initialization.
6819
6820 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6821
6822 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6823
6824 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6825
6826 * window.h (struct window): Change type of 'use_time' and
6827 'sequence_number' from Lisp_Object to int.
6828 * frame.c (make_frame): Adjust users accordingly.
6829 * print.c (print_object): Likewise.
6830 * window.c (select_window, Fwindow_use_time, make_parent_window)
6831 (make_window): Likewise.
6832
6833 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6834
6835 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6836 enabled with --enable-checking=[all,glyphs] configure option.
6837 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6838 adjust comments accordingly.
6839 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6840 undefined, adjust comments accordingly.
6841 * image.c: Likewise.
6842 * scroll.c: Likewise.
6843 * w32fns.c: Likewise.
6844 * w32term.c: Likewise.
6845 * xdisp.c: Likewise.
6846 * xfaces.c: Likewise.
6847 * xfns.c: Likewise.
6848 * xterm.c: Likewise.
6849
6850 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6851
6852 Generalize run-time debugging checks.
6853 * dispextern.h (XASSERTS): Remove.
6854 * fontset.c (xassert): Remove.
6855 Convert from xassert to eassert.
6856 * alloc.c: Convert from xassert to eassert.
6857 * bidi.c: Likewise.
6858 * dispnew.c: Likewise.
6859 * fns.c: Likewise.
6860 * fringe.c: Likewise.
6861 * ftfont.c: Likewise.
6862 * gtkutil.c: Likewise.
6863 * image.c: Likewise.
6864 * keyboard.c: Likewise.
6865 * menu.c: Likewise.
6866 * process.c: Likewise.
6867 * scroll.c: Likewise.
6868 * sound.c: Likewise.
6869 * term.c: Likewise.
6870 * w32console.c: Likewise.
6871 * w32fns.c: Likewise.
6872 * w32term.c: Likewise.
6873 * window.c: Likewise.
6874 * xdisp.c: Likewise.
6875 * xfaces.c: Likewise.
6876 * xfns.c: Likewise.
6877 * xselect.c: Likewise.
6878 * xterm.c: Likewise.
6879
6880 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6881
6882 * fns.c (maybe_resize_hash_table): Output message when growing the
6883 purify-hashtable.
6884
6885 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6886
6887 * alloc.c (allocate_string_data): Remove dead code.
6888 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6889 avoid GCC warning about unused macro.
6890
6891 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6892
6893 * alloc.c (allocate_string): Omit intervals initialization.
6894 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6895 as in make_pure_string and make_pure_c_string.
6896
6897 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6898
6899 * alloc.c (allocate_string): Fix last change.
6900
6901 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6902
6903 * alloc.c (allocate_string): Remove two redundant calls
6904 to memset, add explicit initialization where appropriate.
6905
6906 2012-06-27 Glenn Morris <rgm@gnu.org>
6907
6908 * lisp.mk (lisp): Remove paths.elc.
6909
6910 2012-06-27 Chong Yidong <cyd@gnu.org>
6911
6912 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6913
6914 2012-06-26 John Wiegley <johnw@newartisans.com>
6915
6916 * unexmacosx.c (copy_data_segment): Add two section names used
6917 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6918
6919 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6920 when building with Clang.
6921
6922 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6923
6924 * eval.c (Fapply): Allow calling it with a single argument.
6925
6926 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6927
6928 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6929 _stricmp and _strnicmp.
6930 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6931
6932 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6933
6934 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6935 allocated window.
6936 (allocate_process): Likewise for new process.
6937 (allocate_terminal): Change to use offsetof.
6938 (allocate_frame): Likewise.
6939 * frame.c (make_frame): Omit redundant initialization.
6940 * window.c (make_parent_window): Use memset.
6941 (make_window): Omit redundant initialization.
6942 * process.c (make_process): Omit redundant initialization.
6943 * terminal.c (create_terminal): Likewise.
6944
6945 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6946
6947 * term.c (delete_tty): Remove redundant call to memset.
6948
6949 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6950
6951 * alloc.c: Remove build_string.
6952 * lisp.h: Define build_string as static inline. This provides
6953 a better opportunity to optimize away calls to strlen when the
6954 function is called with compile-time constant argument.
6955 * image.c (imagemagick_error): Convert to build_string.
6956 * w32proc.c (sys_spawnve): Likewise.
6957 * xterm.c (x_term_init): Likewise.
6958
6959 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6960
6961 Use sprintf return value instead of invoking strlen on result.
6962 In the old days this wasn't portable, since some sprintf
6963 implementations returned char *. But they died out years ago and
6964 Emacs already assumes sprintf returns int.
6965 Similarly for float_to_string.
6966 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6967 * ccl.c (ccl_driver):
6968 * character.c (string_escape_byte8):
6969 * data.c (Fnumber_to_string):
6970 * doprnt.c (doprnt):
6971 * print.c (print_object):
6972 * xdisp.c (message_dolog):
6973 * xfns.c (syms_of_xfns):
6974 Use sprintf or float_to_string result to avoid need to call strlen.
6975 * data.c (Fnumber_to_string):
6976 Use make_unibyte_string, since the string must be ASCII.
6977 * lisp.h, print.c (float_to_string): Now returns int length.
6978 * term.c (produce_glyphless_glyph):
6979 Use sprintf result rather than recomputing it.
6980
6981 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6982 * Makefile.in (ALL_CFLAGS):
6983 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6984 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6985
6986 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6987
6988 * dispextern.h (xstrcasecmp): Define to library function
6989 strcasecmp if available.
6990 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6991
6992 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6993
6994 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6995 Avoid comma operator.
6996 * menu.c (push_submenu_start, push_submenu_end)
6997 (push_left_right_boundary, push_menu_pane): Likewise.
6998 * msdos.c (dos_rawgetc): Likewise.
6999
7000 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7001
7002 * xfns.c (xic_create_fontsetname): Remove redundant calls
7003 to memset.
7004
7005 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7006
7007 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7008 sprintf already null-terminates its output.
7009
7010 * xfns.c (x_window): Remove redundant cast.
7011
7012 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7013
7014 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7015 `const char *' to `char *' to avoid compiler warning.
7016
7017 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7018
7019 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7020 instead of truncating it to 63 (admittedly a generous limit).
7021
7022 * process.c: Fix spelling and caps in comments.
7023
7024 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7025
7026 * emacs.c (setpgrp): Remove definition, unused.
7027 * sysdep.c (setpgrp): Remove definition, not used in this file.
7028
7029 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7030
7031 * makefile.w32-in: Update dependencies.
7032
7033 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7034
7035 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7036 (SYSTIME_H): Add nt/inc/sys/time.h.
7037
7038 * systime.h [WINDOWSNT]: Include sys/time.h.
7039
7040 * s/ms-w32.h (struct timespec): Definition moved from
7041 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7042
7043 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7044
7045 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7046 * buffer.h (buffer_slot_type_mismatch):
7047 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7048 * eval.c (unwind_to_catch):
7049 * image.c (my_png_error, my_error_exit):
7050 * keyboard.c (quit_throw_to_read_char, user_error)
7051 (Fexit_recursive_edit, Fabort_recursive_edit):
7052 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7053 (wrong_type_argument, buffer_overflow, __executable_start)
7054 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7055 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7056 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7057 (fatal):
7058 (child_setup) [!DOS_NT]:
7059 * lread.c (end_of_file_error, invalid_syntax):
7060 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7061 * puresize.h (pure_write_error):
7062 * search.c (matcher_overflow):
7063 * sound.c (sound_perror, alsa_sound_perror):
7064 * sysdep.c, syssignal.h (croak):
7065 * term.c (maybe_fatal, vfatal):
7066 * textprop.c (text_read_only):
7067 * undo.c (user_error):
7068 * unexmacosx.c (unexec_error):
7069 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7070 Use _Noreturn rather than NO_RETURN.
7071 No need for separate decl merely because of _Noreturn.
7072 * sound.c (sound_warning, parse_sound):
7073 Remove unnecessary forward decls.
7074
7075 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7078 * lisp.h (WAIT_READING_MAX): New macro.
7079 * dispnew.c (Fsleep_for, sit_for):
7080 * keyboard.c (kbd_buffer_get_event):
7081 * process.c (Faccept_process_output):
7082 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7083 This improves on the previous patch, which introduced a bug
7084 when time_t is unsigned and as wide as intmax_t.
7085 See <http://bugs.gnu.org/9000#51>.
7086
7087 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7088
7089 * dispnew.c (sit_for, Fsleep_for):
7090 * keyboard.c (kbd_buffer_get_event):
7091 * process.c (Faccept_process_output): Avoid compiler warnings when
7092 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7093
7094 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7095
7096 * makefile.w32-in: Update dependencies.
7097
7098 * w32.c (ltime): Add return type and declare static.
7099 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7100
7101 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7102
7103 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7104 Privately reported by Herbert J. Skuhra.
7105 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7106 All uses changed.
7107 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7108 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7109
7110 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7111
7112 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7113 last argument of make_unibyte_string.
7114
7115 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7116 language ID in the event parameters.
7117
7118 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7119 event.code, not the obscure "character set ID".
7120
7121 2012-06-23 Chong Yidong <cyd@gnu.org>
7122
7123 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7124
7125 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7126
7127 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7128 * w32.c (fdutimens): New function.
7129
7130 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7131
7132 * s/ms-w32.h (pselect): Redirect to sys_select.
7133
7134 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7135
7136 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7137 in the logic of incrementing and decrementing the value of
7138 use_relocatable_buffers.
7139
7140 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7141
7142 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7143 Privately reported by Herbert J. Skuhra.
7144 [__FreeBSD__]: Remove "*/" typo after "#include".
7145 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7146 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7147 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7148 Don't assume EMACS_TIME and struct timeval are the same type.
7149
7150 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7151
7152 Support higher-resolution time stamps (Bug#9000).
7153 The time stamps are only nanosecond-resolution at the C level,
7154 since that's the best that any real-world system supports now.
7155 But they are picosecond-resolution at the Lisp level, as that's
7156 easy, and leaves room for future OS improvements.
7157
7158 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7159 (LIBES): Use it.
7160
7161 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7162 Don't get current time unless it's needed.
7163
7164 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7165 now provides it if it's absent.
7166 (start_atimer): Port to higher-res time stamps.
7167 Check for time stamp overflow. Don't get current time more
7168 often than is needed.
7169
7170 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7171 Include systime.h, not time.h.
7172 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7173
7174 * dired.c: Include stat-time.h.
7175 (Ffile-attributes): File times now have higher resolution.
7176
7177 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7178 (struct image): Timestamp now has higher resolution.
7179
7180 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7181 has at least microseconds now. All uses removed.
7182 (update_frame, update_single_window, update_window, update_frame_1)
7183 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7184 (duration_to_sec_usec): Remove; no longer needed.
7185
7186 * editfns.c (time_overflow): Now extern.
7187 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7188 (float-time, Fformat_time_string, Fcurrent_time_string)
7189 (Fcurrent_time_zone): Accept and generate higher-resolution
7190 time stamps.
7191 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7192 (decode_time_components, lisp_seconds_argument): New functions.
7193 (make_time): Now static.
7194 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7195 Report an error if the time is invalid, rather than having the caller
7196 do that.
7197
7198 * fileio.c: Include <stat-time.h>
7199 (Fcopy_file): Copy higher-resolution time stamps.
7200 Prefer to set the time stamp via a file descriptor if that works.
7201 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7202 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7203 (Fvisited_file_modtime, Fset_visited_file_modtime):
7204 Support higher-resolution time stamps.
7205
7206 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7207
7208 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7209
7210 * image.c (prepare_image_for_display, clear_image_cache)
7211 (lookup_image): Port to higer-resolution time stamps.
7212
7213 * keyboard.c (start_polling, bind_polling_period):
7214 Check for time stamp overflow.
7215 (read_char, kbd_buffer_get_event, timer_start_idle)
7216 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7217 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7218 Port to higher-resolution time stamps. Do not assume time_t is signed.
7219 (decode_timer): New function. Timers are now vectors of length 9,
7220 not 8, to accommodate the picosecond component.
7221 (timer_check_2): Use it.
7222
7223 * nsterm.m (select_timeout, timeval_subtract): Remove.
7224 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7225 as they're a bit more accurate and handle overflow better.
7226 (ns_select): Change prototype to be compatible with pselect.
7227 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7228 * nsterm.h (ns_select): Adjust prototype.
7229
7230 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7231 us-resolution time stamps.
7232 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7233
7234 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7235
7236 * lisp.h (time_overflow): New decl.
7237 (wait_reading_process_output): First arg is now intmax_t, not int,
7238 to accommodate larger waits.
7239
7240 * process.h (struct Lisp_Process.read_output_delay):
7241 Now counts nanoseconds, not microseconds.
7242 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7243 EMACS_HAS_USECS.
7244 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7245 (wait_reading_process_output):
7246 Port to ns-resolution time stamps.
7247 (Faccept_process_output, wait_reading_process_output):
7248 Check for time stamp overflow. Do not assume time_t is signed.
7249 (select_wrapper): Remove; we now use pselect.
7250 (Fprocess_attributes): Now generates ns-resolution time stamps.
7251
7252 * sysdep.c: Include utimens.h. Don't include utime.h
7253 or worry about struct utimbuf; gnulib does that for us now.
7254 (gettimeofday): Remove; gnulib provides a substitute.
7255 (make_timeval): New function.
7256 (set_file_times): Now sets ns-resolution time stamps.
7257 New arg FD; all uses changed.
7258 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7259 (system_process_attributes):
7260 Now returns ns-resolution time stamp. All uses changed.
7261 Check for time stamp overflow.
7262
7263 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7264 provides a substitute now.
7265
7266 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7267 since it guarantees struct timespec.
7268 (EMACS_TIME): Now struct timespec, so that we can support
7269 ns-resolution time stamps.
7270 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7271 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7272 (EMACS_USECS): Remove.
7273 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7274 so multiply the arg by 1000 before storing it.
7275 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7276 New macros.
7277 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7278 Port to ns-resolution time stamps.
7279 (EMACS_TIME_NEG_P): Remove; replaced by....
7280 (EMACS_TIME_SIGN): New macro.
7281 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7282 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7283 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7284 (make_timeval, make_lisp_time, decode_time_components): New decls.
7285 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7286 that it mishandled time_t overflow. You can't compare by subtracting!
7287 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7288 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7289
7290 * term.c: Include <sys/time.h>.
7291 (timeval_to_Time): New function, for proper overflow wraparound.
7292 (term_mouse_position, term_mouse_click): Use it.
7293
7294 * undo.c (record_first_change): Support higher-resolution time stamps
7295 in the undo buffer.
7296 (Fprimitive_undo): Use them when restoring time stamps.
7297
7298 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7299 (w32_get_internal_run_time):
7300 Port to higher-resolution Emacs time stamps.
7301 (ltime): Now accepts single 64-bit integer, as that's more convenient
7302 for callers.
7303
7304 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7305
7306 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7307 for compatibility with pselect. Support ns-resolution time stamps.
7308
7309 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7310
7311 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7312 Check for time stamp overflow, and support ns-resolution time stamps.
7313
7314 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7315 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7316 (timeval_subtract): Remove; no longer needed.
7317 (XTflash, XTring_bell, x_wait_for_event):
7318 Port to ns-resolution time stamps. Don't assume time_t is signed.
7319
7320 2012-06-22 Chong Yidong <cyd@gnu.org>
7321
7322 * xdisp.c (x_consider_frame_title): Revert last change.
7323
7324 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7325
7326 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7327 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7328 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7329 staticidx goes up to 1597 out of 1600 = 0x640.)
7330
7331 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7332
7333 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7334 Otherwise, the umask might be mistakenly 0 while handling input signals.
7335
7336 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7337
7338 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7339
7340 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7341
7342 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7343 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7344 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7345 access to `contents' member of Lisp_Vector objects with AREF and ASET
7346 where appropriate.
7347
7348 2012-06-19 Chong Yidong <cyd@gnu.org>
7349
7350 * frame.c (delete_frame): When selecting a frame on a different
7351 text terminal, do not alter the terminal's top-frame.
7352
7353 * xdisp.c (format_mode_line_unwind_data): Record the target
7354 frame's selected window and its terminal's top-frame.
7355 (unwind_format_mode_line): Restore them.
7356 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7357 Callers changed.
7358 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7359 since tty frames can be explicitly named.
7360 (prepare_menu_bars): Likewise.
7361
7362 * term.c (Ftty_top_frame): New function.
7363
7364 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7365
7366 Port byte-code-meter to modern targets.
7367 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7368 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7369 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7370 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7371 (METER_1, METER_2): Simplify.
7372
7373 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7374
7375 * data.c (Fdefalias): Return `symbol' (bug#11686).
7376
7377 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7378
7379 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7380 gets killed during executing of this function (Bug#11665).
7381 Try to always return Qt when the buffer has been actually killed.
7382 (Vkill_buffer_query_functions): In doc-string say that functions
7383 run by this hook should not change the current buffer.
7384
7385 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7386
7387 Fix recently-introduced process.c problems found by static checking.
7388 * process.c (write_queue_push, write_queue_pop, send_process):
7389 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7390 (write_queue_pop): Fix pointer signedness problem.
7391 (send_process): Remove unused local.
7392
7393 2012-06-17 Chong Yidong <cyd@gnu.org>
7394
7395 * xdisp.c (redisplay_internal): No need to redisplay terminal
7396 frames that are not on top.
7397
7398 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7399
7400 * process.c (make_process): Initialize write_queue.
7401 (write_queue_push, write_queue_pop): New functions.
7402 (send_process): Use them to maintain correct ordering of process
7403 writes (Bug#10815).
7404
7405 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 * lisp.h (eassert): Assume C89 or later.
7408 This removes the need for CHECK.
7409 (CHECK): Remove. Its comments about always evaluating its
7410 argument were confusing, as 'eassert' typically does not evaluate
7411 its argument.
7412
7413 * coding.c (produce_chars): Use ptrdiff_t, not int.
7414
7415 * xterm.c (x_draw_underwave): Check for integer overflow.
7416 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7417
7418 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7419
7420 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7421 referenced (Bug#11583).
7422
7423 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7424
7425 Implement wave-style variant of underlining.
7426 * dispextern.h (face_underline_type): New enum.
7427 (face): Add field for underline type.
7428 * nsterm.m (ns_draw_underwave): New function.
7429 (ns_draw_text_decoration): Use it.
7430 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7431 New functions.
7432 (x_draw_glyph_string): Use them.
7433 * xfaces.c (Qline, Qwave): New Lisp objects.
7434 (check_lface_attrs, merge_face_ref)
7435 (Finternal_set_lisp_face_attribute, realize_x_face):
7436 Handle wave-style underline face attributes.
7437 * xterm.c (x_draw_underwave): New function.
7438 (x_draw_glyph_string): Use it.
7439
7440 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7441
7442 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7443 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7444 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7445 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7446 ($(BLD)/w32select.$(O)): Update dependencies.
7447
7448 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7449
7450 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7451 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7452 * character.c (_fetch_multibyte_char_p): Remove.
7453 * alloc.c: Include "character.h" before "buffer.h".
7454 * bidi.c: Likewise.
7455 * buffer.c: Likewise.
7456 * bytecode.c: Likewise.
7457 * callint.c: Likewise.
7458 * callproc.c: Likewise.
7459 * casefiddle.c: Likewise.
7460 * casetab.c: Likewise.
7461 * category.c: Likewise.
7462 * cmds.c: Likewise.
7463 * coding.c: Likewise.
7464 * composite.c: Likewise.
7465 * dired.c: Likewise.
7466 * dispnew.c: Likewise.
7467 * doc.c: Likewise.
7468 * dosfns.c: Likewise.
7469 * editfns.c: Likewise.
7470 * emacs.c: Likewise.
7471 * fileio.c: Likewise.
7472 * filelock.c: Likewise.
7473 * font.c: Likewise.
7474 * fontset.c: Likewise.
7475 * fringe.c: Likewise.
7476 * indent.c: Likewise.
7477 * insdel.c: Likewise.
7478 * intervals.c: Likewise.
7479 * keyboard.c: Likewise.
7480 * keymap.c: Likewise.
7481 * lread.c: Likewise.
7482 * macros.c: Likewise.
7483 * marker.c: Likewise.
7484 * minibuf.c: Likewise.
7485 * nsfns.m: Likewise.
7486 * nsmenu.m: Likewise.
7487 * print.c: Likewise.
7488 * process.c: Likewise.
7489 * regex.c: Likewise.
7490 * region-cache.c: Likewise.
7491 * search.c: Likewise.
7492 * syntax.c: Likewise.
7493 * term.c: Likewise.
7494 * textprop.c: Likewise.
7495 * undo.c: Likewise.
7496 * unexsol.c: Likewise.
7497 * w16select.c: Likewise.
7498 * w32fns.c: Likewise.
7499 * w32menu.c: Likewise.
7500 * window.c: Likewise.
7501 * xdisp.c: Likewise.
7502 * xfns.c: Likewise.
7503 * xmenu.c: Likewise.
7504 * xml.c: Likewise.
7505 * xselect.c: Likewise.
7506
7507 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7508
7509 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7510 If all the glyphs of the glyph row came from strings, and we have no
7511 cursor positioning clues, put the cursor on the first glyph of the
7512 row.
7513 (handle_face_prop): Use chunk-relative overlay string index when
7514 indexing into it->string_overlays array. (Bug#11653)
7515 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7516 the rightmost. (Bug#11720)
7517
7518 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7519
7520 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7521 (CATEGORY_MEMBER): Enforce 1/0 value.
7522 * category.c (_temp_category_set): Remove.
7523
7524 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7525
7526 * window.c (Fdelete_other_windows_internal)
7527 (Fdelete_window_internal): Don't access frame's mouse highlight
7528 info of the initial frame. (Bug#11677)
7529
7530 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7531
7532 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7533 Assume USE_2_TAGS_FOR_INTS.
7534 (xreload): Adjust $tagmask width to match recent lisp.h change.
7535
7536 Simplify lisp.h in minor ways that should not affect code.
7537 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7538 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7539 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7540 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7541 (INTTYPEBITS): New macro, for clarity.
7542 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7543 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7544 Simplify now that USE_LSB_TAG is always defined.
7545 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7546 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7547
7548 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7549
7550 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7551
7552 2012-06-13 Glenn Morris <rgm@gnu.org>
7553
7554 * s/bsd-common.h (BSD4_3):
7555 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7556
7557 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7558
7559 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7560 instead of union.
7561 (XLI, XIL): Define.
7562 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7563 Use them.
7564 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7565 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7566 * alloc.c (widen_to_Lisp_Object): Remove.
7567 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7568 * frame.c (delete_frame): Remove outdated comment.
7569 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7570 USE_LISP_UNION_TYPE.
7571 (Fw32_unregister_hot_key): Likewise.
7572 (Fw32_toggle_lock_key): Likewise.
7573 * w32menu.c (add_menu_item): Likewise.
7574 (w32_menu_display_help): Use XIL instead of checking
7575 USE_LISP_UNION_TYPE.
7576 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7577 (init_heap): Likewise.
7578 * w32term.c (w32_read_socket): Update comment.
7579
7580 2012-06-13 Glenn Morris <rgm@gnu.org>
7581
7582 * s/usg5-4-common.h, src/s/unixware.h:
7583 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7584
7585 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7586
7587 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7590 * alloc.c (make_number) [!defined make_number]:
7591 Remove, as lisp.h always defines this now.
7592 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7593 (roundup_size): Verify that it is a power of 2.
7594 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7595 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7596 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7597 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7598 USE_LSB_TAG now is always defined to be either 0 or 1.
7599 All uses changed.
7600 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7601 code works fine either way, and efficiency is not a concern here,
7602 as the union type is for debugging, not for production.
7603 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7604 Use an inline function on all platforms when using the union type,
7605 since this is simpler and 'static inline' can be used portably
7606 within Emacs now.
7607 (LISP_INITIALLY_ZERO): New macro.
7608 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7609 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7610
7611 2012-06-12 Glenn Morris <rgm@gnu.org>
7612
7613 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7614
7615 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7616
7617 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7618 Move BROKEN_SIGIO to configure.
7619
7620 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7621 Move NO_TERMIO to configure.
7622
7623 2012-06-12 Chong Yidong <cyd@gnu.org>
7624
7625 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7626 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7627 MagickExportImagePixels is undefined.
7628
7629 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7630
7631 * image.c (imagemagick_load_image): Remove unused label.
7632
7633 2012-06-11 Glenn Morris <rgm@gnu.org>
7634
7635 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7636 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7637 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7638 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7639
7640 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7641
7642 * alloc.c (make_byte_code): New function.
7643 (Fmake_byte_code): Use it. Don't purify here.
7644 * lread.c (read1): Use it as well to avoid extra allocation.
7645
7646 2012-06-11 Chong Yidong <cyd@gnu.org>
7647
7648 * image.c (imagemagick_load_image): Implement transparency.
7649
7650 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7651
7652 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7653 account for preceding backslashes. (Bug#11663)
7654
7655 2012-06-09 Chong Yidong <cyd@gnu.org>
7656
7657 * term.c: Support italics in capable terminals (Bug#9652).
7658 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7659 (turn_on_face): Output using TS_enter_italic_mode if available.
7660 Don't handle unused blinking and alt-charset cases.
7661 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7662 and tty_alt_charset_p cases.
7663 (tty_capable_p, init_tty): Support italics.
7664
7665 * termchar.h (struct tty_display_info): Add field for italics.
7666 Remove unused blink field.
7667
7668 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7669 Handle slant.
7670
7671 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7672 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7673 tty_alt_charset_p. Add tty_italic_p.
7674
7675 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7676
7677 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7678 dbus_type_is_basic if available.
7679 (xd_extract_signed, xd_extract_unsigned): Rename from
7680 extract_signed and extract_unsigned, respectively. Adapt callers.
7681
7682 2012-06-09 Chong Yidong <cyd@gnu.org>
7683
7684 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7685
7686 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7687 case (Bug#9752).
7688
7689 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7690
7691 * xdisp.c (vmessage): Treat frame message as multibyte.
7692 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7693 would generate the diagnostic "Making \302\247 buffer-local while
7694 let-bound!".
7695
7696 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7697
7698 * dispnew.c (showing_window_margins_p): Undo last change, which
7699 was done due to an inadvertent commit.
7700 (adjust_frame_glyphs_for_frame_redisplay): Do call
7701 showing_window_margins_p.
7702
7703 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7704
7705 * eval.c (Fmake_var_non_special): New primitive.
7706 (syms_of_eval): Defsubr it.
7707 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7708
7709 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7710
7711 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7712 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7713
7714 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7715
7716 * alloc.c (allocate_vectorlike): Fix last change.
7717
7718 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7719
7720 Block-based vector allocation of small vectors.
7721 * lisp.h (struct vectorlike_header): New field `nbytes',
7722 adjust comment accordingly.
7723 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7724 to denote vector blocks. Adjust users (live_vector_p,
7725 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7726 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7727 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7728 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7729 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7730 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7731 (roundup_size): New constant.
7732 (struct vector_block): New data type.
7733 (vector_blocks, vector_free_lists, zero_vector): New variables.
7734 (all_vectors): Rename to `large_vectors'.
7735 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7736 (sweep_vectors): New functions.
7737 (allocate_vectorlike): Return `zero_vector' as the only vector of
7738 0 items. Allocate new vector from block if vector size is less than
7739 or equal to VBLOCK_BYTES_MAX.
7740 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7741 (init_alloc_once): Add call to init_vectors.
7742
7743 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7744
7745 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7746
7747 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7748
7749 * doprnt.c (doprnt): Truncate multibyte char correctly.
7750 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7751 would mishandle a string argument "Xc" if X was a multibyte
7752 character of length 2: it would truncate after X's first byte
7753 rather than including all of X.
7754
7755 2012-06-06 Chong Yidong <cyd@gnu.org>
7756
7757 * buffer.c (word_wrap): Doc fix.
7758
7759 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7760
7761 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7762
7763 2012-06-03 Glenn Morris <rgm@gnu.org>
7764
7765 * xdisp.c (tool-bar-style): Doc fix.
7766
7767 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7768
7769 * Makefile.in (PAXCTL): Define.
7770 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7771 binary via PaX flags if the paxctl utility is available.
7772 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7773 Restore PaX flags to their default. (Bug#11398)
7774
7775 2012-06-03 Chong Yidong <cyd@gnu.org>
7776
7777 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7778 buffer (Bug#11226).
7779
7780 2012-06-03 Chong Yidong <cyd@gnu.org>
7781
7782 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7783 (note_mode_line_or_margin_highlight): If there is no help echo,
7784 use mode-line-default-help-echo. Handle the case where the mouse
7785 position is past the end of the mode line string.
7786
7787 * buffer.c (buffer_local_value_1): New function, split from
7788 Fbuffer_local_value; can return Qunbound.
7789 (Fbuffer_local_value): Use it.
7790 (Vmode_line_format): Docstring tweaks.
7791
7792 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 * sysdep.c (system_process_attributes): Improve comment.
7795
7796 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7797
7798 * keyboard.c: Export real-this-command to Elisp.
7799 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7800 and DEFVAR it. Update all users.
7801
7802 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7803
7804 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7805
7806 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7807 Convert pctcpu and pctmem to Lisp float properly.
7808 Let the compiler fold better, as 100.0/0x8000 is exact.
7809
7810 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7811
7812 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7813 cons_block.
7814
7815 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7816
7817 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7818
7819 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7820
7821 For a 'struct window', replace some Lisp_Object fields to
7822 bitfields where appropriate, remove unused fields.
7823 * window.h (struct window): Remove unused 'last_mark_x' and
7824 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7825 change its type from Lisp_Object to bitfield.
7826 Change type of 'force_start', 'optional_new_start',
7827 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7828 fields from Lisp_Object to bitfield. Adjust users accordingly.
7829
7830 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 Pacify gcc -Wdouble-precision when using Xaw.
7833 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7834 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7835 Use 'float' consistently, rather than 'float' in most places
7836 and 'double' in a couple of places.
7837
7838 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7839
7840 * xdisp.c (handle_stop): Detect whether we have overlay strings
7841 loaded by testing it->current.overlay_string_index to be
7842 non-negative, instead of checking whether n_overlay_strings is
7843 positive. (Bug#11587)
7844
7845 2012-05-31 Chong Yidong <cyd@gnu.org>
7846
7847 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7848
7849 * doc.c (Fsubstitute_command_keys): Doc fix.
7850
7851 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7852
7853 * search.c (search_buffer): Remove calls to
7854 r_alloc_inhibit_buffer_relocation, as it is now called by
7855 maybe_unify_char, which was the cause of relocation of buffer text
7856 in bug#11519.
7857
7858 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7859
7860 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7861 for the duration of call to load_charset, to avoid problems with
7862 callers of maybe_unify_char that access buffer text through C
7863 pointers.
7864
7865 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7866 decrement the inhibition flag, instead of just setting or
7867 resetting it.
7868
7869 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7870
7871 Remove obsolete '#define static' cruft.
7872 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7873 This #undef was "temporary" in 2000; it is no longer needed
7874 now that '#define static' has gone away.
7875 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7876 (gray_bitmap_bits): Remove; no longer needed.
7877 All uses replaced with definiens.
7878 * xterm.c: Include "bitmaps/gray.xbm".
7879
7880 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7881
7882 Clean up __executable_start, monstartup when --enable-profiling.
7883 The following changes affect the code only when profiling.
7884 * dispnew.c (__executable_start): Rename from safe_bcopy.
7885 Define only on platforms that need it.
7886 * emacs.c: Include <sys/gmon.h> when profiling.
7887 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7888 (__executable_start): Remove decl, since lisp.h does it now.
7889 (safe_bcopy): Remove decl; no longer has that name.
7890 (main): Coalesce #if into single bit of code, for simplicity.
7891 Cast pointers to uintptr_t, since standard libraries want integers
7892 and not pointers.
7893 * lisp.h (__executable_start): New decl.
7894
7895 2012-05-31 Glenn Morris <rgm@gnu.org>
7896
7897 * image.c (Fimagemagick_types): Doc fix.
7898
7899 2012-05-30 Jim Meyering <meyering@redhat.com>
7900
7901 * callproc.c (Fcall_process_region): Include directory component
7902 in mkstemp error message (Bug#11586).
7903
7904 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7905
7906 * alloc.c, lisp.h (make_pure_vector): Now static.
7907
7908 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7909
7910 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7911 Move to byte-run.el.
7912 (Fautoload): Do the hash-doc more carefully.
7913 * data.c (Fdefalias): Purify definition, except for keymaps.
7914 (Qdefun): Move from eval.c.
7915 * lisp.h (Qdefun): Remove.
7916 * lread.c (read1): Tiny simplification.
7917
7918 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7919
7920 Do not create empty overlays with the evaporate property (Bug#9642).
7921 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7922 Bug#9642, but explicitly check that the buffer the overlay would
7923 be moved to is live and rearrange lines to make sure that errors
7924 will not put the overlay in an inconsistent state.
7925 (Fdelete_overlay): Cosmetics.
7926
7927 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7928
7929 * w32term.c (my_bring_window_to_top): New function.
7930 (x_raise_frame): Use handle returned by DeferWindowPos, which
7931 could be different from the original one.
7932 Call my_bring_window_to_top instead of my_set_foreground_window.
7933 (Bug#11513)
7934
7935 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7936 by calling BringWindowToTop.
7937
7938 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7939 (WM_EMACS_END): Increase by one.
7940
7941 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7942
7943 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7944 This avoids undefined behavior that might cause the eassert
7945 to not catch an out-of-range value.
7946
7947 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7948
7949 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7950 Update dependencies.
7951
7952 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7953
7954 * bidi.c (bidi_mirror_char): Fix last change.
7955
7956 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7957
7958 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7959 when referring to sectname field in printf format.
7960
7961 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7962
7963 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7964 Only r_alloc_inhibit_buffer_relocation needed to be added;
7965 the others were already declared.
7966
7967 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7968 before checking whether it's out of range. Put the check inside
7969 eassert. See
7970 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7971
7972 2012-05-27 Ken Brown <kbrown@cornell.edu>
7973
7974 * callproc.c (Fcall_process): Restore a line that was accidentally
7975 commented out in the 2011-02-13 change (bug#11547).
7976
7977 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7978
7979 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7980 defined on ralloc.c.
7981
7982 * buffer.c [REL_ALLOC]: Remove prototypes of
7983 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7984 they are now on lisp.h.
7985
7986 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7987
7988 * search.c (search_buffer): Use it to inhibit relocation of buffer
7989 text while re_search_2 is doing its job, because re_search_2 is
7990 passed C pointers to buffer text. (Bug#11519)
7991
7992 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7993 Update value to 24.
7994
7995 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7996 state after an additional call to move_it_in_display_line_to, keep
7997 the values of it->max_ascent and it->max_descent found for the
7998 entire line.
7999 (pos_visible_p): Revert the comparison against bottom_y to what it
8000 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8001 (Bug#11464)
8002
8003 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8004
8005 Fix coding-related core dumps with gcc -ftrapv.
8006 The code was computing A - B, where A and B are pointers, and B is
8007 random garbage. This can lead to core dumps on platforms that
8008 have special pointer registers, and it also leads to core dumps on
8009 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8010 A - B only when B is initialized properly.
8011 * coding.c (coding_set_source, coding_set_destination): Return void.
8012 (coding_change_source, coding_change_destinations): New functions,
8013 with the old behaviors of coding_set_source and coding_set_destination.
8014 All callers that need an offset changed to use these new functions.
8015
8016 2012-05-26 Glenn Morris <rgm@gnu.org>
8017
8018 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8019
8020 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8021
8022 Extend mouse support on W32 text-mode console.
8023 * xdisp.c (draw_row_with_mouse_face):
8024 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8025
8026 * w32console.c: Include window.h.
8027 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8028 New functions.
8029 (initialize_w32_display): Initialize mouse-highlight data.
8030
8031 * w32inevt.c: Include termchar.h and window.h.
8032 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8033 moves, call note_mouse_highlight. If help_echo changed, call
8034 gen_help_event to produce help-echo message in the echo area.
8035 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8036 highlight info.
8037
8038 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8039
8040 * lread.c (read1): Simplify slightly to avoid an overflow warning
8041 with GCC 4.7.0 on x86-64.
8042
8043 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8044
8045 * bidi.c (bidi_mirror_char): Revert last change: an int is
8046 definitely wide enough here.
8047
8048 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8049
8050 Fix integer width and related bugs (Bug#9874).
8051 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8052 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8053 (string_bytes, check_sblock, allocate_string_data):
8054 (compact_small_strings, Fmake_bool_vector, make_string)
8055 (make_unibyte_string, make_multibyte_string)
8056 (make_string_from_bytes, make_specified_string)
8057 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8058 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8059 (mark_vectorlike):
8060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8061 (allocate_pseudovector):
8062 Use int, not EMACS_INT, where int is wide enough.
8063 (inhibit_garbage_collection, Fgarbage_collect):
8064 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8065 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8066 int might not be wide enough.
8067 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8068 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8069 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8070 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8071 (bidi_level_of_next_char, bidi_move_to_visually_next):
8072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8073 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8074 (Fkill_buffer, Fset_buffer_major_mode)
8075 (advance_to_char_boundary, Fbuffer_swap_text)
8076 (Fset_buffer_multibyte, overlays_at, overlays_in)
8077 (overlay_touches_p, struct sortvec, record_overlay_string)
8078 (overlay_strings, recenter_overlay_lists)
8079 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8080 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8081 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8082 (Foverlay_recenter, last_overlay_modification_hooks_used)
8083 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8085 (validate_region): Omit unnecessary test for b <= e,
8086 since that's guaranteed by the previous test.
8087 (adjust_overlays_for_delete): Avoid pos + length overflow.
8088 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8089 (report_overlay_modification):
8090 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8091 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8092 Omit pointer cast, which isn't needed anyway, and doesn't work
8093 after the EMACS_INT -> ptrdiff_t change.
8094 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8095 * buffer.h: Adjust decls to match defn changes elsewhere.
8096 (struct buffer_text, struct buffer):
8097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8098 Use EMACS_INT, not int, where int might not be wide enough.
8099 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8100 not int, to avoid needless 32-bit limit on 64-bit hosts.
8101 (exec_byte_code): Use tighter memory-full test, one that checks
8102 for alloca overflow. Don't compute the address of the object just
8103 before an array, as that's not portable. Use EMACS_INT, not
8104 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8105 * callint.c (Fcall_interactively):
8106 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8107 * callproc.c (call_process_kill, Fcall_process):
8108 Don't assume pid_t fits into an Emacs fixnum.
8109 (call_process_cleanup, Fcall_process, child_setup):
8110 Don't assume pid_t fits into int.
8111 (call_process_cleanup, Fcall_process, delete_temp_file)
8112 (Fcall_process_region):
8113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8114 (Fcall_process): Simplify handling of volatile integers.
8115 Use int, not EMACS_INT, where int will do.
8116 * casefiddle.c (casify_object, casify_region, operate_on_word)
8117 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8119 (casify_object): Avoid integer overflow when overallocating buffer.
8120 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8121 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8122 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8123 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8124 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8125 integers are now checked earlier. All uses replaced with XINT.
8126 (ccl_driver):
8127 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8128 For CCL_MapSingle, check that content and value are in int range.
8129 (ccl_driver, Fregister_code_conversion_map):
8130 Check that Vcode_version_map_vector is a vector.
8131 (resolve_symbol_ccl_program): Check that vector header is in range.
8132 Always copy the vector, so that we can check its contents reliably
8133 now rather than having to recheck each instruction as it's being
8134 executed. Check that vector words fit in 'int'.
8135 (ccl_get_compiled_code, Fregister_ccl_program)
8136 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8137 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8138 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8139 contents are in range.
8140 (Fccl_execute_on_string): Check that status is in range.
8141 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8142 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8143 Accept and return EMACS_INT, not int, because callers can pass values
8144 out of 'int' range.
8145 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8146 (multibyte_chars_in_text, parse_str_as_multibyte)
8147 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8148 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8149 (string_escape_byte8, Fget_byte):
8150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8151 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8152 avoid mishandling large integers.
8153 * character.h: Adjust decls to match defn changes elsewhere.
8154 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8155 (Ffind_charset_region):
8156 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8157 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8158 (load_charset_map_from_vector, Fdefine_charset_internal):
8159 Don't assume fixnum fits in int.
8160 (load_charset_map_from_vector, Fmap_charset_chars):
8161 Remove now-unnecessary CHECK_NATNUMs.
8162 (Fdefine_charset_internal): Check ranges here, more carefully.
8163 Don't rely on undefined behavior with signed left shift overflow.
8164 Don't assume unsigned int fits into fixnum, or that fixnum fits
8165 into unsigned int. Don't require max_code to be a valid fixnum;
8166 that's not true for gb10830 4-byte on a 32-bit host. Allow
8167 invalid_code to be a cons, for the same reason. Require code_offset
8168 to be a character. Avoid int overflow if max_char is close
8169 to INT_MAX.
8170 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8171 this is intended anyway and avoids some undefined behavior.
8172 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8173 INDEX_TO_CODE_POINT, as that's what it expects.
8174 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8175 * charset.h (DECODE_CHAR): Return int, not unsigned;
8176 this is what was intended anyway, and it avoids undefined behavior.
8177 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8178 integer-overflow issues.
8179 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8180 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8181 where the argument is EMACS_INT, and this behavior is not intended.
8182 * chartab.c (Fmake_char_table, Fset_char_table_range)
8183 (uniprop_get_decoder, uniprop_get_encoder):
8184 Don't assume fixnum fits in int.
8185 * cmds.c (move_point): New function, that does the gist of
8186 Fforward_char and Fbackward_char, but does so while checking
8187 for integer overflow more accurately.
8188 (Fforward_char, Fbackward_char): Use it.
8189 (Fforward_line, Fend_of_line, internal_self_insert)
8190 (internal_self_insert):
8191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8192 Fix a FIXME, by checking for integer overflow when calculating
8193 target_clm and actual_clm.
8194 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8195 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8196 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8197 (coding_alloc_by_making_gap, alloc_destination)
8198 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8199 (encode_coding_utf_16, detect_coding_emacs_mule)
8200 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8201 (detect_coding_iso_2022, decode_coding_iso_2022)
8202 (encode_invocation_designation, encode_designation_at_bol)
8203 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8204 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8205 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8206 (encode_coding_ccl, encode_coding_raw_text)
8207 (detect_coding_charset, decode_coding_charset)
8208 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8209 (produce_composition, produce_charset, produce_annotation)
8210 (decode_coding, handle_composition_annotation)
8211 (handle_charset_annotation, consume_chars, decode_coding_gap)
8212 (decode_coding_object, encode_coding_object, detect_coding_system)
8213 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8214 (code_convert_region, code_convert_string)
8215 (Fdefine_coding_system_internal)
8216 (coding_set_source, coding_set_destination):
8217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8218 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8219 (Fdefine_coding_system_internal):
8220 Don't assume fixnums fit in int.
8221 (decode_coding_gap, decode_coding_object, encode_coding_object)
8222 (Fread_coding_system, Fdetect_coding_region)
8223 (Funencodable_char_position, Fcheck_coding_systems_region)
8224 (get_translation, handle_composition_annotation, consume_chars):
8225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8226 (consume_chars): Rewrite to not calculate an address outside buffer.
8227 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8228 Don't access memory outside of the args array.
8229 (Fdefine_coding_system_internal): Check for charset-id overflow.
8230 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8231 result of ENCODE_CHAR.
8232 * coding.h: Adjust decls to match defn changes elsewhere.
8233 (struct coding_system):
8234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8235 * composite.c (get_composition_id, find_composition)
8236 (run_composition_function, update_compositions)
8237 (compose_text, composition_gstring_put_cache)
8238 (composition_gstring_p, composition_gstring_width)
8239 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8240 (composition_compute_stop_pos, composition_reseat_it)
8241 (composition_update_it, struct position_record)
8242 (find_automatic_composition, composition_adjust_point)
8243 (Fcomposition_get_gstring, Ffind_composition_internal):
8244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8245 (update_compositions):
8246 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8247 * composite.h: Adjust decls to match defn changes elsewhere.
8248 (struct composition):
8249 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8250 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8251 Do not attempt to compute the address of the object just before a
8252 buffer; this is not portable.
8253 (Faref, Faset):
8254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8255 (Faset): Use int, not EMACS_INT, where int is wide enough.
8256 (Fstring_to_number): Don't assume fixnums fit in int.
8257 (Frem): Don't assume arg is nonnegative.
8258 * dbusbind.c (xd_append_arg): Check for integers out of range.
8259 (Fdbus_call_method): Don't overflow the timeout int.
8260 (extract_signed, extract_unsigned): New functions.
8261 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8262 (xd_get_connection_references): Return ptrdiff_t, not int.
8263 All uses changed.
8264 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8265 (xd_read_message_1):
8266 Use int, not unsigned, where the dbus API uses int.
8267 (Fdbus_message_internal): Don't overflow mtype.
8268 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8269 * dired.c (directory_files_internal, file_name_completion, scmp)
8270 (file_name_completion_stat):
8271 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8272 (file_name_completion): Don't overflow matchcount.
8273 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8274 * dispextern.h: Adjust decls to match defn changes elsewhere.
8275 (struct text_pos, struct glyph, struct bidi_saved_info)
8276 (struct bidi_string_data, struct bidi_it, struct composition_it)
8277 (struct it):
8278 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8279 (struct display_pos, struct composition_it, struct it):
8280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8281 * dispnew.c (increment_matrix_positions)
8282 (increment_row_positions, mode_line_string)
8283 (marginal_area_string):
8284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8285 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8287 (duration_to_sec_usec): New function, to check for overflow better.
8288 (Fsleep_for, sit_for): Use it.
8289 * doc.c (get_doc_string, store_function_docstring):
8290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8291 (get_doc_string, Fsnarf_documentation):
8292 Use int, not EMACS_INT, where int is wide enough.
8293 (get_doc_string):
8294 Use SAFE_ALLOCA, not alloca.
8295 Check for overflow when converting EMACS_INT to off_t.
8296 * doprnt.c (doprnt):
8297 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8298 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8299 Don't assume uid_t fits into fixnum.
8300 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8301 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8302 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8303 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8304 (general_insert_function)
8305 (Finsert_char, make_buffer_string, make_buffer_string_both)
8306 (update_buffer_properties, Fbuffer_substring)
8307 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8308 (Fsubst_char_in_region, check_translation)
8309 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8310 (transpose_markers, Ftranspose_regions):
8311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8312 (clip_to_bounds): Move to lisp.h as an inline function).
8313 (Fconstrain_to_field): Don't assume integers are nonnegative.
8314 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8315 (Fsubst_char_in_region, Fsave_restriction):
8316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8317 (Femacs_pid): Don't assume pid_t fits into fixnum.
8318 (lo_time): Use int, not EMACS_INT, when int suffices.
8319 (lisp_time_argument): Check for usec out of range.
8320 (Fencode_time): Don't assume fixnum fits in int.
8321 (Fuser_login_name, Fuser_full_name): Signal an error
8322 if a uid argument is out of range, rather than relying on
8323 undefined behavior.
8324 (Fformat_time_string): Remove now-unnecessary check.
8325 lisp_time_argument checks for out-of-range usec now.
8326 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8327 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8328 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8329 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8330 (init_cmdargs, Fdump_emacs):
8331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8332 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8333 the bottom (typically) 32 bits of the fixnum.
8334 * eval.c (specpdl_size, call_debugger):
8335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8336 (when_entered_debugger, Fbacktrace_debug):
8337 Don't assume fixnum can fit in int.
8338 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8339 the object just before a buffer; this is not portable.
8340 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8341 (grow_specpdl, unbind_to):
8342 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8343 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8344 (grow_specpdl): Simplify allocation by using xpalloc.
8345 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8346 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8347 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8349 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8350 (a_write, e_write):
8351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8352 (Fcopy_file, non_regular_nbytes, read_non_regular)
8353 (Finsert_file_contents):
8354 Use int, not EMACS_INT, where int is wide enough.
8355 (READ_BUF_SIZE): Verify that it fits in int.
8356 (Finsert_file_contents): Check that counts are in proper range,
8357 rather than assuming fixnums fit into ptrdiff_t etc.
8358 Don't assume fixnums fit into int.
8359 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8360 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8361 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8362 (string_char_to_byte, string_byte_to_char)
8363 (string_make_multibyte, string_to_multibyte)
8364 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8365 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8366 (substring_both, Fdelete, internal_equal, Ffillarray)
8367 (Fclear_string, mapcar1)
8368 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8369 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8370 (larger_vector, make_hash_table, maybe_resize_hash_table)
8371 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8372 (Fmaphash, secure_hash):
8373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8374 (concat): Check for string index and length overflow.
8375 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8376 (Frequire):
8377 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8378 (larger_vector): New API (vec, incr_min, size_max) replaces old
8379 one (vec, new_size, init). This catches size overflow.
8380 INIT was removed because it was always Qnil.
8381 All callers changed.
8382 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8383 the upper bound on a hash table index size.
8384 (make_hash_table, maybe_resize_hash_table): Use it.
8385 (secure_hash): Computer start_byte and end_byte only after
8386 they're known to be in ptrdiff_t range.
8387 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8388 (Ffont_get_glyphs, Ffont_at):
8389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8390 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8391 (Flist_fonts, Fopen_font):
8392 Don't assume fixnum can fit in int.
8393 (check_gstring): Don't assume index can fit in int.
8394 (font_match_p): Check that fixnum is a character, not a nonnegative
8395 fixnum, since the later code needs to stuff it into an int.
8396 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8397 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8398 conversion overflow issues.
8399 (Fopen_font): Check for integer out of range.
8400 (Ffont_get_glyphs): Don't assume index can fit in int.
8401 * font.h: Adjust decls to match defn changes elsewhere.
8402 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8403 integer overflow.
8404 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8405 printmax_t, where ptrdiff_t is wide enough.
8406 (Finternal_char_font):
8407 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8408 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8409 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8410 (Fset_frame_position, x_set_frame_parameters)
8411 (x_set_line_spacing, x_set_border_width)
8412 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8413 Check that fixnums are in proper range for system types.
8414 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8416 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8417 Use SAFE_ALLOCA_LISP, not alloca.
8418 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8419 intptr_t is wide enough.
8420 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8421 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8422 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8423 Check for fixnum out of range.
8424 * ftfont.c (ftfont_list): Don't assume index fits in int.
8425 Check that fixnums are in proper range for system types.
8426 (ftfont_shape_by_flt):
8427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8428 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8430 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8431 Check that fixnums are in proper range for system types.
8432 * gnutls.h: Adjust decls to match defn changes elsewhere.
8433 * gtkutil.c (xg_dialog_run):
8434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8435 (update_frame_tool_bar):
8436 Check that fixnums are in proper range for system types.
8437 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8438 (lookup_image): Check that fixnums are in range for system types.
8439 * indent.c (last_known_column, last_known_column_point):
8440 (current_column_bol_cache):
8441 (skip_invisible, current_column, check_display_width):
8442 (check_display_width, scan_for_column, current_column_1)
8443 (Findent_to, Fcurrent_indentation, position_indentation)
8444 (indented_beyond_p, Fmove_to_column, compute_motion):
8445 (Fcompute_motion, Fvertical_motion):
8446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8447 (last_known_column_modified): Use EMACS_INT, not int.
8448 (check_display_width):
8449 (Fcompute_motion):
8450 Check that fixnums and floats are in proper range for system types.
8451 (compute_motion): Don't assume index or fixnum fits in int.
8452 (compute_motion, Fcompute_motion):
8453 Use int, not EMACS_INT, when it is wide enough.
8454 (vmotion): Omit local var start_hpos that is always 0; that way
8455 we don't need to worry about overflow in expressions involving it.
8456 * indent.h: Adjust decls to match defn changes elsewhere.
8457 (struct position):
8458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8459 Use int, not EMACS_INT, where int is wide enough.
8460 Remove unused members ovstring_chars_done and tab_offset;
8461 all uses removed.
8462 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8463 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8464 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8465 (make_gap, copy_text, insert, insert_and_inherit)
8466 (insert_before_markers, insert_before_markers_and_inherit)
8467 (insert_1, count_combining_before, count_combining_after)
8468 (insert_1_both, insert_from_string)
8469 (insert_from_string_before_markers, insert_from_string_1)
8470 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8471 (adjust_after_replace, adjust_after_insert, replace_range)
8472 (replace_range_2, del_range, del_range_1, del_range_byte)
8473 (del_range_both, del_range_2, modify_region)
8474 (prepare_to_modify_buffer, signal_before_change)
8475 (signal_after_change, Fcombine_after_change_execute):
8476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8477 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8478 (balance_an_interval, split_interval_right, split_interval_left)
8479 (find_interval, next_interval, update_interval)
8480 (adjust_intervals_for_insertion, delete_node, delete_interval)
8481 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8482 (static_offset_intervals, offset_intervals)
8483 (merge_interval_right, merge_interval_left, make_new_interval)
8484 (graft_intervals_into_buffer, temp_set_point_both)
8485 (temp_set_point, set_point, adjust_for_invis_intang)
8486 (set_point_both, move_if_not_intangible, get_property_and_range)
8487 (get_local_map, copy_intervals, copy_intervals_to_string)
8488 (compare_string_intervals, set_intervals_multibyte_1):
8489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8490 * intervals.h: Adjust decls to match defn changes elsewhere.
8491 (struct interval):
8492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8493 * keyboard.c (this_command_key_count, this_single_command_key_start)
8494 (before_command_key_count, before_command_echo_length, echo_now)
8495 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8496 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8497 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8498 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8499 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8500 (last_non_minibuf_size, last_point_position, echo_truncate)
8501 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8502 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8503 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8504 (stuff_buffered_input):
8505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8506 (last_auto_save, command_loop_1, read_char):
8507 Use EMACS_INT, not int, to avoid integer overflow.
8508 (record_char): Avoid overflow in total_keys computation.
8509 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8510 * keyboard.h: Adjust decls to match defn changes elsewhere.
8511 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8512 (Fkey_description, Fdescribe_vector, Flookup_key):
8513 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8514 (click_position): New function, to check that positions are in range.
8515 (Fcurrent_active_maps):
8516 (describe_command):
8517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8518 (Faccessible_keymaps, Fkey_description):
8519 (preferred_sequence_p):
8520 Don't assume fixnum can fit into int.
8521 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8522 Check for integer overflow in size calculations.
8523 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8524 avoid mishandling large integers.
8525 * lisp.h: Adjust decls to match defn changes elsewhere.
8526 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8527 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8528 (struct Lisp_Marker):
8529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8530 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8531 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8532 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8533 All callers changed.
8534 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8535 Assume the arg has valid form, since it always does.
8536 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8537 unsigned integer system type.
8538 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8539 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8541 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8542 (duration_to_sec_usec): New decl.
8543 * lread.c (read_from_string_index, read_from_string_index_byte)
8544 (read_from_string_limit, readchar, unreadchar, openp)
8545 (read_internal_start, read1, oblookup):
8546 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8547 (Fload, readevalloop, Feval_buffer, Feval_region):
8548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8549 (openp): Check for out-of-range argument to 'access'.
8550 (read1): Use int, not EMACS_INT, where int is wide enough.
8551 Don't assume fixnum fits into int.
8552 Fix off-by-one error that can read outside a buffer.
8553 (read_filtered_event): Use duration_to_sec_usec
8554 to do proper overflow checking on durations.
8555 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8556 in size calculation.
8557 (Fexecute_kbd_macro):
8558 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8559 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8560 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8561 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8562 (set_marker_both, set_marker_restricted_both, marker_position)
8563 (marker_byte_position, Fbuffer_has_markers_at):
8564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8565 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8566 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8567 It now merely ensures that the menu is large enough, without
8568 necessarily growing it, as this avoids some integer overflow issues.
8569 All callers changed.
8570 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8571 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8572 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8573 Use SAFE_ALLOCA_LISP, not alloca.
8574 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8575 to EMACS_INT. Check that fixnums are in proper range for system types.
8576 * minibuf.c (minibuf_prompt_width, string_to_object)
8577 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8578 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8580 (get_minibuffer, read_minibuf_unwind):
8581 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8582 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8583 this simplifies overflow checking. All callers changed.
8584 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8585 (Ftest_completion):
8586 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8587 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8588 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8589 Check that fixnums are in proper range for system types.
8590 (Fx_create_frame, Fx_show_tip):
8591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8592 * nsfont.m (ns_findfonts, nsfont_list_family):
8593 Don't assume fixnum fits in long.
8594 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8596 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8597 wide enough.
8598 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8600 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8601 (PRINTDECLARE, PRINTPREPARE):
8602 (strout, print_string):
8603 (print, print_preprocess, print_check_string_charset_prop)
8604 (print_object):
8605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8606 (PRINTDECLARE):
8607 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8609 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8610 (printchar, strout): Use xpalloc to catch size calculation overflow.
8611 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8612 (print_error_message): Use SAFE_ALLOCA, not alloca.
8613 (print_object): Use int, not EMACS_INT, where int is wide enough.
8614 (print_depth, new_backquote_output, print_number_index):
8615 Use ptrdiff_t, not int, where int might not be wide enough.
8616 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8617 (Fset_process_window_size, Fformat_network_address)
8618 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8619 (sigchld_handler):
8620 Check that fixnums are in proper range for system types.
8621 (Fsignal_process): Simplify by avoiding a goto.
8622 Check for process-ids out of pid_t range rather than relying on
8623 undefined behavior.
8624 (process_tick, update_tick): Use EMACS_INT, not int.
8625 (Fformat_network_address, read_process_output, send_process)
8626 (Fprocess_send_region, status_notify):
8627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8628 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8629 (wait_reading_process_output, read_process_output, exec_sentinel):
8630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8631 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8632 (Faccept_process_output): Use duration_to_sec_usec to do proper
8633 overflow checking on durations.
8634 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8635 Don't assume pid_t fits in int.
8636 * process.h (struct Lisp_Process): Members tick and update_tick
8637 are now of type EMACS_INT, not int.
8638 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8639 configured --with-wide-int.
8640 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8641 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8642 * search.c (looking_at_1, string_match_1):
8643 (fast_string_match, fast_c_string_match_ignore_case)
8644 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8645 (scan_newline, find_before_next_newline, search_command)
8646 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8647 (set_search_regs, wordify):
8648 (Freplace_match):
8649 (Fmatch_data):
8650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8651 (string_match_1, search_buffer, set_search_regs):
8652 (Fmatch_data):
8653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8654 (wordify): Check for overflow in size calculation.
8655 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8656 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8657 Check that fixnums are in proper range for system types.
8658 * sound.c (struct sound_device)
8659 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8660 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8661 (Fplay_sound_internal):
8662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8663 * syntax.c (struct lisp_parse_state, find_start_modiff)
8664 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8665 (Fparse_partial_sexp):
8666 Don't assume fixnums can fit in int.
8667 (struct lisp_parse_state, find_start_pos, find_start_value)
8668 (find_start_value_byte, find_start_begv)
8669 (update_syntax_table, char_quoted, dec_bytepos)
8670 (find_defun_start, prev_char_comend_first, back_comment):
8671 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8672 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8674 (Finternal_describe_syntax_value): Check that match_lisp is a
8675 character, not an integer, since the code stuffs it into int.
8676 (scan_words, scan_sexps_forward):
8677 Check that fixnums are in proper range for system types.
8678 (Fforward_word):
8679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8680 (scan_sexps_forward):
8681 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8682 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8683 * syntax.h: Adjust decls to match defn changes elsewhere.
8684 (struct gl_state_s):
8685 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8686 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8687 MOST_POSITIVE_FIXNUM.
8688 * sysdep.c (wait_for_termination_1, wait_for_termination)
8689 (interruptible_wait_for_termination, mkdir):
8690 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8691 (emacs_read, emacs_write):
8692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8693 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8694 and double all fit in int.
8695 * term.c (set_tty_color_mode):
8696 Check that fixnums are in proper range for system types.
8697 * termhooks.h (struct input_event):
8698 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8699 * textprop.c (validate_interval_range, interval_of)
8700 (Fadd_text_properties, set_text_properties_1)
8701 (Fremove_text_properties, Fremove_list_of_text_properties)
8702 (Ftext_property_any, Ftext_property_not_all)
8703 (copy_text_properties, text_property_list, extend_property_ranges)
8704 (verify_interval_modification):
8705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8706 (Fnext_single_char_property_change)
8707 (Fprevious_single_char_property_change):
8708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8709 (copy_text_properties):
8710 Check for integer overflow in index calculation.
8711 * undo.c (last_boundary_position, record_point, record_insert)
8712 (record_delete, record_marker_adjustment, record_change)
8713 (record_property_change):
8714 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8715 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8716 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8717 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8718 (Fx_hide_tip, Fx_file_dialog):
8719 * w32menu.c (set_frame_menubar):
8720 Use ptrdiff_t, not int, for consistency with rest of code.
8721 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8722 (select_window, Fdelete_other_windows_internal)
8723 (window_scroll_pixel_based, window_scroll_line_based)
8724 (Frecenter, Fset_window_configuration):
8725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8726 (Fset_window_hscroll, run_window_configuration_change_hook)
8727 (set_window_buffer, temp_output_buffer_show, scroll_command)
8728 (Fscroll_other_window, Frecenter):
8729 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8730 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8731 Don't assume fixnum fits in int.
8732 (Fset_window_scroll_bars):
8733 Check that fixnums are in proper range for system types.
8734 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8735 (string_pos, c_string_pos, number_of_chars, init_iterator)
8736 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8737 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8738 (compute_display_string_end, handle_face_prop)
8739 (face_before_or_after_it_pos, handle_invisible_prop)
8740 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8741 (display_prop_intangible_p, string_buffer_position_lim)
8742 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8743 (get_overlay_strings_1, get_overlay_strings)
8744 (iterate_out_of_display_property, forward_to_next_line_start)
8745 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8746 (get_next_display_element, set_iterator_to_next)
8747 (get_visually_first_element, compute_stop_pos_backwards)
8748 (handle_stop_backwards, next_element_from_buffer)
8749 (move_it_in_display_line_to, move_it_in_display_line)
8750 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8751 (add_to_log, message_dolog, message_log_check_duplicate)
8752 (message2, message2_nolog, message3, message3_nolog
8753 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8754 (current_message_1, truncate_echo_area, truncate_message_1)
8755 (set_message, set_message_1, store_mode_line_noprop)
8756 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8757 (text_outside_line_unchanged_p, check_point_in_composition)
8758 (reconsider_clip_changes)
8759 (redisplay_internal, set_cursor_from_row, try_scrolling)
8760 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8761 (redisplay_window, find_last_unchanged_at_beg_row)
8762 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8763 (trailing_whitespace_p, find_row_edges, display_line)
8764 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8765 (display_mode_element, store_mode_line_string)
8766 (pint2str, pint2hrstr, decode_mode_spec)
8767 (display_count_lines, display_string, draw_glyphs)
8768 (x_produce_glyphs, x_insert_glyphs)
8769 (rows_from_pos_range, mouse_face_from_buffer_pos)
8770 (fast_find_string_pos, mouse_face_from_string_pos)
8771 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8773 (safe_call, init_from_display_pos, handle_fontified_prop)
8774 (handle_single_display_spec, load_overlay_strings)
8775 (with_echo_area_buffer, setup_echo_area_for_printing)
8776 (display_echo_area, echo_area_display)
8777 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8778 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8779 (redisplay_window, dump_glyph_row, display_mode_line)
8780 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8781 (handle_display_spec, display_prop_string_p):
8782 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8783 (handle_single_display_spec, build_desired_tool_bar_string)
8784 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8785 (get_specified_cursor_type):
8786 Check that fixnums are in proper range for system types.
8787 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8788 (Flookup_image_map):
8789 Don't assume fixnums fit in int.
8790 (compare_overlay_entries):
8791 Avoid mishandling comparisons due to subtraction overflow.
8792 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8793 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8794 (handle_tool_bar_click):
8795 Use int, not unsigned, since we prefer signed and the signedness
8796 doesn't matter here.
8797 (get_next_display_element, next_element_from_display_vector):
8798 Use int, not EMACS_INT, when int is wide enough.
8799 (start_hourglass): Use duration_to_sec_usec to do proper
8800 overflow checking on durations.
8801 * xfaces.c (Fbitmap_spec_p):
8802 Check that fixnums are in proper range for system types.
8803 (compare_fonts_by_sort_order):
8804 Avoid mishandling comparisons due to subtraction overflow.
8805 (Fx_family_fonts, realize_basic_faces):
8806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8807 (Fx_family_fonts):
8808 Don't assume fixnum fits in int.
8809 Use SAFE_ALLOCA_LISP, not alloca.
8810 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8811 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8812 (face_at_buffer_position, face_for_overlay_string)
8813 (face_at_string_position):
8814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8815 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8816 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8817 (Fx_show_tip):
8818 Check that fixnums are in proper range for system types.
8819 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8820 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8822 (Fx_change_window_property): Don't assume fixnums fit in int.
8823 * xfont.c (xfont_chars_supported):
8824 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8825 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8826 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8827 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8828 * xml.c (parse_region):
8829 * xrdb.c (magic_file_p):
8830 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8831 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8832 (x_get_local_selection, x_reply_selection_request)
8833 (x_handle_selection_request, wait_for_property_change):
8834 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8835 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8836 short is wide enough.
8837 (x_send_client_event): Don't assume fixnum fits in int.
8838 * xterm.c (x_x_to_emacs_modifiers):
8839 Don't assume EMACS_INT overflows nicely into int.
8840 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8841 may come from Lisp.
8842 (handle_one_xevent): NATNUMP can eval its arg twice.
8843 (x_connection_closed):
8844 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8845 * xterm.h: Adjust decls to match defn changes elsewhere.
8846 (struct scroll_bar): Use struct vectorlike_header
8847 rather than rolling our own approximation.
8848 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8849
8850 2012-05-25 Glenn Morris <rgm@gnu.org>
8851
8852 * lisp.mk (lisp): Update for more files being compiled now.
8853
8854 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8855
8856 * lread.c: Remove `read_pure' which makes no difference.
8857 (read_pure): Remove var.
8858 (unreadpure): Remove function.
8859 (readevalloop): Don't call read_list with -1 flag.
8860 (read1, read_vector): Don't test read_pure any more.
8861 (read_list): Simplify.
8862
8863 * fileio.c, character.h: Minor style tweaks.
8864
8865 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8866
8867 * window.h (clip_changed): Remove useless declaration.
8868
8869 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8870
8871 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8872 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8873
8874 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8875
8876 Remove src/m/*.
8877 This directory predates autoconf and is no longer needed nowadays.
8878 Move its few remaining bits of functionality to where they're needed.
8879 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8880 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8881 * m/template.h: Remove.
8882 * Makefile.in (M_FILE): Remove. All uses removed.
8883 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8884 * lisp.h (USE_LSB_TAG):
8885 * mem-limits.h (EXCEEDS_LISP_PTR):
8886 Use VAL_MAX, not VALBITS, in #if.
8887 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8888 (EMACS_UINT): Define unconditionally now.
8889 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8890 (BITS_PER_EMACS_INT): New constants, replacing
8891 what used to be in config.h, but not useful in #if.
8892 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8893 define them any more.
8894 (VAL_MAX): New macro.
8895 (VALMASK): Use it.
8896 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8897 BITS_PER_EMACS_INT, in #if.
8898 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8899 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8900 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8901 * s/ms-w32.h (DATA_START):
8902 Move here from removed file m/intel386.h.
8903 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8904 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8905
8906 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 Assume C89 or later.
8909 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8910 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8911 (xrealloc):
8912 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8913 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8914 * textprop.c, tparam.c (NULL): Remove.
8915 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8916 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8917 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8918 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8919 * xterm.c (input_signal_count): Assume volatile works.
8920
8921 2012-05-21 Ken Brown <kbrown@cornell.edu>
8922
8923 * xgselect.c (xg_select): Fix first argument in call to 'select'
8924 (bug#11508).
8925
8926 2012-05-20 Ken Brown <kbrown@cornell.edu>
8927
8928 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8929 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8930
8931 2012-05-19 Ken Brown <kbrown@cornell.edu>
8932
8933 * xfns.c (x_in_use): Remove `static' qualifier.
8934 * xterm.h (x_in_use): Declare.
8935 * xgselect.c: Include xterm.h.
8936 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8937 and `display_arg' (bug#9754).
8938
8939 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8940
8941 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8942
8943 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8944 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8945
8946 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8947
8948 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8949
8950 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8951 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8952
8953 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8954 reference to image_cache->refcount.
8955 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8956
8957 2012-05-17 Juri Linkov <juri@jurta.org>
8958
8959 * search.c (Fword_search_regexp, Fword_search_backward)
8960 (Fword_search_forward, Fword_search_backward_lax)
8961 (Fword_search_forward_lax): Move functions to isearch.el
8962 (bug#10145, bug#11381).
8963
8964 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8965
8966 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8967
8968 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8969
8970 * lread.c (init_obarray): Declare Qt and Qnil as special.
8971
8972 2012-05-14 Glenn Morris <rgm@gnu.org>
8973
8974 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8975 Put "libexec" before "bin", for the sake of init_callproc_1.
8976
8977 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8978
8979 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8980
8981 * unexaix.c: Port to more-recent AIX compilers.
8982 (report_error, report_error_1, make_hdr, copy_sym)
8983 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8984 Make arguments const char *, not char *, to avoid violations of C
8985 standard and to fix some AIX warnings reported by Gilles Pion.
8986
8987 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8988
8989 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8990 already have overlays loaded.
8991 (handle_single_display_spec): Before returning without displaying
8992 fringe bitmap, synchronize the bidi iterator with the main display
8993 iterator, by calling iterate_out_of_display_property.
8994 (iterate_out_of_display_property): Detect buffer iteration by
8995 testing that it->string is a Lisp string.
8996 (get_next_display_element): When the current object is exhausted,
8997 and there's something on it->stack, call set_iterator_to_next to
8998 proceed with what's on the stack, instead of returning zero.
8999 (set_iterator_to_next): If called at the end of a Lisp string,
9000 proceed to consider_string_end without incrementing string
9001 position. Don't increment display vector index past the end of
9002 the display vector. (Bug#11417)
9003 (pos_visible_p): Don't report a position visible when move_it_to
9004 stopped at the last line of window, which happens to be scanned
9005 backwards by the bidi iteration. (Bug#11464)
9006
9007 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9008
9009 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9010 and right-margin display specs even if the spec is invalid or we
9011 are on a TTY, and thus unable to display on the fringes.
9012 That's because the text with the property will not be displayed anyway,
9013 so we need to signal to the caller that this is a "replacing"
9014 display spec. This fixes display when the spec is invalid or we
9015 are on a TTY.
9016
9017 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9018
9019 * unexaix.c (make_hdr): Fix typo in prototype.
9020 This bug broke the build on AIX. Problem reported by Gilles Pion.
9021
9022 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9023
9024 * keyboard.c (kbd_buffer_get_event): Read special events also in
9025 batch mode. (Bug#11415)
9026
9027 2012-05-12 Glenn Morris <rgm@gnu.org>
9028
9029 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9030
9031 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9032
9033 * lisp.mk (lisp): Add newcomment.elc.
9034
9035 2012-05-12 Glenn Morris <rgm@gnu.org>
9036
9037 * Makefile.in (MKDIR_P): New, set by configure.
9038 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9039
9040 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9041
9042 Remove unused function hourglass_started.
9043 * dispextern.h (hourglass_started):
9044 * w32fns.c (hourglass_started):
9045 * xdisp.c (hourglass_started): Remove.
9046
9047 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9048
9049 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9050 Update dependencies.
9051
9052 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9053
9054 * xgselect.c (xg_select): Put maxfds+1 into a var.
9055 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9056
9057 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9058
9059 2012-05-10 Dave Abrahams <dave@boostpro.com>
9060
9061 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9062 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9063
9064 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9065
9066 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9067 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9068 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9069 Initialize xd_registered_buses.
9070
9071 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9072
9073 Untag more efficiently if USE_LSB_TAG.
9074 This is based on a proposal by YAMAMOTO Mitsuharu in
9075 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9076 For an admittedly artificial (nth 8000 longlist) benchmark on
9077 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9078 Emacs's overall text size by 1%.
9079 * lisp.h (XUNTAG): New macro.
9080 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9081 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9082 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9083 * eval.c (Fautoload):
9084 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9085 * frame.h (XFRAME): Use XUNTAG.
9086
9087 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9088 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9089 Remove unportable assumptions about print widths of types like
9090 dbus_uint32_t.
9091 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9092 intptr_t when converting between pointer and integer, to avoid GCC
9093 warnings about wrong width.
9094
9095 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9096
9097 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9098 stack for each reader_thread, instead of defaulting to 8MB
9099 determined by the linker. This avoids failures in creating
9100 subprocesses on Windows 7, see the discussion in this thread:
9101 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9102
9103 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9104
9105 Fix up display of the *Minibuf-0* buffer in the mini window.
9106 * keyboard.c (read_char): Don't clear the echo area if there's no
9107 message to clear.
9108 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9109 contents of *Minibuf-0*) if there's no message displayed in its stead.
9110
9111 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9112
9113 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9114 batch mode.
9115
9116 2012-05-06 Chong Yidong <cyd@gnu.org>
9117
9118 * lisp.mk (lisp): Update.
9119
9120 2012-05-05 Jim Meyering <meyering@redhat.com>
9121
9122 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9123
9124 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9125
9126 * data.c (PUT_ERROR): New macro.
9127 (syms_of_data): Use it. Add new error type `user-error'.
9128 * undo.c (user_error): New function.
9129 (Fprimitive_undo): Use it.
9130 * print.c (print_error_message): Adjust print style for `user-error'.
9131 * keyboard.c (user_error): New function.
9132 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9133
9134 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 Do not limit current-time-string to years 1000..9999.
9137 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9138 (Fcurrent_time_string): Support any year that is supported by the
9139 underlying localtime representation. Don't use asctime, as it
9140 has undefined behavior for years outside the range -999..9999.
9141
9142 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9143
9144 Fix race conditions involving setenv, gmtime, localtime, asctime.
9145 Without this fix, interrupts could mess up code that uses these
9146 nonreentrant functions, since setting TZ invalidates existing
9147 tm_zone or tzname values, and since most of these functions return
9148 pointers to static storage.
9149 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9150 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9151 Grow the critical sections to include not just invoking
9152 localtime/gmtime, but also accessing these functions' results
9153 including their tm_zone values if any, and any related TZ setting.
9154 (format_time_string): Last arg is now struct tm *, not struct tm **,
9155 so that the struct tm is saved in the critical section.
9156 All callers changed. Simplify allocation of initial buffer, partly
9157 motivated by the fact that memory allocation needs to be outside
9158 the critical section.
9159
9160 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9161
9162 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9163 with RESET_INTERVAL.
9164
9165 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9166 Remove duplicated buffer name initialization.
9167
9168 2012-05-02 Jim Meyering <jim@meyering.net>
9169
9170 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9171
9172 * xfns.c (x_window): Use xstrdup (Bug#11375).
9173
9174 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9175
9176 * xdisp.c (pos_visible_p): If already at a newline from the
9177 display string before the 'while' loop, don't walk back the glyphs
9178 from it3.glyph_row. Solves assertion violation when the display
9179 string begins with a newline (egg.el). (Bug#11367)
9180
9181 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9182
9183 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9184 Move to simple.el.
9185
9186 2012-05-01 Glenn Morris <rgm@gnu.org>
9187
9188 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9189 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9190 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9191 All were removed before 23.1.
9192
9193 * dispnew.c: Remove HAVE_LIBNCURSES test;
9194 it is always true on relevant platforms.
9195
9196 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9197 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9198
9199 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9200
9201 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9202
9203 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9204 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9205 Remove.
9206
9207 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9208
9209 Do not avoid creating empty evaporating overlays (Bug#9642).
9210 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9211 That is, do not delete an evaporating overlay if it becomes
9212 empty after its bounds are adjusted to fit within its buffer.
9213 This fix caused other problems, and I'm reverting it until we get
9214 to the bottom of them.
9215
9216 2012-04-27 Chong Yidong <cyd@gnu.org>
9217
9218 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9219
9220 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9221
9222 * xdisp.c (pos_visible_p): If the window start position is beyond
9223 ZV, start the display from buffer beginning. Prevents assertion
9224 violation in init_iterator when the minibuffer window is scrolled
9225 via the scroll bar.
9226
9227 * window.c (window_scroll_pixel_based): Likewise.
9228
9229 2012-04-27 Chong Yidong <cyd@gnu.org>
9230
9231 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9232
9233 2012-04-27 Glenn Morris <rgm@gnu.org>
9234
9235 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9236 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9237
9238 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9239
9240 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9241 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9242
9243 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9244
9245 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9246 display element, check also the underlying string or buffer
9247 character. (Bug#11341)
9248
9249 * w32menu.c: Include w32heap.h.
9250 (add_menu_item): If the call to AppendMenuW (via
9251 unicode_append_menu) fails, disable Unicode menus only if we are
9252 running on Windows 9X/Me.
9253
9254 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9255
9256 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9257 (xgetint): Add missing shift for LSB tags.
9258
9259 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9260
9261 * keyboard.c (read_char): Don't wipe echo area for select window
9262 events: These might get delayed via `mouse-autoselect-window'
9263 (Bug#11304).
9264
9265 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9266
9267 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9268 manipulation of :loaded-from data.
9269
9270 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9271
9272 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9273 now a cons (bug#11311).
9274
9275 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9276
9277 Do not create empty overlays with the evaporate property (Bug#9642).
9278 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9279 if it becomes empty after its bounds are adjusted to fit within
9280 its buffer. Without this fix, in a nonempty buffer (let ((o
9281 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9282 yields an empty overlay that has the evaporate property, which is
9283 not supposed to happen.
9284
9285 Fix minor GTK3 problems found by static checking.
9286 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9287 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9288 (struct _EmacsFixedClass, emacs_fixed_get_type):
9289 Move decls here from emacsgtkfixed.h, since they needn't be public.
9290 (emacs_fixed_get_type): Now static.
9291 (emacs_fixed_class_init): Omit unused local.
9292 (emacs_fixed_child_type): Remove; unused.
9293 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9294 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9295 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9296 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9297 (EMACS_FIXED_GET_CLASS): Remove; unused.
9298 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9299
9300 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9301 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9302
9303 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9304
9305 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9306 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9307 (__malloc_size_t, __malloc_ptrdiff_t):
9308 Remove. All uses removed, replaced by the definiens if needed,
9309 since we can assume C89 or better now.
9310 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9311 (protect_malloc_state, align, get_contiguous_space)
9312 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9313 (malloc_atfork_handler_child, malloc_enable_thread)
9314 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9315 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9316 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9317 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9318 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9319 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9320 Define using prototypes, not old style.
9321 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9322 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9323 (align): Don't assume that signed integer overflow wraps around.
9324 Omit unused local var.
9325 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9326 (_free_internal_nolock, memalign, mallochook, reallochook):
9327 Omit no-longer-needed casts.
9328 (valloc): Use getpagesize, not __getpagesize.
9329 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9330 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9331
9332 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9333
9334 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9335
9336 Move functions from C to Lisp. Make non-blocking method calls
9337 the default. Implement further D-Bus standard interfaces.
9338
9339 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9340 (QCdbus_request_name_allow_replacement)
9341 (QCdbus_request_name_replace_existing)
9342 (QCdbus_request_name_do_not_queue)
9343 (QCdbus_request_name_reply_primary_owner)
9344 (QCdbus_request_name_reply_in_queue)
9345 (QCdbus_request_name_reply_exists)
9346 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9347 (QCdbus_registered_serial, QCdbus_registered_method)
9348 (QCdbus_registered_signal): New Lisp objects.
9349 (XD_DEBUG_MESSAGE): Use sizeof.
9350 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9351 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9352 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9353 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9354 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9355 (xd_signature, xd_append_arg): Allow float for integer types.
9356 (xd_get_connection_references): New function.
9357 (xd_get_connection_address): Rename from xd_initialize.
9358 Return cached address.
9359 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9360 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9361 level.
9362 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9363 Return number of refcounts.
9364 (Fdbus_get_unique_name): Make stronger parameter check.
9365 (Fdbus_message_internal): New defun.
9366 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9367 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9368 (Fdbus_send_signal, Fdbus_register_service)
9369 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9370 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9371 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9372 (Vdbus_compiled_version, Vdbus_runtime_version)
9373 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9374 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9375 (Vdbus_message_type_signal): New defvars.
9376 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9377 Adapt docstring.
9378
9379 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9382 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9383 Do not assume ptrdiff_t is the same width as 'int'.
9384
9385 * alloc.c: Handle unusual debugging option combinations.
9386 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9387 since the two debugging options are incompatible.
9388 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9389 is defined.
9390 (mem_init, mem_insert, mem_insert_fixup):
9391 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9392 (NEED_MEM_INSERT): Remove; no longer needed.
9393
9394 2012-04-22 Leo Liu <sdl.web@gmail.com>
9395
9396 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9397
9398 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9399
9400 * sysdep.c [__FreeBSD__]: Minor cleanups.
9401 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9402 Use Emacs indenting style more consistently. Avoid some casts.
9403 Use 'double' consistently rather than mixing 'float' and 'double'.
9404
9405 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9406
9407 * sysdep.c (list_system_processes, system_process_attributes):
9408 Add implementation for FreeBSD (Bug#5243).
9409
9410 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9411
9412 * lisp.mk (lisp): Update.
9413
9414 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9415
9416 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9417 It is never used otherwise.
9418
9419 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9420
9421 * print.c (print_preprocess): Only check print_depth if print-circle
9422 is nil.
9423 (print_object): Check for cycles even when print-circle is nil and
9424 print-gensym is t, but only check print_depth if print-circle is nil.
9425
9426 2012-04-20 Chong Yidong <cyd@gnu.org>
9427
9428 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9429 set the status to "failed" and ensure that sentinel is run.
9430
9431 2012-04-20 Glenn Morris <rgm@gnu.org>
9432
9433 * process.c (Fset_process_inherit_coding_system_flag)
9434 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9435 (Fmake_network_process, Fmake_serial_process): Doc fix.
9436
9437 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9438
9439 * xdisp.c (string_buffer_position_lim): Limit starting position to
9440 BEGV.
9441 (set_cursor_from_row): If called for a mode-line or header-line
9442 row, return zero immediately.
9443 (try_cursor_movement): If inside continuation line, don't back up
9444 farther than the first row after the header line, if any.
9445 Don't consider the header-line row as "partially visible", even if
9446 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9447
9448 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9449
9450 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9451 (bug#11238).
9452
9453 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9454 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9455
9456 configure: new option --enable-gcc-warnings (Bug#11207)
9457 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9458 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9459 (ALL_CFLAGS): Use new macros rather than old.
9460 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9461 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9462 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9463 -Wunused-result, -Wunused-variable. This should go away once
9464 the Emacs and Gnulib regex code is merged.
9465 (xmalloc, xrealloc): Now static.
9466
9467 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9468
9469 * dired.c (Fsystem_groups): Remove unused local.
9470
9471 2012-04-17 Glenn Morris <rgm@gnu.org>
9472
9473 * dired.c (Fsystem_users): Doc fix.
9474
9475 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9476
9477 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9478 (syms_of_dired): Add them.
9479
9480 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9481
9482 Fix minor alloc.c problems found by static checking.
9483 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9484 New extern decls, to avoid calling undeclared functions.
9485 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9486 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9487 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9488 (NEED_MEM_INSERT): New macro.
9489 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9490 Remove one incorrect comment and fix another.
9491
9492 Fix minor ralloc.c problems found by static checking.
9493 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9494 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9495 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9496 (r_alloc_sbrk): Now static.
9497
9498 Improve ralloc.c interface checking.
9499 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9500 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9501 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9502 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9503 [REL_ALLOC]: ... to here, to check interface.
9504 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9505 Remove decls. This fixes an "It stinks!".
9506
9507 * alloc.c (which_symbols): Fix alignment issue / type clash.
9508
9509 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9510
9511 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9512 (struct Lisp_Misc_Any): Likewise.
9513 (struct Lisp_Free): Likewise.
9514 * alloc.c (union aligned_Lisp_Symbol): Define.
9515 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9516 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9517 (union aligned_Lisp_Misc): Define.
9518 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9519 aligned_Lisp_Misc instead of union Lisp_Misc.
9520 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9521
9522 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9523
9524 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9525 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9526 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9527 * s/netbsd.h, s/sol2-6.h:
9528 Remove definition of GC_MARK_STACK, since the default now works.
9529 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9530 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9531 no longer the default.
9532 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9533
9534 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9535
9536 * lread.c (lisp_file_lexically_bound_p):
9537 Fix hang at ";-*-\n" (bug#11238).
9538
9539 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9540
9541 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9542 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9543
9544 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9545
9546 * nsterm.m (constrainFrameRect): Always constrain when there is only
9547 one screen (Bug#10962).
9548
9549 2012-04-13 Ken Brown <kbrown@cornell.edu>
9550
9551 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9552
9553 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9554
9555 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9556
9557 2012-04-11 Daniel Colascione <dancol@dancol.org>
9558
9559 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9560 against is gone. It's better to use vfork now so that when Cygwin
9561 gains a new, working vfork, we use it automatically (bug#10398).
9562
9563 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9564
9565 * window.c (save_window_save): Obey window-point-insertion-type.
9566
9567 2012-04-11 Glenn Morris <rgm@gnu.org>
9568
9569 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9570
9571 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9572
9573 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9574
9575 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9576
9577 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9578 (force_quit_count): New var.
9579 (handle_interrupt): Use it.
9580
9581 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9582
9583 * w32.c (w32_delayed_load): Record the full path of the library
9584 being loaded (bug#10424).
9585
9586 2012-04-09 Glenn Morris <rgm@gnu.org>
9587
9588 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9589 not just in the obarray, before snarfing them. (Bug#11036)
9590
9591 * Makefile.in ($(leimdir)/leim-list.el):
9592 Pass EMACS rather than BUILT_EMACS.
9593
9594 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9595
9596 * process.c (make_process):
9597 * process.h: Add integer `gnutls_handshakes_tried' member to
9598 process struct.
9599
9600 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9601 Add convenience `GNUTLS_LOG2i' macro.
9602
9603 * gnutls.c (gnutls_log_function2i): Convenience log function.
9604 (emacs_gnutls_read): Use new log functions,
9605 `gnutls_handshakes_tried' process member, and
9606 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9607 attempts per process (connection).
9608
9609 2012-04-09 Chong Yidong <cyd@gnu.org>
9610
9611 * eval.c (Fuser_variable_p, user_variable_p_eh)
9612 (lisp_indirect_variable): Functions deleted.
9613 (Fdefvar): Caller changed.
9614
9615 * callint.c (Finteractive, Fcall_interactively):
9616 * minibuf.c (Fread_variable): Callers changed.
9617
9618 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9619
9620 * xdisp.c (set_cursor_from_row): If the display string appears in
9621 the buffer at position that is closer to point than the position
9622 after the display string, display the cursor on the first glyph of
9623 the display string. Fixes cursor display when a 'display' text
9624 property immediately follows invisible text. (Bug#11094)
9625
9626 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9627
9628 composite.c: use 'double' consistently
9629 * composite.c (get_composition_id): Use 'double' consistently
9630 instead of converting 'float' to 'double' and vice versa; this is
9631 easier to understand and avoids a GCC warning.
9632
9633 2012-04-09 Glenn Morris <rgm@gnu.org>
9634
9635 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9636 preparation for dumping it with emacs. (Bug#4789)
9637 (leimdir): New variable.
9638 ($(leimdir)/leim-list.el): New rule.
9639 (emacs$(EXEEXT)): Depend on leim-list.el.
9640
9641 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9642 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9643 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9644
9645 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9646
9647 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9648 proper alignment.
9649
9650 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9651
9652 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9653 Remove unused local variable.
9654
9655 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9656
9657 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9658 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9659 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9660 objects, as mark_maybe_pointer will catch them otherwise.
9661 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9662 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9663
9664 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9665
9666 Fix typo that broke non-Windows builds.
9667 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9668
9669 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9670
9671 Support building on MS-Windows with libxml2.
9672
9673 * makefile.w32-in (OBJ2): Add xml.$(O).
9674 (GLOBAL_SOURCES): Add xml.c.
9675 ($(BLD)/xml.$(O)): New dependency list.
9676
9677 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9678 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9679 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9680 [!WINDOWSNT]: New macros.
9681 (init_libxml2_functions, libxml2_loaded_p): New functions.
9682 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9683 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9684 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9685 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9686 linked in).
9687 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9688 Call init_libxml2_functions before calling libxml2 functions.
9689 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9690
9691 * emacs.c: Don't include libxml/parser.h.
9692 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9693 xmlCleanupParser directly.
9694
9695 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9696
9697 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9698
9699 * indent.c (Fvertical_motion): If there is a display string at
9700 point, use it.vpos to compute how many lines to backtrack after
9701 move_it_to point. (Bug#11133)
9702
9703 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9704
9705 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9706 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9707 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9708 macros related to unification of CJK characters. For the details,
9709 see the discussion following the message here:
9710 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9711
9712 2012-04-04 Chong Yidong <cyd@gnu.org>
9713
9714 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9715
9716 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9717
9718 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9719 instead of alloca. (Bug#11138)
9720
9721 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9722
9723 * w32menu.c (is_simple_dialog): Properly check lisp types.
9724 (Bug#11141)
9725
9726 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9727
9728 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9729 position we get to after a call to move_it_to fails the
9730 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9731 only if we wind up in a string from display property. (Bug#11063)
9732
9733 * window.c (Fdelete_other_windows_internal): Invalidate the row
9734 and column information about mouse highlight, so that redisplay
9735 restores it after reallocating the glyph matrices. (Bug#7464)
9736
9737 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9738 string comes from a `display' text property, use the buffer
9739 position of that property as if we actually saw that position in
9740 the row's glyphs.
9741 (move_it_by_lines): Remove the assertion that
9742 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9743 violated when there's a before-string at the beginning of a line.
9744 (Bug#11063)
9745
9746 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9747
9748 * xdisp.c (append_space_for_newline): If the default face was
9749 remapped, use the remapped face for the appended newline.
9750 (extend_face_to_end_of_line): Use the remapped default face for
9751 extending the face to the end of the line.
9752 (display_line): Call extend_face_to_end_of_line when the default
9753 face was remapped. (Bug#11068)
9754
9755 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9756
9757 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9758
9759 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9760
9761 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9762
9763 2012-03-27 Glenn Morris <rgm@gnu.org>
9764
9765 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9766 Doc fixes.
9767
9768 2012-03-26 Kenichi Handa <handa@m17n.org>
9769
9770 * dispextern.h (struct glyph): Fix previous change. Change the
9771 bit length of glyphless.ch to 25 (Bug#11082).
9772
9773 2012-03-26 Chong Yidong <cyd@gnu.org>
9774
9775 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9776 (command_loop_1): Use it; inhibit selection update for
9777 handle-select-window too (Bug#8996).
9778
9779 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9780
9781 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9782
9783 2012-03-25 Kenichi Handa <handa@m17n.org>
9784
9785 * dispextern.h (struct glyph): Change the bit length of
9786 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9787
9788 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9789
9790 * s/ms-w32.h (tzname): Include time.h before redirecting to
9791 _tzname. Fixes the MSVC build. (Bug#9960)
9792
9793 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9794
9795 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9796 characters.
9797
9798 * xterm.c (XTread_socket): Only modify handling_signal if
9799 !SYNC_INPUT. (Bug#11080)
9800
9801 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9802
9803 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9804 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9805 when fetching a multibyte character consumes more bytes than
9806 CHAR_BYTES returns, due to unification of CJK characters in
9807 string_char. (Bug#11073)
9808
9809 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9810
9811 * process.c (wait_reading_process_output): Handle pty disconnect
9812 by refraining from sending oneself a SIGCHLD (bug#10933).
9813
9814 2012-03-22 Chong Yidong <cyd@gnu.org>
9815
9816 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9817
9818 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9819 Mark string as coming from a prefix property.
9820 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9821 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9822
9823 2012-03-21 Chong Yidong <cyd@gnu.org>
9824
9825 * xfaces.c (Vface_remapping_alist): Doc fix.
9826
9827 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9828
9829 * w32proc.c (Fw32_set_console_codepage)
9830 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9831 Doc fixes.
9832
9833 2012-03-20 Chong Yidong <cyd@gnu.org>
9834
9835 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9836 to reflect default non-nil value of redisplay-dont-pause.
9837
9838 2012-03-19 Kenichi Handa <handa@m17n.org>
9839
9840 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9841 it fit in a valid range (Bug#11003).
9842
9843 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9844
9845 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9846 that is not from display property, accept the row as a "cursor
9847 row" if one of the string's character has a non-nil `cursor'
9848 property. Fixes cursor positioning when there are newlines in
9849 overlay strings, e.g. in icomplete.el. (Bug#11035)
9850
9851 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9852
9853 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9854
9855 2012-03-12 Chong Yidong <cyd@gnu.org>
9856
9857 * eval.c (inhibit_lisp_code): Rename from
9858 inhibit_window_configuration_change_hook; move from window.c.
9859
9860 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9861 * window.c (run_window_configuration_change_hook)
9862 (syms_of_window): Callers changed.
9863
9864 2012-03-11 Chong Yidong <cyd@gnu.org>
9865
9866 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9867
9868 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9869
9870 2012-03-10 Chong Yidong <cyd@gnu.org>
9871
9872 * frame.c (other_visible_frames): Don't assume the selected frame
9873 is visible (Bug#10955).
9874
9875 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9876
9877 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9878
9879 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9880
9881 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9882 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9883 zero (Bug#10954).
9884
9885 2012-03-03 Glenn Morris <rgm@gnu.org>
9886
9887 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9888
9889 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9890
9891 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9892 position past the first glyph_row that ends at ZV. (Bug#10902)
9893 (redisplay_window, next_element_from_string): Fix typos in
9894 comments.
9895 (redisplay_window): Pass to move_it_vertically the margin in
9896 pixels, not in screen lines.
9897
9898 2012-03-02 Glenn Morris <rgm@gnu.org>
9899
9900 * buffer.c (buffer-list-update-hook): Doc fix.
9901
9902 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9903
9904 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9905 push_it before setting up the iterator for the first overlay
9906 string, even if we have an empty string loaded.
9907 (next_overlay_string): If there's an empty string on the iterator
9908 stack, pop the stack. (Bug#10903)
9909
9910 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9911
9912 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9913 Suggested by Stefan Monnier in
9914 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9915 * alloc.c (widen_to_Lisp_Object): New static function.
9916 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9917 and widening them to Lisp_Objects. This would work even if
9918 USE_LSB_TAG is defined and wide integers are used, which might
9919 happen in a future version of Emacs.
9920
9921 2012-02-25 Chong Yidong <cyd@gnu.org>
9922
9923 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9924 Doc fix.
9925
9926 * xselect.c (Fx_selection_exists_p): Doc fix.
9927 (x_clipboard_manager_save_all): Print an informative message
9928 before saving to clipboard manager.
9929
9930 2012-02-24 Chong Yidong <cyd@gnu.org>
9931
9932 * keyboard.c (process_special_events): Handle all X selection
9933 requests in kbd_buffer, not just the next one (Bug#8869).
9934
9935 2012-02-23 Chong Yidong <cyd@gnu.org>
9936
9937 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9938 call when setting menu-bar-lines and tool-bar-lines parameters.
9939 (unwind_create_frame_1): New helper function.
9940
9941 * window.c (inhibit_window_configuration_change_hook): New var.
9942 (run_window_configuration_change_hook): Obey it.
9943 (syms_of_window): Initialize it.
9944
9945 2012-02-22 Chong Yidong <cyd@gnu.org>
9946
9947 * xterm.c (x_draw_image_relief): Add missing type check for
9948 Vtool_bar_button_margin (Bug#10743).
9949
9950 2012-02-21 Chong Yidong <cyd@gnu.org>
9951
9952 * fileio.c (Vfile_name_handler_alist): Doc fix.
9953
9954 * buffer.c (Fget_file_buffer): Protect against invalid file
9955 handler return value.
9956
9957 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9958
9959 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9960 when computing $valmask.
9961
9962 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9963 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9964 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9965 It's useless in that case, and it can cause problems on hosts
9966 that allocate halves of EMACS_INT values separately.
9967 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9968 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9969 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9970 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9971 it avoids undefined behavior on hosts where shifting right by more
9972 than the word width has undefined behavior.
9973
9974 2012-02-19 Chong Yidong <cyd@gnu.org>
9975
9976 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9977 (Funhandled_file_name_directory, Ffile_name_as_directory)
9978 (Fdirectory_file_name, Fexpand_file_name)
9979 (Fsubstitute_in_file_name): Protect against invalid file handler
9980 return values (Bug#10845).
9981
9982 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9983
9984 * .gdbinit (pitx): Fix incorrect references to fields of the
9985 iterator stack.
9986
9987 2012-02-17 Chong Yidong <cyd@gnu.org>
9988
9989 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9990
9991 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9992
9993 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9994 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9995
9996 2012-02-15 Chong Yidong <cyd@gnu.org>
9997
9998 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9999 marked as special. Also, starting docstrings with * is obsolete.
10000
10001 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10002
10003 * gnutls.c (emacs_gnutls_write): Fix last change.
10004
10005 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10006
10007 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10008 send_process.
10009
10010 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10011
10012 * keymap.c (Fsingle_key_description): Handle char ranges.
10013
10014 2012-02-12 Chong Yidong <cyd@gnu.org>
10015
10016 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10017 as that creates a dangerous corner case.
10018
10019 * window.c (Fdelete_window_internal): Invalidate the mouse
10020 highlight (Bug#9904).
10021
10022 2012-02-12 Glenn Morris <rgm@gnu.org>
10023
10024 * xselect.c (Fx_own_selection_internal)
10025 (Fx_get_selection_internal, Fx_disown_selection_internal)
10026 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10027 * nsselect.m (Fx_own_selection_internal)
10028 (Fx_disown_selection_internal, Fx_selection_exists_p)
10029 (Fx_selection_owner_p, Fx_get_selection_internal):
10030 Sync docs and argument specs with the xselect.c versions.
10031
10032 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10033
10034 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10035
10036 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10037
10038 * w32select.c (Fx_selection_exists_p): Sync doc string and
10039 argument list with xselect.c. (Bug#10783)
10040
10041 * w16select.c (Fx_selection_exists_p): Sync doc string and
10042 argument list with xselect.c. (Bug#10783)
10043
10044 2012-02-10 Glenn Morris <rgm@gnu.org>
10045
10046 * fns.c (Fsecure_hash): Doc fix.
10047
10048 2012-02-09 Kenichi Handa <handa@m17n.org>
10049
10050 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10051
10052 2012-02-07 Chong Yidong <cyd@gnu.org>
10053
10054 * buffer.c (Fbuffer_local_variables)
10055 (buffer_lisp_local_variables): Handle unbound vars correctly;
10056 don't let Qunbound leak into Lisp.
10057
10058 2012-02-07 Glenn Morris <rgm@gnu.org>
10059
10060 * image.c (Fimagemagick_types): Doc fix.
10061
10062 * image.c (imagemagick-render-type): Change it from a lisp object
10063 to an integer. Move the doc here from the lisp manual.
10064 Treat all values not equal to 0 the same.
10065
10066 2012-02-06 Chong Yidong <cyd@gnu.org>
10067
10068 * doc.c (store_function_docstring): Avoid applying docstring of
10069 alias to base function (Bug#2603).
10070
10071 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10072
10073 * .gdbinit (pp1, pv1): Remove redundant defines.
10074 (pr): Use pp.
10075
10076 2012-02-04 Chong Yidong <cyd@gnu.org>
10077
10078 * nsterm.m: Declare a global (Bug#10694).
10079
10080 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10081
10082 * w32.c (get_emacs_configuration_options):
10083 Include --enable-checking, if specified, in the return value.
10084
10085 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10086
10087 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10088 after rounding frame sizes. (Bug#9723)
10089
10090 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10091
10092 * keyboard.c (adjust_point_for_property): Don't position point
10093 before BEGV. (Bug#10696)
10094
10095 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10096
10097 Handle overflow when computing char display width (Bug#9496).
10098 * character.c (char_width): Return EMACS_INT, not int.
10099 (char_width, c_string_width): Check for overflow when
10100 computing the width; this is possible now that individual
10101 characters can have unbounded width. Problem introduced
10102 by merge from Emacs 23 on 2012-01-19.
10103
10104 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10105
10106 * dbusbind.c (Fdbus_register_method): Mention the return value
10107 :ignore in the docstring.
10108
10109 2012-02-02 Glenn Morris <rgm@gnu.org>
10110
10111 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10112
10113 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10114 Unconditionally set to t. (Bug#10673)
10115 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10116 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10117 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10118
10119 2012-02-02 Kenichi Handa <handa@m17n.org>
10120
10121 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10122 0, do not call append_composite_glyph.
10123
10124 2012-02-02 Kenichi Handa <handa@m17n.org>
10125
10126 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10127 NULL (Bug#6988).
10128 (x_produce_glyphs): If the component of a composition is a null
10129 string, set it->pixel_width to 1 to avoid zero-width glyph.
10130
10131 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10132
10133 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10134 first 2 arguments are identical. This makes inserting large
10135 output from a subprocess an order of magnitude faster on
10136 MS-Windows, where all sbrk'ed memory is always contiguous.
10137
10138 2012-01-31 Glenn Morris <rgm@gnu.org>
10139
10140 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10141 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10142 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10143
10144 2012-01-29 Glenn Morris <rgm@gnu.org>
10145
10146 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10147
10148 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10149
10150 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10151
10152 2012-01-28 Chong Yidong <cyd@gnu.org>
10153
10154 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10155
10156 2012-01-26 Chong Yidong <cyd@gnu.org>
10157
10158 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10159
10160 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10161 repeat counts (Bug#10507).
10162
10163 2012-01-26 Glenn Morris <rgm@gnu.org>
10164
10165 * lread.c (syms_of_lread): Doc fix.
10166
10167 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10168
10169 * coding.c (encode_designation_at_bol): Change return value to
10170 EMACS_INT.
10171
10172 2012-01-25 Chong Yidong <cyd@gnu.org>
10173
10174 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10175
10176 2012-01-21 Chong Yidong <cyd@gnu.org>
10177
10178 * floatfns.c (Fcopysign): Make the second argument non-optional,
10179 since nil is not allowed anyway.
10180
10181 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10182
10183 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10184 (send_process): Likewise.
10185
10186 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10187
10188 * window.c (save_window_save, Fcurrent_window_configuration)
10189 (Vwindow_persistent_parameters): Do not use Qstate.
10190 Rewrite doc-strings.
10191
10192 2012-01-19 Kenichi Handa <handa@m17n.org>
10193
10194 * character.c (char_width): New function.
10195 (Fchar_width, c_string_width, lisp_string_width):
10196 Use char_width (Bug#9496).
10197
10198 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10199
10200 * window.c (Vwindow_persistent_parameters): New variable.
10201 (Fset_window_configuration, save_window_save): Handle persistent
10202 window parameters.
10203
10204 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10205
10206 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10207 thrashing the stack of the thread. (Bug#9087)
10208
10209 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10210
10211 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10212
10213 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10214
10215 * xdisp.c (rows_from_pos_range): Handle the case where the
10216 highlight ends on a newline. (Bug#10464)
10217 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10218 he end column for display of highlight that ends on a newline
10219 before a R2L line.
10220
10221 2012-01-11 Glenn Morris <rgm@gnu.org>
10222
10223 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10224 from load-path also when installation-directory is nil. (Bug#10208)
10225
10226 2012-01-10 Glenn Morris <rgm@gnu.org>
10227
10228 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10229
10230 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10231 Update template values to be closer to their typical values these days.
10232
10233 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10234
10235 * xdisp.c (rows_from_pos_range): Accept additional argument
10236 DISP_STRING, and accept any glyph in a row whose object is that
10237 string as eligible for mouse highlight. Fixes mouse highlight of
10238 display strings from overlays. (Bug#10464)
10239
10240 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10241
10242 emacs: fix an auto-save permissions race condition (Bug#10400)
10243 * fileio.c (auto_saving_dir_umask): New static var.
10244 (Fmake_directory_internal): Use it.
10245 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10246 creating the directory. The old code temporarily assigns
10247 too-generous permissions to the directory.
10248 (do_auto_save_eh): Clear it.
10249 (Fdo_auto_save): Catch all errors, not just file errors, so
10250 that the var is always cleared.
10251
10252 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10253
10254 * search.c (scan_buffer): Pass character positions to
10255 know_region_cache, not byte positions. (Bug#6540)
10256
10257 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10258
10259 * w32.c (sys_rename): Report EXDEV when rename of a directory
10260 fails because the target is on another logical disk. (Bug#10284)
10261
10262 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10263
10264 * xterm.c (x_embed_request_focus): New function.
10265
10266 * xterm.h: Add prototype.
10267
10268 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10269
10270 2012-01-05 Glenn Morris <rgm@gnu.org>
10271
10272 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10273
10274 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10275
10276 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10277 Load gnutls_transport_set_lowat only if GnuTLS version is below
10278 2.11.1.
10279 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10280 GnuTLS versions below 2.11.1.
10281
10282 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10283
10284 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10285 to the doc string advising against its use for altering the way
10286 windows are scrolled.
10287
10288 2011-12-28 Kenichi Handa <handa@m17n.org>
10289
10290 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10291 coding-system ASCII compatible only when it does not produce BOM
10292 on encoding (Bug#10383).
10293
10294 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10295
10296 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10297 can scroll.
10298 (create_and_show_popup_menu): Always use menu_position_func for
10299 Gtk3 (Bug#10361).
10300
10301 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10302
10303 * callint.c (Fcall_interactively): Don't truncate prompt string.
10304
10305 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10306
10307 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10308 property that ends at ZV, so that the bidi iteration could be
10309 resumed from there (after widening). (Bug#10360)
10310
10311 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10312
10313 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10314
10315 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10316
10317 * nsterm.m (x_free_frame_resources):
10318 Release f->output_data.ns->miniimage.
10319 (ns_index_color): Fix indentation. Do not retain
10320 color_table->colors[i].
10321
10322 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10323 before returning.
10324
10325 * nsfns.m (x_set_background_color): Assign return value from
10326 ns_index_color to face-background instead of NSColor*.
10327 (ns_implicitly_set_icon_type): Fix indentation.
10328 Change assignment in for loop to comparison.
10329
10330 * emacs.c (ns_pool): New variable.
10331 (main): Assign ns_pool.
10332 (Fkill_emacs): Call ns_release_autorelease_pool.
10333
10334 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10335 autorelease fdesc, release fdAttrs and tdict.
10336 (ns_get_covering_families): Release charset.
10337 (ns_findfonts): Release NSFontDescriptor created with new.
10338 (ns_uni_to_glyphs): Fix indentation.
10339 (setString): Release attrStr before assigning new value.
10340
10341 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10342
10343 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10344 and NS_IMPL_COCOA.
10345 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10346 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10347
10348 2011-12-18 David Reitter <reitter@cmu.edu>
10349
10350 * nsterm.m (ns_term_init): Subscribe for notifications
10351 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10352 to method trackingNotification in EmacsMenu.
10353
10354 * nsmenu.m (trackingMenu): New variable.
10355 (trackingNotification): New method (from Aquamacs).
10356 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10357 from Aquamacs (Bug#7030).
10358
10359 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10360
10361 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10362 (symbol_to_nsstring): Fix indentation.
10363 (ns_symbol_to_pb): New function.
10364 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10365 (Fns_rotate_cut_buffers_internal): Remove.
10366 (Fns_store_selection_internal): Rename from
10367 Fns_store_cut_buffer_internal.
10368 (ns_get_foreign_selection, Fx_own_selection_internal)
10369 (Fx_disown_selection_internal, Fx_selection_exists_p)
10370 (Fns_get_selection_internal, Fns_store_selection_internal):
10371 Use ns_symbol_to_pb and check if return value is nil.
10372 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10373 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10374 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10375 renamed to Sns_store_selection_internal.
10376 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10377 and remove this function.
10378 (ns_handle_selection_clear): Remove, never used.
10379 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10380 here.
10381
10382 2011-12-17 Ken Brown <kbrown@cornell.edu>
10383
10384 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10385 GID is unknown (Bug#10257).
10386
10387 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10388
10389 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10390 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10391 which caused a build failure on GNU/Linux IA-64. This problem was
10392 introduced by my 2011-10-07 patch.
10393
10394 2011-12-15 Juri Linkov <juri@jurta.org>
10395
10396 * image.c (imagemagick_error): New function. (Bug#10112)
10397 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10398 Use `imagemagick_error' where ImageMagick functions return
10399 `MagickFalse'.
10400 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10401 proper order.
10402
10403 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10404
10405 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10406 fill background (Bug#8992).
10407
10408 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10409
10410 * window.c (Vwindow_combination_resize)
10411 (Vwindow_combination_limit): Use t instead of non-nil in
10412 doc-strings.
10413 (Vrecenter_redisplay): Add first sentence of doc-string on
10414 separate line.
10415 (Frecenter): Fix doc-string typo.
10416
10417 2011-12-11 Kenichi Handa <handa@m17n.org>
10418
10419 * coding.c (Funencodable_char_position): Pay attention to the
10420 buffer text relocation (Bug#9389).
10421
10422 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10423
10424 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10425 gtk_init (Bug#10100).
10426
10427 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10428
10429 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10430 IT->string is nil. (Bug#10263)
10431
10432 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10433
10434 * nsterm.h (x_free_frame_resources): Declare.
10435
10436 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10437 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10438
10439 * nsterm.h (ns_get_defaults_value): Declare.
10440
10441 * nsterm.m (ns_default): Call ns_get_defaults_value.
10442
10443 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10444
10445 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10446 (Bug#10170)
10447
10448 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10449
10450 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10451 that where the value of an _OBJC_* symbol points to is in the .bss
10452 section (Bug#10240).
10453
10454 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10455
10456 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10457 after the loop to call ccl_driver at least once (Bug#8619).
10458
10459 2011-12-08 Kenichi Handa <handa@m17n.org>
10460
10461 * ftfont.c (get_adstyle_property): Fix previous change
10462 (Bug#10233).
10463
10464 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10465
10466 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10467 dirs from the default value of EMACSLOADPATH (bug#10208).
10468
10469 2011-12-07 Glenn Morris <rgm@gnu.org>
10470
10471 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10472 installation and source directories as well. (Bug#10208)
10473
10474 2011-12-06 Chong Yidong <cyd@gnu.org>
10475
10476 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10477
10478 2011-12-06 Glenn Morris <rgm@gnu.org>
10479
10480 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10481 as an error, not just -1. (Bug#10217)
10482
10483 2011-12-05 Chong Yidong <cyd@gnu.org>
10484
10485 * keyboard.c (process_special_events): New function.
10486 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10487
10488 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10489
10490 * coding.c (encode_designation_at_bol): Don't use uninitialized
10491 local variable (Bug#9318).
10492
10493 2011-12-05 Kenichi Handa <handa@m17n.org>
10494
10495 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10496 return Qnil (Bug#8046, Bug#10193).
10497
10498 2011-12-05 Kenichi Handa <handa@m17n.org>
10499
10500 * coding.c (encode_designation_at_bol): New args charbuf_end and
10501 dst. Return the number of produced bytes. Callers changed.
10502 (coding_set_source): Return how many bytes coding->source was
10503 relocated.
10504 (coding_set_destination): Return how many bytes
10505 coding->destination was relocated.
10506 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10507 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10508
10509 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10510
10511 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10512 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10513 macro (Bug#9318).
10514
10515 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10516
10517 The following changes are to fix Bug#9318.
10518
10519 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10520 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10521 (encode_coding_iso_2022, encode_coding_sjis)
10522 (encode_coding_big5, encode_coding_charset): Use the above macros.
10523
10524 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10525
10526 * lisp.h (process_quit_flag): Fix external declaration.
10527
10528 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10529
10530 Don't macro-inline non-performance-critical code.
10531 * eval.c (process_quit_flag): New function.
10532 * lisp.h (QUIT): Use it.
10533
10534 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10535
10536 * nsfns.m (get_geometry_from_preferences): New function.
10537 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10538
10539 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10540
10541 * emacs.c (Qkill_emacs): Define.
10542 (syms_of_emacs): Initialize it.
10543 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10544 Qquit_flag to `kill-emacs' instead.
10545 (quit_throw_to_read_char): Add parameter `from_signal'.
10546 All callers changed. Call Fkill_emacs if requested and safe.
10547 * lisp.h (QUIT): Call Fkill_emacs if requested.
10548
10549 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10550
10551 * widget.c (update_wm_hints): Return if wmshell is null.
10552 (widget_update_wm_size_hints): New function.
10553
10554 * widget.h (widget_update_wm_size_hints): Declare.
10555
10556 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10557 widget_update_wm_size_hints (Bug#10104).
10558
10559 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10560
10561 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10562 before a newline, prepare the bidi iterator for consuming the
10563 newline, and keep the current paragraph direction. (Bug#10183)
10564 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10565
10566 2011-12-02 Juri Linkov <juri@jurta.org>
10567
10568 * search.c (Fword_search_regexp): New Lisp function created from
10569 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10570 (Fword_search_backward, Fword_search_forward)
10571 (Fword_search_backward_lax, Fword_search_forward_lax):
10572 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10573 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10574
10575 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10576
10577 * fileio.c (Finsert_file_contents): Move after-change-function call
10578 to before the "handled:" label, since all "goto handled" appear in
10579 cases where the *-change-functions have already been properly called
10580 (bug#10117).
10581
10582 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10583
10584 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10585 waiting for input. (Bug#10169)
10586
10587 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10588
10589 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10590 verifies glyph row's hash code--we have just reallocated the
10591 glyphs, so their contents can be complete garbage. (Bug#10164)
10592
10593 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10594
10595 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10596
10597 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10598
10599 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10600 attributes are tested _before_ calling verify_row_hash, to protect
10601 against GCC re-ordering of the tests. (Bug#10164)
10602
10603 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10604
10605 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10606
10607 * xterm.c (handle_one_xevent): Only set async_visible and friends
10608 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10609 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10610 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10611
10612 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10613
10614 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10615 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10616 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10617 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10618 All uses changed to use GCPRO1 etc.
10619 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10620 Revert to old implementation (i.e., before 2011-03-11).
10621
10622 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10623
10624 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10625 of scroll runs so as to avoid assigning disabled bogus rows and
10626 unnecessary graphics copy operations.
10627
10628 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10629
10630 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10631 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10632 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10633 (malloc, free, realloc, calloc): Redirect to e_* only when
10634 compiling Emacs.
10635
10636 * lisp.h (GCTYPEBITS): Move before first use.
10637 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10638 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10639 this macro definition.
10640
10641 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10642 _MSC_VER.
10643
10644 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10645
10646 * gtkutil.c (xg_create_frame_widgets):
10647 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10648 present with Gtk+ 2.0.
10649
10650 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10651
10652 * fileio.c (Finsert_file_contents): Undo previous change; see
10653 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10654
10655 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10656
10657 Rename locals to avoid shadowing.
10658 * fileio.c (Finsert_file_contents):
10659 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10660 * process.c (wait_reading_process_output):
10661 Rename inner 'proc' to 'p' to avoid shadowing.
10662 Indent for consistency with usual Emacs style.
10663
10664 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10665
10666 * xdisp.c (redisplay_window): If cursor row is not fully visible
10667 after recentering, and scroll-conservatively is set to a large
10668 number, scroll window by a few more lines to make the cursor fully
10669 visible and out of scroll-margin. (Bug#10105)
10670 (start_display): Don't move to the next line if the display should
10671 start at a newline that is part of a display vector or an overlay
10672 string. (Bug#10119)
10673
10674 2011-11-24 Juri Linkov <juri@jurta.org>
10675
10676 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10677 after the `MagickPingImage' call. (Bug#10112)
10678
10679 2011-11-23 Chong Yidong <cyd@gnu.org>
10680
10681 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10682
10683 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10684
10685 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10686 making another buffer current. (Bug#10114)
10687
10688 2011-11-23 Glenn Morris <rgm@gnu.org>
10689
10690 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10691
10692 2011-11-23 Chong Yidong <cyd@gnu.org>
10693
10694 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10695 using it (Bug#5984).
10696
10697 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10698
10699 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10700 and header-lines, as they don't have one computed for them.
10701 (Bug#10098)
10702
10703 * .gdbinit (prow): Make displayed values more self-explaining.
10704 Add row's hash code.
10705
10706 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10707
10708 * process.c (wait_reading_process_output): Fix asynchrounous
10709 GnuTLS socket handling on some versions of the GnuTLS library.
10710 (wait_reading_process_output): Add comment and URL.
10711
10712 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10713
10714 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10715
10716 2011-11-21 Chong Yidong <cyd@gnu.org>
10717
10718 * window.c (Fnext_window, Fprevious_window): Doc fix.
10719
10720 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10721
10722 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10723
10724 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10725
10726 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10727
10728 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10729
10730 * window.c (Fset_window_combination_limit): Rename argument
10731 STATUS to LIMIT.
10732 (Vwindow_combination_limit): Remove "status" from doc-string.
10733
10734 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10735
10736 * m/ibms390.h: Remove.
10737 * m/ibms390x.h: Don't include "ibms390.h".
10738
10739 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10740
10741 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10742 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10743
10744 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10745
10746 * casetab.c (Fset_case_table):
10747 * charset.c (Fcharset_after): Fix typos.
10748
10749 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10750
10751 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10752 Otherwise, valgrind does not work on some platforms.
10753 Problem reported by Andreas Schwab in
10754 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10755 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10756 is set, removing the need for VIRT_ADDRESS_VARIES.
10757 (PURE_P): Use a more-efficient implementation that needs just one
10758 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10759 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10760 to 4 (xorl, subq, cmpq, setbe).
10761 * alloc.c (pure): Always extern now, since that's the
10762 VIRT_ADDR_VARIES behavior.
10763 (PURE_POINTER_P): Use a single comparison, not two, for
10764 consistency with the new puresize.h.
10765 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10766 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10767 Remove VIRT_ADDR_VARIES no longer needed.
10768
10769 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10770
10771 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10772 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10773 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10774 behave as if the cursor position were at the window margin.
10775
10776 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10777 and the cursor position is out of bounds, behave as if the cursor
10778 position were at the window margin. (Bug#10075)
10779
10780 2011-11-18 Chong Yidong <cyd@gnu.org>
10781
10782 * window.c (Fwindow_combination_limit): Make first argument
10783 non-optional, since it is meaningless for live windows like the
10784 selected window.
10785
10786 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10787
10788 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10789
10790 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10791
10792 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10793 (graft_intervals_into_buffer): Simplify.
10794
10795 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10796
10797 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10798 hash values of the two rows.
10799 (copy_row_except_pointers): Preserve the used[] arrays and the
10800 hash values of the two rows. (Bug#10035)
10801 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10802
10803 * xdisp.c (row_hash): New function, body extracted from
10804 compute_line_metrics.
10805 (compute_line_metrics): Call row_hash, instead of computing the
10806 hash code inline.
10807
10808 * dispnew.c (verify_row_hash): Call row_hash for computing the
10809 hash code of a row, instead of duplicating code from xdisp.c.
10810
10811 * dispextern.h (row_hash): Add prototype.
10812
10813 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10814
10815 * frame.c (delete_frame): Don't delete the terminal when the last
10816 X frame is closed if emacs is built with GTK toolkit.
10817
10818 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10819
10820 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10821
10822 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10823
10824 * window.c (Vwindow_splits): Rename to
10825 Vwindow_combination_resize. Suggested by Juri Linkov.
10826 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10827 of Vwindow_splits.
10828
10829 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10830
10831 * nsfns.m (Fns_font_name):
10832 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10833
10834 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10835
10836 * window.h (window): Rename slot "nest" to "combination_limit".
10837 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10838 (Fset_window_nest): Rename to Fset_window_combination_limit.
10839 (Vwindow_nest): Rename to Vwindow_combination_limit.
10840 (recombine_windows, make_parent_window, make_window)
10841 (Fsplit_window_internal, saved_window)
10842 (Fset_window_configuration, save_window_save): Rename all
10843 occurrences of window_nest to window_combination_limit.
10844
10845 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10846
10847 * image.c (imagemagick_load_image): Fix typo.
10848
10849 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10850
10851 * xdisp.c (display_line): Move the call to
10852 highlight_trailing_whitespace before the call to
10853 compute_line_metrics, since the latter needs to see the final
10854 faces of all the glyphs to compute ROW's hash value.
10855 Fixes assertion violations in row_equal_p. (Bug#10035)
10856
10857 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10858
10859 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10860 just return (bug#10044).
10861
10862 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10863
10864 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10865 with user-defined heap size. Bump the default size of the temacs
10866 heap to 27MB, to avoid memory warning when running temacs.
10867 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10868
10869 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10870 current_matrix and desired_matrix. (Bug#9990)
10871 (verify_row_hash) [XASSERTS]: New function.
10872 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10873 that the hash value of glyph rows is correct.
10874
10875 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10876
10877 * window.h (window): Remove splits slot.
10878 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10879 (Fdelete_other_windows_internal, make_parent_window)
10880 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10881 (Fset_window_configuration, save_window_save): Don't deal with
10882 split status of windows.
10883 (saved_window): Remove splits slot.
10884 (Vwindow_splits): Rewrite doc-string.
10885
10886 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10887
10888 * xfns.c (unwind_create_frame):
10889 * nsfns.m (unwind_create_frame):
10890 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10891 Vframe_list (Bug#9999).
10892
10893 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10894
10895 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10896
10897 2011-11-11 Kenichi Handa <handa@m17n.org>
10898
10899 * callproc.c (Fcall_process): Set the member dst_multibyte of
10900 process_coding.
10901
10902 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10903
10904 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10905 avoid a crash (bug#9496).
10906
10907 2011-11-09 Chong Yidong <cyd@gnu.org>
10908
10909 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10910 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10911
10912 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10913
10914 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10915
10916 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 Avoid some portability problems by eschewing 'extern inline' functions.
10919 The trivial performance wins aren't worth the portability hassles; see
10920 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10921 et seq.
10922 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10923 (window_box_width, window_box_left, window_box_left_offset)
10924 (window_box_right, window_box_right_offset): Undo previous change,
10925 by removing the "extern"s.
10926 * intervals.c (adjust_intervals_for_insertion)
10927 (adjust_intervals_for_deletion): Undo previous change,
10928 making these static again.
10929 (offset_intervals, temp_set_point_both, temp_set_point)
10930 (copy_intervals_to_string): No longer inline.
10931 * xdisp.c (window_text_bottom_y, window_box_width)
10932 (window_box_height, window_box_left_offset)
10933 (window_box_right_offset, window_box_left, window_box_right)
10934 (window_box): No longer inline.
10935
10936 2011-11-08 Chong Yidong <cyd@gnu.org>
10937
10938 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10939 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10940 Signal an error if not a live window.
10941 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10942 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10943
10944 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10945
10946 * lisp.h (syms_of_abbrev): Remove declaration.
10947 Reported by CHENG Gao <chenggao@royau.me>.
10948
10949 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10950
10951 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10952 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10953 of temacs in GUI mode.
10954
10955 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10956
10957 * window.h: Declare delete_all_child_windows instead of
10958 delete_all_subwindows.
10959 * window.c (Fwindow_nest, Fset_window_nest)
10960 (Fset_window_new_total, Fset_window_new_normal)
10961 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10962 (delete_all_subwindows): Rename to delete_all_child_windows.
10963 (Fdelete_other_windows_internal, Fset_window_configuration):
10964 Call delete_all_child_windows instead of delete_all_subwindows.
10965 * frame.c (delete_frame): Call delete_all_child_windows instead
10966 of delete_all_subwindows.
10967
10968 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10969
10970 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10971 This is also needed for porting to any host where GC_MARK_STACK is
10972 not GC_MAKE_GCPROS_NOOPS.
10973 (which_symbols): Use it.
10974
10975 2011-11-07 Kenichi Handa <handa@m17n.org>
10976
10977 * coding.c (coding_set_destination): Check coding->src_pos only
10978 when coding->src_object is a buffer (bug#9910).
10979
10980 * process.c (send_process): Set the member src_multibyte of coding
10981 to 0 (bug#9911) when sending a unibyte text.
10982
10983 * callproc.c (Fcall_process): Set the member src_multibyte of
10984 process_coding to 0 (bug#9912).
10985
10986 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10987
10988 * xmenu.c (cleanup_widget_value_tree): New function.
10989 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10990 calling free_menubar_widget_value_tree directly (Bug#9830).
10991
10992 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10993
10994 Fix some portability problems with 'inline'.
10995 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10996 (window_box_width, window_box_left, window_box_left_offset)
10997 (window_box_right, window_box_right_offset): Declare extern.
10998 Otherwise, these inline functions do not conform to C99 and
10999 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11000 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11001 * intervals.c (adjust_intervals_for_insertion)
11002 (adjust_intervals_for_deletion): Now extern, because otherwise the
11003 extern inline functions 'offset_intervals' couldn't refer to it.
11004 (static_offset_intervals): Remove.
11005 (offset_intervals): Rewrite using the old contents of
11006 static_offset_intervals. The old version didn't conform to C99
11007 because an extern inline function contained a reference to an
11008 identifier with static linkage.
11009
11010 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11011
11012 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11013 GC.
11014
11015 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11016
11017 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11018 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11019 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11020 return Qleft_to_right.
11021
11022 2011-11-06 Chong Yidong <cyd@gnu.org>
11023
11024 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11025 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11026 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11027 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11028 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11029 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11030 (Fwindow_vscroll): Doc fix.
11031 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11032 argument, since it makes no sense to pass a live window and for
11033 consistency with window-child.
11034
11035 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11036
11037 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11038 support MSVC.
11039
11040 2011-11-05 Jason Rumney <jasonr@gnu.org>
11041
11042 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11043 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11044 fonts (Bug#6029).
11045 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11046 bitwise arithmetic preventing use of unicode-sip and non-truetype
11047 opentype fonts.
11048
11049 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11050
11051 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11052 "emacs"-only part.
11053
11054 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11055 initialization code to keep similarity to xfns.c after changes
11056 from 2011-11-05.
11057
11058 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11059
11060 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11061 (unwind_create_frame): New function (Bug#9943).
11062 (Fx_create_frame): Restructure code to be more similar to the one in
11063 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11064 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11065 Move terminal->reference_count++ just before making the frame official
11066 (Bug#9943).
11067
11068 * nsterm.m (x_free_frame_resources): New function.
11069 (x_destroy_window): Move code to x_free_frame_resources.
11070
11071 * xfns.c (unwind_create_frame): Fix comment.
11072 (Fx_create_frame, x_create_tip_frame):
11073 Move terminal->reference_count++ just before making the frame
11074 official. Move initialization of image_cache_refcount and
11075 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11076
11077 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11078
11079 Support MSVC build with newer versions of Visual Studio.
11080 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11081 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11082 nt/gmake.defs.
11083
11084 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11085 which are not supported by MSVC.
11086 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11087 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11088 bitfields.
11089 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11090 types in bitfields.
11091 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11092
11093 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11094
11095 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11096
11097 Support MSVC build with newer versions of Visual Studio.
11098 * w32.c: Don't include w32api.h for MSVC.
11099 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11100
11101 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11102 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11103 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11104 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11105 e_* cousins.
11106 (alloca) [_MSC_VER]: Define to _alloca.
11107
11108 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11109
11110 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11111
11112 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11113
11114 * xdisp.c (note_mouse_highlight): If either of
11115 previous/next-single-property-change returns nil, treat that as
11116 the beginning or the end of the buffer. (Bug#9955)
11117
11118 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11119
11120 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11121 label is not null (Bug#9951).
11122 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11123 may be NULL.
11124
11125 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11126
11127 * window.c (Fwindow_body_size): Mention in the doc string that the
11128 return value is in frame's canonical units. (Bug#9949)
11129
11130 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11131
11132 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11133
11134 * w32fns.c (unwind_create_frame): If needed, free the glyph
11135 matrices of the partially constructed frame. (Bug#9943)
11136 * xfns.c (unwind_create_frame): Likewise.
11137
11138 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11139
11140 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11141 Don't stop backward scan on the continuation glyph, even though
11142 its CHARPOS is positive.
11143 (mouse_face_from_buffer_pos, note_mouse_highlight):
11144 Rename cover_string to disp_string.
11145
11146 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11147
11148 * window.c (temp_output_buffer_show): Don't use
11149 Vtemp_buffer_show_specifiers.
11150 (Vtemp_buffer_show_specifiers): Remove unused variable.
11151
11152 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11153
11154 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11155 past the beginning of the current glyph matrix.
11156
11157 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11158
11159 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11160 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11161 HAVE_GTK3 (Bug#9869).
11162
11163 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11164 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11165
11166 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11167
11168 * xterm.c: Declare x_handle_net_wm_state to return int.
11169 (handle_one_xevent): Check if we are iconified but don't have
11170 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11171 (get_current_wm_state): Return non-zero if not hidden,
11172 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11173 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11174 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11175 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11176
11177 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11178
11179 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11180 so that this new function doesn't get optimized away by a
11181 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11182
11183 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11184
11185 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11186
11187 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11188
11189 Fix the `xbytecode' command.
11190 * .gdbinit (xprintbytestr): New command.
11191 (xwhichsymbols): Rename from `which'; all callers changed.
11192 (xbytecode): Print the byte-code string as well.
11193
11194 2011-10-29 Kim Storm <storm@cua.dk>
11195
11196 * alloc.c (which_symbols): New function.
11197
11198 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11199
11200 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11201 line. (Bug#9903)
11202
11203 2011-10-29 Glenn Morris <rgm@gnu.org>
11204
11205 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11206 Not clear what it was for, and it causes various bugs. (Bug#9839)
11207
11208 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11209
11210 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11211 possible random value that matches one of those tested as
11212 condition to clear the mouse face.
11213
11214 2011-10-28 Chong Yidong <cyd@gnu.org>
11215
11216 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11217
11218 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11219
11220 * window.c (make_window): Initialize phys_cursor_on_p.
11221
11222 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11223
11224 * lisp.h (struct Lisp_Symbol): Update comments.
11225
11226 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11227
11228 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11229
11230 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11231
11232 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11233 <oslsachem@gmail.com> for helping to debug this.
11234
11235 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11236 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11237 (g_b_init_get_glyph_outline_w): New static variables.
11238 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11239 (GetGlyphOutlineW_Proc): New typedefs.
11240 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11241 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11242 New functions.
11243 (w32font_open_internal, compute_metrics):
11244 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11245 instead of calling the "wide" APIs directly.
11246
11247 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11248
11249 * w32.h (syms_of_w32font): Add prototype.
11250
11251 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11252
11253 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11254 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11255 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11256 (Fmove_to_window_line): Doc fix.
11257
11258 2011-10-27 Chong Yidong <cyd@gnu.org>
11259
11260 * process.c (make_process): Set gnutls_state to NULL.
11261
11262 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11263 non-NULL, regardless of GNUTLS_INITSTAGE.
11264 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11265 an error. Set process slots as soon as we allocate them.
11266
11267 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11268
11269 2011-10-27 Chong Yidong <cyd@gnu.org>
11270
11271 * gnutls.c (emacs_gnutls_deinit): New function.
11272 Deallocate credentials structures as well as calling gnutls_deinit.
11273 (Fgnutls_deinit, Fgnutls_boot): Use it.
11274
11275 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11276 (deactivate_process): Call emacs_gnutls_deinit.
11277
11278 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11279
11280 * image.c (x_create_x_image_and_pixmap):
11281 * w32.c (sys_rename, w32_delayed_load):
11282 * w32font.c (fill_in_logfont):
11283 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11284
11285 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11286
11287 * w32fns.c (w32_default_color_map): New function,
11288 extracted from Fw32_default_color_map.
11289 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11290
11291 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11292
11293 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11294
11295 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11296
11297 * keyboard.c (test_undefined): New function (bug#9751).
11298 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11299
11300 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11301
11302 * sysdep.c (init_sys_modes): Fix the check for the controlling
11303 terminal (Bug#6649).
11304
11305 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11306
11307 * dispextern.h (struct bidi_it): New member next_en_type.
11308
11309 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11310 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11311 current character, check also for next_en_type being WEAK_EN.
11312 (bidi_resolve_weak): Don't enter the expensive loop if the current
11313 position is before next_en_pos. Record the bidi type of the first
11314 non-ET, non-BN character we find, in addition to its position.
11315 (bidi_level_of_next_char): Invalidate next_en_type when
11316 next_en_pos is over-stepped.
11317
11318 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11319
11320 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11321 * editfns.c: Rewrite current-time-zone so that it invokes
11322 the equivalent of (format-time-string "%Z") to get the time zone name.
11323 This fixes a bug when the time zone name contains characters that
11324 need converting from the system time locale to Emacs internal format.
11325 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11326 that patch fixed format-time-string to do the conversion, but
11327 I forgot to fix current-time-zone.
11328 (format_time_string): New function, containing most of
11329 what Fformat_time_string used to contain.
11330 (Fformat_time_string): Rewrite in terms of format_time_string.
11331 This doesn't change this function's behavior.
11332 (current-time-zone): Rewrite to use format_time_string.
11333 This fixes the bug reported by Michael Schierl in
11334 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11335 Jason Rumney's 2007-06-07 change worked around this bug, but
11336 didn't fix it.
11337 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11338
11339 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11340
11341 * xdisp.c (start_display): If the character at POS is displayed
11342 via a display vector, reset IT->current.dpvec_index to zero.
11343 (try_window_reusing_current_matrix): If a line ends in a display
11344 vector or the next line starts in a display vector, continue
11345 redrawing the window even though the character position of
11346 start_row was reached.
11347 (Bug#9771, part 2)
11348
11349 2011-10-18 Chong Yidong <cyd@gnu.org>
11350
11351 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11352 with nobreak-char-display too.
11353
11354 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11355
11356 Fix part 3 of bug#9771.
11357 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11358 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11359 non-neutral characters if the current character is a paragraph
11360 separator (a.k.a. Newline). This avoids running the same
11361 expensive loop twice, once when we consume the preceding newline
11362 and the other time when the line actually needs to be displayed.
11363 Avoid the loop when we see neutrals on the base embedding level
11364 following a character whose directionality is the same as the
11365 paragraph's. This avoids running the expensive loop when a line
11366 ends in a long sequence of neutrals, like control characters.
11367 Add assertion against STRONG_AL type. Slightly rearrange code
11368 that determines the type of a neutral given the first non-neutral
11369 that follows it.
11370 (bidi_level_of_next_char): Set next_en_pos to zero when
11371 invalidating its info.
11372
11373 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11374
11375 * xdisp.c (push_display_prop): Determine whether to record string
11376 or buffer position by IT->string, not by IT->method. Allow
11377 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11378 (move_it_vertically_backward): Don't look for character position
11379 immediately after the newline when in a continuation line.
11380 (Bug#9771, part 1)
11381
11382 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11383
11384 * window.c (coordinates_in_window): Rewrite and delabelize
11385 vertical border check. (Bug#5357) (Bug#9618)
11386
11387 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11388
11389 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11390 errors in XSetWindowBorder (bug#9310).
11391
11392 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11393
11394 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11395 avoid crash when xmalloc overrun checking is enabled.
11396
11397 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11398
11399 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11400 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11401 cursor motion with <left> and <right> arrow keys.
11402
11403 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11404 some callers set that themselves.
11405
11406 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11407
11408 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11409 display string and the previous row comes from the same string and
11410 is empty. (Bug#9739) (Bug#9738)
11411
11412 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11413
11414 * doc.c (get_doc_string): Encode file name (bug#9735).
11415
11416 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11417
11418 * bidi.c (bidi_level_of_next_char):
11419 * xdisp.c (get_visually_first_element): Remove old incorrect
11420 comments regarding the Unicode Line Separator character.
11421
11422 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11423
11424 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11425
11426 * alloc.c (Fgc_status): Do not access beyond zombies array
11427 boundary if nzombies > MAX_ZOMBIES.
11428 * alloc.c (dump_zombies): Add missing format specifier.
11429
11430 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11431
11432 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11433 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11434
11435 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11436 Some packages use them to denote characters with modifiers.
11437
11438 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11439
11440 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11441 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11442 matching a pp-number. Rename parameter var to var1.
11443
11444 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11445
11446 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11447
11448 2011-10-08 Glenn Morris <rgm@gnu.org>
11449
11450 * callint.c (Fcall_interactively): Give a more explicit error for the
11451 'c' case with a non-character input. (Bug#8479)
11452
11453 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11454
11455 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11456 lines.
11457 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11458 lines that are hscrolled on the left.
11459
11460 * dispnew.c (buffer_posn_from_coords): Account for a possible
11461 presence of header-line. (Bug#4426)
11462
11463 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11464
11465 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11466 Don't advertise functionality which we discourage or doesn't work.
11467
11468 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11469
11470 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11471 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11472 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11473 this makes Emacs dump core during garbage collection on rare
11474 occasions. sizeof is obviously inferior to offsetof here, so
11475 stick with offsetof.
11476 (GC_POINTER_ALIGNMENT): New macro.
11477 (mark_memory): Omit 3rd (offset) arg; caller changed.
11478 Don't assume EMACS_INT alignment is the same as pointer alignment.
11479
11480 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11481
11482 * keyboard.c (read_key_sequence_remapped): New var.
11483 (read_key_sequence): Compute remapping in the right buffer.
11484 (command_loop_1): Use read_key_sequence's remapping directly.
11485
11486 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11487
11488 * dired.c (file_name_completion): Don't expand file name.
11489 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11490 before checking file name handler.
11491
11492 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11493 they've been requested explicitly (bug#9591).
11494
11495 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11496
11497 * keymap.c (Fsingle_key_description): Use make_specified_string
11498 instead of build_string to build string from push_key_description.
11499 (Bug#5193)
11500
11501 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11502
11503 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11504 This fixes a Y2038 bug on 64-bit hosts.
11505 * buffer.c (reset_buffer):
11506 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11507 (Fclear_buffer_auto_save_failure):
11508 Use 0, not -1, to represent an unset failure time, since time_t
11509 might not be signed.
11510
11511 Remove dependency on glibc malloc internals.
11512 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11513 Move back here from lisp.h, but with their new implementations.
11514 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11515 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11516 * charset.c (charset_table_init): New static var.
11517 (syms_of_charset): Use it instead of xmalloc. This removes a
11518 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11519 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11520 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11521 Move back to alloc.c.
11522 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11523 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11524
11525 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11526
11527 * nsterm.m (windowDidResize): Call x_set_window_size only when
11528 ns_in_resize is true. Otherwise set pixelwidth/height and
11529 call change_frame_size (Bug#9628).
11530
11531 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11532
11533 Port --enable-checking=all to Fedora 14 x86-64.
11534 * charset.c (syms_of_charset): Also account for glibc malloc's
11535 internal overhead when calculating the initial malloc maximum.
11536
11537 Port --enable-checking=all to Fedora 14 x86.
11538 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11539 Move to lisp.h.
11540 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11541 (overrun_check_realloc, overrun_check_free):
11542 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11543 That way, xmalloc returns a properly-aligned pointer even if
11544 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11545 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11546 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11547 into account when calculating the initial malloc maximum.
11548 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11549 Move here from alloc.c, so that charset.c can use it too.
11550 Properly align; the old code wasn't right for common 32-bit hosts
11551 when configured with --enable-checking=all.
11552 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11553 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11554
11555 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11556
11557 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11558 use EDOM.
11559
11560 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11561
11562 * xdisp.c (compute_display_string_end): If there's no display
11563 string at CHARPOS, return -1.
11564
11565 * bidi.c (bidi_fetch_char): When compute_display_string_end
11566 returns a negative value, treat the character as a normal
11567 character not covered by a display string. (Bug#9624)
11568
11569 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11570
11571 * lread.c (Fread_from_string): Fix typo in docstring.
11572
11573 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11574
11575 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11576 newline, reseat the iterator instead of bidi-iterating there one
11577 character at a time. (Bug#9610)
11578 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11579 TO_CHARPOS if the bidi iterator is at base embedding level.
11580
11581 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11582
11583 * lread.c (readevalloop): Use correct code for NBSP.
11584 (read1): Likewise. (Bug#9608)
11585
11586 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11587
11588 * dbusbind.c (Fdbus_register_signal): When service is not
11589 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11590
11591 2011-09-25 Glenn Morris <rgm@gnu.org>
11592
11593 * buffer.c (truncate-lines): Doc fix.
11594
11595 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11596
11597 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11598 (Fset_window_next_buffers): Doc fix.
11599
11600 2011-09-24 Glenn Morris <rgm@gnu.org>
11601
11602 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11603
11604 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11605
11606 Fix minor problems found by static checking.
11607 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11608 * indent.c (Fvertical_motion): Fix == vs = typo.
11609
11610 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11611
11612 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11613 Default value is now t. Doc fix.
11614
11615 * indent.c (Fvertical_motion): Compute and apply the overshoot
11616 logic when moving up, not only when moving down. Fix the
11617 confusing name and values of the it_overshoot_expected variable;
11618 logic changes accordingly. (Bug#9254) (Bug#9549)
11619
11620 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11621 CHARPOS is covered by a display string which includes newlines.
11622 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11623 is covered by a display string with embedded newlines.
11624
11625 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11626
11627 * dbusbind.c (Fdbus_register_signal): Add match rule to
11628 Vdbus_registered_objects_table. (Bug#9581)
11629 (Fdbus_register_method, Vdbus_registered_objects_table):
11630 Fix docstring.
11631
11632 2011-09-24 Jim Meyering <meyering@redhat.com>
11633
11634 do not ignore write error for any output size
11635 The previous change was incomplete.
11636 While it makes emacs --batch detect the vast majority of stdout
11637 write failures, errors were still ignored whenever the output size is
11638 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11639 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11640 && echo FAIL: ignored write error
11641 FAIL: ignored write error
11642 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11643 && echo FAIL: ignored write error
11644 FAIL: ignored write error
11645 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11646
11647 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11648
11649 * emacs.c (Fkill_emacs): In noninteractive mode exit
11650 non-successfully if a write error occurred on stdout. (Bug#9574)
11651
11652 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11653
11654 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11655 the xassert test.
11656
11657 * dispextern.h (struct it): Update the comment documenting what
11658 can it->OBJECT be.
11659
11660 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11661
11662 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11663 a display string, extend search for cursor position to end of row.
11664 (find_row_edges): If the row ends in a newline from a display
11665 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11666 Handle the case of a display string with multiple newlines.
11667 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11668 non-empty line. Fixes confusing cursor motion with arrow keys at
11669 the beginning of a line that starts with whitespace.
11670
11671 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11672
11673 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11674 (bug#9493).
11675
11676 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11677
11678 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11679 boolean (Bug#9154).
11680
11681 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11682
11683 * xdisp.c (display_line): Record maximum and minimum buffer
11684 positions even if no glyphs were produced (e.g., by a zero-width
11685 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11686 buffer positions that will be removed from the glyph row because
11687 they don't fit.
11688 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11689 column is beyond frame width: don't subtract 1 "pixel" when
11690 computing width of the stretch.
11691 (reseat_at_next_visible_line_start): Undo the change made on
11692 2011-09-17 that saved paragraph information and restored it after
11693 the call to `reseat'. (Bug#9545)
11694
11695 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11696
11697 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11698 and turn window cursor on if cleared (Bug#9415).
11699
11700 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11701
11702 * search.c (boyer_moore): Take unibyte characters from pattern
11703 literally. (Bug#9458)
11704
11705 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11706
11707 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11708
11709 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11710
11711 Fix minor problem found by static checking.
11712 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11713 initialized, to pacify gcc -Wuninitialized.
11714
11715 * fileio.c: Report proper errno when syscall falls.
11716 (Finsert_file_contents): Save and restore errno,
11717 so that report_file_error outputs the correct diagnostic.
11718 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11719
11720 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11721
11722 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11723
11724 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11725
11726 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11727 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11728
11729 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11730
11731 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11732 about the current paragraph and restore it after the call to reseat.
11733
11734 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11735 (bidi_find_paragraph_start): Search back for paragraph beginning
11736 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11737 (bidi_move_to_visually_next): Only trigger paragraph-related
11738 computations when the last character is a newline or at EOB, not
11739 just any NEUTRAL_B. (Bug#9470)
11740
11741 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11742 truncated lines if point is covered by a display string. (Bug#9524)
11743
11744 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11745
11746 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11747 (cons_to_x_long): New function.
11748 (lisp_data_to_selection_data): Use it. Correct the test for
11749 short-versus-long data; it was negated. Break out of vector
11750 loop, for efficiency, when a long datum is discovered.
11751
11752 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11753
11754 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11755
11756 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11757
11758 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11759 GCC PR/17406) by declaring this function with external scope.
11760
11761 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11762
11763 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11764 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11765
11766 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11767
11768 * editfns.c (Fformat): Correctly handle text properties on "%%".
11769
11770 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11771
11772 * xterm.c (x_draw_composite_glyph_string_foreground):
11773 * w32term.c (x_draw_composite_glyph_string_foreground):
11774 * term.c (encode_terminal_code):
11775 * composite.c (composition_update_it, get_composition_id):
11776 * xdisp.c (get_next_display_element)
11777 (fill_composite_glyph_string): Add comments about special meaning
11778 of TAB characters in a composition.
11779
11780 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11781
11782 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11783 This occurs when processing a multibyte format.
11784 Problem reported by Wolfgang Jenker.
11785
11786 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11787
11788 * xdisp.c (try_cursor_movement): Only check for exact match if
11789 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11790
11791 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11792
11793 Remove unused external symbols.
11794 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11795 * xdisp.c (calc_pixel_width_or_height): Now static.
11796 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11797 * indent.c (check_display_width):
11798 * w32term.c: Fix comment to match code.
11799 * xterm.c, xterm.h (x_catching_errors): Remove.
11800
11801 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11802
11803 * xselect.c: Use signed conversions more consistently (Bug#9498).
11804 (selection_data_to_lisp_data): Assume incoming selection data are
11805 signed integers, not unsigned. This is to be consistent with
11806 outgoing selection data, which was modified to use signed integers
11807 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11808 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11809 expects long, not unsigned long.
11810
11811 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11812
11813 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11814 computation of loop end. Reported by Johan Bockgård
11815 <bojohan@gnu.org>.
11816
11817 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11818
11819 * frame.c (Fother_visible_frames_p): Function deleted.
11820
11821 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11822
11823 * indent.c (compute_motion): Process display vector front to back
11824 rather than the other way around. (Bug#2496)
11825
11826 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11827
11828 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11829
11830 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11831
11832 * minibuf.c (Fread_from_minibuffer): Doc fix.
11833
11834 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11835
11836 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11837 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11838
11839 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11840
11841 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11842 value for non-existent files.
11843
11844 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11845
11846 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11847 set its "size" to -1. This will set the modtime_size field of
11848 the corresponding buffer to -1, which is what
11849 verify-visited-file-modtime expects for files that do not exist.
11850 (Bug#9139)
11851
11852 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11853
11854 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11855 here ...
11856 * lisp.h: ... from here. push_key_description is no longer
11857 defined in keyboard.c, so its declaration should not be in
11858 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11859 logically belongs with push_key_description.
11860
11861 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11862
11863 * buffer.h: Include <sys/types.h> instead of <time.h>.
11864 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11865 Problem reported by Herbert J. Skuhra.
11866
11867 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11868
11869 * xml.c (parse_region): Make the parsing work for
11870 non-comment-starting XML files again (bug#9144).
11871
11872 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11873
11874 * image.c (gif_load): Fix calculation of bottom and right corner.
11875 (Bug#9468)
11876
11877 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11878
11879 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11880 redisplay in small windows.
11881
11882 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11883
11884 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11885
11886 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11887
11888 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11889 Operate on live windows only.
11890
11891 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11892
11893 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11894
11895 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11896
11897 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11898 only under bidi iteration.
11899
11900 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11901
11902 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11903
11904 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11905
11906 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11907 Without this fix, the command to link temacs failed due to an
11908 undefined symbol __builtin_isnan. This is because
11909 /usr/include/iso/math_c99.h #defines isnan(x) to
11910 __builtin_isnan(x), but the bundled gcc, which identifies itself
11911 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11912 a __builtin_isnan.
11913 * floatfns.c (isnan): #undef, and then #define to a clone of
11914 what's in data.c.
11915 (Fisnan): Always define, since it's always available now.
11916 (syms_of_floatfns): Always define isnan at the Lisp level.
11917
11918 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11919
11920 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11921
11922 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11923
11924 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11925 The previous code assumed that file offsets (off_t values) fit in
11926 EMACS_INT variables, which is not true on typical 32-bit hosts.
11927 The code messed up by falsely reporting buffer overflow in cases
11928 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11929 when "big" contains more than 2**29 bytes, even though this
11930 inserts just one byte and does not overflow the buffer.
11931 (Finsert_file_contents): Store file offsets as off_t
11932 values, not as EMACS_INT values. Check for overflow when
11933 converting between EMACS_INT and off_t. When checking for
11934 buffer overflow or for overlap, take the offsets into account.
11935 Don't use EMACS_INT for small values where int suffices.
11936 When checking for overlap, fix a typo: ZV was used where
11937 ZV_BYTE was intended.
11938 (Fwrite_region): Don't assume off_t fits into 'long'.
11939 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11940
11941 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11942
11943 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11944
11945 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11946
11947 sprintf-related integer and memory overflow issues (Bug#9412).
11948
11949 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11950 (esprintf, exprintf, evxprintf): New functions.
11951 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11952 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11953 (modify_event_symbol): Do not assume that the length of
11954 name_alist_or_stem is safe to alloca and fits in int.
11955 (Fexecute_extended_command): Likewise for function name and binding.
11956 (Frecursion_depth): Wrap around reliably on integer overflow.
11957 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11958 since some callers pass EMACS_INT values.
11959 (Fsingle_key_description): Don't crash if symbol name contains more
11960 than MAX_ALLOCA bytes.
11961 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11962 (get_minibuffer): Arg is now EMACS_INT, not int.
11963 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11964 (esprintf, exprintf, evxprintf): New decls.
11965 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11966
11967 * dbusbind.c (signature_cat): New function.
11968 (xd_signature, Fdbus_register_signal):
11969 Do not overrun buffer; instead, report string overflow.
11970
11971 * dispnew.c (add_window_display_history): Don't overrun buffer.
11972 Truncate instead; this is OK since it's just a log.
11973
11974 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11975 even if the time zone offset is outlandishly large.
11976 Don't mishandle offset == INT_MIN.
11977
11978 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11979 when creating daemon; the previous buffer-overflow check was incorrect.
11980
11981 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11982 which has the guts of the old verror function.
11983
11984 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11985 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11986
11987 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11988 (font_unparse_xlfd): Don't blindly alloca long strings.
11989 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11990 fits in int, when using sprintf. Use single snprintf to count
11991 length of string rather than counting it via multiple sprintfs;
11992 that's simpler and more reliable.
11993 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11994 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11995 sprintf, in case result does not fit in int.
11996
11997 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11998 (fontset_from_font): Print it.
11999
12000 * frame.c (tty_frame_count): Now printmax_t, not int.
12001 (make_terminal_frame, set_term_frame_name): Print it.
12002 (x_report_frame_params): In X, window IDs are unsigned long,
12003 not signed long, so print them as unsigned.
12004 (validate_x_resource_name): Check for implausibly long names,
12005 and don't assume name length fits in 'int'.
12006 (x_get_resource_string): Don't blindly alloca invocation name;
12007 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12008 not fit in int.
12009
12010 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12011 (xg_check_special_colors, xg_set_geometry):
12012 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12013
12014 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12015 Use esprintf, not sprintf, in case result does not fit in int.
12016
12017 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12018 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12019 it as a large positive number.
12020 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12021 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12022
12023 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12024 in case result does not fit in int.
12025
12026 * print.c (float_to_string): Detect width overflow more reliably.
12027 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12028 buffer overrun. Don't assume list length fits in 'int'. Treat
12029 print length of 0 as 0, not as infinity; to be consistent with other
12030 uses of print length in this function. Don't overflow print length
12031 index. Don't assume hash table size fits in 'long', or that
12032 vectorlike size fits in 'unsigned long'.
12033
12034 * process.c (make_process): Use printmax_t, not int, to format
12035 process-name gensyms.
12036
12037 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12038
12039 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12040 to avoid potential buffer overrun.
12041
12042 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12043 if X resource line is longer than 512 bytes.
12044
12045 * xfns.c (x_window): Make sprintf buffer a bit bigger
12046 to avoid potential buffer overrun.
12047
12048 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12049
12050 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12051
12052 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12053
12054 Integer overflow fixes for scrolling, etc.
12055 Without these, Emacs silently mishandles large integers sometimes.
12056 For example, "C-u 4294967297 M-x recenter" was treated as if
12057 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12058
12059 * xdisp.c (try_window_id): Check Emacs fixnum range before
12060 converting to 'int'.
12061
12062 * window.c (window_scroll_line_based, Frecenter):
12063 Check that an Emacs fixnum is in range before assigning it to 'int'.
12064 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12065 values converted from Emacs fixnums.
12066 (Frecenter): Don't wrap around a line count if it is out of 'int'
12067 range; instead, treat it as an extreme value.
12068 (Fset_window_configuration, compare_window_configurations):
12069 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12070
12071 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12072 that can exceed INT_MAX. Check that EMACS_INT value is in range
12073 before assigning it to the (possibly-narrower) index.
12074 (match_limit): Don't assume that a fixnum can fit in 'int'.
12075
12076 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12077 exceed INT_MAX.
12078
12079 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12080 (Fvertical_motion): Don't wrap around LINES values that don't fit
12081 in 'int'. Instead, treat them as extreme values. This is good
12082 enough for windows, which can't have more than INT_MAX lines anyway.
12083
12084 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12085
12086 * Require libxml/parser.h to avoid compilation warning.
12087
12088 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12089
12090 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12091 since this reportedly can destroy thread storage.
12092
12093 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12094
12095 * syntax.c (find_defun_start): Update all cache variables if
12096 exiting early (Bug#9401).
12097
12098 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12099
12100 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12101
12102 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12103 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12104 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12105
12106 * term.c (tty_append_glyph): New function.
12107 (produce_stretch_glyph): Static function and its prototype deleted.
12108
12109 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12110 Add prototypes.
12111
12112 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12113
12114 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12115 when checking :margin (Bug#9390).
12116 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12117 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12118 so that the name doesn't mislead. All uses changed.
12119
12120 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12121
12122 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12123 set_tty_hooks.
12124
12125 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12126
12127 * xdisp.c (move_it_to): Don't bail out early when reaching
12128 position beyond to_charpos, if we are scanning backwards.
12129 (move_it_vertically_backward): When DY == 0, make sure we get to
12130 the first character in the line after the newline.
12131
12132 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12133
12134 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12135 (ccl_driver): Do not generate an out-of-range pointer.
12136 (Fccl_execute_on_string): Remove unnecessary check for
12137 integer overflow, noted by Stefan Monnier in
12138 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12139 Remove a FIXME that didn't need fixing.
12140 Simplify the newly-introduced buffer reallocation code.
12141
12142 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12143
12144 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12145
12146 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12147
12148 Integer and memory overflow issues (Bug#9196).
12149
12150 * doc.c (get_doc_string): Rework so that
12151 get_doc_string_buffer_size is the actual buffer size, rather than
12152 being 1 less than the actual buffer size; this makes xpalloc more
12153 convenient.
12154
12155 * image.c (x_allocate_bitmap_record, cache_image):
12156 * xselect.c (Fx_register_dnd_atom):
12157 Simplify previous changes by using xpalloc.
12158
12159 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12160 since either will do and ptrdiff_t is convenient with xpalloc.
12161
12162 * charset.c (charset_table_size)
12163 (struct charset_sort_data.priority): Now ptrdiff_t.
12164 (charset_compare): Don't overflow if priorities differ greatly.
12165 (Fsort_charsets): Don't assume list length fits in int.
12166 Check for size-calculation overflow when allocating sort data.
12167 (syms_of_charset): Allocate an initial charset table that is
12168 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12169
12170 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12171
12172 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12173 The actual value is always <= INT_MAX, and leaving it unsigned made
12174 overflow checking harder.
12175
12176 * dispextern.h (struct glyph_matrix.rows_allocated)
12177 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12178 with xpalloc. The values are still always <= INT_MAX.
12179
12180 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12181
12182 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12183 (SAFE_NALLOCA): New macro.
12184
12185 * region-cache.c (struct boundary.pos, find_cache_boundary)
12186 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12187 (set_cache_region, invalidate_region_cache)
12188 (revalidate_region_cache, know_region_cache, region_cache_forward)
12189 (region_cache_backward, pp_cache):
12190 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12191 so that ptrdiff_t * can be passed to xpalloc.
12192 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12193 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12194 (pp_cache): Don't assume cache_len fits in int.
12195 * region-cache.h: Adjust extern decls to match.
12196
12197 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12198 EMACS_INT, since either will do, for xpalloc.
12199
12200 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12201 (xnmalloc, xnrealloc, xpalloc): New functions.
12202
12203 * bidi.c (bidi_shelve_header_size): New constant.
12204 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12205 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12206
12207 * bidi.c (bidi_cache_shrink):
12208 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12209 (overlay_strings):
12210 Don't update size of array until after memory allocation succeeds,
12211 because xmalloc/xrealloc may not return.
12212 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12213 now that we have proper integer overflow checking.
12214 (record_overlay_string, overlay_strings): Catch overflows when
12215 calculating size of overlay_str_buf.
12216
12217 * callproc.c (Fcall_process): Check for size overflow when
12218 calculating size of args2.
12219 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12220 Normally we prefer signed values, but sticking with ptrdiff_t would
12221 require adding more-complicated checks.
12222
12223 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12224 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12225 Redo buffer-overflow calculations to avoid integer overflow.
12226 Add a FIXME comment where memory seems to be over-allocated.
12227
12228 * character.c (Fstring): Check for size-calculation overflow.
12229
12230 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12231 unnecessary integer overflow. Check for size overflow.
12232 (encode_coding_object): Don't update size until xmalloc succeeds.
12233
12234 * composite.c (get_composition_id): Check for overflow in glyph
12235 length calculations.
12236
12237 Integer and memory overflow fixes for display code.
12238 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12239 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12240 (scrolling_window): Check for overflow in size calculations.
12241 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12242 Don't assume glyph table len fits in int.
12243 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12244 (row_table_size): Now ptrdiff_t, not int.
12245 (scrolling_window): Avoid overflow in size calculations.
12246 Don't update size until allocation succeeds.
12247 * fns.c (concat): Check for overflow in size calculations.
12248 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12249 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12250 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12251
12252 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12253 (get_doc_string): Check for size calculation overflow.
12254 Don't update size until allocation succeeds.
12255 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12256 EMACS_INT, where ptrdiff_t will do.
12257 (Fsubstitute_command_keys): Check for string overflow.
12258
12259 * editfns.c (set_time_zone_rule): Don't assume environment length
12260 fits in int.
12261 (message_length): Now ptrdiff_t, not int.
12262 (Fmessage_box): Don't update size until allocation succeeds.
12263 Don't assume message length fits in int.
12264 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12265
12266 * emacs.c (main): Do not reallocate argv, since there is a null at
12267 the end that can be overwritten, and this way there's no need to
12268 worry about size-calculation overflow.
12269 (sort_args): Check for size-calculation overflow.
12270
12271 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12272 alloc succeeds.
12273 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12274
12275 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12276 (x_set_scroll_bar_width, x_figure_window_size):
12277 Check for integer overflow.
12278 (x_set_alpha): Do not assume XINT fits in int.
12279
12280 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12281 This is for the members text_lines, text_cols, total_lines, total_cols,
12282 where the system imposes an 'int' limit.
12283
12284 * fringe.c (Fdefine_fringe_bitmap):
12285 Don't update size until alloc works.
12286
12287 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12288 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12289
12290 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12291 Check for size-calculation overflow.
12292 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12293 do, as we prefer signed integers.
12294 (id_to_widget.max_size, id_to_widget.used)
12295 (xg_store_widget_in_map, xg_remove_widget_from_map)
12296 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12297 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12298 Use and return ptrdiff_t, not int.
12299 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12300 * gtkutil.h: Change prototypes to match the above.
12301
12302 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12303 are duplicate now that they've been promoted to lisp.h.
12304 (x_allocate_bitmap_record, x_alloc_image_color)
12305 (make_image_cache, cache_image, xpm_load):
12306 Don't update size until alloc is done.
12307 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12308 (x_detect_edges):
12309 Check for size calculation overflow.
12310 (ct_colors_allocated_max): New constant.
12311 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12312 overflow.
12313
12314 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12315 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12316 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12317 Use ptrdiff_t, not int, to count maps.
12318 (read_char_minibuf_menu_prompt): Check for overflow in size
12319 calculations. Don't update size until allocation succeeds.
12320 Redo calculations to avoid overflow.
12321 * keyboard.h: Change prototypes to match the above.
12322
12323 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12324 to count maps.
12325 (current_minor_maps): Check for size calculation overflow.
12326 * keymap.h: Change prototypes to match the above.
12327
12328 * lread.c (read1, init_obarray): Don't update size until alloc done.
12329
12330 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12331 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12332
12333 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12334 Now ptrdiff_t, not int.
12335 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12336 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12337
12338 * process.c (Fnetwork_interface_list): Check for overflow
12339 in size calculation.
12340
12341 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12342
12343 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12344 overflow. Don't bother calling xmalloc when xrealloc will do.
12345
12346 * search.c (Freplace_match): Check for size calculation overflow.
12347 (Fset_match_data): Don't assume list lengths fit in 'int'.
12348
12349 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12350 for command line length. Do not attempt to address one before the
12351 beginning of an array, as that's not portable.
12352
12353 * term.c (max_frame_lines): Remove; unused.
12354 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12355 not int.
12356 (encode_terminal_code, calculate_costs): Check for size
12357 calculation overflow.
12358 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12359 table lengths and related sizes. Don't update size until alloc
12360 done. Redo calculations to avoid overflow.
12361 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12362
12363 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12364 subtracting pointers.
12365 (gobble_line): Check for overflow more carefully. Don't update size
12366 until alloc done.
12367
12368 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12369 Don't update size until alloc done.
12370 Redo size calculations to avoid overflow.
12371 Check for size calculation overflow.
12372 (main) [DEBUG]: Fix typo in invoking tparam1.
12373
12374 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12375 Use ptrdiff_t, not int, for sizes.
12376 (store_mode_line_noprop_char): Don't update size until alloc done.
12377
12378 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12379 Use ptrdiff_t, not int, for sizes.
12380 (Finternal_make_lisp_face, cache_face):
12381 Check for size calculation overflow.
12382 (cache_face): Treat size calculation overflows as if they were
12383 memory exhaustion (the usual treatment), rather than aborting.
12384
12385 * xfns.c (x_encode_text, x_set_name_internal)
12386 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12387 sizes, since they can exceed INT_MAX in size. Check for size
12388 calculation overflow.
12389
12390 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12391 (xg_select): Check for size calculation overflow.
12392 Don't update size until alloc done.
12393
12394 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12395 as sprintf is limited to int lengths.
12396
12397 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12398 (X_LONG_MIN): New macros.
12399 Use them to make the following changes clearer.
12400 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12401 This change doesn't affect the value now, but it may help remind
12402 future maintainers not to raise the value too much later.
12403 (SELECTION_QUANTUM): Remove, replacing with ...
12404 (selection_quantum): ... new function, which avoids overflow.
12405 All uses changed.
12406 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12407 assumption that selection length fits in 'int'.
12408 (x_reply_selection_request, x_handle_selection_request)
12409 (x_get_window_property, receive_incremental_selection)
12410 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12411 (lisp_data_to_selection_data, clean_local_selection_data):
12412 Use ptrdiff_t, not int, to record length of selection.
12413 (x_reply_selection_request, x_get_window_property)
12414 (receive_incremental_selection, x_property_data_to_lisp):
12415 Redo calculations to avoid overflow.
12416 (x_reply_selection_request): When sending hint, ceiling it at
12417 X_LONG_MAX rather than relying on wraparound overflow to send
12418 something.
12419 (x_get_window_property, receive_incremental_selection)
12420 (lisp_data_to_selection_data, x_property_data_to_lisp):
12421 Check for size-calculation overflow.
12422 (x_get_window_property, receive_incremental_selection)
12423 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12424 Don't store size until memory allocation succeeds.
12425 (x_get_window_property): Plug memory leak on memory exhaustion.
12426 Don't double-block input; malloc is safe here. Don't assume 2**34
12427 - 4 fits in unsigned long. Add an xassert to check
12428 XGetWindowProperty overflow. Be more careful about overflow
12429 calculations, and distinguish size from memory overflow better.
12430 (receive_incremental_selection): When tracing, don't assume
12431 unsigned int is less than INT_MAX.
12432 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12433 harmful) conversions of unsigned short to int.
12434 (lisp_data_to_selection_data): Don't assume that integers
12435 in the range -65535 through -1 fit in an X unsigned short.
12436 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12437 result parameters unless successful. Rely on cons_to_unsigned
12438 to report problems with elements; the old code wasn't right anyway.
12439 (x_check_property_data): Check for int overflow; we cannot use
12440 a wider type due to X limits.
12441 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12442
12443 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12444
12445 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12446 (x_term_init): Check for size calculation overflow.
12447 (x_color_cells): Don't store size until memory allocation succeeds.
12448 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12449 Don't assume alloca size is less than MAX_ALLOCA.
12450 (x_term_init): Don't assume length fits in int (sprintf is limited
12451 to int size).
12452
12453 Use ptrdiff_t for composition IDs.
12454 * character.c (lisp_string_width):
12455 * composite.c (composition_table_size, n_compositions)
12456 (get_composition_id, composition_gstring_from_id):
12457 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12458 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12459 * window.c (Frecenter):
12460 Use ptrdiff_t, not int, for composition IDs.
12461 * composite.c (get_composition_id): Check for integer overflow.
12462 * composite.h: Adjust prototypes to match the above changes.
12463
12464 Use ptrdiff_t for hash table indexes.
12465 * category.c (hash_get_category_set):
12466 * ccl.c (ccl_driver):
12467 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12468 * coding.c (coding_system_charset_list, detect_coding_system):
12469 * coding.h (struct coding_system.id):
12470 * composite.c (get_composition_id, gstring_lookup_cache):
12471 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12472 * image.c (xpm_get_color_table_h):
12473 * lisp.h (hash_lookup, hash_put):
12474 * minibuf.c (Ftest_completion):
12475 Use ptrdiff_t for hash table indexes, not int (which is too
12476 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12477 32-bit --with-wide-int hosts).
12478
12479 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12480 Add a FIXME comment about memory leaks.
12481 (syms_of_charset): Don't assume xmalloc returns.
12482
12483 Don't assume that stated character widths fit in int.
12484 * character.c (Fchar_width, c_string_width, lisp_string_width):
12485 * character.h (CHAR_WIDTH):
12486 * indent.c (MULTIBYTE_BYTES_WIDTH):
12487 Use sanitize_char_width to avoid undefined and/or bad behavior
12488 with outlandish widths.
12489 * character.h (sanitize_tab_width): Rename from sanitize_width,
12490 now that we have two such functions. All uses changed.
12491 (sanitize_char_width): New inline function.
12492
12493 Don't assume that tab-width fits in int.
12494 * character.h (sanitize_width): New inline function.
12495 (SANE_TAB_WIDTH): New macro.
12496 (ASCII_CHAR_WIDTH): Use it.
12497 * indent.c (sane_tab_width): Remove. All uses replaced by
12498 SANE_TAB_WIDTH (current_buffer).
12499 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12500
12501 * fileio.c: Integer overflow issues with file modes.
12502 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12503
12504 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12505 Remove unreachable code.
12506 (read_hex, load_charset_map_from_file): Check for integer overflow.
12507
12508 * xterm.c: Don't go over XClientMessageEvent limit.
12509 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12510 (x_send_scroll_bar_event): Likewise. Check that the size does not
12511 exceed limits imposed by XClientMessageEvent, as well as the usual
12512 ptrdiff_t and size_t limits.
12513
12514 * keyboard.c: Overflow, signedness and related fixes.
12515 (make_lispy_movement): Use same integer type in forward decl
12516 that is used in the definition.
12517 (read_key_sequence, keyremap_step):
12518 Change bufsize argument back to int, undoing my 2011-03-30 change.
12519 We prefer signed types, and int is wide enough here.
12520 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12521 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12522 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12523 length, not size_t. Use ptrdiff_t for index, not int.
12524 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12525 possibility of integer overflow.
12526
12527 Overflow, signedness and related fixes for images.
12528
12529 * dispextern.h (struct it.stack[0].u.image.image_id)
12530 (struct_it.image_id, struct image.id, struct image_cache.size)
12531 (struct image_cache.used, struct image_cache.ref_count):
12532 * gtkutil.c (update_frame_tool_bar):
12533 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12534 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12535 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12536 * nsmenu.m (update_frame_tool_bar):
12537 * xdisp.c (calc_pixel_width_or_height):
12538 * xfns.c (image_cache_refcount):
12539 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12540 on typical 64-bit hosts.
12541
12542 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12543 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12544 Omit unnecessary casts to int.
12545 (parse_image_spec): Check that integers fall into 'int' range
12546 when the callers expect that.
12547 (image_ascent): Redo ascent calculation to avoid int overflow.
12548 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12549 (lookup_image): Remove unnecessary tests.
12550 (xbm_image_p): Locals are now of int, not EMACS_INT,
12551 since parse_image_check makes sure they fit into int.
12552 (png_load, gif_load, svg_load_image):
12553 Prefer int to unsigned where either will do.
12554 (tiff_handler): New function, combining the cores of the
12555 old tiff_error_handler and tiff_warning_handler.
12556 This function is rewritten to use vsnprintf and thereby avoid
12557 stack buffer overflows. It uses only the features of vsnprintf
12558 that are common to both POSIX and native Microsoft.
12559 (tiff_error_handler, tiff_warning_handler): Use it.
12560 (tiff_load, gif_load, imagemagick_load_image):
12561 Don't assume :index value fits in 'int'.
12562 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12563 (imagemagick_load_image): Check that crop parameters fit into
12564 the integer types that MagickCropImage accepts. Don't assume
12565 Vimagemagick_render_type has a nonnegative value. Don't assume
12566 size_t fits in 'long'.
12567 (gs_load): Use printmax_t to print the widest integers possible.
12568 Check for integer overflow when computing image height and width.
12569
12570 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12571
12572 * xdisp.c (redisplay_window): Don't force window start if point
12573 will be invisible in the resulting window. (Bug#9324)
12574
12575 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12576
12577 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12578 the display spec is of the form `(space ...)'.
12579 (handle_display_spec): Return the value returned by
12580 handle_single_display_spec, not just 1 or zero.
12581 (handle_single_display_spec): If the display spec is of the form
12582 `(space ...)', and specifies display in the text area, return 2
12583 rather than 1.
12584 (try_cursor_movement): Check for the need to scroll more
12585 accurately, and prefer exact match for point under bidi.
12586 Don't advance `row' beyond the last row of the window.
12587
12588 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12589 into disp_prop; all users changed.
12590
12591 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12592 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12593 for the text covered by the display property.
12594
12595 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12596
12597 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12598 Change return value to nil.
12599 (Frecord_buffer): Delete unused function.
12600
12601 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12602
12603 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12604 buffers, return left-to-right.
12605 (set_cursor_from_row): Consider candidate row a win if its glyph
12606 represents a newline and point is on that newline. Fixes cursor
12607 positioning on the newline at EOL of R2L text within L2R
12608 paragraph, and vice versa.
12609 (try_cursor_movement): Check continued rows, in addition to
12610 continuation rows. Fixes unwarranted scroll when point enters a
12611 continued line of R2L text within an L2R paragraph, or vice versa.
12612 (cursor_row_p): Consider the case of point being equal to
12613 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12614 from the end of a short line to the beginning of a continued line
12615 of R2L text within L2R paragraph.
12616 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12617 composed characters.
12618
12619 * bidi.c (bidi_check_type): Use xassert.
12620 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12621 members.
12622
12623 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12624
12625 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12626 a character.
12627
12628 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12629
12630 * nsfont.m (ns_otf_to_script): Fix typo.
12631
12632 2011-08-22 Kenichi Handa <handa@m17n.org>
12633
12634 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12635 extra slot even if the purpose is char-code-property-table.
12636
12637 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12638
12639 * xdisp.c (redisplay_window): When computing centering_position,
12640 account for the height of the header line. (Bug#8874)
12641
12642 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12643 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12644 candidate is selected by the mouse, and that candidate has a
12645 composed character under the mouse.
12646
12647 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12648 coordinates reported by pos-visible-in-window-p for a composed
12649 character in column zero.
12650
12651 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12652
12653 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12654
12655 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12656
12657 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12658 consider it a hit if to_charpos is anywhere in the range of the
12659 composed buffer positions.
12660
12661 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12662
12663 * image.c (gif_load): Don't assume that each subimage has the same
12664 dimensions as the base image. Handle disposal method that is
12665 "undefined" by the gif spec (Bug#9335).
12666
12667 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12668
12669 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12670 (Fcondition_case): Document `debug' symbol in error handler.
12671
12672 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12673
12674 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12675 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12676 from an Org mode buffer to a Speedbar frame.
12677
12678 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12679 a composition, take its buffer position from IT->cmp_it.charpos.
12680 Fixes cursor positioning at the beginning of a line that begins
12681 with a composed character.
12682
12683 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12684
12685 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12686 character bidirectional type, use STRONG_L instead. Fixes crashes
12687 in a buffer produced by `describe-categories'.
12688
12689 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12690 members before the level stack, so they would be saved and
12691 restored when copying iterator state. Fixes incorrect reordering
12692 around TABs covered by display properties.
12693
12694 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12695
12696 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12697
12698 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12699
12700 * eval.c (internal_condition_case, internal_condition_case_1)
12701 (internal_condition_case_2, internal_condition_case_n):
12702 Remove unnecessary aborts (Bug#9081).
12703
12704 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12705
12706 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12707 has no `load' handler, try opening the file locally. (Bug#9311)
12708
12709 2011-08-16 Ken Brown <kbrown@cornell.edu>
12710
12711 * gmalloc.c: Expand comment.
12712
12713 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12714
12715 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12716 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12717
12718 2011-08-16 Ken Brown <kbrown@cornell.edu>
12719
12720 Fix memory allocation problems in Cygwin build (Bug#9273).
12721
12722 * unexcw.c ( __malloc_initialized): Declare external variable.
12723 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12724
12725 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12726 New variables.
12727 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12728 dumped emacs.
12729 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12730 in the static heap.
12731 [CYGWIN] (special_realloc): New function.
12732 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12733 requests to realloc storage in the static heap.
12734
12735 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12736
12737 * bidi.c (bidi_initialize): Remove unused local.
12738
12739 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12740
12741 * bidimirror.h:
12742 * biditype.h: Remove file.
12743 * makefile.w32-in ($(BLD)/bidi.$(O)):
12744 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12745
12746 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12747
12748 * chartab.c: Improve commentary for the uniprop_table API.
12749
12750 * bidi.c (bidi_paragraph_init): Support zero value of
12751 bidi_ignore_explicit_marks_for_paragraph_level.
12752 (bidi_initialize): Use uniprop_table instead of including
12753 biditype.h and bidimirror.h.
12754
12755 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12756 coordinates of the iterator when restoring from ppos_it.
12757 (Bug#9296)
12758
12759 2011-08-14 Kenichi Handa <handa@m17n.org>
12760
12761 * process.c (create_process): Call setup_process_coding_systems
12762 after the pid of the process is set to -1 (Bug#8162).
12763
12764 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12765
12766 * xdisp.c (move_it_in_display_line_to): Don't invoke
12767 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12768 ppos_it. Fixes vertical cursor motion when line beginning is
12769 covered by an image. (Bug#9296)
12770
12771 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12772
12773 * nsterm.h (ns_run_ascript): Declare.
12774 (NSAPP_DATA2_RUNASSCRIPT): Define.
12775
12776 * nsfns.m (as_script, as_result, as_status): New static variables.
12777 (ns_run_ascript): New function.
12778 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12779 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12780 the event loop. Get status from as_status (Bug#7276).
12781
12782 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12783 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12784 the event loop (Bug#7276).
12785
12786 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12787
12788 * gnutls.c (QCgnutls_bootprop_priority)
12789 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12790 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12791 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12792 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12793 (QCgnutls_bootprop_verify_hostname_error)
12794 (QCgnutls_bootprop_callbacks_verify): Rename from
12795 Qgnutls_bootprop_..., all uses changed.
12796
12797 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12798 uses changed.
12799
12800 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12801
12802 * xfaces.c (Qframe_set_background_mode): Now static.
12803 * dispextern.h (Qframe_set_background_mode): Remove decl.
12804
12805 * process.c (Fnetwork_interface_info): Declare local only if needed.
12806
12807 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12808
12809 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12810 (Fnetwork_interface_list): Allocate in increments of bytes instead
12811 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12812 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12813 sockaddr.
12814 (struct ifflag_def): notrailers is smart on OSX.
12815 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12816 Get hardware address with getifaddrs if available.
12817
12818 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12819
12820 * xdisp.c (iterate_out_of_display_property): xassert that
12821 IT->position is set to within IT->object's boundaries. Break from
12822 the loop as soon as EOB is reached; avoids infloops in redisplay
12823 when IT->position is set up wrongly due to some bug.
12824 Set IT->current to match the bidi iterator unconditionally.
12825 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12826 entry. Force push_it to save on the stack the current
12827 buffer/string position, to be restored by pop_it. Fix flags in
12828 the iterator structure wrt the object coming from a display
12829 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12830 properties. (Bug#9284)
12831
12832 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12833
12834 * fontset.c (fontset_get_font_group): Add proper type checks.
12835 (Bug#9172)
12836
12837 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12838
12839 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12840 and LC_VERSION_MIN_MACOSX.
12841 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12842 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12843
12844 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12845
12846 * xdisp.c (forward_to_next_line_start): Allow to use the
12847 no-display-properties-and-no-overlays under bidi display.
12848 Set disp_pos in the bidi iterator to avoid searches for display
12849 properties and overlays.
12850
12851 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12852
12853 * editfns.c (Fset_time_zone_rule): Document relationship with the
12854 setenv function.
12855
12856 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12857 the font entity extracted from the cache (Bug#8109).
12858
12859 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12860
12861 * composite.c (autocmp_chars): Don't reset point. That is done by
12862 restore_point_unwind (Bug#5984).
12863
12864 2011-08-07 Juri Linkov <juri@jurta.org>
12865
12866 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12867 to show the arg `TIME' instead of `TIMEVAL'.
12868
12869 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12870
12871 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12872 display property strides EOL and includes a newline, as in
12873 longlines-mode. (Bug#9254)
12874 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12875 word-wrap under bidirectional display. (Bug#9224)
12876
12877 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12878 is non-zero, even if the data buffer is NULL. Fixes a crash in
12879 vertical-motion with longlines-mode. (Bug#9254)
12880
12881 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12882
12883 * bidi.c <bidi_cache_total_alloc>: Now static.
12884 (bidi_initialize): Initialize bidi_cache_total_alloc.
12885
12886 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12887 cache. (Bug#9221)
12888
12889 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12890 amount allocated this far in `bidi_cache_total_alloc'.
12891 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12892 non-zero, only free the data buffer without restoring the cache
12893 contents. All callers changed.
12894
12895 * dispextern.h (bidi_unshelve_cache): Update prototype.
12896
12897 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12898 (move_it_in_display_line, move_it_to)
12899 (move_it_vertically_backward, move_it_by_lines): Replace the call
12900 to xfree to an equivalent call to bidi_unshelve_cache.
12901 (move_it_in_display_line_to): Fix logic of returning
12902 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12903
12904 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12905
12906 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12907 came from a string character with a `cursor' property. (Bug#9229)
12908
12909 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12910
12911 * Makefile.in (LIB_PTHREAD): New variable.
12912 (LIBES): Add LIB_PTHREAD (Bug#9216).
12913
12914 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12915 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12916
12917 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12918
12919 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12920
12921 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12922
12923 * xterm.c (x_find_topmost_parent): New function.
12924 (x_set_frame_alpha): Find topmost parent window with
12925 x_find_topmost_parent and set the property there also (bug#9181).
12926 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12927
12928 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12929
12930 * callproc.c (Fcall_process): Avoid vfork clobbering
12931 the local vars buffer, coding_systems, current_dir.
12932
12933 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12934
12935 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12936
12937 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12938
12939 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12940 so that it is not optimized away.
12941
12942 * xdisp.c (compute_display_string_pos): Remove unused local.
12943
12944 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12945
12946 Fix slow cursor motion and scrolling in large buffers with
12947 selective display, like Org Mode buffers. (Bug#9218)
12948
12949 * dispextern.h (struct bidi_it): New member disp_prop_p.
12950
12951 * xdisp.c: Remove one-slot cache of display string positions.
12952 (compute_display_string_pos): Accept an additional argument
12953 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12954 for a display string or property. If found, set DISP_PROP_P
12955 non-zero.
12956
12957 * bidi.c (bidi_fetch_char): Accept an additional argument
12958 DISP_PROP_P, and pass it to compute_display_string_pos.
12959 Only handle text covered by a display string if DISP_PROP_P is returned
12960 non-zero. All callers of bidi_fetch_char changed.
12961
12962 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12963
12964 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12965
12966 2010-12-03 Don March <don@ohspite.net>
12967
12968 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12969 last character M-[char] is translated to ESC [char] (bug#7541).
12970
12971 2011-08-02 Kenichi Handa <handa@m17n.org>
12972
12973 * lisp.h (uniprop_table): Extern it.
12974
12975 * chartab.c (uniprop_table): Make it non-static.
12976
12977 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12978
12979 * xdisp.c (forward_to_next_line_start): Accept additional argument
12980 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12981 on the newline.
12982 (reseat_at_next_visible_line_start): Use the bidi iterator state
12983 returned by forward_to_next_line_start to restore the state of
12984 it->bidi_it after backing up to previous newline. (Bug#9212)
12985
12986 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12987
12988 * regex.c (re_comp): Protoize.
12989 (re_exec): Fix return type.
12990 (regexec): Fix type of `ret'. (Bug#9203)
12991
12992 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12993
12994 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12995 This is needed if max-image-size is a floating-point number.
12996
12997 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12998
12999 * print.c (print_object): Print empty symbol as ##.
13000
13001 * lread.c (read1): Read ## as empty symbol.
13002
13003 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13004
13005 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13006 setting frame foreground color (Bug#9175).
13007 (x_set_background_color): Likewise.
13008
13009 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13010 contents (Bug#9176).
13011 (EmacsTooltip -init): Remove bezels and add shadows to
13012 tooltip windows.
13013
13014 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13015 or scroll bar (Bug#8470).
13016
13017 * nsfont.m (nsfont_open): Remove assignment to voffset and
13018 unnecessary vars hshink, expand, hd, full_height, min_height.
13019 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13020
13021 * nsterm.h (nsfont_info): Remove voffset field.
13022
13023 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13024
13025 Implement strike-through and overline on NextStep (Bug#8863).
13026
13027 * nsfont.m (nsfont_open): Use underline position provided by font,
13028 instead of hard-coded value of 2.
13029 (nsfont_draw): Call ns_draw_text_decoration instead.
13030
13031 * nsterm.h: Add declaration for ns_draw_text_decoration.
13032
13033 * nsterm.m (ns_draw_text_decoration): New function for drawing
13034 underline, overline, and strike-through.
13035 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13036 ns_draw_text_decoration. Change treatment of cursor drawing to
13037 accommodate underlining, etc.
13038
13039 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13040
13041 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13042 default.
13043
13044 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13045
13046 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13047 Without this fix, if a signal arrives just after memory fills up,
13048 'malloc' might be invoked reentrantly.
13049
13050 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13051 In other words, assume that every image size is allowed, on non-X
13052 hosts. This assumption is probably wrong, but it lets Emacs compile.
13053
13054 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13055
13056 * regex.c (re_iswctype): Convert return values to boolean.
13057
13058 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13059
13060 * xdisp.c (compute_display_string_pos): Don't use cached display
13061 string position if the buffer had its restriction changed.
13062 (Bug#9184)
13063
13064 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13065
13066 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13067
13068 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13069
13070 Integer signedness and overflow and related fixes. (Bug#9079)
13071
13072 * bidi.c: Integer size and overflow fixes.
13073 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13074 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13075 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13076 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13077 (bidi_find_other_level_edge):
13078 Use ptrdiff_t instead of EMACS_INT where either will do.
13079 This works better on 32-bit hosts configured --with-wide-int.
13080 (bidi_cache_ensure_space): Check for size-calculation overflow.
13081 Use % rather than repeated addition, for better worst-case speed.
13082 Don't set bidi_cache_size until after xrealloc returns, because it
13083 might not return.
13084 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13085 (bidi_cache_ensure_space): Also check that the bidi cache size
13086 does not exceed that of the largest Lisp string or buffer. See Eli
13087 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13088
13089 * alloc.c (__malloc_size_t): Remove.
13090 All uses replaced by size_t. See Andreas Schwab's note
13091 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13092
13093 * image.c: Improve checking for integer overflow.
13094 (check_image_size): Assume that f is nonnull, since
13095 it is always nonnull in practice. This is one less thing to
13096 worry about when checking for integer overflow later.
13097 (x_check_image_size): New function, which checks for integer
13098 overflow issues inside X.
13099 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13100 This removes the need for a memory_full check.
13101 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13102 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13103 (xbm_read_bitmap_data): Change locals back to 'int', since
13104 their values must fit in 'int'.
13105 (xpm_load_image, png_load, tiff_load):
13106 Invoke x_create_x_image_and_pixmap earlier,
13107 to avoid much needless work if the image is too large.
13108 (tiff_load): Treat overly large images as if
13109 x_create_x_image_and_pixmap failed, not as malloc failures.
13110 (gs_load): Use x_check_image_size.
13111
13112 * gtkutil.c: Omit integer casts.
13113 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13114 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13115
13116 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13117
13118 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13119 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13120 would wrongly return t on a 64-bit host.
13121
13122 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13123 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13124 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13125 and therefore cause GCC to emit a bogus diagnostic in some cases.
13126
13127 * image.c: Integer signedness and overflow and related fixes.
13128 This is not an exhaustive set of fixes, but it's time to
13129 record what I've got.
13130 (lookup_pixel_color, check_image_size): Remove redundant decls.
13131 (check_image_size): Don't assume that arbitrary EMACS_INT values
13132 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13133 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13134 (tiff_load, imagemagick_load_image):
13135 Check for overflow in size calculations.
13136 (x_create_x_image_and_pixmap): Remove unnecessary test for
13137 xmalloc returning NULL; that can't happen.
13138 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13139 (xpm_color_bucket): Use better integer hashing function.
13140 (xpm_cache_color): Don't possibly over-allocate memory.
13141 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13142 (gif_memory_source):
13143 Use ptrdiff_t, not int or size_t, to record sizes.
13144 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13145 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13146 either works, as we prefer signed integers.
13147 (tiff_read_from_memory, tiff_write_from_memory):
13148 Return tsize_t, not size_t, since that's what the TIFF API wants.
13149 (tiff_read_from_memory): Don't fail simply because the read would
13150 go past EOF; instead, return a short read.
13151 (tiff_load): Omit no-longer-needed casts.
13152 (Fimagemagick_types): Don't assume size fits into 'int'.
13153
13154 Improve hashing quality when configured --with-wide-int.
13155 * fns.c (hash_string): New function, taken from sxhash_string.
13156 Do not discard information about ASCII character case; this
13157 discarding is no longer needed.
13158 (sxhash-string): Use it. Change sig to match it. Caller changed.
13159 * lisp.h: Declare it.
13160 * lread.c (hash_string): Remove, since we now use fns.c's version.
13161 The fns.c version returns a wider integer if --with-wide-int is
13162 specified, so this should help the quality of the hashing a bit.
13163
13164 * emacs.c: Integer overflow minor fix.
13165 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13166 Define only if GNU_LINUX.
13167 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13168
13169 * dispnew.c: Integer signedness and overflow fixes.
13170 Remove unnecessary forward decls, that were a maintenance hassle.
13171 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13172 All uses changed.
13173 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13174 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13175 (prepare_desired_row, line_draw_cost):
13176 Use int, not unsigned, where either works.
13177 (save_current_matrix, restore_current_matrix):
13178 Use ptrdiff_t, not size_t, where either works.
13179 (init_display): Check for overflow more accurately, and without
13180 relying on undefined behavior.
13181
13182 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13183 Remove, replacing with the new symbols in lisp.h. All uses changed.
13184 * fileio.c (make_temp_name):
13185 * filelock.c (lock_file_1, lock_file):
13186 * xdisp.c (message_dolog):
13187 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13188 Use pMd etc. instead.
13189 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13190 replacing the pWIDE etc. symbols removed from editfns.c.
13191
13192 * keyboard.h (num_input_events): Now uintmax_t.
13193 This is (very slightly) less likely to mess up due to wraparound.
13194 All uses changed.
13195
13196 * buffer.c: Integer signedness fixes.
13197 (alloc_buffer_text, enlarge_buffer_text):
13198 Use ptrdiff_t rather than size_t when either will do, as we prefer
13199 signed integers.
13200
13201 * alloc.c: Integer signedness and overflow fixes.
13202 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13203 (__malloc_size_t): Default to size_t, not to int.
13204 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13205 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13206 Prefer ptrdiff_t to size_t when either would do, as we prefer
13207 signed integers.
13208 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13209 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13210 Now const. Initialize with values that are in range even if char
13211 is signed.
13212 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13213 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13214 These functions do the right thing with sizes > 2**32.
13215 (check_depth): Now ptrdiff_t, not int.
13216 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13217 Adjust to new way of storing sizes. Check for size overflow bugs
13218 in rest of code.
13219 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13220 slightly wrong anyway, as it missed one instance of
13221 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13222 (refill_memory_reserve): Omit needless cast to size_t.
13223 (mark_object_loop_halt): Mark as externally visible.
13224
13225 * xselect.c: Integer signedness and overflow fixes.
13226 (Fx_register_dnd_atom, x_handle_dnd_message):
13227 Use ptrdiff_t, not size_t, since we prefer signed.
13228 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13229 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13230 x_dnd_atoms_size and x_dnd_atoms_length.
13231
13232 * doprnt.c: Prefer signed to unsigned when either works.
13233 * eval.c (verror):
13234 * doprnt.c (doprnt):
13235 * lisp.h (doprnt):
13236 * xdisp.c (vmessage):
13237 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13238 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13239 prefer signed arithmetic to avoid comparison confusion.
13240 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13241 but is a bit tricky.
13242
13243 Assume freestanding C89 headers, string.h, stdlib.h.
13244 * data.c, doprnt.c, floatfns.c, print.c:
13245 Include float.h unconditionally.
13246 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13247 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13248 * regex.c: Likewise for stddef.h, string.h.
13249 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13250 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13251 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13252 (STDC_HEADERS): Remove obsolete defines.
13253 * sysdep.c: Include limits.h unconditionally.
13254
13255 Assume support for memcmp, memcpy, memmove, memset.
13256 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13257 * regex.c (memcmp, memcpy):
13258 Remove; we assume C89 now.
13259
13260 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13261 (__malloc_safe_bcopy): Remove; no longer needed.
13262
13263 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13264 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13265 well either way, and we prefer signed to unsigned.
13266
13267 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13268
13269 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13270 closes the connection while we're reading (bug#9182).
13271
13272 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13273
13274 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13275 are specified (Bug#9168).
13276
13277 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13278
13279 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13280 Found by GCC static checking and --with-wide-int on a 32-bit host.
13281
13282 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13283
13284 * xdisp.c (compute_display_string_pos): Fix logic of caching
13285 previous display string position. Initialize cached_prev_pos to
13286 -1. Fixes slow-down at the beginning of a buffer.
13287
13288 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13289
13290 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13291 for attrs[LFACE_FONTSET_INDEX].
13292
13293 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13294
13295 * xml.c (parse_region): Remove unused local
13296 that was recently introduced.
13297
13298 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13299
13300 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13301 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13302
13303 * xdisp.c (move_it_in_display_line_to): Record the best matching
13304 position for TO_CHARPOS while scanning the line, and restore it on
13305 exit if none of the characters scanned was an exact match.
13306 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13307 when exact match is impossible due to invisible text, and the
13308 lines are truncated.
13309
13310 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13311
13312 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13313 for OSX >= 10.7.
13314
13315 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13316
13317 Fix a significant slow-down of cursor motion with C-n, C-p,
13318 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13319 auto-repeat under bidi redisplay in fontified buffers.
13320 * xdisp.c (compute_stop_pos_backwards): New function.
13321 (next_element_from_buffer): Call compute_stop_pos_backwards to
13322 find a suitable prev_stop when we find ourselves before
13323 base_level_stop.
13324 (reseat): Don't look for prev_stop, as that could mean a very long
13325 run.
13326 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13327 <cached_disp_overlay_modiff>: Cache for last found display string
13328 position.
13329 (compute_display_string_pos): Return the cached position if asked
13330 about the same buffer in the same area of character positions, and
13331 the buffer wasn't changed since the time the display string
13332 position was cached.
13333
13334 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13335
13336 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13337 is an integer, which is important for empty lines. (Bug#9149)
13338
13339 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13340
13341 * frame.c (Fmodify_frame_parameters): In tty case, update the
13342 default face if necessary (Bug#4238).
13343
13344 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13345
13346 * editfns.c (Fstring_to_char): No need to explain what a character
13347 is in the docstring (Bug#6576).
13348
13349 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13350
13351 * xml.c (parse_region): Make sure we always return a tree.
13352
13353 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13354
13355 * xml.c (parse_region): If a document contains only comments,
13356 return that, too.
13357
13358 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13359
13360 * xml.c (make_dom): Return comments, too.
13361
13362 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13363
13364 Port to OpenBSD.
13365 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13366 and the surrounding thread.
13367 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13368 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13369 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13370 timer goes off.
13371 * s/openbsd.h (BROKEN_SIGIO): Define.
13372 * unexelf.c (unexec) [__OpenBSD__]:
13373 Don't update the .mdebug section of the Alpha COFF symbol table.
13374
13375 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13376
13377 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13378 (bug#8460).
13379
13380 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13381
13382 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13383 This fixes some race conditions on the permissions of any newly
13384 created file.
13385
13386 * alloc.c (valid_pointer_p): Use pipe, not open.
13387 This fixes some permissions issues when debugging.
13388
13389 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13390 If fchown fails to set both uid and gid, try to set just gid,
13391 as that is sometimes allowed. Adjust the file's mode to eliminate
13392 setuid or setgid bits that are inappropriate if fchown fails.
13393
13394 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13395
13396 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13397 to compare Lisp_Objects.
13398 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13399 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13400 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13401
13402 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13403
13404 * lread.c (read_integer): Unread even EOF character.
13405 (read1): Likewise. Properly record start position of symbol.
13406
13407 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13408 symbol character follows.
13409
13410 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13411
13412 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13413 This works around a problem with the previous change to Fcopy_file.
13414 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13415 and without this change, GCC might complain about discarding
13416 fchown's return value.
13417
13418 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13419
13420 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13421
13422 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13423
13424 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13425
13426 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13427
13428 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13429 it's used from the C level.
13430
13431 * process.c: Use the same condition for POLL_FOR_INPUT in both
13432 keyboard.c and process.c (bug#1858).
13433
13434 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13435
13436 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13437 (Fgnutls_boot): Use it.
13438
13439 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13440
13441 * doc.c (Fsubstitute_command_keys): Revert last change.
13442
13443 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13444
13445 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13446 quotes the next character, and doesn't affect other longer
13447 sequences (bug#8935).
13448
13449 * lread.c (syms_of_lread): Clarify that is isn't only
13450 `eval-buffer' and `eval-defun' that's affected by
13451 `lexical-binding' (bug#8460).
13452
13453 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13454
13455 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13456 bidi redisplay when a line includes both an image and is truncated.
13457
13458 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13459
13460 Fix minor problems found by static checking.
13461 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13462 (elsz): Now a signed constant, not a size_t var. We prefer signed
13463 types to unsigned, to avoid integer comparison confusion. Without
13464 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13465 "cannot optimize loop, the loop counter may overflow", a symptom
13466 of the confusion.
13467 * indent.c (Fvertical_motion): Mark locals as initialized.
13468 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13469
13470 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13471
13472 * search.c (Fre_search_backward): Mention `case-fold-search' in
13473 all the re_search_* functions (bug#8138).
13474
13475 * keyboard.c (Fopen_dribble_file): Document when the file is
13476 closed (bug#8056).
13477
13478 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13479
13480 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13481 bidi_cache_idx.
13482
13483 Support bidi reordering of display and overlay strings.
13484 * xdisp.c (compute_display_string_pos)
13485 (compute_display_string_end): Accept additional argument STRING.
13486 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13487 (reseat_to_string): Initialize bidi_it->string.s and
13488 bidi_it->string.schars.
13489 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13490 NULL (avoids a crash in bidi_paragraph_init).
13491 Initialize itb.string.lstring.
13492 (init_iterator): Call bidi_init_it only of a valid
13493 buffer position was specified. Initialize paragraph_embedding to
13494 L2R.
13495 (reseat_to_string): Initialize the bidi iterator.
13496 (display_string): If we need to ignore text properties of
13497 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13498 original value of -1 will not work with bidi.)
13499 (compute_display_string_pos): First arg is now struct
13500 `text_pos *'; all callers changed. Support display properties on
13501 Lisp strings.
13502 (compute_display_string_end): Support display properties on Lisp
13503 strings.
13504 (init_iterator, reseat_1, reseat_to_string): Initialize the
13505 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13506 when iterating on a string not from display properties).
13507 (compute_display_string_pos, compute_display_string_end):
13508 Fix calculation of the object to scan. Fixes an error when using
13509 arrow keys.
13510 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13511 base_level_stop; instead, set base_level_stop to BEGV.
13512 Fixes crashes in vertical-motion.
13513 (next_element_from_buffer): Improve commentary for when
13514 the iterator is before prev_stop.
13515 (init_iterator): Initialize bidi_p from the default value of
13516 bidi-display-reordering, not from buffer-local value. Use the
13517 buffer-local value only if initializing for buffer iteration.
13518 (handle_invisible_prop): Support invisible properties on strings
13519 that are being bidi-reordered.
13520 (set_iterator_to_next): Support bidi reordering of C strings and
13521 Lisp strings.
13522 (next_element_from_string): Support bidi reordering of Lisp
13523 strings.
13524 (handle_stop_backwards): Support Lisp strings as well.
13525 (display_string): Support display of R2L glyph rows.
13526 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13527 (init_iterator): Don't initialize it->bidi_p for strings
13528 here.
13529 (reseat_to_string): Initialize it->bidi_p for strings here.
13530 (next_element_from_string, next_element_from_c_string)
13531 (next_element_from_buffer): Add xassert's for correspondence
13532 between IT's object being iterated and it->bidi_it.string
13533 structure.
13534 (face_before_or_after_it_pos): Support bidi iteration.
13535 (next_element_from_c_string): Handle the case of the first string
13536 character that is not the first one in the visual order.
13537 (get_visually_first_element): New function, refactored from common
13538 parts of next_element_from_buffer, next_element_from_string, and
13539 next_element_from_c_string.
13540 (tool_bar_lines_needed, redisplay_tool_bar)
13541 (display_menu_bar): Force left-to-right direction. Add a FIXME
13542 comment for making that be controlled by a user option.
13543 (push_it, pop_it): Save and restore the state of the
13544 bidi iterator. Save and restore the bidi_p flag.
13545 (pop_it): Iterate out of display property for string iteration as
13546 well.
13547 (iterate_out_of_display_property): Support iteration over strings.
13548 (handle_single_display_spec): Set up it->bidi_it for iteration
13549 over a display string, and call bidi_init_it.
13550 (handle_single_display_spec, next_overlay_string)
13551 (get_overlay_strings_1, push_display_prop): Set up the bidi
13552 iterator for displaying display or overlay strings.
13553 (forward_to_next_line_start): Don't use the shortcut if
13554 bidi-iterating.
13555 (back_to_previous_visible_line_start): If handle_display_prop
13556 pushed the iterator stack, restore the internal state of the bidi
13557 iterator by calling bidi_pop_it same number of times.
13558 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13559 and we are bidi-iterating, don't decrement the iterator position;
13560 instead, set the first_elt flag in the bidi iterator, to produce
13561 the same effect.
13562 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13563 (push_display_prop): xassert that we are iterating a buffer.
13564 (push_it, pop_it): Save and restore paragraph_embedding member.
13565 (handle_single_display_spec, next_overlay_string)
13566 (get_overlay_strings_1, reseat_1, reseat_to_string)
13567 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13568 correctly. Don't assume unibyte strings are not bidi-reordered.
13569 (compute_display_string_pos)
13570 (compute_display_string_end): Fix handling the case of C string.
13571 (push_it, pop_it): Save and restore from_disp_prop_p.
13572 (handle_single_display_spec, push_display_prop): Set the
13573 from_disp_prop_p flag.
13574 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13575 (pop_it): Call iterate_out_of_display_property only if we are
13576 popping after iteration over a string that came from a display
13577 property. Fix a typo in popping stretch info. Add an assertion
13578 for verifying that the iterator position is in sync with the bidi
13579 iterator.
13580 (handle_single_display_spec, get_overlay_strings_1)
13581 (push_display_prop): Fix initialization of paragraph direction for
13582 string when that of the parent object is not yet determined.
13583 (reseat_1): Call bidi_init_it to resync the bidi
13584 iterator with IT's position. (Bug#7616)
13585 (find_row_edges): If ROW->start.pos gives position
13586 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13587 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13588 Reset the from_disp_prop_p flag.
13589 (SAVE_IT, RESTORE_IT): New macros.
13590 (pos_visible_p, face_before_or_after_it_pos)
13591 (back_to_previous_visible_line_start)
13592 (move_it_in_display_line_to, move_it_in_display_line)
13593 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13594 (try_scrolling, redisplay_window, display_line): Use them when
13595 saving a temporary copy of the iterator and restoring it back.
13596 (back_to_previous_visible_line_start, reseat_1)
13597 (init_iterator): Empty the bidi cache "stack".
13598 (move_it_in_display_line_to): If iterator ended up at
13599 EOL, but we never saw any buffer positions smaller than
13600 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13601 motion in bidi-reordered lines.
13602 (move_it_in_display_line_to): Record prev_method and prev_pos
13603 immediately before the call to set_iterator_to_next. Fixes cursor
13604 motion in bidi-reordered lines with stretch glyphs and strings
13605 displayed in margins. (Bug#8133) (Bug#8867)
13606 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13607 TO_CHARPOS.
13608 (pos_visible_p): Support positions in bidi-reordered lines.
13609 Save and restore bidi cache.
13610
13611 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13612 (bidi_paragraph_info): Delete unused struct.
13613 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13614 (bidi_cache_start): New variable.
13615 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13616 to zero.
13617 (bidi_cache_fetch_state, bidi_cache_search)
13618 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13619 (bidi_cache_find, bidi_peek_at_next_level)
13620 (bidi_level_of_next_char, bidi_find_other_level_edge)
13621 (bidi_move_to_visually_next): Compare cache index with
13622 bidi_cache_start rather than with zero.
13623 (bidi_fetch_char): Accept new argument STRING; all callers
13624 changed. Support iteration over a string. Support strings with
13625 display properties. Support unibyte strings. Fix the type of
13626 `len' according to what STRING_CHAR_AND_LENGTH expects.
13627 (bidi_paragraph_init, bidi_resolve_explicit_1)
13628 (bidi_resolve_explicit, bidi_resolve_weak)
13629 (bidi_level_of_next_char, bidi_move_to_visually_next):
13630 Support iteration over a string.
13631 (bidi_set_sor_type, bidi_resolve_explicit_1)
13632 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13633 can now be zero (for strings); special values 0 and -1 were
13634 changed to -1 and -2, respectively.
13635 (bidi_char_at_pos): New function.
13636 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13637 Call it instead of FETCH_MULTIBYTE_CHAR.
13638 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13639 initialized to valid values.
13640 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13641 values.
13642 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13643 the test for valid cached positions. Fix the logic for looking up
13644 the sentinel state in the cache. GCPRO the Lisp string we are
13645 iterating.
13646 (bidi_push_it, bidi_pop_it): New functions.
13647 (bidi_initialize): Initialize the bidi cache start stack pointer.
13648 (bidi_cache_ensure_space): New function, refactored from part of
13649 bidi_cache_iterator_state. Don't assume the required size is just
13650 one BIDI_CACHE_CHUNK away.
13651 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13652 (bidi_count_bytes, bidi_char_at_pos): New functions.
13653 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13654 always valid if bidi_cache_idx is valid.
13655 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13656 is valid if it's going to be used.
13657 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13658 (bidi_cache_fetch_state, bidi_cache_search)
13659 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13660 (bidi_cache_iterator_state, bidi_cache_find)
13661 (bidi_find_other_level_edge, bidi_cache_start_stack):
13662 All variables related to cache indices are now EMACS_INT.
13663
13664 * dispextern.h (struct bidi_string_data): New structure.
13665 (struct bidi_it): New member `string'. Make flag members be 1-bit
13666 fields, and put them last in the struct.
13667 (compute_display_string_pos, compute_display_string_end):
13668 Update prototypes.
13669 (bidi_push_it, bidi_pop_it): Add prototypes.
13670 (struct iterator_stack_entry): New members bidi_p,
13671 paragraph_embedding, and from_disp_prop_p.
13672 (struct it): Member bidi_p is now a bit field 1 bit wide.
13673 (bidi_shelve_cache, bidi_unshelve_cache):
13674 Declare prototypes.
13675
13676 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13677 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13678 and vector-like objects.
13679
13680 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13681 cache around display iteration.
13682
13683 * window.c (Fwindow_end, window_scroll_pixel_based)
13684 (displayed_window_lines, Frecenter): Save and restore the bidi
13685 cache around display iteration.
13686
13687 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13688
13689 * editfns.c (Fdelete_region): Clarify the use of the named
13690 parameters (bug#6788).
13691
13692 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13693
13694 * indent.c (Fvertical_motion): Set and restore w->pointm when
13695 saving and restoring the window's buffer (Bug#9006).
13696
13697 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13698
13699 * editfns.c (Fstring_to_char): Clarify just what is returned
13700 (bug#6576). Text by Eli Zaretskii.
13701
13702 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13703
13704 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13705
13706 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13707
13708 * buffer.c (mmap_find): Fix a typo.
13709
13710 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13711
13712 Fix execution of x selection hooks.
13713 * xselect.c (Qx_lost_selection_functions)
13714 (Qx_sent_selection_functions): New vars.
13715 (syms_of_xselect): DEFSYM them.
13716 (x_handle_selection_request): Pass Qx_sent_selection_functions
13717 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13718 (x_handle_selection_clear,x_clear_frame_selections):
13719 Pass Qx_lost_selection_functions rather than
13720 Vx_lost_selection_functions to Frun_hook_with_args.
13721
13722 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13723
13724 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13725 The old code sometimes used this field without initializing it.
13726
13727 * alloc.c (gc_sweep): Don't read past end of array.
13728 In theory, the old code could also have corrupted Emacs internals,
13729 though it'd be very unlikely.
13730
13731 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13732
13733 * character.c (Fcharacterp): Don't advertise optional ignored
13734 argument. (Bug#4026)
13735
13736 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13737
13738 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13739 key" (bug#4257).
13740
13741 * window.c (Fset_window_start): Doc fix (bug#4199).
13742 (Fset_window_hscroll): Ditto.
13743
13744 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13745
13746 Fix minor new problems caught by GCC 4.6.1.
13747 * term.c (init_tty): Remove unused local.
13748 * xsettings.c (store_monospaced_changed): Define this function only
13749 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13750 not used otherwise.
13751
13752 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13753
13754 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13755
13756 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13757
13758 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13759 are the mini-buffer and the echo area (bug#3320).
13760
13761 * term.c (init_tty): Remove support for supdup, c10 and perq
13762 terminals, which are no longer supported (bug#1482).
13763
13764 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13765
13766 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13767
13768 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13769
13770 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13771 for non-popups (Bug#3642).
13772
13773 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13774
13775 * alloc.c (reset_malloc_hooks): Protoize.
13776 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13777 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13778 * cm.c (losecursor): Likewise.
13779 * data.c (fmod): Likewise.
13780 * dispnew.c (swap_glyphs_in_rows): Likewise.
13781 * emacs.c (memory_warning_signal): Likewise.
13782 * floatfns.c (float_error): Likewise.
13783 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13784 (otf_open, font_otf_capability, generate_otf_features)
13785 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13786 Likewise.
13787 * image.c (pbm_read_file): Likewise.
13788 * indent.c (string_display_width): Likewise.
13789 * intervals.c (check_for_interval, search_for_interval)
13790 (inc_interval_count, count_intervals, root_interval)
13791 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13792 * lread.c (defalias): Likewise.
13793 * ralloc.c (r_alloc_check): Likewise.
13794 * regex.c (set_image_of_range_1, set_image_of_range)
13795 (regex_grow_registers): Likewise.
13796 * sysdep.c (strerror): Likewise.
13797 * termcap.c (valid_filename_p, tprint, main): Likewise.
13798 * tparam.c (main): Likewise.
13799 * unexhp9k800.c (run_time_remap, save_data_space)
13800 (update_file_ptrs, read_header, write_header, calculate_checksum)
13801 (copy_file, copy_rest, display_header): Likewise.
13802 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13803 Likewise.
13804 * xdisp.c (check_it): Likewise.
13805 * xfaces.c (register_color, unregister_color, unregister_colors):
13806 Likewise.
13807 * xfns.c (print_fontset_result): Likewise.
13808 * xrdb.c (member, fatal, main): Likewise.
13809
13810 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13811
13812 Fix minor problems found by static checking (Bug#9031).
13813 * chartab.c (char_table_set_range, map_sub_char_table):
13814 Remove unused locals.
13815 (uniprop_table): Now static.
13816 * composite.c (_work_char): Remove unused static var.
13817
13818 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13819
13820 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13821
13822 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13823
13824 * gtkutil.c (qttip_cb): Remove code without function.
13825
13826 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13827
13828 * w32.c (pthread_sigmask): New stub.
13829
13830 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13831
13832 Use pthread_sigmask, not sigprocmask (Bug#9010).
13833 sigprocmask is portable only for single-threaded applications, and
13834 Emacs can be multi-threaded when it uses GTK.
13835 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13836 (LIBES): Use it.
13837 * callproc.c (Fcall_process):
13838 * process.c (create_process):
13839 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13840 Use pthread_sigmask, not sigprocmask.
13841
13842 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13843
13844 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13845 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13846 wrong (Bug#8591).
13847
13848 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13849
13850 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13851 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13852 (xg_hide_tooltip): Fix comment.
13853
13854 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13855 in registerServicesMenuSendTypes.
13856 (validRequestorForSendType): Don't check ns_return_types.
13857
13858 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13859 ns_return_type.
13860
13861 2011-07-08 Jason Rumney <jasonr@gnu.org>
13862
13863 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13864 SH_SHOW for hidden windows (Bug#5482).
13865
13866 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13867 frame struct members of non-existent frames (Bug#6284).
13868
13869 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13870
13871 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13872 variable firstTime not needed on OSX >= 10.6.
13873 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13874 >= 10.5. Use setKnobProportion, setDoubleValue.
13875
13876 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13877 (MAC_OS_X_VERSION_10_5): Define if not defined.
13878 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13879 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13880 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13881
13882 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13883 cString and lossyCString on OSX >= 10.4.
13884
13885 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13886 sizeToFit on OSX >= 10.2.
13887
13888 * nsimage.m (allocInitFromFile): Don't use deprecated method
13889 bestRepresentationForDevice on OSX >= 10.6.
13890
13891 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13892 to avoid warning.
13893
13894 * emacs.c: Declare unexec_init_emacs_zone.
13895
13896 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13897
13898 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13899
13900 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13901 on svcsMenu (Bug#8842).
13902
13903 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13904 ns_return_types.
13905 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13906
13907 * nsterm.m (QUTF8_STRING): Declare.
13908 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13909 (validRequestorForSendType): Return type is (id).
13910 Change indexOfObjectIdenticalTo to indexOfObject.
13911 Check if we have local selection before returning self (Bug#8842).
13912 (writeSelectionToPasteboard): Put local selection into paste board
13913 if we have a local selection (Bug#8842).
13914 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13915
13916 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13917 (ns_get_local_selection): Declare.
13918
13919 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13920
13921 * keymap.c (describe_map_tree): Don't insert a double newline at
13922 the end of the buffer (bug#1169) and return whether we inserted
13923 something.
13924
13925 * callint.c (Fcall_interactively): Change "reading args" to
13926 "providing args" to try to clarify what it does (bug#1010).
13927
13928 2011-07-07 Kenichi Handa <handa@m17n.org>
13929
13930 * composite.c (composition_compute_stop_pos): Ignore a static
13931 composition starting before CHARPOS (Bug#8915).
13932
13933 * xdisp.c (handle_composition_prop): Likewise.
13934
13935 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13936
13937 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13938 (Bug#9015)
13939
13940 2011-07-07 Kenichi Handa <handa@m17n.org>
13941
13942 * character.h (unicode_category_t): New enum type.
13943
13944 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13945 (Qchar_code_property_table): New variable.
13946 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13947 (UNIPROP_COMPRESSED_FORM_P): New macros.
13948 (char_table_ascii): Uncompress the compressed values.
13949 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13950 Uncompress the compressed values.
13951 (sub_char_table_ref_and_range): Likewise.
13952 (char_table_ref_and_range): Uncompress the compressed values.
13953 (sub_char_table_set): New arg is_uniprop. Callers changed.
13954 Uncompress the compressed values.
13955 (sub_char_table_set_range): Args changed. Callers changed.
13956 (char_table_set_range): Adjuted for the above change.
13957 (map_sub_char_table): Delete args default_val and parent. Add arg
13958 top. Give decoded values to a Lisp function.
13959 (map_char_table): Adjust for the above change. Give decoded
13960 values to a Lisp function. Gcpro more variables.
13961 (uniprop_table_uncompress)
13962 (uniprop_decode_value_run_length): New functions.
13963 (uniprop_decoder, uniprop_decoder_count): New variables.
13964 (uniprop_get_decoder, uniprop_encode_value_character)
13965 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13966 New functions.
13967 (uniprop_encoder, uniprop_encoder_count): New variables.
13968 (uniprop_get_encoder, uniprop_table)
13969 (Funicode_property_table_internal, Fget_unicode_property_internal)
13970 (Fput_unicode_property_internal): New functions.
13971 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13972 Sunicode_property_table_internal, Sget_unicode_property_internal,
13973 and Sput_unicode_property_internal. Defvar_lisp
13974 char-code-property-alist.
13975
13976 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13977 Vunicode_category_table.
13978
13979 * font.c (font_range): Adjust for the change of
13980 Vunicode_category_table.
13981
13982 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13983
13984 * m/iris4d.h: Remove file, move contents ...
13985 * s/irix6-5.h: ... here.
13986
13987 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13988
13989 Remove unportable assumption about struct layout (Bug#8884).
13990 * alloc.c (mark_buffer):
13991 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13992 (clone_per_buffer_values): Don't assume that
13993 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13994 This isn't true in general, and it's particularly not true
13995 if Emacs is configured with --with-wide-int.
13996 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13997 New macros, used in the buffer.c change.
13998
13999 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14000
14001 * xsettings.c: Use both GConf and GSettings if both are available.
14002 (store_config_changed_event): Add comment.
14003 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14004 (store_tool_bar_style_changed): New functions.
14005 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14006 (struct xsettings): Move font inside HAVE_XFT.
14007 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14008 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14009 Move inside HAVE_XFT.
14010 (something_changed_gsettingsCB): Rename from something_changedCB.
14011 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14012 also.
14013 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14014 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14015 (something_changed_gconfCB): Rename from something_changedCB.
14016 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14017 (parse_settings): Move check for font inside HAVE_XFT.
14018 (read_settings, apply_xft_settings): Add comment.
14019 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14020 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14021 call store_font_name_changed.
14022 (xft_settings_event): Add comment.
14023 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14024 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14025 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14026 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14027 (xsettings_initialize): Call init_gsettings last.
14028 (xsettings_get_system_font, xsettings_get_system_normal_font):
14029 Add comment.
14030
14031 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14032
14033 Random fixes. E.g., (random) never returned negative values.
14034 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14035 subseconds part to the entropy, as that's a bit more random.
14036 Prefer signed to unsigned, since the signedness doesn't matter and
14037 in general we prefer signed. When given a limit, use a
14038 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14039 latter isn't right if USE_2_TAGS_FOR_INTS.
14040 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14041 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14042
14043 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14044
14045 * textprop.c (text_property_stickiness):
14046 Obey Vtext_property_default_nonsticky.
14047 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14048 * w32fns.c (syms_of_w32fns):
14049 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14050
14051 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14052
14053 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14054 This is more efficient than Ffile_directory_p and avoids a minor race.
14055
14056 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14057
14058 * buffer.c (Foverlay_put): Say what the return value is
14059 (bug#7835).
14060
14061 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14062 is a directory before asking whether to use the file name
14063 (bug#7564).
14064 (barf_or_query_if_file_exists): Make the "File is a directory"
14065 error be more correct.
14066
14067 * fns.c (Frequire): Remove the mention of the .gz files, since
14068 that's installation-specific, but keep the mention of
14069 `get-load-suffixes'.
14070
14071 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14072
14073 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14074 Report string overflow if the output is too long.
14075
14076 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14077
14078 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14079 (syms_of_gnutls): Remove duplicate DEFSYM for
14080 Qgnutls_bootprop_verify_hostname_error, an error for
14081 Qgnutls_bootprop_verify_error (which is no longer used).
14082
14083 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14084 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14085 Also (re)move comments that are misplaced or no longer relevant.
14086
14087 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14088
14089 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14090
14091 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14092
14093 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14094 and background color parameters if they have been changed.
14095
14096 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14097
14098 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14099
14100 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14101
14102 * xsettings.c (SYSTEM_FONT): Define only when used.
14103 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14104
14105 * keymap.c (access_keymap_1): Now static.
14106
14107 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14108
14109 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14110 leave any prefix arg for the up event (Bug#1586).
14111
14112 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14113
14114 * lread.c (syms_of_lread): Mention single symbols defined by
14115 `defvar' or `defconst' (bug#7154).
14116
14117 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14118 (Frequire): Mention get-load-suffixes.
14119
14120 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14121
14122 * window.h (window): Remove clone_number slot.
14123 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14124 Remove.
14125 (make_parent_window, make_window, saved_window)
14126 (Fset_window_configuration, save_window_save): Don't deal with
14127 clone numbers.
14128 * buffer.c (Qclone_number): Remove declaration.
14129 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14130
14131 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14132
14133 Add multiple inheritance to keymaps.
14134 * keymap.c (Fmake_composed_keymap): New function.
14135 (Fset_keymap_parent): Simplify.
14136 (fix_submap_inheritance): Remove.
14137 (access_keymap_1): New function extracted from access_keymap to handle
14138 embedded parents and handle lists of maps.
14139 (access_keymap): Use it.
14140 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14141 (Fcopy_keymap): Handle embedded parents.
14142 (Fcommand_remapping, define_as_prefix): Simplify.
14143 (Fkey_binding): Simplify.
14144 (syms_of_keymap): Move minibuffer-local-completion-map,
14145 minibuffer-local-filename-completion-map,
14146 minibuffer-local-must-match-map, and
14147 minibuffer-local-filename-must-match-map to Elisp.
14148 (syms_of_keymap): Defsubr make-composed-keymap.
14149 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14150 (parse_menu_item): Trivial simplification.
14151
14152 2011-07-01 Glenn Morris <rgm@gnu.org>
14153
14154 * Makefile.in (SETTINGS_LIBS): Fix typo.
14155
14156 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14157
14158 * coding.c (Fencode_coding_string): Record the last coding system
14159 used, as the function doc string says (bug#8738).
14160
14161 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14162
14163 * xsettings.c (store_monospaced_changed): Take new font as arg and
14164 check for change against current_mono_font.
14165 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14166 (emacs_settings_constructor, emacs_settings_get_property)
14167 (emacs_settings_set_property, emacs_settings_class_init)
14168 (emacs_settings_init, gsettings_obj): Remove.
14169 (something_changedCB): New function for HAVE_GSETTINGS.
14170 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14171 with value as argument.
14172 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14173 g_settings_new (Bug#8967). Do not create gsettings_obj.
14174 Remove calls to g_settings_bind. Connect something_changedCB to
14175 "changed".
14176
14177 * xgselect.c: Add defined (HAVE_GSETTINGS).
14178 (xgselect_initialize): Ditto.
14179
14180 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14181 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14182 xg_select.
14183
14184 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14185
14186 * eval.c (struct backtrace): Simplify and port the data structure.
14187 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14188 signed bit field, as this assumption is not portable and it makes
14189 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14190 "char debug_on_exit : 1" as this is not portable either; instead,
14191 use the portable "unsigned int debug_on_exit : 1". Remove unused
14192 member evalargs. Remove obsolete comments about cc bombing out.
14193
14194 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14195
14196 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14197 Let HAVE_GSETTINGS override HAVE_GCONF.
14198 (store_monospaced_changed): New function.
14199 (EMACS_SETTINGS): A new type derived from GObject to handle
14200 GSettings notifications.
14201 (emacs_settings_constructor, emacs_settings_get_property)
14202 (emacs_settings_set_property, emacs_settings_class_init):
14203 New functions.
14204 (gsettings_client, gsettings_obj): New variables.
14205 (GSETTINGS_SCHEMA): New define.
14206 (something_changedCB): Call store_monospaced_changed.
14207 (init_gsettings): New function.
14208 (xsettings_initialize): Call init_gsettings.
14209 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14210 to NULL.
14211
14212 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14213 GCONF_CFLAGS/LIBS.
14214
14215 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14216
14217 * window.c (resize_root_window, grow_mini_window)
14218 (shrink_mini_window): Rename Qresize_root_window to
14219 Qwindow_resize_root_window and Qresize_root_window_vertically to
14220 Qwindow_resize_root_window_vertically.
14221
14222 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14223
14224 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14225
14226 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14227
14228 * makefile.w32-in: Redesign dependencies so they reflect more
14229 clearly which files are directly included by each source file,
14230 and not through other includes.
14231
14232 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14233
14234 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14235 (sort_overlays, overlay_strings): When an overlay's clone number
14236 matches the window's clone number process the overlay even if
14237 the overlay's window property doesn't match the current window.
14238
14239 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14240 (Fwindow_hchild): Rename to Fwindow_left_child.
14241 (Fwindow_next): Rename to Fwindow_next_sibling.
14242 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14243 (resize_window_check): Rename to window_resize_check.
14244 (resize_window_apply): Rename to window_resize_apply.
14245 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14246 (Fdelete_other_windows_internal, resize_frame_windows)
14247 (Fsplit_window_internal, Fdelete_window_internal)
14248 (grow_mini_window, shrink_mini_window)
14249 (Fresize_mini_window_internal): Fix callers accordingly.
14250
14251 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14252
14253 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14254 (emacs_fixed_set_min_size): Remove.
14255 (emacs_fixed_new): Take frame as argument.
14256
14257 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14258 (_EmacsFixedPrivate): Remove minwidth/height.
14259 Add struct frame *f.
14260 (emacs_fixed_init): Initialize priv->f.
14261 (get_parent_class, emacs_fixed_set_min_size): Remove.
14262 (emacs_fixed_new): Set priv->f to argument.
14263 (emacs_fixed_get_preferred_width)
14264 (emacs_fixed_get_preferred_height): Use min_width/height from
14265 frames size_hint to set minimum and natural (Bug#8919).
14266 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14267 and use min_width/height from frames size_hint to set
14268 min_width/height (Bug#8919).
14269
14270 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14271 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14272 Fix indentation.
14273
14274 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14275
14276 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14277 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14278 called at ZV.
14279
14280 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14281
14282 * process.c (wait_reading_process_output): Bypass select if
14283 waiting for a cell while ignoring keyboard input, and input is
14284 pending. Suggested by Jan Djärv (Bug#8869).
14285
14286 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14287
14288 Use gnulib's dup2 module instead of rolling our own.
14289 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14290
14291 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14292
14293 * dispnew.c (scrolling_window): Before scrolling, turn off a
14294 mouse-highlight in the window being scrolled.
14295
14296 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14297
14298 Move DEFSYM to lisp.h and use everywhere.
14299
14300 * character.h (DEFSYM): Move declaration...
14301 * lisp.h (DEFSYM): ...here.
14302
14303 * gnutls.c:
14304 * minibuf.c:
14305 * w32menu.c:
14306 * w32proc.c:
14307 * w32select.c: Don't include character.h.
14308
14309 * alloc.c (syms_of_alloc):
14310 * buffer.c (syms_of_buffer):
14311 * bytecode.c (syms_of_bytecode):
14312 * callint.c (syms_of_callint):
14313 * casefiddle.c (syms_of_casefiddle):
14314 * casetab.c (init_casetab_once):
14315 * category.c (init_category_once, syms_of_category):
14316 * ccl.c (syms_of_ccl):
14317 * cmds.c (syms_of_cmds):
14318 * composite.c (syms_of_composite):
14319 * dbusbind.c (syms_of_dbusbind):
14320 * dired.c (syms_of_dired):
14321 * dispnew.c (syms_of_display):
14322 * doc.c (syms_of_doc):
14323 * editfns.c (syms_of_editfns):
14324 * emacs.c (syms_of_emacs):
14325 * eval.c (syms_of_eval):
14326 * fileio.c (syms_of_fileio):
14327 * fns.c (syms_of_fns):
14328 * frame.c (syms_of_frame):
14329 * fringe.c (syms_of_fringe):
14330 * insdel.c (syms_of_insdel):
14331 * keymap.c (syms_of_keymap):
14332 * lread.c (init_obarray, syms_of_lread):
14333 * macros.c (syms_of_macros):
14334 * msdos.c (syms_of_msdos):
14335 * print.c (syms_of_print):
14336 * process.c (syms_of_process):
14337 * search.c (syms_of_search):
14338 * sound.c (syms_of_sound):
14339 * syntax.c (init_syntax_once, syms_of_syntax):
14340 * terminal.c (syms_of_terminal):
14341 * textprop.c (syms_of_textprop):
14342 * undo.c (syms_of_undo):
14343 * w32.c (globals_of_w32):
14344 * window.c (syms_of_window):
14345 * xdisp.c (syms_of_xdisp):
14346 * xfaces.c (syms_of_xfaces):
14347 * xfns.c (syms_of_xfns):
14348 * xmenu.c (syms_of_xmenu):
14349 * xsettings.c (syms_of_xsettings):
14350 * xterm.c (syms_of_xterm): Use DEFSYM.
14351
14352 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14353
14354 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14355
14356 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14357
14358 Integer and buffer overflow fixes (Bug#8873).
14359
14360 * print.c (printchar, strout): Check for string overflow.
14361 (PRINTPREPARE, printchar, strout):
14362 Don't set size unless allocation succeeds.
14363
14364 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14365 for sizes. Check for string overflow more accurately.
14366 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14367
14368 * macros.c: Integer and buffer overflow fixes.
14369 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14370 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14371 Use ptrdiff_t, not int, for sizes.
14372 Don't increment bufsize until after realloc succeeds.
14373 Check for size-calculation overflow.
14374 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14375
14376 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14377
14378 * lread.c: Integer overflow fixes.
14379 (read_integer): Radix is now EMACS_INT, not int,
14380 to improve quality of diagnostics for out-of-range radices.
14381 Calculate buffer size correctly for out-of-range radices.
14382 (read1): Check for integer overflow in radices, and in
14383 read-circle numbers.
14384 (read_escape): Avoid int overflow.
14385 (Fload, openp, read_buffer_size, read1)
14386 (substitute_object_recurse, read_vector, read_list, map_obarray):
14387 Use ptrdiff_t, not int, for sizes.
14388 (read1): Use EMACS_INT, not int, for sizes.
14389 Check for size overflow.
14390
14391 * image.c (cache_image): Check for size arithmetic overflow.
14392
14393 * lread.c: Integer overflow issues.
14394 (saved_doc_string_size, saved_doc_string_length)
14395 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14396 Now ptrdiff_t, not int.
14397 (read1): Don't assume doc string length fits in int. Check for
14398 out-of-range doc string lengths.
14399 (read_list): Don't assume file position fits in int.
14400 (read_escape): Check for hex character overflow.
14401
14402 2011-06-22 Leo Liu <sdl.web@gmail.com>
14403
14404 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14405 Move to minibuffer.el.
14406
14407 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14408
14409 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14410 The following patches are for when GLYPH_DEBUG && !XASSERT.
14411 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14412 * dispnew.c (flush_stdout):
14413 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14414 Mark as externally visible.
14415 * dispnew.c (check_window_matrix_pointers): Now static.
14416 * dispnew.c (window_to_frame_vpos):
14417 * xfns.c (unwind_create_frame):
14418 * xterm.c (x_check_font): Remove unused local.
14419 * scroll.c (CHECK_BOUNDS):
14420 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14421 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14422 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14423 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14424 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14425 Now static.
14426 (debug_method_add): Use va_list and vsprintf rather than relying
14427 on undefined behavior with wrong number of arguments.
14428 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14429 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14430 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14431 since we're not interested in debugging glyphs with old libraries.
14432 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14433 GCC 4.6.0's static checking.
14434
14435 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14436
14437 Integer overflow and signedness fixes (Bug#8873).
14438 A few related buffer overrun fixes, too.
14439
14440 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14441
14442 * dispextern.h (struct face.stipple):
14443 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14444 (x_bitmap_mask, x_allocate_bitmap_record)
14445 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14446 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14447 (x_create_bitmap_from_xpm_data):
14448 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14449 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14450 (.bitmaps_last):
14451 * xfaces.c (load_pixmap):
14452 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14453 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14454 (.bitmaps_last, struct x_output.icon_bitmap):
14455 Use ptrdiff_t, not int, for bitmap indexes.
14456 (x_allocate_bitmap_record): Check for size overflow.
14457 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14458
14459 Use ptrdiff_t, not int, for overlay counts.
14460 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14461 * editfns.c (overlays_around, get_pos_property):
14462 * textprop.c (get_char_property_and_overlay):
14463 * xdisp.c (next_overlay_change, note_mouse_highlight):
14464 * xfaces.c (face_at_buffer_position):
14465 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14466 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14467 (Fnext_overlay_change, Fprevious_overlay_change)
14468 (mouse_face_overlay_overlaps, Foverlays_in):
14469 Use ptrdiff_t, not int, for sizes.
14470 (overlays_at, overlays_in): Check for size-calculation overflow.
14471
14472 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14473
14474 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14475 (x_session_initialize): Do not assume string length fits in int.
14476
14477 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14478 This is unlikely, but can occur if DPI is outlandish.
14479
14480 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14481 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14482
14483 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14484 * xrdb.c (magic_file_p, search_magic_path):
14485 Omit last arg SUFFIX; it was always 0. All callers changed.
14486 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14487
14488 * xfont.c (xfont_match): Avoid need for strlen.
14489
14490 * xfns.c: Don't assume strlen fits in int.
14491 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14492
14493 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14494 not unsigned long, as we prefer signed integers. All callers changed.
14495 Detect integer overflow in repeat count.
14496 (message_dolog): Don't assume print length fits in 39 bytes.
14497 (display_mode_element): Don't assume strlen fits in int.
14498
14499 * termcap.c: Don't assume sizes fit in int and never overflow.
14500 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14501 (gobble_line): Check for size-calculation overflow.
14502
14503 * minibuf.c (Fread_buffer):
14504 * lread.c (intern, intern_c_string):
14505 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14506 Don't assume string length fits in int.
14507
14508 * keyboard.c (parse_tool_bar_item):
14509 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14510
14511 * font.c: Don't assume string length fits in int.
14512 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14513 Use ptrdiff_t, not int.
14514 (font_intern_prop): Don't assume string length fits in int.
14515 Don't assume integer property fits in fixnum.
14516 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14517
14518 * filelock.c: Fix some buffer overrun and integer overflow issues.
14519 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14520 Reformulate so as not to need the command string.
14521 Invoke gzip -cd rather than gunzip, as it's more portable.
14522 (lock_info_type, lock_file_1, lock_file):
14523 Don't assume pid_t and time_t fit in unsigned long.
14524 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14525 (current_lock_owner): Prefer signed type for sizes.
14526 Use memcpy, not strncpy, where memcpy is what is really wanted.
14527 Don't assume (via atoi) that time_t and pid_t fit in int.
14528 Check for time_t and/or pid_t out of range, e.g., via a network share.
14529 Don't alloca where an auto var works fine.
14530
14531 * fileio.c: Fix some integer overflow issues.
14532 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14533 Don't assume string length fits in int.
14534 (directory_file_name): Don't assume string length fits in long.
14535 (make_temp_name): Don't assume pid fits in int, or that its print
14536 length is less than 20.
14537
14538 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14539
14540 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14541
14542 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14543
14544 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14545 We prefer signed integers, even for size calculations.
14546
14547 * emacs.c: Don't assume string length fits in 'int'.
14548 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14549 (main): Don't invoke strlen when not needed.
14550
14551 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14552 (XD_DEBUG_MESSAGE): Don't waste a byte.
14553
14554 * callproc.c (getenv_internal_1, getenv_internal)
14555 (Fgetenv_internal):
14556 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14557
14558 * lread.c (invalid_syntax): Omit length argument.
14559 All uses changed. This doesn't fix a bug, but it simplifies the
14560 code away from its former Hollerith-constant appearance, and it's
14561 one less 'int' to worry about when looking at integer-overflow issues.
14562 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14563
14564 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14565 This didn't break anything, but it didn't help either.
14566 It's confusing to put a bogus integer in a place where the actual
14567 value does not matter.
14568 (LIST_END_P): Remove unused macro and its bogus comment.
14569 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14570
14571 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14572 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14573 implementation.
14574 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14575 We prefer signed types, and the value cannot exceed the EMACS_INT
14576 range anyway (because otherwise the length would not be representable).
14577 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14578 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14579 This avoids a GCC warning when WIDE_EMACS_INT.
14580
14581 * indent.c (sane_tab_width): New function.
14582 (current_column, scan_for_column, Findent_to, position_indentation)
14583 (compute_motion): Use it. This is just for clarity.
14584 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14585
14586 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14587
14588 * lisp.h (lint_assume): New macro.
14589 * composite.c (composition_gstring_put_cache):
14590 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14591
14592 * editfns.c, insdel.c:
14593 Omit unnecessary forward decls, to simplify future changes.
14594
14595 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14596
14597 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14598
14599 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14600 Use much-faster test for byte-length change.
14601 Don't assume string byte-length fits in 'int'.
14602 Check that character arg fits in 'int'.
14603 (mapcar1): Declare byte as byte, for clarity.
14604
14605 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14606
14607 * fns.c (concat): Catch string overflow earlier.
14608 Do not rely on integer wraparound.
14609
14610 * dispextern.h (struct it.overlay_strings_charpos)
14611 (struct it.selective): Now EMACS_INT, not int.
14612 * xdisp.c (forward_to_next_line_start)
14613 (back_to_previous_visible_line_start)
14614 (reseat_at_next_visible_line_start, next_element_from_buffer):
14615 Don't arbitrarily truncate the value of 'selective' to int.
14616
14617 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14618
14619 * composite.c: Don't truncate sizes to 'int'.
14620 (composition_gstring_p, composition_reseat_it)
14621 (composition_adjust_point): Use EMACS_INT, not int.
14622 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14623 not EMACS_UINT, for indexes.
14624
14625 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14626
14627 * buffer.c: Include <verify.h>.
14628 (struct sortvec.priority, struct sortstr.priority):
14629 Now EMACS_INT, not int.
14630 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14631 (struct sortstr.size, record_overlay_string)
14632 (struct sortstrlist.size, struct sortlist.used):
14633 Don't truncate size to int.
14634 (record_overlay_string): Check for size-calculation overflow.
14635 (init_buffer_once): Check at compile-time, not run-time.
14636
14637 2011-06-22 Jim Meyering <meyering@redhat.com>
14638
14639 Don't leak an XBM-image-sized buffer
14640 * image.c (xbm_load): Free the image buffer after using it.
14641
14642 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14643
14644 Port to Sun C.
14645 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14646 that Sun C diagnosed.
14647 * fns.c (secure_hash): Fix pointer signedness issue.
14648 * intervals.c (static_offset_intervals): New function.
14649 (offset_intervals): Use it.
14650
14651 2011-06-21 Leo Liu <sdl.web@gmail.com>
14652
14653 * deps.mk (fns.o):
14654 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14655 sha512.h.
14656
14657 * fns.c (secure_hash): Rename from crypto_hash_function and change
14658 the first arg to accept symbols.
14659 (Fsecure_hash): New primitive.
14660 (syms_of_fns): New symbols.
14661
14662 2011-06-20 Deniz Dogan <deniz@dogan.se>
14663
14664 * process.c (Fset_process_buffer): Clarify return value in
14665 docstring.
14666
14667 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14668
14669 * dispnew.c (add_window_display_history): Use BVAR.
14670
14671 * xdisp.c (debug_method_add): Use BVAR.
14672 (check_window_end, dump_glyph_matrix, dump_glyph)
14673 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14674
14675 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14676 Likewise.
14677
14678 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14679 check till after the cache is created in init_frame_faces.
14680
14681 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14682
14683 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14684
14685 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14686
14687 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14688 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14689 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14690
14691 Improve buffer-overflow checking (Bug#8873).
14692 * fileio.c (Finsert_file_contents):
14693 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14694 Remove the old (too-loose) buffer overflow checks.
14695 They weren't needed, since make_gap checks for buffer overflow.
14696 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14697 The old code merely checked for Emacs fixnum overflow, and relied
14698 on undefined (wraparound) behavior. The new code avoids undefined
14699 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14700
14701 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14702 Tune. Don't use wider integers than needed. Don't use alloca.
14703 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14704
14705 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14706
14707 * insdel.c, lisp.h (buffer_overflow): New function.
14708 (insert_from_buffer_1, replace_range, replace_range_2):
14709 * insdel.c (make_gap_larger):
14710 * editfns.c (Finsert_char):
14711 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14712
14713 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14714
14715 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14716
14717 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14718
14719 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14720 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14721
14722 * fileio.c: Don't assume EMACS_INT fits in off_t.
14723 (emacs_lseek): New static function.
14724 (Finsert_file_contents, Fwrite_region): Use it.
14725 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14726
14727 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14728
14729 * fns.c: Don't overflow int when computing a list length.
14730 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14731 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14732 truncation on 64-bit hosts. Check for QUIT every
14733 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14734 faster and is responsive enough.
14735 (Flength): Report an error instead of overflowing an integer.
14736 (Fsafe_length): Return a float if the value is not representable
14737 as a fixnum. This shouldn't happen except in contrived situations.
14738 (Fnthcdr, Fsort): Don't assume list length fits in int.
14739 (Fcopy_sequence): Don't assume vector length fits in int.
14740
14741 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14742 (header_size, word_size): New constants.
14743 (allocate_vectorlike): Don't check size overflow here.
14744 (allocate_vector): Check it here instead, since this is the only
14745 caller of allocate_vectorlike that could cause overflow.
14746 Check that the new vector's length is representable as a fixnum.
14747
14748 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14749 The previous code was bogus. For example, next_almost_prime (32)
14750 returned 39, which is undesirable as it is a multiple of 3; and
14751 next_almost_prime (24) returned 25, which is a multiple of 5 so
14752 why was the code bothering to check for multiples of 7?
14753
14754 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14755
14756 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14757
14758 Variadic C functions now count arguments with ptrdiff_t.
14759 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14760 Back then I didn't know that the Emacs coding style prefers signed int.
14761 Also, in the meantime I found a few more instances where arguments
14762 were being counted with int, which may truncate counts on 64-bit
14763 machines, or EMACS_INT, which may be unnecessarily wide.
14764 * lisp.h (struct Lisp_Subr.function.aMANY)
14765 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14766 Arg counts are now ptrdiff_t, not size_t.
14767 All variadic functions and their callers changed accordingly.
14768 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14769 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14770 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14771 * callint.c (Fcall_interactively): Check arg count for overflow,
14772 to avoid potential buffer overrun. Use signed char, not 'int',
14773 for 'varies' array, so that we needn't bother to check its size
14774 calculation for overflow.
14775 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14776 * eval.c (apply_lambda):
14777 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14778 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14779 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14780
14781 * callint.c (Fcall_interactively): Don't use index var as event count.
14782
14783 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14784 * mem-limits.h (SIZE): Remove; no longer used.
14785
14786 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14787
14788 Remove unnecessary casts.
14789 * xterm.c (x_term_init):
14790 * xfns.c (x_set_border_pixel):
14791 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14792 These aren't needed now that we assume ANSI C.
14793
14794 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14795 It's more likely to cause problems (due to unsigned overflow)
14796 than to cure them.
14797
14798 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14799
14800 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14801
14802 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14803
14804 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14805
14806 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14807
14808 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14809
14810 GLYPH_CODE_FACE returns EMACS_INT, not int.
14811 * dispextern.h (merge_faces):
14812 * xfaces.c (merge_faces):
14813 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14814 Don't assume EMACS_INT fits in int.
14815
14816 * character.h (CHAR_VALID_P): Remove unused parameter.
14817 * fontset.c, lisp.h, xdisp.c: All uses changed.
14818
14819 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14820
14821 * fns.c (concat): Minor tuning based on overflow analysis.
14822 This doesn't fix any bugs. Use int to hold character, instead
14823 of constantly refetching from Emacs object. Use XFASTINT, not
14824 XINT, for value known to be a character. Don't bother comparing
14825 a single byte to 0400, as it's always less.
14826
14827 * floatfns.c (Fexpt):
14828 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14829
14830 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14831 for characters.
14832
14833 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14834
14835 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14836 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14837 incorrectly succeed when S was a string, because 4294967386 was
14838 truncated before it was used.
14839
14840 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14841 Otherwise, an out-of-range integer could cause undefined behavior
14842 on a 64-bit host.
14843
14844 * composite.c: Use int, not EMACS_INT, for characters.
14845 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14846 EMACS_INT, for values that are known to be in character range.
14847 This doesn't fix any bugs but is the usual style inside Emacs and
14848 may generate better code on 32-bit machines.
14849
14850 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14851 This is for reasons similar to the recent CHAR_STRING fix.
14852 * charset.c (Fencode_char): Check that character arg is actually
14853 a character. Pass an int to ENCODE_CHAR.
14854 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14855 wider than 'int', as a compile-time check to prevent future regressions
14856 in this area.
14857
14858 * character.c (char_string): Remove unnecessary casts.
14859
14860 Make sure a 64-bit char is never passed to CHAR_STRING.
14861 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14862 by silently ignoring the top 32 bits, allowing some values
14863 that were far too large to be valid characters.
14864 * character.h: Include <verify.h>.
14865 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14866 arguments are no wider than unsigned, as a compile-time check
14867 to prevent future regressions in this area.
14868 * data.c (Faset):
14869 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14870 (Fsubst_char_in_region):
14871 * fns.c (concat):
14872 * xdisp.c (decode_mode_spec_coding):
14873 Adjust to CHAR_STRING's new requirement.
14874 * editfns.c (Finsert_char, Fsubst_char_in_region):
14875 * fns.c (concat): Check that character args are actually
14876 characters. Without this test, these functions did the wrong
14877 thing with wildly out-of-range values on 64-bit hosts.
14878
14879 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14880 These casts should not be needed on 32-bit hosts, either.
14881 * keyboard.c (read_char):
14882 * lread.c (Fload): Remove casts to unsigned.
14883
14884 * lisp.h (UNSIGNED_CMP): New macro.
14885 This fixes comparison bugs on 64-bit hosts.
14886 (ASCII_CHAR_P): Use it.
14887 * casefiddle.c (casify_object):
14888 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14889 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14890 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14891 * dispextern.h (FACE_FROM_ID):
14892 * keyboard.c (read_char): Use UNSIGNED_CMP.
14893
14894 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14895 not to EMACS_INT, to avoid GCC warning.
14896
14897 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14898
14899 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14900 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14901 isn't needed on 32-bit machines.
14902
14903 * buffer.c (Fgenerate_new_buffer_name):
14904 Use EMACS_INT for count, not int.
14905 (advance_to_char_boundary): Return EMACS_INT, not int.
14906
14907 * data.c (Qcompiled_function): Now static.
14908
14909 * window.c (window_body_lines): Now static.
14910
14911 * image.c (gif_load): Rename local to avoid shadowing.
14912
14913 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14914 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14915 * alloc.c (make_save_value): Integer argument is now of type
14916 ptrdiff_t, not int.
14917 (mark_object): Use ptrdiff_t, not int.
14918 * lisp.h (pD): New macro.
14919 * print.c (print_object): Use it.
14920
14921 * alloc.c: Use EMACS_INT, not int, to count objects.
14922 (total_conses, total_markers, total_symbols, total_vector_size)
14923 (total_free_conses, total_free_markers, total_free_symbols)
14924 (total_free_floats, total_floats, total_free_intervals)
14925 (total_intervals, total_strings, total_free_strings):
14926 Now EMACS_INT, not int. All uses changed.
14927 (Fgarbage_collect): Compute overall total using a double, so that
14928 integer overflow is less likely to be a problem. Check for overflow
14929 when converting back to an integer.
14930 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14931 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14932 These were 'int' variables that could overflow on 64-bit hosts;
14933 they were never used, so remove them instead of repairing them.
14934 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14935 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14936 Previously, this ceilinged at INT_MAX, but that doesn't work on
14937 64-bit machines.
14938 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14939
14940 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14941 (allocate_vectorlike): Check for ptrdiff_t overflow.
14942 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14943 when a (possibly-narrower) signed value would do just as well.
14944 We prefer using signed arithmetic, to avoid comparison confusion.
14945
14946 * alloc.c: Catch some string size overflows that we were missing.
14947 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14948 for convenience in STRING_BYTES_MAX.
14949 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14950 The definition here is exact; the one in lisp.h was approximate.
14951 (allocate_string_data): Check for string overflow. This catches
14952 some instances we weren't catching before. Also, it catches
14953 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14954 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14955 and ptrdiff_t and EMACS_INT are both 64 bits.
14956
14957 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14958 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14959 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14960
14961 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14962
14963 * alloc.c (Fmake_string): Check for out-of-range init.
14964
14965 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14966
14967 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14968
14969 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14970
14971 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14972 xg_get_default_scrollbar_width.
14973
14974 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14975 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14976 (style_changed_cb): Call update_theme_scrollbar_width and call
14977 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14978 all frames (Bug#8505).
14979 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14980 Call gtk_window_set_resizable if HAVE_GTK3.
14981 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14982 and height if HAVE_GTK3 (Bug#8505).
14983 (scroll_bar_width_for_theme): New variable.
14984 (update_theme_scrollbar_width): New function.
14985 (xg_get_default_scrollbar_width): Move code to
14986 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14987 (xg_initialize): Call update_theme_scrollbar_width.
14988
14989 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14990
14991 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14992
14993 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14994
14995 * frame.c (make_frame): Call other_buffer_safely instead of
14996 other_buffer.
14997
14998 * window.c (temp_output_buffer_show): Call display_buffer with
14999 second argument Vtemp_buffer_show_specifiers and reset latter
15000 immediately after the call.
15001 (Vtemp_buffer_show_specifiers): New variable.
15002 (auto_window_vscroll_p, next_screen_context_lines)
15003 (Vscroll_preserve_screen_position): Remove leading asterisks from
15004 doc-strings.
15005
15006 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15007
15008 Fix minor problems found by GCC 4.6.0 static checking.
15009 * buffer.c (Qclone_number): Remove for now, as it's unused.
15010 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15011 (record_buffer): Remove unused local.
15012 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15013 (set_frame_buffer_list): Remove; unused.
15014 * frame.h (other_visible_frames): Remove decl.
15015 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15016 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15017 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15018 if HAVE_GPM.
15019 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15020 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15021 Define only if HAVE_GPM.
15022 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15023 (update_hints_inhibit): Remove; never set. All uses removed.
15024 * widgetprv.h (emacsFrameClassRec): Remove decl.
15025 * window.c (delete_deletable_window): Now returns void, since it
15026 wasn't returning anything.
15027 (compare_window_configurations): Remove unused locals.
15028 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15029 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15030 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15031 the same widths as pointers. This follows up on the 2011-05-06 patch.
15032 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15033 * xterm.h: Likewise.
15034 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15035
15036 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15037
15038 * makefile.w32-in: Update dependencies.
15039 (LISP_H): Add lib/intprops.h.
15040
15041 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15042
15043 * image.c (gif_load): Add animation frame delay to the metadata.
15044 (syms_of_image): Use DEFSYM. New symbol `delay'.
15045
15046 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15047
15048 * window.c (delete_deletable_window): Re-add.
15049 (Fset_window_configuration): Rewrite to handle dead buffers and
15050 consequently deletable windows.
15051 (window_tree, Fwindow_tree): Remove. Supply functionality in
15052 window.el.
15053 (compare_window_configurations): Simplify code.
15054
15055 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15056
15057 * image.c (imagemagick_load_image): Fix type mismatch.
15058 (Fimagemagick_types): Likewise.
15059
15060 * window.h (replace_buffer_in_windows): Declare.
15061
15062 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15063
15064 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15065 Qclone_number. Remove external declaration of Qdelete_window.
15066 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15067 code.
15068 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15069 Run Qbuffer_list_update_hook if allowed.
15070 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15071 buffer list implementation.
15072 (other_buffer_safely): New function.
15073 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15074 calls to replace_buffer_in_windows and
15075 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15076 if allowed.
15077 (record_buffer): Inhibit quitting and rewrite using quittable
15078 functions. Run Qbuffer_list_update_hook if allowed.
15079 (Frecord_buffer, Funrecord_buffer): New functions.
15080 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15081 Move switch-to-buffer to window.el.
15082 (bury-buffer): Move to window.el.
15083 (Vbuffer_list_update_hook): New variable.
15084
15085 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15086 section.
15087
15088 * window.h (resize_frame_windows): Move up in code.
15089 (Fwindow_frame): Remove EXFUN.
15090 (replace_buffer_in_all_windows): Remove prototype.
15091 (replace_buffer_in_windows_safely): Add prototype.
15092
15093 * window.c: Declare Qdelete_window static again. Move down
15094 declaration of select_count.
15095 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15096 (Fother_window): Move to window.el.
15097 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15098 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15099 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15100 window.el.
15101 (replace_buffer_in_windows): Implement by calling
15102 Qreplace_buffer_in_windows.
15103 (replace_buffer_in_all_windows): Remove with some functionality
15104 moved into replace_buffer_in_windows_safely.
15105 (replace_buffer_in_windows_safely): New function.
15106 (select_window_norecord, select_frame_norecord): Move in front
15107 of run_window_configuration_change_hook. Remove now obsolete
15108 declarations.
15109 (Fset_window_buffer): Rewrite doc-string.
15110 Call Qrecord_window_buffer.
15111 (keys_of_window): Move binding for other-window to window.el.
15112
15113 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15114
15115 * dispextern.h (struct image): Replace data member, whose int_val
15116 and ptr_val fields were not used by anything, with a single
15117 lisp_val object.
15118
15119 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15120 (gif_clear_image, gif_load, imagemagick_load_image)
15121 (gs_clear_image, gs_load): Callers changed.
15122
15123 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15124
15125 * buffer.h: Include <time.h>, for time_t.
15126 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15127
15128 Fix minor problems found by static checking.
15129
15130 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15131
15132 Make identifiers static if they are not used in other modules.
15133 * data.c (Qcompiled_function, Qframe, Qvector):
15134 * image.c (QimageMagick, Qsvg):
15135 * minibuf.c (Qmetadata):
15136 * window.c (resize_window_check, resize_root_window): Now static.
15137 * window.h (resize_window_check, resize_root_window): Remove decls.
15138
15139 * window.c (window_deletion_count, delete_deletable_window):
15140 Remove; unused.
15141 (window_body_lines): Now static.
15142 (Fdelete_other_windows_internal): Mark vars as initialized.
15143 Make sure 'resize_failed' is initialized.
15144 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15145 (resize_window_apply): Remove unused local.
15146 * window.h (delete_deletable_window): Remove decl.
15147
15148 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15149 (imagemagick_load_image): Fix pointer signedness problem by changing
15150 last arg from unsigned char * to char *. All uses changed.
15151 Also, fix a local for similar reasons.
15152 Remove unused locals. Remove locals to avoid shadowing.
15153 (fn_rsvg_handle_free): Remove; unused.
15154 (svg_load, svg_load_image): Fix pointer signedness problem.
15155 (imagemagick_load_image): Don't use garbage pointer image_wand.
15156
15157 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15158
15159 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15160
15161 * image.c (gif_load): Fix omitted cast error introduced by
15162 2011-06-06 change.
15163
15164 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15165
15166 * window.h (resize_proportionally, orig_total_lines)
15167 (orig_top_line): Remove from window structure.
15168 (set_window_height, set_window_width, change_window_heights)
15169 (Fdelete_window): Remove prototypes.
15170 (resize_frame_windows): Remove duplicate declaration.
15171
15172 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15173
15174 * window.h (resize_frame_windows, resize_window_check)
15175 (delete_deletable_window, resize_root_window)
15176 (resize_frame_windows): Declare prototypes.
15177
15178 * window.c (resize_window_apply): Make definition be "static" to
15179 match the prototype.
15180
15181 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15182
15183 * window.c: Remove declarations of Qwindow_size_fixed,
15184 window_min_size_1, window_min_size_2, window_min_size,
15185 size_window, window_fixed_size_p, enlarge_window, delete_window.
15186 Remove static from declaration of Qdelete_window, it's
15187 temporarily needed by Fbury_buffer.
15188 (replace_window): Don't assign orig_top_line and
15189 orig_total_lines.
15190 (Fdelete_window, delete_window): Remove. Window deletion is
15191 handled by window.el.
15192 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15193 Replace Fdelete_window calls with calls to Qdelete_window.
15194 (Fdelete_other_windows): Remove. Deleting other windows is
15195 handled by window.el.
15196 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15197 handled in window.el.
15198 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15199 Window minimum sizes are handled in window.el.
15200 (shrink_windows, size_window, set_window_height)
15201 (set_window_width, change_window_heights, window_height)
15202 (window_width, CURBEG, CURSIZE, enlarge_window)
15203 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15204 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15205 handled in window.el.
15206 (make_dummy_parent): Rename to make_parent_window and give it a
15207 second argument horflag.
15208 (make_window): Don't set resize_proportionally any more.
15209 (Fsplit_window): Remove. Windows are split in window.el.
15210 (save_restore_action, save_restore_orig_size)
15211 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15212 Resize mini windows in window.el.
15213 (grow_mini_window, shrink_mini_window): Implement by calling
15214 Qresize_root_window_vertically, resize_window_check and
15215 resize_window_apply.
15216 (saved_window, Fset_window_configuration, save_window_save):
15217 Do not handle orig_top_line, orig_total_lines, and
15218 resize_proportionally.
15219 (window_min_height, window_min_width): Move to window.el.
15220 (keys_of_window): Move bindings for delete-other-windows,
15221 split-window, delete-window and enlarge-window to window.el.
15222
15223 * buffer.c: Temporarily extern Qdelete_window.
15224 (Fbury_buffer): Temporarily call Qdelete_window instead of
15225 Fdelete_window (Fbury_buffer will move to window.el soon).
15226
15227 * frame.c (set_menu_bar_lines_1): Remove code handling
15228 orig_top_line and orig_total_lines.
15229
15230 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15231 set_window_height but set heights directly.
15232 (change_frame_size_1): Use resize_frame_windows.
15233
15234 * xdisp.c (init_xdisp): Don't use set_window_height but set
15235 heights directly.
15236
15237 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15238 Use resize_frame_windows instead of change_window_heights and run
15239 run_window_configuration_change_hook.
15240
15241 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15242 instead of change_window_heights and run
15243 run_window_configuration_change_hook.
15244
15245 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15246
15247 * window.c (replace_window): Rename second argument REPLACEMENT to
15248 NEW. New third argument SETFLAG. Rewrite.
15249 (delete_window, make_dummy_parent): Call replace_window with
15250 third argument 1.
15251 (window_list_1): Move down in code.
15252 (run_window_configuration_change_hook): Move set_buffer part
15253 before select_frame_norecord part in order to unwind correctly.
15254 Rename count1 to count.
15255 (recombine_windows, delete_deletable_window, resize_root_window)
15256 (Fdelete_other_windows_internal)
15257 (Frun_window_configuration_change_hook, make_parent_window)
15258 (resize_window_check, resize_window_apply, Fresize_window_apply)
15259 (resize_frame_windows, Fsplit_window_internal)
15260 (Fdelete_window_internal, Fresize_mini_window_internal):
15261 New functions.
15262 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15263
15264 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15265
15266 * window.h (window): Add some new members to window structure -
15267 normal_lines, normal_cols, new_total, new_normal, clone_number,
15268 splits, nest, prev_buffers, next_buffers.
15269 (WINDOW_TOTAL_SIZE): Move here from window.c.
15270 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15271
15272 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15273 Remove.
15274 (make_dummy_parent): Set new members of windows structure.
15275 (make_window): Move down in code. Handle new members of window
15276 structure.
15277 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15278 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15279 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15280 (Fset_window_prev_buffers, Fwindow_next_buffers)
15281 (Fset_window_next_buffers, Fset_window_clone_number):
15282 New functions.
15283 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15284 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15285 Doc-string fixes.
15286 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15287 Argument WINDOW can be now internal window too.
15288 (Fwindow_use_time): Move up in code.
15289 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15290 Rewrite doc-string.
15291 (Fset_window_configuration, saved_window)
15292 (Fcurrent_window_configuration, save_window_save): Handle new
15293 members of window structure.
15294 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15295 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15296 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15297 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15298 Qget_mru_window, Qresize_root_window,
15299 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15300 Qauto_buffer_name; staticpro them.
15301
15302 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15303
15304 * window.c (Fwindow_total_size, Fwindow_left_column)
15305 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15306 (Fwindow_list_1): New functions.
15307 (window_box_text_cols): Replace with window_body_cols.
15308 (Fwindow_width, Fscroll_left, Fscroll_right):
15309 Use window_body_cols instead of window_box_text_cols.
15310 (delete_window, Fset_window_configuration):
15311 Call delete_all_subwindows with window as argument.
15312 (delete_all_subwindows): Take a window as argument and not a
15313 structure. Rewrite.
15314 (window_loop): Remove handling of GET_LRU_WINDOW and
15315 GET_LARGEST_WINDOW.
15316 (Fget_lru_window, Fget_largest_window): Move to window.el.
15317
15318 * window.h: Extern window_body_cols instead of
15319 window_box_text_cols. delete_all_subwindows now takes a
15320 Lisp_Object as argument.
15321
15322 * indent.c (compute_motion, Fcompute_motion):
15323 Use window_body_cols instead of window_box_text_cols.
15324
15325 * frame.c (delete_frame): Call delete_all_subwindows with root
15326 window as argument.
15327
15328 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15329
15330 * fns.c (Fputhash): Document return value.
15331
15332 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15333
15334 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15335
15336 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15337
15338 Cons<->int and similar integer overflow fixes (Bug#8794).
15339
15340 Check for overflow when converting integer to cons and back.
15341 * charset.c (Fdefine_charset_internal, Fdecode_char):
15342 Use cons_to_unsigned to catch overflow.
15343 (Fencode_char): Use INTEGER_TO_CONS.
15344 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15345 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15346 * data.c (long_to_cons, cons_to_long): Remove.
15347 (cons_to_unsigned, cons_to_signed): New functions.
15348 These signal an error for invalid or out-of-range values.
15349 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15350 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15351 * font.c (Ffont_variation_glyphs):
15352 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15353 * lisp.h: Include <intprops.h>.
15354 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15355 (cons_to_signed, cons_to_unsigned): New decls.
15356 (long_to_cons, cons_to_long): Remove decls.
15357 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15358 (Fprimitive_undo): Use CONS_TO_INTEGER.
15359 * xfns.c (Fx_window_property): Likewise.
15360 * xselect.c: Include <limits.h>.
15361 (x_own_selection, selection_data_to_lisp_data):
15362 Use INTEGER_TO_CONS.
15363 (x_handle_selection_request, x_handle_selection_clear)
15364 (x_get_foreign_selection, Fx_disown_selection_internal)
15365 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15366 (lisp_data_to_selection_data): Use cons_to_unsigned.
15367 (x_fill_property_data): Use cons_to_signed.
15368 Report values out of range.
15369
15370 Check for buffer and string overflow more precisely.
15371 * buffer.h (BUF_BYTES_MAX): New macro.
15372 * lisp.h (STRING_BYTES_MAX): New macro.
15373 * alloc.c (Fmake_string):
15374 * character.c (string_escape_byte8):
15375 * coding.c (coding_alloc_by_realloc):
15376 * doprnt.c (doprnt):
15377 * editfns.c (Fformat):
15378 * eval.c (verror):
15379 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15380 since they may not be the same number.
15381 * editfns.c (Finsert_char):
15382 * fileio.c (Finsert_file_contents):
15383 Likewise for BUF_BYTES_MAX.
15384
15385 * image.c: Use ptrdiff_t, not int, for sizes.
15386 (slurp_file): Switch from int to ptrdiff_t.
15387 All uses changed.
15388 (slurp_file): Check that file size fits in both size_t (for
15389 malloc) and ptrdiff_t (for sanity and safety).
15390
15391 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15392 if b->modtime has its maximal value.
15393
15394 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15395
15396 Don't assume time_t can fit into int.
15397 * buffer.h (struct buffer.modtime): Now time_t, not int.
15398 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15399 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15400
15401 Minor fixes for signed vs unsigned integers.
15402 * character.h (MAYBE_UNIFY_CHAR):
15403 * charset.c (maybe_unify_char):
15404 * keyboard.c (read_char, reorder_modifiers):
15405 XINT -> XFASTINT, since the integer must be nonnegative.
15406 * ftfont.c (ftfont_spec_pattern):
15407 * keymap.c (access_keymap, silly_event_symbol_error):
15408 XUINT -> XFASTINT, since the integer must be nonnegative.
15409 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15410 since it makes no difference and we prefer signed.
15411 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15412 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15413 nonnegative.
15414
15415 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15416
15417 * window.h (Fwindow_frame): Declare.
15418
15419 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15420
15421 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15422 (SPARE_MEMORY): Always define.
15423 (LARGE_REQUEST): Remove.
15424 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15425
15426 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15427
15428 * lisp.h: Move EXFUNS for Fframe_root_window,
15429 Fframe_first_window and Fset_frame_selected_window to window.h.
15430
15431 * window.h: Move EXFUNS for Fframe_root_window,
15432 Fframe_first_window and Fset_frame_selected_window here from
15433 lisp.h.
15434
15435 * frame.c (Fwindow_frame, Fframe_first_window)
15436 (Fframe_root_window, Fframe_selected_window)
15437 (Fset_frame_selected_window): Move to window.c.
15438 (Factive_minibuffer_window): Move to minibuf.c.
15439 (Fother_visible_frames_p): New function.
15440
15441 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15442
15443 * window.c (decode_window, decode_any_window): Move up in code.
15444 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15445 (inhibit_frame_unsplittable): Remove unused variable.
15446 (Fwindow_buffer): Move up and rewrite doc-string.
15447 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15448 (Fwindow_prev): New functions.
15449 (Fwindow_frame): Move here from frame.c. Accept any window as
15450 argument.
15451 (Fframe_root_window, Fframe_first_window)
15452 (Fframe_selected_window): Move here from frame.c. Accept frame
15453 or arbitrary window as argument. Update doc-strings.
15454 (Fminibuffer_window): Move up in code.
15455 (Fwindow_minibuffer_p): Move up in code and simplify.
15456 (Fset_frame_selected_window): Move here from frame.c.
15457 Marginal rewrite.
15458 (Fselected_window, select_window, Fselect_window): Move up in
15459 code. Minor doc-string fixes.
15460
15461 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15462
15463 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15464 Do not assume that spare memory exists; that assumption is valid
15465 only if SYSTEM_MALLOC.
15466 (LARGE_REQUEST): New macro, so that the issue of large requests
15467 is separated from the issue of spare memory.
15468
15469 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15470
15471 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15472 format. (Bug#8806)
15473
15474 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15475
15476 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15477 before statements.
15478
15479 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15480
15481 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15482
15483 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15484
15485 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15486 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15487
15488 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15489
15490 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15491
15492 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15493
15494 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15495 (x_clipboard_manager_save): Add return value.
15496 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15497 New error handlers.
15498 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15499 Obey Vx_select_enable_clipboard_manager. Catch errors in
15500 x_clipboard_manager_save (Bug#8779).
15501 (Vx_select_enable_clipboard_manager): New variable.
15502 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15503
15504 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15505
15506 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15507
15508 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15509
15510 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15511 in the current matrix if keep_current_p is non-zero.
15512
15513 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15514
15515 * bidi.c (bidi_level_of_next_char): Fix last change.
15516
15517 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15518
15519 Support bidi reordering of text covered by display properties.
15520
15521 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15522 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15523 (bidi_cache_search, bidi_cache_iterator_state)
15524 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15525 (bidi_level_of_next_char, bidi_move_to_visually_next):
15526 Support character positions inside a run of characters covered by a
15527 display string.
15528 (bidi_paragraph_init, bidi_resolve_explicit_1)
15529 (bidi_level_of_next_char): Call bidi_fetch_char and
15530 bidi_fetch_char_advance instead of FETCH_CHAR and
15531 FETCH_CHAR_ADVANCE.
15532 (bidi_init_it): Initialize new members.
15533 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15534 definitions.
15535 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15536 instead of using explicit *_CHAR codes.
15537 (bidi_resolve_explicit, bidi_resolve_weak):
15538 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15539 bidirectional text is supported only in multibyte buffers.
15540 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15541 it to initialize the frame_window_p member of struct bidi_it.
15542 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15543 (bidi_resolve_explicit, bidi_resolve_weak)
15544 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15545 bidi_it->nchars is non-positive.
15546 (bidi_level_of_next_char): Don't try to lookup the cache for the
15547 next/previous character if nothing is cached there yet, or if we
15548 were just reseat()'ed to a new position.
15549
15550 * xdisp.c (set_cursor_from_row): Set start and stop points
15551 according to the row's direction when priming the loop that looks
15552 for the glyph on which to display cursor.
15553 (single_display_spec_intangible_p): Function deleted.
15554 (display_prop_intangible_p): Reimplement to call
15555 handle_display_spec instead of single_display_spec_intangible_p.
15556 Accept 3 additional arguments needed by handle_display_spec.
15557 This fixes incorrect cursor motion across display property with complex
15558 values: lists, `(when COND...)' forms, etc.
15559 (single_display_spec_string_p): Support property values that are
15560 lists with the argument STRING its top-level element.
15561 (display_prop_string_p): Fix the condition for processing a
15562 property that is a list to be consistent with handle_display_spec.
15563 (handle_display_spec): New function, refactored from the
15564 last portion of handle_display_prop.
15565 (compute_display_string_pos): Accept additional argument
15566 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15567 value of a `display' property is a "replacing spec".
15568 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15569 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15570 the display property, but just return a value indicating whether
15571 the display property will replace the characters it covers.
15572 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15573 frame_window_p members of struct bidi_it.
15574 (compute_display_string_pos, compute_display_string_end):
15575 New functions.
15576 (push_it): Accept second argument POSITION, where pop_it should
15577 jump to continue iteration.
15578 (reseat_1): Initialize bidi_it.disp_pos.
15579
15580 * keyboard.c (adjust_point_for_property): Adjust the call to
15581 display_prop_intangible_p to its new signature.
15582
15583 * dispextern.h (struct bidi_it): New member frame_window_p.
15584 (bidi_init_it): Update prototypes.
15585 (display_prop_intangible_p): Update prototype.
15586 (compute_display_string_pos, compute_display_string_end):
15587 Declare prototypes.
15588 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15589 EMACS_INT.
15590
15591 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15592
15593 Malloc failure behavior now depends on size of allocation.
15594 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15595 * lisp.h: Change signatures accordingly.
15596 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15597 All callers changed. (Bug#8762)
15598
15599 * gnutls.c: Use Emacs's memory allocators.
15600 Without this change, the gnutls library would invoke malloc etc.
15601 directly, which causes problems on non-SYNC_INPUT hosts, and which
15602 runs afoul of improving memory_full behavior. (Bug#8761)
15603 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15604 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15605 xfree instead of the default malloc, realloc, free.
15606 (Fgnutls_boot): No need to check for memory allocation failure,
15607 since xmalloc does that for us.
15608
15609 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15610 * category.c (hash_get_category_set):
15611 * ccl.c (ccl_driver):
15612 * charset.c (Fdefine_charset_internal):
15613 * charset.h (struct charset.hash_index):
15614 * composite.c (get_composition_id, gstring_lookup_cache)
15615 (composition_gstring_put_cache):
15616 * composite.h (struct composition.hash_index):
15617 * dispextern.h (struct image.hash):
15618 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15619 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15620 (hashfn_equal, hashfn_user_defined, make_hash_table)
15621 (maybe_resize_hash_table, hash_lookup, hash_put)
15622 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15623 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15624 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15625 * image.c (make_image, search_image_cache, lookup_image)
15626 (xpm_put_color_table_h):
15627 * lisp.h (struct Lisp_Hash_Table):
15628 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15629 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15630 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15631 * alloc.c (allocate_vectorlike):
15632 Check for overflow in vector size calculations.
15633 * ccl.c (ccl_driver):
15634 Check for overflow when converting EMACS_INT to int.
15635 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15636 need to be updated by these changes.
15637 * fns.c (make_hash_table, maybe_resize_hash_table):
15638 Check for integer overflow with large hash tables.
15639 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15640 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15641 (SXHASH_REDUCE): New macro.
15642 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15643 Use it instead of discarding useful hash info with large hash values.
15644 (sxhash_float): New function.
15645 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15646 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15647 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15648 Rewrite to use FIXNUM_BITS, as this simplifies things.
15649 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15650 Adjust signatures to match updated version of code.
15651 (consing_since_gc): Now EMACS_INT, since a single hash table can
15652 use more than INT_MAX bytes.
15653
15654 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15655
15656 Make it possible to build with GCC-4.6+ -O2 -flto.
15657
15658 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15659
15660 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15661
15662 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15663 Call minibuffer-inactive-mode.
15664
15665 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15666
15667 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15668 Update dependencies.
15669
15670 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15671
15672 * data.c (init_data): Remove code for UTS, this system is not
15673 supported anymore.
15674
15675 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15676
15677 Don't force ./temacs to start in terminal mode.
15678
15679 * frame.c (make_initial_frame): Initialize faces in all cases, not
15680 only when CANNOT_DUMP is defined.
15681 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15682
15683 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15684
15685 * dispnew.c (add_window_display_history): Use const for the string
15686 pointer. Remove declaration, not needed.
15687
15688 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15689
15690 Use 'inline', not 'INLINE'.
15691 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15692 * alloc.c, fontset.c (INLINE): Remove.
15693 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15694 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15695 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15696 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15697 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15698
15699 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15700
15701 Make it possible to run ./temacs.
15702
15703 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15704 syms_of_callproc does the same thing. Remove test for
15705 "initialized", do it in the caller.
15706 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15707
15708 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15709
15710 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15711 (read_minibuf): Use get_minibuffer.
15712 (syms_of_minibuf): Use DEFSYM.
15713 (Qmetadata): New var.
15714 * data.c (Qbuffer): Don't make it static.
15715 (syms_of_data): Use DEFSYM.
15716
15717 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15718
15719 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15720 (CCL_CODE_MIN): New macro.
15721
15722 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15723
15724 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15725
15726 * eval.c (Qdebug): Now static.
15727 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15728 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15729 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15730
15731 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15732
15733 * image.c: Various fixes to ImageMagick code comments.
15734 (Fimagemagick_types): Doc fix.
15735
15736 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15737
15738 Minor fixes prompted by GCC 4.6.0 warnings.
15739
15740 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15741
15742 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15743 (x_clipboard_manager_save_all): Move extern decl to ...
15744 * xterm.h: ... here, so that it can be checked for consistency.
15745
15746 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15747
15748 * xselect.c (x_clipboard_manager_save_frame)
15749 (x_clipboard_manager_save_all): New functions.
15750 (Fx_clipboard_manager_save): Lisp function deleted.
15751
15752 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15753 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15754
15755 * xterm.h: Update prototype.
15756
15757 2011-05-28 William Xu <william.xwl@gmail.com>
15758
15759 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15760 exiting (Bug#8239).
15761
15762 2011-05-28 Jim Meyering <meyering@redhat.com>
15763
15764 Avoid a sign-extension bug in crypto_hash_function.
15765 * fns.c (to_uchar): Define.
15766 (crypto_hash_function): Use it to convert some newly-signed
15767 variables to unsigned, to avoid sign-extension bugs. For example,
15768 without this change, (md5 "truc") would evaluate to
15769 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15770 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15771 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15772
15773 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15774
15775 Integer overflow fixes.
15776
15777 * dbusbind.c: Serial number integer overflow fixes.
15778 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15779 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15780 to hold a serial number that is too large for a fixnum.
15781 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15782 Check for serial numbers out of range. Decode any serial number
15783 that was so large that it became a float. (Bug#8722)
15784
15785 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15786 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15787 Use XFASTINT rather than XUINT when numbers are nonnegative.
15788 (xd_append_arg, Fdbus_method_return_internal):
15789 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15790 arguments, check that Lisp number is nonnegative, rather than
15791 silently wrapping negative numbers around. (Bug#8722)
15792 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15793 (Bug#8722)
15794
15795 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15796
15797 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15798
15799 ccl: Add integer overflow checks.
15800 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15801 (IN_INT_RANGE): New macros.
15802 (ccl_driver): Use them to check for integer overflow when
15803 decoding a CCL program. Many of the new checks are whether XINT (x)
15804 fits in int; it doesn't always, on 64-bit hosts. The new version
15805 doesn't catch all possible integer overflows, but it's an
15806 improvement. (Bug#8719)
15807
15808 * alloc.c (make_event_array): Use XINT, not XUINT.
15809 There's no need for unsigned here.
15810
15811 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15812 This follows up to the 2011-05-06 change that substituted uintptr_t
15813 for EMACS_INT. This case wasn't caught back then.
15814
15815 Rework Fformat to avoid integer overflow issues.
15816 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15817 now (part of C89). Include <verify.h>.
15818 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15819 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15820 (Fformat): Avoid the prepass trying to compute sizes; it was only
15821 approximate and thus did not catch overflow reliably. Instead, walk
15822 through the format just once, formatting and computing sizes as we go,
15823 checking for integer overflow at every step, and allocating a larger
15824 buffer as needed. Keep track separately whether the format is
15825 multibyte. Keep only the most-recently calculated precision, rather
15826 than them all. Record whether each argument has been converted to
15827 string. Use EMACS_INT, not int, for byte and char and arg counts.
15828 Support field widths and precisions larger than INT_MAX. Avoid
15829 sprintf's undefined behavior with conversion specifications such as %#d
15830 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15831 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15832 formatting out-of-range floating point numbers with int
15833 formats. (Bug#8668)
15834
15835 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15836
15837 * data.c: Avoid integer truncation in expressions involving floats.
15838 * data.c: Include <intprops.h>.
15839 (arith_driver): When there's an integer overflow in an expression
15840 involving floating point, convert the integers to floating point
15841 so that the resulting value does not suffer from catastrophic
15842 integer truncation. For example, on a 64-bit host (* 4
15843 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15844 Do not rely on undefined behavior after integer overflow.
15845
15846 merge count_size_as_multibyte, parse_str_to_multibyte
15847 * character.c, character.h (count_size_as_multibyte):
15848 Rename from parse_str_to_multibyte; all uses changed.
15849 Check for integer overflow.
15850 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15851 since it's now a duplicate of the other. This is more of
15852 a character than a buffer op, so better that it's in character.c.
15853 * fns.c, print.c: Adjust to above changes.
15854
15855 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15856
15857 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15858
15859 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15860
15861 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15862 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15863 (x_clipboard_manager_save): Now static.
15864 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15865
15866 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15867 (crypto_hash_function): Now static.
15868 Fix pointer signedness problems. Avoid unnecessary initializations.
15869
15870 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15871
15872 * termhooks.h (Vselection_alist): Make it terminal-local.
15873
15874 * terminal.c (create_terminal): Initialize it.
15875
15876 * xselect.c: Support for clipboard managers.
15877 (Vselection_alist): Move to termhooks.h as terminal-local var.
15878 (LOCAL_SELECTION): New macro.
15879 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15880 (symbol_to_x_atom): Remove gratuitous arg.
15881 (x_handle_selection_request, lisp_data_to_selection_data)
15882 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15883 (x_own_selection, x_get_local_selection, x_convert_selection):
15884 New arg, specifying work frame. Use terminal-local Vselection_alist.
15885 (some_frame_on_display): Delete unused function.
15886 (Fx_own_selection_internal, Fx_get_selection_internal)
15887 (Fx_disown_selection_internal, Fx_selection_owner_p)
15888 (Fx_selection_exists_p): New optional frame arg.
15889 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15890 (x_handle_selection_clear): Don't treat other terminals with the
15891 same keyboard specially. Use the terminal-local Vselection_alist.
15892 (x_clear_frame_selections): Use Frun_hook_with_args.
15893
15894 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15895
15896 * xterm.h: Add support for those atoms.
15897
15898 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15899
15900 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15901 (converted_selections, conversion_fail_tag): New global variables.
15902 (x_selection_request_lisp_error): Free the above.
15903 (x_get_local_selection): Remove unnecessary code.
15904 (x_reply_selection_request): Args changed; handle arbitrary array
15905 of converted selections stored in converted_selections.
15906 Separate the XChangeProperty and SelectionNotify steps.
15907 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15908 (x_convert_selection): New function.
15909 (x_handle_selection_event): Simplify.
15910 (x_get_foreign_selection): Don't ignore incoming requests while
15911 waiting for an answer; this will fail when we implement
15912 SAVE_TARGETS, and seems unnecessary anyway.
15913 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15914 (Vx_sent_selection_functions): Doc fix.
15915
15916 2011-05-26 Leo Liu <sdl.web@gmail.com>
15917
15918 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15919
15920 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15921
15922 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15923
15924 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15925 for fringe update if it has periodic bitmap.
15926 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15927 and fringe_bitmap_periodic_p.
15928
15929 * fringe.c (get_fringe_bitmap_data): New function.
15930 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15931 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15932 row. Mark glyph row for fringe update if periodicity changed.
15933
15934 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15935 for fringe update unless it has periodic bitmap.
15936
15937 2011-05-25 Kenichi Handa <handa@m17n.org>
15938
15939 * xdisp.c (get_next_display_element): Set correct it->face_id for
15940 a static composition.
15941
15942 2011-05-24 Leo Liu <sdl.web@gmail.com>
15943
15944 * deps.mk (fns.o):
15945 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15946
15947 * fns.c (crypto_hash_function, Fsha1): New function.
15948 (Fmd5): Use crypto_hash_function.
15949 (syms_of_fns): Add Ssha1.
15950
15951 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15952
15953 * gnutls.c: Remove unused macros.
15954 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15955 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15956 Remove macros that are defined and never used.
15957 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15958
15959 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15960
15961 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15962 (Fx_get_selection_internal): Minor cleanup.
15963 (Fx_own_selection_internal): Rename arguments for consistency with
15964 select.el.
15965
15966 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15967
15968 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15969
15970 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15971
15972 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15973
15974 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15975
15976 * dispnew.c (scrolling_window): Don't exclude the case that the
15977 last enabled row in the desired matrix touches the bottom boundary.
15978
15979 2011-05-21 Glenn Morris <rgm@gnu.org>
15980
15981 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15982 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15983 and add some more files.
15984
15985 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15986
15987 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15988 report_file_error introduced by the change from 2011-05-07.
15989
15990 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15991
15992 * systime.h (Time): Define only if emacs is defined.
15993 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15994 where the include path doesn't have X11/X.h by default. See
15995 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15996
15997 2011-05-20 Kenichi Handa <handa@m17n.org>
15998
15999 * composite.c (find_automatic_composition): Fix previous change.
16000
16001 2011-05-20 Glenn Morris <rgm@gnu.org>
16002
16003 * lisp.mk: New file, split from Makefile.in.
16004 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16005 (shortlisp): Remove.
16006 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16007
16008 2011-05-19 Glenn Morris <rgm@gnu.org>
16009
16010 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16011 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16012 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16013 (lisp): Set the order to that of loadup.el.
16014 (shortlisp): Make it a copy of $lisp.
16015 (SOME_MACHINE_LISP): Remove.
16016 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16017 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16018
16019 2011-05-18 Kenichi Handa <handa@m17n.org>
16020
16021 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16022 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16023 (find_automatic_composition): Mostly rewrite for efficiency.
16024
16025 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16026
16027 * makefile.w32-in: Update dependencies.
16028
16029 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16030
16031 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16032 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16033
16034 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16035
16036 Fix some integer overflow issues, such as string length overflow.
16037
16038 * insdel.c (count_size_as_multibyte): Check for string overflow.
16039
16040 * character.c (lisp_string_width): Check for string overflow.
16041 Use EMACS_INT, not int, for string indexes and lengths; in
16042 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16043 the resulting string length overflows an EMACS_INT; instead,
16044 report a string overflow if no precision given. When checking for
16045 precision exhaustion, use a check that cannot possibly have
16046 integer overflow. (Bug#8675)
16047 * character.h (lisp_string_width): Adjust to new signature.
16048
16049 * alloc.c (string_overflow): New function.
16050 (Fmake_string): Use it. This doesn't change behavior, but saves
16051 a few bytes and will simplify future changes.
16052 * character.c (string_escape_byte8): Likewise.
16053 * lisp.h (string_overflow): New decl.
16054
16055 Fixups, following up to the user-interface timestamp change.
16056 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16057 for UI timestamps, instead of unsigned long.
16058 * msdos.c (mouse_get_pos): Likewise.
16059 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16060 * w32gui.h (Time): Define by including "systime.h" rather than by
16061 declaring it ourselves. (Bug#8664)
16062
16063 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16064 * image.c (clear_image_cache): Likewise.
16065
16066 * term.c (term_mouse_position): Don't assume time_t wraparound.
16067
16068 Be more systematic about user-interface timestamps.
16069 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16070 and sometimes 'EMACS_UINT', to represent these timestamps.
16071 This change causes it to use 'Time' uniformly, as that's what X uses.
16072 This makes the code easier to follow, and makes it easier to catch
16073 integer overflow bugs such as Bug#8664.
16074 * frame.c (Fmouse_position, Fmouse_pixel_position):
16075 Use Time, not unsigned long, for user-interface timestamps.
16076 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16077 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16078 * keyboard.h (last_event_timestamp): Likewise.
16079 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16080 * menu.h (xmenu_show): Likewise.
16081 * term.c (term_mouse_position): Likewise.
16082 * termhooks.h (struct input_event.timestamp): Likewise.
16083 (struct terminal.mouse_position_hook): Likewise.
16084 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16085 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16086 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16087 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16088 what it was before.
16089 * menu.h, termhooks.h: Include "systime.h", for Time.
16090
16091 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16092 Don't assume that the difference between two unsigned long values
16093 can fit into an integer. At this point, we know button_down_time
16094 <= event->timestamp, so the difference must be nonnegative, so
16095 there's no need to cast the result if double-click-time is
16096 nonnegative, as it should be; check that it's nonnegative, just in
16097 case. This bug is triggered when events are more than 2**31 ms
16098 apart (about 25 days). (Bug#8664)
16099
16100 * xselect.c (last_event_timestamp): Remove duplicate decl.
16101 (x_own_selection): Remove needless cast to unsigned long.
16102
16103 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16104 that always fit in int. Use a sentinel instead of a counter, to
16105 avoid a temp and to allay GCC's concerns about possible int overflow.
16106 * frame.h (struct frame): Use int for menu_bar_items_used
16107 instead of EMACS_INT, since it always fits in int.
16108
16109 * menu.c (grow_menu_items): Check for int overflow.
16110
16111 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16112
16113 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16114 Before, the code was not consistent. These values cannot exceed
16115 2**31 - 1 so there's no need to make them unsigned.
16116 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16117 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16118 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16119 as modifiers.
16120 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16121
16122 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16123 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16124 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16125 presumably because the widths might not match.
16126
16127 * window.c (size_window): Avoid needless test at loop start.
16128
16129 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16130
16131 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16132
16133 2011-05-12 Drew Adams <drew.adams@oracle.com>
16134
16135 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16136
16137 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16138
16139 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16140 `width' to `bar_area_x' and `bar_area_width', respectively.
16141 (x_scroll_run): Take account of fringe background extension.
16142
16143 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16144 Rename local vars `left' and `width' to `bar_area_x' and
16145 `bar_area_width', respectively.
16146 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16147 background extension.
16148
16149 2011-05-10 Jim Meyering <meyering@redhat.com>
16150
16151 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16152
16153 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16154
16155 * image.c (Finit_image_library): Return t for built-in image types,
16156 like pbm and xbm. (Bug#8640)
16157
16158 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16159
16160 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16161
16162 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16163
16164 * w32console.c (Fset_screen_color): Doc fix.
16165 (Fget_screen_color): New function.
16166 (syms_of_ntterm): Defsubr it.
16167
16168 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16169 unlink the temporary file if Fcall_process didn't create it in the
16170 first place.
16171 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16172 child process will be redirected to a file specified with `:file'.
16173 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16174 cue to call_process_cleanup not to close that handle.
16175
16176 2011-05-07 Ben Key <bkey76@gmail.com>
16177
16178 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16179 one of two shell specific rules, either bootstrap-temacs-CMD or
16180 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16181 to the previous implementation of the bootstrap-temacs rule.
16182 The bootstrap-temacs-CMD rule is similar to the previous
16183 implementation of the bootstrap-temacs rule except that it
16184 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16185 variable.
16186
16187 These changes, along with some changes to nt/configure.bat,
16188 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16189 earlier fix to add support for --cflags and --ldflags options
16190 that include quotes so that it works whether make uses cmd or
16191 sh as the shell.
16192
16193 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16194
16195 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16196 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16197 is a constant.
16198 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16199 a string. Handle both cases.
16200 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16201 (Fdbus_register_method): Use Qinvalid_function.
16202
16203 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16204
16205 * makefile.w32-in: Update dependencies.
16206 (LISP_H): Add inttypes.h and stdin.h.
16207 (PROCESS_H): Add unistd.h.
16208
16209 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16210
16211 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16212 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16213
16214 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16215
16216 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16217
16218 * term.c (vfatal): Remove stray call to va_end.
16219 It's not needed and the C Standard doesn't allow it here anyway.
16220
16221 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16222 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16223
16224 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16225 bytes.
16226
16227 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16228
16229 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16230
16231 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16232
16233 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16234
16235 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16236
16237 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16238 * charset.c (Fdefine_charset_internal): Don't initialize
16239 charset.code_space[15]. The value was garbage, on hosts with
16240 32-bit int (Bug#8600).
16241
16242 * lread.c (read_integer): Be more consistent with string-to-number.
16243 Use string_to_number to do the actual conversion; this avoids
16244 rounding errors and fixes some other screwups. Without this fix,
16245 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16246 (digit_to_number): Move earlier, for benefit of read_integer.
16247 Return -1 if the digit is out of range for the base, -2 if it is
16248 not a digit in any supported base. (Bug#8602)
16249
16250 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16251
16252 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16253 to match comment at start of function. This also removes a
16254 GCC warning about overflow in a 32+64-bit port.
16255
16256 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16257
16258 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16259 Reported by Stefan Monnier in
16260 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16261 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16262 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16263
16264 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16265 (EMACS_UINTPTR): Likewise, with uintptr_t.
16266
16267 * lisp.h: Prefer 64-bit EMACS_INT if available.
16268 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16269 on 32-bit hosts that have 64-bit int, so that they can access
16270 large files.
16271 However, temporarily disable this change unless the temporary
16272 symbol WIDE_EMACS_INT is defined.
16273
16274 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16275
16276 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16277 This removes an assumption that EMACS_INT and long are the same
16278 width as pointers. The assumption is true for Emacs porting targets
16279 now, but we want to make other targets possible.
16280 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16281 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16282 In the rest of the code, change types of integers that hold casted
16283 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16284 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16285 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16286 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16287 No need to cast type when ORing.
16288 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16289 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16290 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16291 assume EMACS_INT is the same width as char *.
16292 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16293 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16294 Remove no-longer-needed casts.
16295 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16296 (xg_tool_bar_help_callback, xg_make_tool_item):
16297 Use EMACS_INTPTR to hold an integer
16298 that will be cast to void *; this can avoid a GCC warning
16299 if EMACS_INT is not the same width as void *.
16300 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16301 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16302 (current_message_1, set_message_1):
16303 Use a local to convert to proper width without a cast.
16304 * xmenu.c (dialog_selection_callback): Likewise.
16305
16306 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16307 Also, don't assume VALBITS / RAND_BITS is less than 5,
16308 and don't rely on undefined behavior when shifting a 1 left into
16309 the sign bit.
16310 * lisp.h (get_random): Change signature to match.
16311
16312 * lread.c (hash_string): Use size_t, not int, for hash computation.
16313 Normally we prefer signed values; but hashing is special, because
16314 it's better to use unsigned division on hash table sizes so that
16315 the remainder is nonnegative. Also, size_t is the natural width
16316 for hashing into memory. The previous code used 'int', which doesn't
16317 retain enough info to hash well into very large tables.
16318 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16319
16320 * dbusbind.c: Don't possibly lose pointer info when converting.
16321 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16322 Use XPNTR rather than XHASH, so that the high-order bits of
16323 the pointer aren't lost when converting through void *.
16324
16325 * eval.c (Fautoload): Don't double-shift a pointer.
16326
16327 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16328
16329 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16330
16331 * gnutls.c (DEF_GNUTLS_FN):
16332 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16333
16334 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16335
16336 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16337 marker. (Bug#8610)
16338
16339 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16340
16341 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16342 New version that can reserve upto 2GB of heap space.
16343
16344 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16345
16346 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16347
16348 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16349
16350 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16351 `gnutls_certificate_set_x509_key_file'.
16352
16353 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16354
16355 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16356 Update dependencies.
16357
16358 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16359
16360 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16361 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16362 Remove unused parameter `fildes'.
16363 * process.c (read_process_output, send_process): Don't pass it.
16364
16365 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16366
16367 Fix previous change: the library cache is defined in w32.c.
16368 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16369 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16370
16371 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16372
16373 Implement dynamic loading of GnuTLS on Windows.
16374
16375 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16376 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16377 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16378 Declare.
16379
16380 * gnutls.c (Qgnutls_dll): Define.
16381 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16382 (gnutls_*): Declare function pointers.
16383 (init_gnutls_functions): New function to initialize function pointers.
16384 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16385 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16386 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16387 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16388 (emacs_gnutls_write, emacs_gnutls_read)
16389 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16390 (Fgnutls_available_p): New function.
16391 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16392 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16393 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16394
16395 * image.c: Include w32.h.
16396 (Vimage_type_cache): Delete.
16397 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16398 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16399 (w32_delayed_load): Move to w32.c.
16400
16401 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16402
16403 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16404 (w32_delayed_load): Move from image.c. When loading a library, record
16405 its filename in the :loaded-from property of the library id.
16406 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16407 Initialize and staticpro them.
16408 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16409
16410 * process.c: Include lisp.h before w32.h, not after.
16411 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16412 instead of gnutls_record_check_pending.
16413
16414 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16415
16416 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16417
16418 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16419 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16420 as passed in.
16421
16422 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16423
16424 * xterm.c (x_set_frame_alpha): Do not set property on anything
16425 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16426
16427 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16428
16429 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16430
16431 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16432
16433 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16434 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16435 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16436 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16437 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16438 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16439 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16440 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16441 (Qgnutls_bootprop_callbacks_verify): Make static.
16442
16443 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16444
16445 * callproc.c: Indentation fixup.
16446
16447 * sysdep.c (wait_for_termination_1): Make static.
16448 (wait_for_termination, interruptible_wait_for_termination):
16449 Move after wait_for_termination_1.
16450
16451 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16452
16453 * sysdep.c (interruptible_wait_for_termination): New function
16454 which is like wait_for_termination, but allows keyboard
16455 interruptions.
16456
16457 * callproc.c (Fcall_process): Add (:file "file") as an option for
16458 the STDOUT buffer.
16459 (Fcall_process_region): Ditto.
16460
16461 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16462
16463 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16464 rather than `XVECTOR (FOO)->size'.
16465
16466 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16467 inttypes.h, as a gnulib replacement is used if it not available in
16468 system headers.
16469
16470 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16471
16472 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16473 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16474 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16475
16476 * coding.c (coding_alloc_by_realloc): Error out if destination
16477 will grow beyond MOST_POSITIVE_FIXNUM.
16478 (decode_coding_emacs_mule): Abort if there isn't enough place in
16479 charbuf for the composition carryover bytes. Reserve an extra
16480 space for up to 2 characters produced in a loop.
16481 (decode_coding_iso_2022): Abort if there isn't enough place in
16482 charbuf for the composition carryover bytes.
16483
16484 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16485
16486 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16487 aborting when %lld or %lll format is passed.
16488 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16489 %llo or %llx format is passed. (Bug#8545)
16490
16491 * window.c (window_scroll_line_based): Use a marker instead of
16492 simple variables to record original value of point. (Bug#7952)
16493
16494 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16495 produced by %s or %c overflows available buffer space. (Bug#8545)
16496
16497 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16498
16499 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16500 (SIZE_MAX): Move defn after all includes, as they might #define it.
16501
16502 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16503
16504 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16505
16506 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16507
16508 * keyboard.c (Qdelayed_warnings_hook): Define.
16509 (command_loop_1): Run `delayed-warnings-hook'
16510 if Vdelayed_warnings_list is non-nil.
16511 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16512 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16513
16514 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16515
16516 * doprnt.c (doprnt): Don't return value smaller than the buffer
16517 size if the message was truncated. (Bug#8545).
16518
16519 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16520
16521 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16522 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16523
16524 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16525
16526 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16527
16528 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16529
16530 * makefile.w32-in: Update dependencies.
16531
16532 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16533
16534 Improve `doprnt' and its usage. (Bug#8545)
16535 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16536 `format_end'. Remove support for %l as a conversion specifier.
16537 Don't use xrealloc. Improve diagnostics when the %l size modifier
16538 is used. Update the commentary.
16539
16540 * eval.c (verror): Simplify calculation of size_t.
16541
16542 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16543 messages.
16544
16545 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16546
16547 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16548 change.
16549
16550 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16551
16552 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16553 This makes this file independent of the recent pseudovector change.
16554
16555 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16556
16557 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16558
16559 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16560 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16561 Remove unused local.
16562 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16563
16564 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16565 GCC 4.6.0 optimizes based on type-based alias analysis.
16566 For example, if b is of type struct buffer * and v of type struct
16567 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16568 != &v->size, and therefore "v->size = 1; b->size = 2; return
16569 v->size;" must therefore return 1. This assumption is incorrect
16570 for Emacs, since it type-puns struct Lisp_Vector * with many other
16571 types. To fix this problem, this patch adds a new type struct
16572 vectorlike_header that documents the constraints on layout of vectors
16573 and pseudovectors, and helps optimizing compilers not get fooled
16574 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16575 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16576 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16577 the size member.
16578 (XSETPVECTYPE): Rewrite in terms of new macro.
16579 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16580 This is a bit clearer, and further avoids the possibility of
16581 undesirable aliasing.
16582 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16583 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16584 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16585 since Lisp_Subr is a special case (no "next" field).
16586 (ASIZE): Now uses header.size rather than size.
16587 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16588 to avoid the hassle of writing XVECTOR (foo)->header.size.
16589 (struct vectorlike_header): New type.
16590 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16591 object, to help avoid aliasing.
16592 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16593 (SUBRP): Likewise, since Lisp_Subr is a special case.
16594 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16595 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16596 (struct Lisp_Hash_Table): Combine first two members into a single
16597 struct vectorlike_header member. All uses of "size" and "next" members
16598 changed to be "header.size" and "header.next".
16599 * buffer.h (struct buffer): Likewise.
16600 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16601 * frame.h (struct frame): Likewise.
16602 * process.h (struct Lisp_Process): Likewise.
16603 * termhooks.h (struct terminal): Likewise.
16604 * window.c (struct save_window_data, struct saved_window): Likewise.
16605 * window.h (struct window): Likewise.
16606 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16607 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16608 * buffer.c (init_buffer_once): Likewise.
16609 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16610 special case.
16611 * process.c (Fformat_network_address): Use local var for size,
16612 for brevity.
16613
16614 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16615
16616 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16617 * data.c (atof): Remove decl; no longer used or needed.
16618 (digit_to_number): Move to lread.c.
16619 (Fstring_to_number): Use new string_to_number function, to be
16620 consistent with how the Lisp reader treats infinities and NaNs.
16621 Do not assume that floating-point numbers represent EMACS_INT
16622 without losing information; this is not true on most 64-bit hosts.
16623 Avoid double-rounding errors, by insisting on integers when
16624 parsing non-base-10 numbers, as the documentation specifies.
16625 * lisp.h (string_to_number): New decl, replacing ...
16626 (isfloat_string): Remove.
16627 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16628 (read1): Do not accept +. and -. as integers; this
16629 appears to have been a coding error. Similarly, do not accept
16630 strings like +-1e0 as floating point numbers. Do not report
16631 overflow for integer overflows unless the base is not 10 which
16632 means we have no simple and reliable way to continue.
16633 Break out the floating-point parsing into a new
16634 function string_to_number, so that Fstring_to_number parses
16635 floating point numbers consistently with the Lisp reader.
16636 (digit_to_number): Move here from data.c. Make it static inline.
16637 (E_CHAR, EXP_INT): Remove, replacing with ...
16638 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16639 (string_to_number): New function, replacing isfloat_string.
16640 This function checks for valid syntax and produces the resulting
16641 Lisp float number too. Rework it so that string-to-number
16642 no longer mishandles examples like "1.0e+". Use strtoumax,
16643 so that overflow for non-base-10 numbers is reported only when
16644 there's no portable and simple way to convert to floating point.
16645
16646 * textprop.c (set_text_properties_1): Rewrite for clarity,
16647 and to avoid GCC warning about integer overflow.
16648
16649 * intervals.h (struct interval): Use EMACS_INT for members
16650 where EMACS_UINT might cause problems. See
16651 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16652 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16653 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16654 All uses changed.
16655 (offset_intervals): Tell GCC not to worry about length overflow
16656 when negating a negative length.
16657
16658 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16659 (overrun_check_free): Likewise.
16660
16661 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16662 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16663 word size.
16664
16665 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16666 (gnutls_make_error): Rename local to avoid shadowing.
16667 (gnutls_emacs_global_deinit): ifdef out; not used.
16668 (Fgnutls_boot): Use const for pointer to readonly storage.
16669 Comment out unused local. Fix pointer signedness problems.
16670
16671 * lread.c (openp): Don't stuff size_t into an 'int'.
16672 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16673 about possible signed overflow.
16674
16675 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16676 (GDK_KEY_g): Don't define if already defined.
16677 (xg_prepare_tooltip): Avoid pointer signedness problem.
16678 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16679
16680 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16681 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16682
16683 * xfns.c (Fx_window_property): Simplify a bit,
16684 to make a bit faster and to avoid GCC 4.6.0 warning.
16685 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16686
16687 * fns.c (internal_equal): Don't assume size_t fits in int.
16688
16689 * alloc.c (compact_small_strings): Tighten assertion a little.
16690
16691 Replace pEd with more-general pI, and fix some printf arg casts.
16692 * lisp.h (pI): New macro, generalizing old pEd macro to other
16693 conversion specifiers. For example, use "...%"pI"d..." rather
16694 than "...%"pEd"...".
16695 (pEd): Remove. All uses replaced with similar uses of pI.
16696 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16697 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16698 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16699 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16700 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16701 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16702 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16703 64-bit hosts.
16704 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16705 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16706 * print.c (safe_debug_print, print_object): Likewise.
16707 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16708 to int.
16709 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16710 avoiding the 0 flag, which is not portable.
16711 * process.c (Fmake_network_process): Use pI to avoid cast.
16712 * region-cache.c (pp_cache): Likewise.
16713 * xdisp.c (decode_mode_spec): Likewise.
16714 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16715 behavior on 64-bit hosts with printf arg.
16716 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16717 (x_stop_queuing_selection_requests): Likewise.
16718 (x_get_window_property): Don't truncate byte count to an 'int'
16719 when tracing.
16720
16721 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16722 here, since it parses constructs like leading '-' and spaces,
16723 which are not wanted; and it overflows with large numbers.
16724 Instead, simply match F[0-9]+, which is what is wanted anyway.
16725
16726 * alloc.c: Remove unportable assumptions about struct layout.
16727 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16728 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16729 (allocate_vectorlike, make_pure_vector): Use the new macros,
16730 plus offsetof, to remove unportable assumptions about struct layout.
16731 These assumptions hold on all porting targets that I know of, but
16732 they are not guaranteed, they're easy to remove, and removing them
16733 makes further changes easier.
16734
16735 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16736 This doesn't fix a bug but makes the code clearer.
16737 (string_overrun_cookie): Now const. Use initializers that
16738 don't formally overflow signed char, to avoid warnings.
16739 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16740 can cause Emacs to crash when string overrun checking is enabled.
16741 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16742 multiple of sizeof (EMACS_INT); it need not be, if
16743 alignof(EMACS_INT) < sizeof (EMACS_INT).
16744 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16745
16746 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16747
16748 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16749
16750 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16751
16752 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16753 supposed to be handshaking. (Bug#8556)
16754 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16755
16756 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16757
16758 * lisp.h (Qdebug): List symbol.
16759 * eval.c (Qdebug): Restore global linkage.
16760 * keyboard.c (debug-on-event): New variable.
16761 (handle_user_signal): Break into debugger when debug-on-event
16762 matches the current signal symbol.
16763
16764 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16765
16766 * alloc.c (check_sblock, check_string_bytes)
16767 (check_string_free_list): Convert to standard C.
16768
16769 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16770
16771 * w32.c (emacs_gnutls_push): Fix typo.
16772
16773 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16774
16775 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16776 "cast to pointer from integer of different size".
16777
16778 Improve doprnt and its use in verror. (Bug#8545)
16779 * doprnt.c (doprnt): Document the set of format control sequences
16780 supported by the function. Use SAFE_ALLOCA instead of always
16781 using `alloca'.
16782
16783 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16784 is one byte too soon. Don't use xrealloc; instead xfree and
16785 xmalloc anew.
16786
16787 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16788
16789 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16790 callbacks stage.
16791
16792 * gnutls.c: Renamed global_initialized to
16793 gnutls_global_initialized. Added internals for the
16794 :verify-hostname-error, :verify-error, and :verify-flags
16795 parameters of `gnutls-boot' and documented those parameters in the
16796 docstring. Start callback support.
16797 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16798 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16799 on error. Return error code.
16800 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16801 (emacs_gnutls_read): Likewise.
16802 (Fgnutls_boot): Return handshake error code.
16803 (emacs_gnutls_handle_error): New function.
16804 (wsaerror_to_errno): Likewise.
16805
16806 * w32.h (emacs_gnutls_pull): Add prototype.
16807 (emacs_gnutls_push): Likewise.
16808
16809 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16810 (emacs_gnutls_push): Likewise.
16811
16812 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16813
16814 * process.c (wait_reading_process_output): Check if GnuTLS
16815 buffered some data internally if no FDs are set for TLS
16816 connections.
16817
16818 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16819 (LIBS): Link to USER_LIBS.
16820 ($(BLD)/gnutls.$(0)): New target.
16821
16822 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16823
16824 * xdisp.c (handle_single_display_spec): Rename the
16825 display_replaced_before_p argument into display_replaced_p, to
16826 make it consistent with the commentary. Fix typos in the
16827 commentary.
16828
16829 * textprop.c (syms_of_textprop): Remove dead code.
16830 (copy_text_properties): Delete obsolete commentary about an
16831 interface that was deleted long ago. Fix typos in the description
16832 of arguments.
16833
16834 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16835 to changes in oldXMenu/XMenu.h from 2011-04-16.
16836 <menu_help_message, prev_menu_help_message>: Constify.
16837 (IT_menu_make_room): menu->help_text is now `const char **';
16838 adjust.
16839
16840 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16841 to changes in oldXMenu/XMenu.h from 2011-04-16.
16842 (struct XMenu): Declare `help_text' `const char **'.
16843
16844 * xfaces.c <Qunspecified>: Make extern again.
16845
16846 * syntax.c: Include sys/types.h before including regex.h, as
16847 required by POSIX.
16848
16849 * doc.c (get_doc_string): Improve the format passed to `error'.
16850
16851 * doprnt.c (doprnt): Improve commentary.
16852
16853 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16854
16855 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16856 them with etags.
16857
16858 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16859 changes in globals.h immediately force recompilation.
16860 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16861 $(CURDIR)/s/ms-w32.h.
16862 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16863
16864 * character.c (Fchar_direction): Function deleted.
16865 (syms_of_character): Don't defsubr it.
16866 <char-direction-table>: Deleted.
16867
16868 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16869
16870 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16871 * doprnt.c: Include limits.h.
16872 (SIZE_MAX): New macro.
16873 (doprnt): Return a size_t value. 2nd arg is now size_t.
16874 Many local variables are now size_t instead of int or unsigned.
16875 Improve overflow protection. Support `l' modifier for integer
16876 conversions. Support %l conversion. Don't assume an EMACS_INT
16877 argument for integer conversions and for %c.
16878
16879 * lisp.h (doprnt): Restore prototype.
16880
16881 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16882 $(SRC)/character.h.
16883
16884 * Makefile.in (base_obj): Add back doprnt.o.
16885
16886 * deps.mk (doprnt.o): Add back prerequisites.
16887 (callint.o): Depend on character.h.
16888
16889 * eval.c (internal_lisp_condition_case): Include the handler
16890 representation in the error message.
16891 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16892 when breaking from the loop.
16893
16894 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16895
16896 * callint.c (Fcall_interactively): When displaying error message
16897 about invalid control letter, pass the character's codepoint, not
16898 a pointer to its multibyte form. Improve display of the character
16899 in octal and display also its hex code.
16900
16901 * character.c (char_string): Use %x to display the (unsigned)
16902 codepoint of an invalid character, to avoid displaying a bogus
16903 negative value.
16904
16905 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16906 `error', not SYMBOL_NAME itself.
16907
16908 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16909 character arguments to `error'.
16910
16911 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16912 to `error' in error message about FINAL_CHAR argument. Make sure
16913 FINAL_CHAR is a character, and use %c when it is passed as
16914 argument to `error'.
16915
16916 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16917
16918 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16919
16920 * w32.c: Include <time.h>.
16921 (sys_localtime): New function.
16922
16923 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16924
16925 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16926
16927 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16928
16929 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16930
16931 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16932 zombies (Bug#8467).
16933
16934 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16935
16936 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16937 gl_state.e_property when gl_state.object is Qt.
16938
16939 * insdel.c (make_gap_larger): Remove limitation of buffer size
16940 to <= INT_MAX.
16941
16942 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16943
16944 * xdisp.c (lookup_glyphless_char_display)
16945 (produce_glyphless_glyph): Handle cons cell entry in
16946 glyphless-char-display.
16947 (Vglyphless_char_display): Document it.
16948
16949 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16950 glyphless-char-display.
16951
16952 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16953
16954 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16955
16956 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16957
16958 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16959 definition for no-X builds.
16960
16961 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16962
16963 Static checks with GCC 4.6.0 and non-default toolkits.
16964
16965 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16966
16967 * process.c (keyboard_bit_set): Define only if SIGIO.
16968 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16969 (send_process): Repair possible setjmp clobbering.
16970
16971 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16972
16973 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16974
16975 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16976
16977 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16978 Define only if needed.
16979
16980 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16981 by pacifying GCC about it. Maybe it's time to retire it?
16982 * xfaces.c (USG, __TIMEVAL__): Likewise.
16983
16984 * dispextern.h (struct redisplay_interface): Rename param
16985 to avoid shadowing.
16986 * termhooks.h (struct terminal): Likewise.
16987 * xterm.c (xembed_send_message): Likewise.
16988
16989 * insdel.c (make_gap_smaller): Define only if
16990 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16991
16992 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16993 it.
16994
16995 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16996 so that we aren't warned about unused symbols.
16997
16998 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16999
17000 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17001
17002 * xfns.c (x_real_positions): Mark locals as initialized.
17003
17004 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17005
17006 * xterm.c: Fix problems found by static analysis with other toolkits.
17007 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17008 (x_dispatch_event): Declare static if USE_GTK, and
17009 define if USE_GTK || USE_X_TOOLKIT.
17010 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17011 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17012 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17013 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17014
17015 * xmenu.c (menu_help_callback): Pointer type fixes.
17016 Use const pointers when pointing at readonly data. Avoid pointer
17017 signedness clashes.
17018 (FALSE): Remove unused macro.
17019 (update_frame_menubar): Remove unused decl.
17020
17021 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17022
17023 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17024 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17025 (single_menu_item): Rename local to avoid shadowing.
17026
17027 * keyboard.c (make_lispy_event): Remove unused local var.
17028
17029 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17030 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17031
17032 * bitmaps: Change bitmaps from unsigned char back to the X11
17033 compatible char. Avoid the old compiler warnings about
17034 out-of-range initializers by using, for example, '\xab' rather
17035 than 0xab.
17036
17037 * xgselect.c (xgselect_initialize): Check vs interface
17038 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17039
17040 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17041
17042 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17043 to read-only memory.
17044
17045 * fns.c (vector): Remove; this old hack is no longer needed.
17046
17047 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17048 Remove unused var.
17049 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17050
17051 * xrdb.c (x_load_resources): Omit unused local.
17052
17053 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17054 (x_window): Rename locals to avoid shadowing.
17055 (USG): Use the kludged USG macro, to pacify gcc.
17056
17057 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17058 (x_term_init): Remove local to avoid shadowing.
17059
17060 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17061
17062 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17063 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17064
17065 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17066
17067 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17068
17069 Fix regex.c, syntax.c and friends for buffers > 2GB.
17070 * syntax.h (struct gl_state_s): Declare character position members
17071 EMACS_INT.
17072
17073 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17074
17075 * textprop.c (verify_interval_modification, interval_of):
17076 Declare arguments EMACS_INT.
17077
17078 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17079 EMACS_INT.
17080
17081 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17082
17083 * indent.c (Fvertical_motion): Local variable it_start is now
17084 EMACS_INT.
17085
17086 * regex.c (re_match, re_match_2, re_match_2_internal)
17087 (bcmp_translate, regcomp, regexec, print_double_string)
17088 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17089 (re_compile_pattern, re_exec): Declare arguments and local
17090 variables `size_t' and `ssize_t' and return values `regoff_t', as
17091 appropriate.
17092 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17093 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17094 <compile_stack_type>: `size' and `avail' are now `size_t'.
17095
17096 * regex.h <regoff_t>: Use ssize_t, not int.
17097 (re_search, re_search_2, re_match, re_match_2): Arguments that
17098 specify buffer/string position and length are now ssize_t and
17099 size_t. Return type is regoff_t.
17100
17101 2011-04-16 Ben Key <bkey76@gmail.com>
17102
17103 * nsfont.m: Fixed bugs in ns_get_family and
17104 ns_descriptor_to_entity that were caused by using free to
17105 deallocate memory blocks that were allocated by xmalloc (via
17106 xstrdup). This caused Emacs to crash when compiled with
17107 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17108 --enable-checking=xmallocoverrun). xfree is now used to
17109 deallocate these memory blocks.
17110
17111 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17112
17113 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17114
17115 emacs_write: Accept and return EMACS_INT for sizes.
17116 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17117 et seq.
17118 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17119 Accept and return EMACS_INT.
17120 (emacs_gnutls_write): Return the number of bytes written on
17121 partial writes.
17122 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17123 (emacs_read, emacs_write): Remove check for negative size, as the
17124 Emacs source code has been audited now.
17125 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17126 (emacs_read, emacs_write): Use it.
17127 * process.c (send_process): Adjust to the new signatures of
17128 emacs_write and emacs_gnutls_write. Do not attempt to store
17129 a byte offset into an 'int'; it might overflow.
17130 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17131
17132 * sound.c: Don't assume sizes fit in 'int'.
17133 (struct sound_device.period_size, alsa_period_size):
17134 Return EMACS_INT, not int.
17135 (struct sound_device.write, vox_write, alsa_write):
17136 Accept EMACS_INT, not int.
17137 (wav_play, au_play): Use EMACS_INT to store sizes and to
17138 record read return values.
17139
17140 2011-04-15 Ben Key <bkey76@gmail.com>
17141
17142 * keyboard.c (Qundefined): Don't declare static since it is used
17143 in nsfns.m.
17144 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17145 static since they are used in nsfont.m.
17146
17147 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17148
17149 * process.c (Qprocessp): Don't declare static.
17150 * lisp.h (Qprocessp): Declare again.
17151
17152 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17153
17154 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17155
17156 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17157
17158 Improve C-level modularity by making more things 'static'.
17159
17160 Don't publish debugger-only interfaces to other modules.
17161 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17162 (verify_bytepos, count_markers): Move decls to the only modules
17163 that need them.
17164 * region-cache.h (pp_cache): Likewise.
17165 * window.h (check_all_windows): Likewise.
17166 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17167
17168 * sysdep.c (croak): Now static, if
17169 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17170 * syssignal.h (croak): Declare only if not static.
17171
17172 * alloc.c (refill_memory_reserve): Now static if
17173 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17174 * lisp.h (refill_memory_reserve): Declare only if not static.
17175
17176 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17177 Define only if USE_LUCID.
17178
17179 * xrdb.c (x_customization_string, x_rm_string): Now static.
17180
17181 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17182 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17183
17184 * xdisp.c (draw_row_with_mouse_face): Now static.
17185 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17186
17187 * window.h (check_all_windows): Mark externally visible.
17188
17189 * window.c (window_deletion_count): Now static.
17190
17191 * undo.c: Make symbols static if they're not exported.
17192 (last_undo_buffer, last_boundary_position, pending_boundary):
17193 Now static.
17194
17195 * textprop.c (interval_insert_behind_hooks): Now static.
17196 (interval_insert_in_front_hooks): Likewise.
17197
17198 * term.c: Make symbols static if they're not exported.
17199 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17200 (max_frame_lines, tty_set_terminal_modes):
17201 (tty_reset_terminal_modes, tty_turn_off_highlight):
17202 (get_tty_terminal): Now static.
17203 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17204 * termhooks.h (term_mouse_moveto): Do not declare if
17205 HAVE_WINDOW_SYSTEM.
17206 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17207 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17208
17209 * sysdep.c: Make symbols static if they're not exported.
17210 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17211 Now static.
17212 (sigprocmask_set, full_mask): Remove; unused.
17213 (wait_debugging): Mark as visible.
17214 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17215 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17216
17217 * syntax.c (syntax_temp): Define only if !__GNUC__.
17218
17219 * sound.c (current_sound_device, current_sound): Now static.
17220
17221 * search.c (searchbufs, searchbuf_head): Now static.
17222
17223 * scroll.c (scroll_cost): Remove; unused.
17224 * dispextern.h (scroll_cost): Remove decl.
17225
17226 * region-cache.h (pp_cache): Mark as externally visible.
17227
17228 * process.c: Make symbols static if they're not exported.
17229 (process_tick, update_tick, create_process, chan_process):
17230 (Vprocess_alist, proc_buffered_char, datagram_access):
17231 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17232 (deactivate_process): Mark defn as static, as well as decl.
17233 * lisp.h (create_process): Remove decl.
17234 * process.h (chan_process, Vprocess_alist): Remove decls.
17235
17236 * print.c: Make symbols static if they're not exported.
17237 (print_depth, new_backquote_output, being_printed, print_buffer):
17238 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17239 (print_interval, print_number_index, initial_stderr_stream):
17240 Now static.
17241 * lisp.h (Fprinc): Remove decl.
17242 (debug_output_compilation_hack): Mark as externally visible.
17243
17244 * sysdep.c (croak): Move decl from here to syssignal.h.
17245 * syssignal.h (croak): Put it here, so the API can be checked when
17246 'croak' is called from dissociate_if_controlling_tty.
17247
17248 * minibuf.c: Make symbols static if they're not exported.
17249 (minibuf_save_list, choose_minibuf_frame): Now static.
17250 * lisp.h (choose_minibuf_frame): Remove decl.
17251
17252 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17253
17254 * lread.c: Make symbols static if they're not exported.
17255 (read_objects, initial_obarray, oblookup_last_bucket_number):
17256 Now static.
17257 (make_symbol): Remove; unused.
17258 * lisp.h (initial_obarray, make_symbol): Remove decls.
17259
17260 * keyboard.c: Make symbols static if they're not exported.
17261 (single_kboard, recent_keys_index, total_keys, recent_keys):
17262 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17263 (this_single_command_key_start, echoing, last_auto_save):
17264 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17265 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17266 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17267 (Vlispy_mouse_stem, double_click_count):
17268 Now static.
17269 (force_auto_save_soon): Define only if SIGDANGER.
17270 (ignore_mouse_drag_p): Now static if
17271 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17272 (print_help): Remove; unused.
17273 (stop_character, last_timer_event): Mark as externally visible.
17274 * keyboard.h (ignore_mouse_drag_p): Declare only if
17275 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17276 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17277 * lisp.h (echoing): Remove decl.
17278 (force_auto_save_soon): Declare only if SIGDANGER.
17279 * xdisp.c (redisplay_window): Simplify code, to make it more
17280 obvious that ignore_mouse_drag_p is not accessed if !defined
17281 USE_GTK && !defined HAVE_NS.
17282
17283 * intervals.c: Make symbols static if they're not exported.
17284 (merge_properties_sticky, merge_interval_right, delete_interval):
17285 Now static.
17286 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17287
17288 * insdel.c: Make symbols static if they're not exported.
17289 However, leave prepare_to_modify_buffer alone. It's never
17290 called from outside this function, but that appears to be a bug.
17291 (combine_after_change_list, combine_after_change_buffer):
17292 (adjust_after_replace, signal_before_change): Now static.
17293 (adjust_after_replace_noundo): Remove; unused.
17294 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17295 (signal_before_change): Remove decls.
17296
17297 * indent.c (val_compute_motion, val_vmotion): Now static.
17298
17299 * image.c: Make symbols static if they're not exported.
17300 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17301 if USE_GTK.
17302 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17303 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17304
17305 * fringe.c (standard_bitmaps): Now static.
17306 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17307
17308 * frame.c: Make symbols static if they're not exported.
17309 (x_report_frame_params, make_terminal_frame): Now static.
17310 (get_frame_param): Now static, unless HAVE_NS.
17311 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17312 (x_get_resource_string): Remove; not used.
17313 * frame.h (make_terminal_frame, x_report_frame_params):
17314 (x_get_resource_string); Remove decls.
17315 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17316 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17317
17318 * font.c, fontset.c: Make symbols static if they're not exported.
17319 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17320 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17321 * font.c (font_close_object): Now static.
17322 * font.h (font_close_object): Remove.
17323 * fontset.c (FONTSET_OBJLIST): Remove.
17324 (free_realized_fontset) #if-0 the body, which does nothing.
17325 (face_suitable_for_char_p): #if-0, as it's never called.
17326 * fontset.h (face_suitable_for_char_p): Remove decl.
17327 * xfaces.c (face_at_string_position):
17328 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17329 since 0 is always ASCII.
17330
17331 * fns.c (weak_hash_tables): Now static.
17332
17333 * fileio.c: Make symbols static if they're not exported.
17334 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17335 (Vwrite_region_annotation_buffers): Now static.
17336
17337 * eval.c: Make symbols static if they're not exported.
17338 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17339 * lisp.h (backtrace_list): Remove decl.
17340
17341 * emacs.c: Make symbols static if they're not exported.
17342 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17343 (fatal_error_code, fatal_error_signal_hook, standard_args):
17344 Now static.
17345 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17346 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17347 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17348 * lisp.h (fatal_error_signal_hook): Remove decl.
17349 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17350
17351 * editfns.c: Move a (normally-unused) function to its only use.
17352 * editfns.c, lisp.h (get_operating_system_release): Remove.
17353 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17354 worth the hassle of breaking this out.
17355
17356 * xterm.c: Make symbols static if they're not exported.
17357 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17358 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17359 (x_destroy_window, x_delete_display):
17360 Now static.
17361 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17362 (x_mouse_leave): Remove; unused.
17363 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17364 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17365 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17366 Remove decls.
17367 (x_mouse_leave): Declare only if WINDOWSNT.
17368 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17369 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17370 USE_X_TOOLKIT.
17371
17372 * ftxfont.c: Make symbols static if they're not exported.
17373 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17374 HAVE_FREETYPE.
17375 * font.h (ftxfont_driver): Likewise.
17376
17377 * xfns.c: Make symbols static if they're not exported.
17378 (x_last_font_name, x_display_info_for_name):
17379 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17380 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17381 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17382 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17383 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17384 (last_show_tip_args): Now static.
17385 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17386 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17387 (x_screen_planes): Remove; unused.
17388 * dispextern.h (x_screen_planes): Remove decl.
17389
17390 * dispnew.c: Make symbols static if they're not exported.
17391 * dispextern.h (redraw_garbaged_frames, scrolling):
17392 (increment_row_positions): Remove.
17393 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17394 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17395 Now static.
17396 (redraw_garbaged_frames): Remove; unused.
17397
17398 * xfaces.c: Make symbols static if they're not exported.
17399 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17400 Remove decls.
17401 * xterm.h (defined_color): Remove decls.
17402 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17403 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17404 (menu_face_changed_default, defined_color, free_realized_face):
17405 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17406 (ascii_face_of_lisp_face): Remove; unused.
17407
17408 * xdisp.c: Make symbols static if they're not exported.
17409 * dispextern.h (scratch_glyph_row, window_box_edges):
17410 (glyph_to_pixel_coords, set_cursor_from_row):
17411 (get_next_display_element, set_iterator_to_next):
17412 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17413 (show_mouse_face): Remove decls
17414 * frame.h (message_buf_print): Likewise.
17415 * lisp.h (pop_message, set_message, check_point_in_composition):
17416 Likewise.
17417 * xterm.h (set_vertical_scroll_bar): Likewise.
17418 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17419 (message_buf_print, scratch_glyph_row, displayed_buffer):
17420 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17421 (get_next_display_element, show_mouse_face, window_box_edges):
17422 (frame_to_window_pixel_xy, check_point_in_composition):
17423 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17424 (glyph_to_pixel_coords): Remove; unused.
17425
17426 * dired.c (file_name_completion): Now static.
17427
17428 * dbusbind.c (xd_in_read_queued_messages): Now static.
17429
17430 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17431 * data.c (circular_list_error): Remove.
17432
17433 * commands.h (last_point_position, last_point_position_buffer):
17434 (last_point_position_window): Remove decls.
17435 * keyboard.c: Make these variables static.
17436
17437 * coding.h (coding, code_convert_region, encode_coding_gap):
17438 Remove decls.
17439 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17440 (iso_code_class, detect_coding, code_convert_region): Now static.
17441 (encode_coding_gap): Remove; unused.
17442
17443 * chartab.c (chartab_chars, chartab_bits): Now static.
17444
17445 * charset.h (charset_iso_8859_1): Remove decl.
17446 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17447 Now static.
17448
17449 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17450 * ccl.c (Vccl_program_table): Now static.
17451 (check_ccl_update): Remove; unused.
17452
17453 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17454 * category.h: ... from here.
17455 * category.c (check_category_table, set_category_set): Now static.
17456
17457 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17458 * lisp.h: Remove these decls.
17459
17460 * buffer.c (buffer_count): Remove unused var.
17461
17462 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17463 so that it's not optimized away.
17464 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17465 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17466 exported only to the debugger.
17467
17468 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17469 * atimer.h (run_all_atimers): Remove; not exported.
17470
17471 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17472 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17473 was inaccessible from Lisp.
17474 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17475 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17476
17477 alloc.c: Import and export fewer symbols, and remove unused items.
17478 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17479 is defined.
17480 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17481 it's not optimized away by whole-program optimization.
17482 (message_enable_multibyte, free_misc): Remove.
17483 (catchlist, handlerlist, mark_backtrace):
17484 Declare only if BYTE_MARK_STACK.
17485 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17486 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17487 (message_enable_multibyte): Remove decl.
17488 (free_misc, interval_free_list, float_block, float_block_index):
17489 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17490 (cons_free_list, last_marked_index):
17491 Now static.
17492 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17493 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17494 (mark_backtrace): Define only if BYTE_MARK_STACK.
17495 * xdisp.c (message_enable_multibyte): Now static.
17496
17497 Declare Lisp_Object Q* variables to be 'static' if not exported.
17498 This makes it easier for human readers (and static analyzers)
17499 to see whether these variables are used from other modules.
17500 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17501 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17502 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17503 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17504 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17505 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17506 * xmenu.c, xselect.c:
17507 Declare Q* vars static if they are not used in other modules.
17508 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17509 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17510 Remove decls of unexported vars.
17511 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17512
17513 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17514
17515 Make Emacs functions such as Fatom 'static' by default.
17516 This makes it easier for human readers (and static analyzers)
17517 to see whether these functions can be called from other modules.
17518 DEFUN now defines a static function. To make the function external
17519 so that it can be used in other C modules, use the new macro DEFUE.
17520 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17521 (Finit_image_library):
17522 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17523 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17524 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17525 Remove decls, since these functions are now static.
17526 (Funintern, Fget_internal_run_time): New decls, since these functions
17527 were already external.
17528
17529 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17530 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17531 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17532 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17533 * keyboard.c, keymap.c, lread.c:
17534 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17535 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17536 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17537 Mark functions with DEFUE instead of DEFUN,
17538 if they are used in other modules.
17539 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17540 decls for now-static functions.
17541 * buffer.h (Fdelete_overlay): Remove decl.
17542 * callproc.c (Fgetenv_internal): Mark as internal.
17543 * composite.c (Fremove_list_of_text_properties): Remove decl.
17544 (Fcomposition_get_gstring): New forward static decl.
17545 * composite.h (Fcomposite_get_gstring): Remove decl.
17546 * dired.c (Ffile_attributes): New forward static decl.
17547 * doc.c (Fdocumntation_property): New forward static decl.
17548 * eval.c (Ffetch_bytecode): New forward static decl.
17549 (Funintern): Remove extern decl; now in .h file where it belongs.
17550 * fileio.c (Fmake_symbolic_link): New forward static decl.
17551 * image.c (Finit_image_library): New forward static decl.
17552 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17553 * intervals.h (Fprevious_property_change):
17554 (Fremove_list_of_text_properties): Remove decls.
17555 * keyboard.c (Fthis_command_keys): Remove decl.
17556 (Fcommand_execute): New forward static decl.
17557 * keymap.c (Flookup_key): New forward static decl.
17558 (Fcopy_keymap): Now static.
17559 * keymap.h (Flookup_key): Remove decl.
17560 * process.c (Fget_process): New forward static decl.
17561 (Fprocess_datagram_address): Mark as internal.
17562 * syntax.c (Fsyntax_table_p): New forward static decl.
17563 (skip_chars): Remove duplicate decl.
17564 * textprop.c (Fprevious_property_change): New forward static decl.
17565 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17566 Now internal.
17567 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17568 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17569
17570 * editfns.c (Fformat): Remove unreachable code.
17571
17572 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17573
17574 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17575 change. (Bug#8496)
17576
17577 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17578
17579 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17580 when at ZV. (Bug#8487)
17581
17582 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17583
17584 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17585 (Bug#8437)
17586 * keyboard.c (parse_tool_bar_item): Likewise.
17587 * sound.c (sound_cleanup, alsa_close): Likewise.
17588 * termcap.c (tgetent): Likewise.
17589 * xfns.c (x_default_font_parameter): Likewise.
17590 * xsettings.c (read_and_apply_settings): Likewise.
17591
17592 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17593 (overrun_check_free): Protoize.
17594
17595 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17596
17597 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17598 since callers should never pass a negative size.
17599 Change the signature to match that of plain 'read' and 'write'; see
17600 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17601 * lisp.h: Update prototypes of emacs_write and emacs_read.
17602
17603 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17604
17605 * xdisp.c (redisplay_window): Don't try to determine the character
17606 position of the scroll margin if the window start point w->startp
17607 is outside the buffer's accessible region. (Bug#8468)
17608
17609 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17610
17611 Fix write-region and its subroutines for buffers > 2GB.
17612 * fileio.c (a_write, e_write): Modify declaration of arguments and
17613 local variables to support buffers larger than 2GB.
17614 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17615
17616 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17617 argument, local variables, and return value.
17618
17619 * lisp.h: Update prototypes of emacs_write and emacs_read.
17620
17621 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17622
17623 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17624
17625 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17626
17627 Fix more problems found by GCC 4.6.0's static checks.
17628
17629 * xdisp.c (vmessage): Use a better test for character truncation.
17630
17631 * charset.c (load_charset_map): <, not <=, for optimization,
17632 and to avoid potential problems with integer overflow.
17633 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17634 * casetab.c (set_identity, shuffle): Likewise.
17635 * editfns.c (Fformat): Likewise.
17636 * syntax.c (skip_chars): Likewise.
17637
17638 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17639 This also lets GCC 4.6.0 generate slightly better loop code.
17640
17641 * callint.c (Fcall_interactively): <, not <=, for optimization.
17642 (Fcall_interactively): Count the number of arguments produced,
17643 not the number of arguments given. This is simpler and lets GCC
17644 4.6.0 generate slightly better code.
17645
17646 * ftfont.c: Distingish more carefully between FcChar8 and char.
17647 The previous code passed unsigned char * to a functions like
17648 strlen and xstrcasecmp that expect char *, which does not
17649 conform to the C standard.
17650 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17651 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17652 char * when the C standard requires it.
17653
17654 * keyboard.c (read_char): Remove unused var.
17655
17656 * eval.c: Port to Windows vsnprintf (Bug#8435).
17657 Include <limits.h>.
17658 (SIZE_MAX): Define if the headers do not.
17659 (verror): Do not give up if vsnprintf returns a negative count.
17660 Instead, grow the buffer. This ports to Windows vsnprintf, which
17661 does not conform to C99. Problem reported by Eli Zaretskii.
17662 Also, simplify the allocation scheme, by avoiding the need for
17663 calling realloc, and removing the ALLOCATED variable.
17664
17665 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17666
17667 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17668 But keep the doprint source code for now, as we might revamp it
17669 and use it again (Bug#8435).
17670 * lisp.h (doprnt): Remove.
17671 * Makefile.in (base_obj): Remove doprnt.o.
17672 * deps.mk (doprnt.o): Remove.
17673
17674 error: Print 32- and 64-bit integers portably (Bug#8435).
17675 Without this change, on typical 64-bit hosts error ("...%d...", N)
17676 was used to print both 32- and 64-bit integers N, which relied on
17677 undefined behavior.
17678 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17679 * lisp.h (error, verror): Mark as printf-like functions.
17680 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17681 Report overflow in size calculations when allocating printf buffer.
17682 Do not truncate output string at its first null byte.
17683 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17684 Truncate the output at a character boundary, since vsnprintf does not
17685 do that.
17686 * charset.c (check_iso_charset_parameter): Convert internal
17687 character to string before calling 'error', since %c now has the
17688 printf meaning.
17689 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17690 overflow when computing char to be passed to 'error'. Do not
17691 pass Lisp_Object to 'error'; pass the integer instead.
17692 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17693 formatted with plain %d.
17694
17695 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17696
17697 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17698
17699 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17700
17701 * xterm.c (x_catch_errors): Remove duplicate declaration.
17702
17703 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17704
17705 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17706
17707 2011-04-10 Jim Meyering <meyering@redhat.com>
17708
17709 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17710 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17711 return ssize_t not "int", and use size_t as the buffer length.
17712 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17713 * gnutls.h: Update declarations.
17714 * process.c (read_process_output): Use ssize_t, to match.
17715 (send_process): Likewise.
17716
17717 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17718
17719 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17720
17721 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17722
17723 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17724 Use unsigned char, to match FcChar8 type definition.
17725
17726 * xterm.c (handle_one_xevent):
17727 * xmenu.c (create_and_show_popup_menu):
17728 * xselect.c (x_decline_selection_request)
17729 (x_reply_selection_request): Avoid type-punned deref of X events.
17730
17731 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17732
17733 Fix some uses of `int' instead of EMACS_INT.
17734 * search.c (string_match_1, fast_string_match)
17735 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17736 (scan_buffer, find_next_newline_no_quit)
17737 (find_before_next_newline, search_command, Freplace_match)
17738 (Fmatch_data): Make some `int' variables be EMACS_INT.
17739
17740 * xdisp.c (display_count_lines): 3rd argument and return value now
17741 EMACS_INT. All callers changed.
17742 (pint2hrstr): Last argument is now EMACS_INT.
17743
17744 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17745 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17746 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17747 (decode_coding_utf_16, decode_coding_emacs_mule)
17748 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17749 (decode_coding_ccl, decode_coding_charset)
17750 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17751 (decode_coding_iso_2022, decode_coding_emacs_mule)
17752 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17753 <char_offset, last_offset>: Declare EMACS_INT.
17754 (encode_coding_utf_8, encode_coding_utf_16)
17755 (encode_coding_emacs_mule, encode_invocation_designation)
17756 (encode_designation_at_bol, encode_coding_iso_2022)
17757 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17758 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17759 Declare EMACS_INT.
17760 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17761 (encode_invocation_designation): Last argument P_NCHARS is now
17762 EMACS_INT.
17763 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17764 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17765
17766 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17767 All users changed.
17768
17769 * ccl.c (Fccl_execute_on_string): Declare some variables
17770 EMACS_INT.
17771
17772 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17773
17774 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17775
17776 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17777
17778 * process.c (Fformat_network_address): Doc fix.
17779
17780 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17781
17782 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17783
17784 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17785
17786 * keyboard.c (read_char): Call Lisp function help-form-show,
17787 instead of using internal_with_output_to_temp_buffer.
17788 (Qhelp_form_show): New var.
17789 (syms_of_keyboard): Use DEFSYM macro.
17790
17791 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17792
17793 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17794
17795 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17796
17797 * process.c (Flist_processes): Remove to Lisp.
17798 (list_processes_1): Delete.
17799
17800 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17801
17802 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17803
17804 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17805
17806 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17807
17808 Fix more problems found by GCC 4.6.0's static checks.
17809
17810 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17811
17812 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17813
17814 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17815
17816 * xdisp.c (vmessage): Mark as a printf-like function.
17817
17818 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17819
17820 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17821
17822 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17823 printf-like functions.
17824 (tiff_load): Add casts to remove these marks before passing them
17825 to system-supplied API.
17826
17827 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17828
17829 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17830 This avoids several warnings with gcc -Wstrict-overflow.
17831 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17832 directly, rather than having caller test rule sign. This avoids
17833 some unnecessary tests.
17834 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17835 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17836 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17837
17838 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17839 (xfont_open): Avoid unnecessary tests.
17840
17841 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17842
17843 * composite.h, composite.c (composition_gstring_put_cache):
17844 Use EMACS_INT, not int, for length.
17845
17846 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17847 breaking out part of COMPOSITION_DECODE_RULE.
17848 (COMPOSITION_DECODE_RULE): Use it.
17849 * composite.c (get_composition_id): Remove unused local vars,
17850 by using the new macro.
17851
17852 * textprop.c (set_text_properties_1): Change while to do-while,
17853 since the condition is always true at first.
17854
17855 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17856 (interval_deletion_adjustment): Return unsigned value.
17857 All uses changed.
17858
17859 * process.c (list_processes_1, create_pty, read_process_output):
17860 (exec_sentinel): Remove vars that were set but not used.
17861 (create_pty): Remove unnecessary "volatile"s.
17862 (Fnetwork_interface_info): Avoid possibility of int overflow.
17863 (read_process_output): Do adaptive read buffering even if carryover.
17864 (read_process_output): Simplify nbytes computation if buffered.
17865
17866 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17867
17868 * syntax.c (scan_words): Remove var that was set but not used.
17869 (update_syntax_table): Use unsigned instead of int.
17870
17871 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17872 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17873 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17874
17875 * print.c (print_error_message): Avoid int overflow.
17876
17877 * font.c (font_list_entities): Redo for clarity,
17878 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17879
17880 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17881 (font_score): Avoid potential overflow in diff calculation.
17882
17883 * fns.c (substring_both): Remove var that is set but not used.
17884 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17885
17886 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17887
17888 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17889 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17890 can always succeed if overflow has undefined behavior.
17891
17892 * search.c (boyer_moore, wordify): Remove vars set but not used.
17893 (wordify): Omit three unnecessary tests.
17894
17895 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17896 All callers changed. This avoids the need for an unused var.
17897
17898 * casefiddle.c (casify_region): Remove var that is set but not used.
17899
17900 * dired.c (file_name_completion): Remove var that is set but not used.
17901
17902 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17903
17904 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17905 (Finsert_file_contents): Remove unnecessary code checking fd.
17906
17907 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17908 Check for integer overflow on size calculations.
17909
17910 * buffer.c (Fprevious_overlay_change): Remove var that is set
17911 but not used.
17912
17913 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17914 Remove vars that are set but not used.
17915 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17916 (timer_check_2): Mark vars as initialized.
17917
17918 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17919
17920 * image.c (lookup_image): Remove var that is set but not used.
17921 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17922
17923 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17924 that are set but not used.
17925
17926 * xfns.c (make_invisible_cursor): Don't return garbage
17927 if XCreateBitmapFromData fails (Bug#8410).
17928
17929 * xselect.c (x_get_local_selection, x_handle_property_notify):
17930 Remove vars that are set but not used.
17931
17932 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17933 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17934
17935 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17936 Remove var that is set but not used.
17937 (scroll_bar_windows_size): Now size_t, not int.
17938 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17939 Check for overflow.
17940
17941 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17942 (map_tty_color) [!defined MSDOS]: Likewise.
17943
17944 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17945
17946 * coding.c: Remove vars that are set but not used.
17947 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17948 All callers changed.
17949 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17950 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17951 (decode_coding_charset): Remove vars that are set but not used.
17952
17953 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17954 that is set but not used.
17955
17956 * print.c (print_object): Remove var that is set but not used.
17957
17958 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17959 The gnulib version avoids calling malloc in the usual case,
17960 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17961 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17962 * filelock.c (current_lock_owner): Likewise.
17963 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17964 * sysdep.c: Include allocator.h, careadlinkat.h.
17965 (emacs_no_realloc_allocator): New static constant.
17966 (emacs_readlink): New function.
17967 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17968 ../lib/careadlinkat.h.
17969
17970 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17971
17972 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17973 first non-nil return value).
17974
17975 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17976
17977 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17978 if not defined (Bug#8403).
17979
17980 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17981
17982 * xdisp.c (display_count_lines): Remove parameter `start',
17983 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17984 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17985 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17986 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17987 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17988 and thereabouts. All callers changed.
17989 (get_per_char_metric): Remove parameter `f', unused since
17990 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17991
17992 2011-04-02 Jim Meyering <meyering@redhat.com>
17993
17994 do not dereference NULL upon failed strdup
17995 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17996 (ns_get_family): Likewise.
17997
17998 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17999
18000 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18001
18002 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18003
18004 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18005 later (Bug#8403).
18006
18007 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18008
18009 Add lexical binding.
18010
18011 * window.c (Ftemp_output_buffer_show): New fun.
18012 (Fsave_window_excursion):
18013 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18014
18015 * lread.c (lisp_file_lexically_bound_p): New function.
18016 (Fload): Bind Qlexical_binding.
18017 (readevalloop): Remove `evalfun' arg.
18018 Bind Qinternal_interpreter_environment.
18019 (Feval_buffer): Bind Qlexical_binding.
18020 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18021 Mark as dynamic.
18022 (syms_of_lread): Declare `lexical-binding'.
18023
18024 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18025
18026 * keyboard.c (eval_dyn): New fun.
18027 (menu_item_eval_property): Use it.
18028
18029 * image.c (parse_image_spec): Use Ffunctionp.
18030
18031 * fns.c (concat, mapcar1): Accept byte-code-functions.
18032
18033 * eval.c (Fsetq): Handle lexical vars.
18034 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18035 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18036 (FletX, Flet): Obey lexical binding.
18037 (Fcommandp): Handle closures.
18038 (Feval): New `lexical' arg.
18039 (eval_sub): New function extracted from Feval. Use it almost
18040 everywhere where Feval was used. Look up vars in lexical env.
18041 Handle closures.
18042 (Ffunctionp): Move from subr.el.
18043 (Ffuncall): Handle closures.
18044 (apply_lambda): Remove `eval_flags'.
18045 (funcall_lambda): Handle closures and new byte-code-functions.
18046 (Fspecial_variable_p): New function.
18047 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18048 but without exporting it to Lisp.
18049
18050 * doc.c (Fdocumentation, store_function_docstring):
18051 * data.c (Finteractive_form): Handle closures.
18052
18053 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18054 interactive spec.
18055
18056 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18057 New byte-codes.
18058 (exec_byte_code): New function extracted from Fbyte_code to handle new
18059 calling convention for byte-code-functions. Add new byte-codes.
18060
18061 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18062
18063 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18064
18065 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18066
18067 * xdisp.c (redisplay_internal): Fix prototype.
18068
18069 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18070
18071 * xdisp.c (SCROLL_LIMIT): New macro.
18072 (try_scrolling): Use it when setting scroll_limit.
18073 Limit scrolling to 100 screen lines.
18074 (redisplay_window): Even when falling back on "recentering",
18075 position point in the window according to scroll-conservatively,
18076 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18077
18078 (try_scrolling): When point is above the window, allow searching
18079 as far as scroll_max, or one screenful, to compute vertical
18080 distance from PT to the scroll margin position. This prevents
18081 try_scrolling from unnecessarily failing when
18082 scroll-conservatively is set to a value slightly larger than the
18083 window height. Clean up the case of PT below the margin at bottom
18084 of window: scroll_max can no longer be INT_MAX. When aggressive
18085 scrolling is in use, don't let point enter the opposite scroll
18086 margin as result of the scroll.
18087 (syms_of_xdisp) <scroll-conservatively>: Document the
18088 threshold of 100 lines for never-recentering scrolling.
18089
18090 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18091
18092 * dispextern.h (move_it_by_lines):
18093 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18094 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18095 (message_log_check_duplicate): Remove parameters `prev_bol' and
18096 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18097 (redisplay_internal): Remove parameter `preserve_echo_area',
18098 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18099
18100 * indent.c (Fvertical_motion):
18101 * window.c (window_scroll_pixel_based, Frecenter):
18102 Don't pass `need_y_p' to `move_it_by_lines'.
18103
18104 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18105
18106 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18107 steal a few bits to be more compact.
18108 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18109 Remove unneeded casts.
18110
18111 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18112
18113 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18114
18115 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18116 binding" message (bug#7967).
18117
18118 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18119
18120 Fix more problems found by GCC 4.6.0's static checks.
18121
18122 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18123 Remove unused local var.
18124
18125 * editfns.c (Fmessage_box): Remove unused local var.
18126
18127 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18128 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18129 Omit unused local vars.
18130 * window.c (shrink_windows): Omit unused local var.
18131 * menu.c (digest_single_submenu): Omit unused local var.
18132 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18133 Omit unused local var.
18134
18135 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18136 Don't assume string length fits in int.
18137 (keyremap_step, read_key_sequence): Use size_t for sizes.
18138 (read_key_sequence): Don't check last_real_key_start redundantly.
18139
18140 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18141 instead of alloca (Bug#8344).
18142
18143 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18144 (Fbacktrace_frame): Don't assume nframes fits in int.
18145
18146 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18147
18148 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18149 concerns.
18150
18151 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18152
18153 * cm.c (calccost): Turn while-do into do-while, for clarity.
18154
18155 * keyboard.c (syms_of_keyboard): Use the same style as later
18156 in this function when indexing through an array. This also
18157 works around GCC bug 48267.
18158
18159 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18160
18161 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18162
18163 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18164 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18165
18166 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18167 This avoids undefined behavior on integer overflow, and is a bit
18168 more convenient anyway since it is compared to a size_t variable.
18169
18170 Variadic C functions now count arguments with size_t, not int.
18171 This avoids an unnecessary limitation on 64-bit machines, which
18172 caused (substring ...) to crash on large vectors (Bug#8344).
18173 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18174 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18175 All variadic functions and their callers changed accordingly.
18176 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18177 * data.c (arith_driver, float_arith_driver): Likewise.
18178 * editfns.c (general_insert_function): Likewise.
18179 * eval.c (struct backtrace.nargs, interactive_p)
18180 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18181 (funcall_lambda, mark_backtrace): Likewise.
18182 * fns.c (concat): Likewise.
18183 * frame.c (x_set_frame_parameters): Likewise.
18184 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18185 0 if not found, not -1. All callers changed.
18186
18187 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18188 (stack_copy_size): Now size_t, not int.
18189 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18190
18191 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18192
18193 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18194 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18195 All callers changed.
18196
18197 * lisp.h (multibyte_char_to_unibyte):
18198 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18199 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18200 * character.h (CHAR_TO_BYTE8):
18201 * cmds.c (internal_self_insert):
18202 * editfns.c (general_insert_function):
18203 * keymap.c (push_key_description):
18204 * search.c (Freplace_match):
18205 * xdisp.c (message_dolog, set_message_1): All callers changed.
18206
18207 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18208
18209 * keyboard.c (safe_run_hook_funcall): New function.
18210 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18211 don't set the hook to nil, but remove the offending function instead.
18212 (Qcommand_hook_internal): Remove, unused.
18213 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18214 Vcommand_hook_internal.
18215
18216 * eval.c (enum run_hooks_condition): Remove.
18217 (funcall_nil, funcall_not): New functions.
18218 (run_hook_with_args): Call each function through a `funcall' argument.
18219 Remove `cond' argument, now redundant.
18220 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18221 (Frun_hook_with_args_until_failure): Adjust accordingly.
18222 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18223
18224 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18225
18226 * dispextern.h (string_buffer_position): Remove declaration.
18227
18228 * print.c (strout): Remove parameter `multibyte', unused since
18229 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18230
18231 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18232 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18233 All callers changed.
18234
18235 * w32.c (_wsa_errlist): Use braces for struct initializers.
18236
18237 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18238 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18239 All callers changed.
18240 (string_buffer_position): Likewise. Also, make static (it's never
18241 used outside xdisp.c).
18242 (cursor_row_p): Remove parameter `w', unused since
18243 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18244 (decode_mode_spec): Remove parameter `precision', introduced during
18245 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18246 All callers changed.
18247
18248 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18249
18250 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18251
18252 2011-03-27 Anders Lindgren <andlind@gmail.com>
18253
18254 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18255 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18256 (ns_update_auto_hide_menu_bar): New functions.
18257 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18258 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18259 ns_constrain_all_frames.
18260 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18261 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18262
18263 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18264
18265 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18266
18267 2011-03-27 Glenn Morris <rgm@gnu.org>
18268
18269 * syssignal.h: Replace RETSIGTYPE with void.
18270 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18271 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18272 Replace SIGTYPE with void everywhere.
18273 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18274 * s/template.h (SIGTYPE): Remove commented out definition.
18275
18276 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18277
18278 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18279 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18280
18281 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18282
18283 * w32.c (read_unc_volume): Use parameter `henum', instead of
18284 global variable `wget_enum_handle'.
18285
18286 * keymap.c (describe_vector): Remove parameters `indices' and
18287 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18288 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18289
18290 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18291
18292 * keyboard.c (timer_check): Remove parameter `do_it_now',
18293 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18294 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18295 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18296
18297 * keyboard.c (read_char):
18298 * w32menu.c (w32_menu_display_help):
18299 * xmenu.c (show_help_event, menu_help_callback):
18300 Adjust calls to `show_help_echo'.
18301
18302 * gtkutil.c (xg_maybe_add_timer):
18303 * keyboard.c (readable_events):
18304 * process.c (wait_reading_process_output):
18305 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18306
18307 * insdel.c (adjust_markers_gap_motion):
18308 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18309 (gap_left, gap_right): Don't call it.
18310
18311 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18312
18313 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18314 incurred during fontification.
18315
18316 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18317
18318 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18319 (DEFVAR_PER_BUFFER): Don't pass it.
18320
18321 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18322 (scrolling_window): Don't pass it.
18323
18324 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18325
18326 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18327
18328 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18329 and `suffix'.
18330 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18331 of variables specific to SELinux and computation of `encoded_absname'.
18332
18333 * image.c (XPutPixel): Remove unused variable `height'.
18334
18335 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18336
18337 * unexw32.c (get_section_info): Remove unused variable `section'.
18338
18339 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18340 (system_process_attributes): Remove unused variable `sess'.
18341 (sys_read): Remove unused variable `err'.
18342
18343 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18344 (w32_wnd_proc): Remove unused variable `isdead'.
18345 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18346 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18347 (x_create_tip_frame): Remove unused variable `tem'.
18348
18349 * w32inevt.c (w32_console_read_socket):
18350 Remove unused variable `no_events'.
18351
18352 * w32term.c (x_draw_composite_glyph_string_foreground):
18353 Remove unused variable `width'.
18354
18355 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18356
18357 * w32term.c (x_set_glyph_string_clipping):
18358 Don't pass uninitialized region to CombineRgn.
18359
18360 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18361
18362 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18363 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18364 (Fx_close_connection): Remove unused variable `i'.
18365
18366 * w32font.c (w32font_draw): Return number of glyphs.
18367 (w32font_open_internal): Remove unused variable `i'.
18368 (w32font_driver): Add missing initializer.
18369
18370 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18371 (fill_in_menu): Remove unused variable `items_added'.
18372
18373 * w32term.c (last_mouse_press_frame): Remove static global variable.
18374 (w32_clip_to_row): Remove unused variable `f'.
18375 (x_delete_terminal): Remove unused variable `i'.
18376
18377 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18378 (NOTHING): Remove unused static global variable.
18379 (uniscribe_check_otf): Remove unused variable `table'.
18380 (uniscribe_font_driver): Add missing initializers.
18381
18382 2011-03-23 Julien Danjou <julien@danjou.info>
18383
18384 * term.c (Fsuspend_tty, Fresume_tty):
18385 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18386 * window.c (temp_output_buffer_show):
18387 * insdel.c (signal_before_change):
18388 * frame.c (Fhandle_switch_frame):
18389 * fileio.c (Fdo_auto_save):
18390 * emacs.c (Fkill_emacs):
18391 * editfns.c (save_excursion_restore):
18392 * cmds.c (internal_self_insert):
18393 * callint.c (Fcall_interactively):
18394 * buffer.c (Fkill_all_local_variables):
18395 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18396 Use Frun_hooks.
18397 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18398 unconditionally since it does the check itself.
18399
18400 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18401
18402 Fix more problems found by GCC 4.5.2's static checks.
18403
18404 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18405 the first time through the loop, since we know p0 < p1 then.
18406 This also avoids a gcc -Wstrict-overflow warning.
18407
18408 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18409 leading to a memory leak, possible in functions like
18410 load_charset_map_from_file that can allocate an unbounded number
18411 of objects (Bug#8318).
18412
18413 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18414 that could (at least in theory) be that large.
18415
18416 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18417 This is less likely to overflow, and avoids undefined behavior if
18418 overflow does occur. All callers changed. Use strtoul to scan
18419 for the unsigned long integer.
18420 (pint2hrstr): Simplify and tune code slightly.
18421 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18422
18423 * scroll.c (do_scrolling): Work around GCC bug 48228.
18424 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18425
18426 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18427 This also avoids a warning with gcc -Wstrict-overflow.
18428 (validate_x_resource_name): Simplify count usage.
18429 This also avoids a warning with gcc -Wstrict-overflow.
18430
18431 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18432 fail (Bug#8306).
18433
18434 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18435
18436 * process.c (Fmake_network_process): Use socklen_t, not int,
18437 where POSIX says socklen_t is required in portable programs.
18438 This fixes a porting bug on hosts like 64-bit HP-UX, where
18439 socklen_t is wider than int (Bug#8277).
18440 (Fmake_network_process, server_accept_connection):
18441 (wait_reading_process_output, read_process_output):
18442 Likewise.
18443
18444 * process.c: Rename or move locals to avoid shadowing.
18445 (list_processes_1, Fmake_network_process):
18446 (read_process_output_error_handler, exec_sentinel_error_handler):
18447 Rename or move locals.
18448 (Fmake_network_process): Define label "retry_connect" only if needed.
18449 (Fnetwork_interface_info): Fix pointer signedness.
18450 (process_send_signal): Add cast to avoid pointer signedness problem.
18451 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18452 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18453
18454 Make tparam.h and terminfo.c consistent.
18455 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18456 Include tparam.h instead, since it declares them.
18457 * cm.h (PC): Remove extern decl; tparam.h now does this.
18458 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18459 * terminfo.c: Include tparam.h, to check interfaces.
18460 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18461 (tparam): Adjust signature to match interface in tparam.h;
18462 this removes some undefined behavior. Check that outstring and len
18463 are zero, which they always are with Emacs.
18464 * tparam.h (PC, BC, UP): New extern decls.
18465
18466 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18467 (xftfont_open): Rename locals to avoid shadowing.
18468
18469 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18470 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18471 (OTF_TAG_SYM): Omit macro if not needed.
18472 (ftfont_list): Remove unused local.
18473 (get_adstyle_property, ftfont_pattern_entity):
18474 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18475 Rename locals to avoid shadowing.
18476
18477 * xfont.c (xfont_list_family): Mark var as initialized.
18478
18479 * xml.c (make_dom): Now static.
18480
18481 * composite.c (composition_compute_stop_pos): Rename local to
18482 avoid shadowing.
18483 (composition_reseat_it): Remove unused locals.
18484 (find_automatic_composition, composition_adjust_point): Likewise.
18485 (composition_update_it): Mark var as initialized.
18486 (find_automatic_composition): Mark vars as initialized,
18487 with a FIXME (Bug#8290).
18488
18489 character.h: Rename locals to avoid shadowing.
18490 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18491 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18492 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18493 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18494 to avoid shadowing.
18495
18496 * textprop.c (property_change_between_p): Remove; unused.
18497
18498 * intervals.c (interval_start_pos): Now static.
18499
18500 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18501
18502 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18503 Rename locals to avoid shadowing.
18504
18505 * sound.c (wav_play, au_play, Fplay_sound_internal):
18506 Fix pointer signedness.
18507 (alsa_choose_format): Remove unused local var.
18508 (wav_play): Initialize a variable to 0, to prevent undefined
18509 behavior (Bug#8278).
18510
18511 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18512
18513 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18514
18515 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18516 clobbering (Bug#8298).
18517 * sysdep.c (sys_subshell): Likewise.
18518 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18519
18520 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18521 This should get cleaned up, so that child_setup has the
18522 same signature on all platforms.
18523
18524 * callproc.c (call_process_cleanup): Now static.
18525 (relocate_fd): Rename locals to avoid shadowing.
18526
18527 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18528
18529 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18530 not to be necessary, and produces flickering.
18531
18532 2011-03-20 Glenn Morris <rgm@gnu.org>
18533
18534 * config.in: Remove file.
18535
18536 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18537
18538 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18539 are now in src/globals.h.
18540 (syms_of_minibuf): Remove spurious & from previous change.
18541
18542 2011-03-20 Leo Liu <sdl.web@gmail.com>
18543
18544 * minibuf.c (completing-read-function): New variable.
18545 (completing-read-default): Rename from completing-read.
18546 (completing-read): Call completing-read-function.
18547
18548 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18549
18550 * xfaces.c (Fx_load_color_file):
18551 Read color file from absolute filename (bug#8250).
18552
18553 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18554
18555 * makefile.w32-in: Update dependencies.
18556
18557 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18558
18559 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18560
18561 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18562
18563 Fix more problems found by GCC 4.5.2's static checks.
18564
18565 * process.c (make_serial_process_unwind, send_process_trap):
18566 (sigchld_handler): Now static.
18567
18568 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18569 That way, the code declares only the vars that it needs.
18570 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18571 * s/cygwin.h (PTY_ITERATION): Likewise.
18572 * s/darwin.h (PTY_ITERATION): Likewise.
18573 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18574
18575 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18576 * process.c (allocate_pty): Don't declare stb unless it's needed.
18577
18578 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18579 (CONSTANTLIM): Remove; unused.
18580 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18581 Define only if needed.
18582
18583 * unexelf.c (unexec): Name an expression,
18584 to avoid gcc -Wbad-function-cast warning.
18585 Use a different way to cause a compilation error if anyone uses
18586 n rather than nn, a way that does not involve shadowing.
18587 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18588
18589 * deps.mk (unexalpha.o): Remove; unused.
18590
18591 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18592 * unexec.h: New file.
18593 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18594 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18595 Depend on unexec.h.
18596 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18597 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18598 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18599 Change as necessary to match prototype in unexec.h.
18600
18601 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18602 shadowing.
18603 (back_comment, skip_chars): Mark vars as initialized.
18604
18605 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18606 Rename locals to avoid shadowing.
18607
18608 * lread.c (read1): Rewrite so as not to use empty "else".
18609 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18610
18611 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18612
18613 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18614 warning when compiling print.c.
18615
18616 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18617 instead of using an uninitialized var.
18618 (font_sort_entities): Mark var as initialized.
18619
18620 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18621
18622 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18623 pointers to constants.
18624 (font_parse_fcname): Remove unused vars.
18625 (font_delete_unmatched): Now static.
18626 (font_get_spec): Remove; unused.
18627 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18628 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18629 Rename or move locals to avoid shadowing.
18630
18631 * fns.c (require_nesting_list, require_unwind): Now static.
18632 (Ffillarray): Rename locals to avoid shadowing.
18633
18634 * floatfns.c (domain_error2): Define only if needed.
18635 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18636
18637 * alloc.c (mark_backtrace): Move decl from here ...
18638 * lisp.h: ... to here, so that it can be checked.
18639
18640 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18641 (Fdefvar): Rewrite so as not to use empty "else".
18642 (lisp_indirect_variable): Name an expression,
18643 to avoid gcc -Wbad-function-cast warning.
18644 (Fdefvar): Rename locals to avoid shadowing.
18645
18646 * callint.c (quotify_arg, quotify_args): Now static.
18647 (Fcall_interactively): Rename locals to avoid shadowing.
18648 Use const pointer when appropriate.
18649
18650 * lisp.h (get_system_name, get_operating_system_release):
18651 Move decls here, to check interfaces.
18652 * process.c (get_operating_system_release): Move decl to lisp.h.
18653 * xrdb.c (get_system_name): Likewise.
18654 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18655 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18656 some of which prompt warnings from gcc -Wbad-function-cast.
18657 (Fformat_time_string, Fencode_time, Finsert_char):
18658 (Ftranslate_region_internal, Fformat):
18659 Rename or remove local vars to avoid shadowing.
18660 (Ftranslate_region_internal): Mark var as initialized.
18661
18662 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18663 avoid shadowing.
18664
18665 * lisp.h (eassert): Check that the argument compiles, even if
18666 ENABLE_CHECKING is not defined.
18667
18668 * data.c (Findirect_variable): Name an expression, to avoid
18669 gcc -Wbad-function-cast warning.
18670 (default_value, arithcompare, arith_driver, arith_error): Now static.
18671 (store_symval_forwarding): Rename local to avoid shadowing.
18672 (Fmake_variable_buffer_local, Fmake_local_variable):
18673 Mark variables as initialized.
18674 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18675
18676 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18677 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18678 Rename locals to avoid shadowing.
18679 (mark_stack): Move local variables into the #ifdef region where
18680 they're used.
18681 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18682 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18683 needed otherwise.
18684 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18685 (GC_STRING_CHARS): Remove; not used.
18686 (Fmemory_limit): Cast sbrk's returned value to char *.
18687
18688 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18689 avoids undefined behavior in theory.
18690
18691 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18692
18693 Use functions, not macros, for up- and down-casing (Bug#8254).
18694 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18695 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18696 to use the following functions instead of these macros.
18697 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18698 EMACS_INT, since callers assume the returned value fits in int.
18699 (upcase1): Likewise, for UPCASE_TABLE.
18700 (uppercasep, lowercasep, upcase): New static inline functions.
18701 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18702 the race-condition problem in the old DOWNCASE.
18703
18704 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18705 Rename locals to avoid shadowing.
18706 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18707 (regex_compile, re_search_2, re_match_2_internal):
18708 Remove unused local vars.
18709 (FREE_VAR): Rewrite so as not to use empty "else",
18710 which gcc can warn about.
18711 (regex_compile, re_match_2_internal): Mark locals as initialized.
18712 (RETALLOC_IF): Define only if needed.
18713 (WORDCHAR_P): Likewise. This one is never needed, but is used
18714 only in a comment talking about a compiler bug, so put inside
18715 the #if 0 of that comment.
18716 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18717 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18718 Remove; unused.
18719
18720 * search.c (boyer_moore): Rename locals to avoid shadowing.
18721 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18722 (PREV_CHAR_BOUNDARY): Likewise.
18723
18724 * search.c (simple_search): Remove unused var.
18725
18726 * dired.c (compile_pattern): Move decl from here ...
18727 * lisp.h: ... to here, so that it can be checked.
18728 (struct re_registers): New forward decl.
18729
18730 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18731
18732 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18733 All uses changed.
18734 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18735 Rename locals to avoid shadowing.
18736 (Fvertical_motion): Mark locals as initialized.
18737
18738 * casefiddle.c (casify_object, casify_region): Now static.
18739 (casify_region): Mark local as initialized.
18740
18741 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18742
18743 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18744 New macros, so that the caller can use some names other than
18745 gcpro1, gcpro2, etc.
18746 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18747 of the new macros.
18748 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18749 argument, for consistency with GCPRO2_VAR, etc: it is now the
18750 prefix of the variable, not the variable itself. All uses
18751 changed.
18752 * dired.c (directory_files_internal, file_name_completion):
18753 Rename locals to avoid shadowing.
18754
18755 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18756 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18757 dired.c's scmp function, had undefined behavior.
18758 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18759 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18760 * buffer.h: ... to here, because these macros use current_buffer,
18761 and the new implementation with inline functions needs to have
18762 current_buffer in scope now, rather than later when the macros
18763 are used.
18764 (downcase, upcase1): New static inline functions.
18765 (DOWNCASE, UPCASE1): Reimplement using these functions.
18766 This avoids undefined behavior in expressions like
18767 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18768 from race conditions in accessing the global variables
18769 case_temp1 and case_temp2.
18770 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18771 * lisp.h (case_temp1, case_temp2): Remove their decls.
18772 * character.h (ASCII_CHAR_P): Move from here ...
18773 * lisp.h: ... to here, so that the inline functions mentioned
18774 above can use them.
18775
18776 * dired.c (directory_files_internal_unwind): Now static.
18777
18778 * fileio.c (file_name_as_directory, directory_file_name):
18779 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18780 Now static.
18781 (file_name_as_directory): Use const pointers when appropriate.
18782 (Fexpand_file_name): Likewise. In particular, newdir might
18783 point at constant storage, so make it a const pointer.
18784 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18785 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18786 signedness issues.
18787 (Fset_file_times, Finsert_file_contents, auto_save_error):
18788 Rename locals to avoid shadowing.
18789
18790 * minibuf.c (choose_minibuf_frame_1): Now static.
18791 (Ftry_completion, Fall_completions): Rename or remove locals
18792 to avoid shadowing.
18793
18794 * marker.c (bytepos_to_charpos): Remove; unused.
18795
18796 * lisp.h (verify_bytepos, count_markers): New decls,
18797 so that gcc does not warn that these functions aren't declared.
18798
18799 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18800 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18801 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18802 (copy_text): Remove unused local var.
18803
18804 * filelock.c (within_one_second): Now static.
18805 (lock_file_1): Rename local to avoid shadowing.
18806
18807 * buffer.c (fix_overlays_before): Mark locals as initialized.
18808 (fix_start_end_in_overlays): Likewise. This function should be
18809 simplified by using pointers-to-pointers, but that's a different
18810 matter.
18811 (switch_to_buffer_1): Now static.
18812 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18813 (report_overlay_modification): Rename locals to avoid shadowing.
18814
18815 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18816 Fix pointer signedness issue.
18817 (sys_subshell): Mark local as volatile if checking for lint,
18818 to suppress a gcc -Wclobbered warning that does not seem to be right.
18819 (MAXPATHLEN): Define only if needed.
18820
18821 * process.c (serial_open, serial_configure): Move decls from here ...
18822 * systty.h: ... to here, so that they can be checked.
18823
18824 * fns.c (get_random, seed_random): Move extern decls from here ...
18825 * lisp.h: ... to here, so that they can be checked.
18826
18827 * sysdep.c (reset_io): Now static.
18828 (wait_for_termination_signal): Remove; unused.
18829
18830 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18831 (copy_keymap_item, append_key, push_text_char_description):
18832 Now static.
18833 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18834 (DENSE_TABLE_SIZE): Remove; unused.
18835 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18836 (describe_map_tree):
18837 Rename locals to avoid shadowing.
18838
18839 * keyboard.c: Declare functions static if they are not used elsewhere.
18840 (echo_char, echo_dash, cmd_error, top_level_2):
18841 (poll_for_input, handle_async_input): Now static.
18842 (read_char, kbd_buffer_get_event, make_lispy_position):
18843 (make_lispy_event, make_lispy_movement, apply_modifiers):
18844 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18845 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18846 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18847 (read_key_sequence, read_char): Mark locals as initialized.
18848 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18849
18850 * keyboard.h (make_ctrl_char): New decl.
18851 (mark_kboards): Move decl here ...
18852 * alloc.c (mark_kboards): ... from here.
18853
18854 * lisp.h (force_auto_save_soon): New decl.
18855
18856 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18857 (DEFINE_DUMMY_FUNCTION): New macro.
18858 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18859 Use it.
18860 (main): Add casts to avoid warnings
18861 if GCC considers string literals to be constants.
18862
18863 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18864
18865 * dbusbind.c: Pointer signedness fixes.
18866 (xd_signature, xd_append_arg, xd_initialize):
18867 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18868 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18869 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18870 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18871
18872 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18873 if GCC considers string literals to be constants.
18874 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18875
18876 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18877
18878 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18879 (print_preprocess, print_object): New macro to fix last change.
18880
18881 * print.c (print_preprocess): Don't forget font objects.
18882
18883 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18884
18885 * emacs.c (USAGE3): Doc fixes.
18886
18887 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18888
18889 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18890 structure.
18891
18892 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18893
18894 * lisp.h (VWindow_system, Qfile_name_history):
18895 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18896 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18897 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18898
18899 * w32select.c: Don't #include "keyboard.h".
18900 (run_protected): Add extern declaration for waiting_for_input.
18901
18902 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18903 * w32console.c (detect_input_pending, read_input_pending)
18904 (encode_terminal_code):
18905 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18906 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18907 (w32_system_caret_y, Qfile_name_history):
18908 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18909 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18910 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18911 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18912 * w32proc.c (Qlocal, report_file_error):
18913 * w32term.c (Vwindow_system, updating_frame):
18914 * w32uniscribe.c (initialized, uniscribe_font_driver):
18915 Remove unneeded extern declarations.
18916
18917 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18918
18919 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18920
18921 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18922
18923 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18924 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18925 These macros can no longer be used for assignment.
18926
18927 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18928 Assign struct members directly, instead of using BUF_BEGV etc.
18929 (record_buffer_markers, fetch_buffer_markers): New functions for
18930 recording and fetching special buffer markers.
18931 (set_buffer_internal_1, set_buffer_temp): Use them.
18932
18933 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18934
18935 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18936
18937 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18938 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18939
18940 * xdisp.c (hscroll_window_tree):
18941 (reconsider_clip_changes): Use PT instead of BUF_PT.
18942
18943 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18944
18945 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18946 $(EMACS_ROOT)/lib/intprops.h.
18947
18948 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18949
18950 Fix more problems found by GCC 4.5.2's static checks.
18951
18952 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18953 to unsigned char * to avoid compiler diagnostic.
18954 (xg_free_frame_widgets): Make it clear that a local variable is
18955 needed only if USE_GTK_TOOLTIP.
18956 (gdk_window_get_screen): Make it clear that this macro is needed
18957 only if USE_GTK_TOOLTIP.
18958 (int_gtk_range_get_value): New function, which avoids a diagnostic
18959 from gcc -Wbad-function-cast.
18960 (xg_set_toolkit_scroll_bar_thumb): Use it.
18961 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18962 diagnostic from gcc -Wbad-function-cast.
18963 (get_utf8_string, xg_get_file_with_chooser):
18964 Rename locals to avoid shadowing.
18965 (create_dialog): Move locals to avoid shadowing.
18966
18967 * xgselect.c (xg_select): Remove unused var.
18968
18969 * image.c (four_corners_best): Mark locals as initialized.
18970 (gif_load): Initialize transparent_p to zero (Bug#8238).
18971 Mark another local as initialized.
18972 (my_png_error, my_error_exit): Mark with NO_RETURN.
18973
18974 * image.c (clear_image_cache): Now static.
18975 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18976 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18977 (x_edge_detection): Remove unnecessary cast that
18978 gcc -Wbad-function-cast diagnoses.
18979 (gif_load): Fix pointer signedness.
18980 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18981 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18982
18983 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18984
18985 Improve quality of tests for time stamp overflow.
18986 For example, without this patch (encode-time 0 0 0 1 1
18987 1152921504606846976) returns the obviously-bogus value (-948597
18988 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18989 reports time overflow. See
18990 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18991 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18992 * editfns.c: Include limits.h and intprops.h.
18993 (TIME_T_MIN, TIME_T_MAX): New macros.
18994 (time_overflow): Move earlier, to before first use.
18995 (hi_time, lo_time): New functions, for an accurate test for
18996 out-of-range times.
18997 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18998 (Fget_internal_run_time): Don't assume time_t fits in int.
18999 (make_time): Use list2 instead of Fcons twice.
19000 (Fdecode_time): More accurate test for out-of-range times.
19001 (check_tm_member): New function.
19002 (Fencode_time): Use it, to test for out-of-range times.
19003 (lisp_time_argument): Don't rely on undefined left-shift and
19004 right-shift behavior when checking for time stamp overflow.
19005
19006 * editfns.c (time_overflow): New function, refactoring common code.
19007 (Fformat_time_string, Fdecode_time, Fencode_time):
19008 (Fcurrent_time_string): Use it.
19009
19010 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19011 * dired.c (make_time): Move to ...
19012 * editfns.c (make_time): ... here.
19013 * systime.h: Note the move.
19014
19015 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19016
19017 * fringe.c (update_window_fringes): Remove unused variables.
19018
19019 * unexmacosx.c (copy_data_segment): Also copy __got section.
19020 (Bug#8223)
19021
19022 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19023
19024 * termcap.c [MSDOS]: Include "msdos.h".
19025 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19026 Constify `char *' arguments and their references according to
19027 prototypes in tparam.h.
19028
19029 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19030
19031 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19032 Adapt all references accordingly.
19033
19034 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19035
19036 2011-03-11 Tom Tromey <tromey@redhat.com>
19037
19038 * buffer.c (syms_of_buffer): Remove obsolete comment.
19039
19040 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19041
19042 * termhooks.h (encode_terminal_code): Declare prototype.
19043
19044 * msdos.c (encode_terminal_code): Don't declare prototype.
19045
19046 * term.c (encode_terminal_code): Now external again, used by
19047 w32console.c and msdos.c.
19048
19049 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19050 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19051
19052 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19053
19054 Fix some minor problems found by GCC 4.5.2's static checks.
19055
19056 * fringe.c (update_window_fringes): Mark locals as initialized
19057 (Bug#8227).
19058 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19059
19060 * alloc.c (mark_fringe_data): Move decl from here ...
19061 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19062 to check its interface.
19063 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19064
19065 * fontset.c (free_realized_fontset): Now static.
19066 (Fset_fontset_font): Rename local to avoid shadowing.
19067 (fontset_font): Mark local as initialized.
19068 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19069
19070 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19071
19072 * xselect.c (x_disown_buffer_selections): Remove; not used.
19073 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19074 (x_own_selection, Fx_disown_selection_internal): Rename locals
19075 to avoid shadowing.
19076 (x_handle_dnd_message): Remove local to avoid shadowing.
19077
19078 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19079 so that the caller can use some name other than gcpro1.
19080 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19081 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19082 (Fx_backspace_delete_keys_p):
19083 Use them to avoid shadowing, and rename vars to avoid shadowing.
19084 (x_decode_color, x_set_name, x_window): Now static.
19085 (Fx_create_frame): Add braces to silence GCC warning.
19086 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19087 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19088 Remove unused locals.
19089 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19090 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19091 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19092 macros.
19093
19094 * xterm.h (x_mouse_leave): New decl.
19095
19096 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19097 Remove unused functions.
19098 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19099 (x_calc_absolute_position): Now static.
19100 (XTread_socket): Don't define label "out" unless it's used.
19101 Don't declare local "event" unless it's used.
19102 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19103 unless they are used.
19104 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19105 (x_fatal_error_signal): Remove; not used.
19106 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19107 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19108 (x_error_catcher, x_connection_closed, x_error_handler):
19109 (x_error_quitter, xembed_send_message, x_iconify_frame):
19110 (my_log_handler): Rename locals to avoid shadowing.
19111 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19112 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19113
19114 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19115 Rename or move locals to avoid shadowing.
19116 (tty_defined_color, merge_face_heights): Now static.
19117 (free_realized_faces_for_fontset): Remove; not used.
19118 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19119 does not deduce is never used uninitialized.
19120 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19121 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19122
19123 * terminal.c (store_terminal_param): Now static.
19124
19125 * xmenu.c (menu_highlight_callback): Now static.
19126 (set_frame_menubar): Remove unused local.
19127 (xmenu_show): Rename parameter to avoid shadowing.
19128 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19129 since they might point to immutable storage.
19130 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19131 since it's unused otherwise.
19132
19133 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19134 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19135 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19136 avoids a gcc -Wuninitialized diagnostic.
19137 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19138 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19139 does not deduce are never used uninitialized.
19140
19141 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19142
19143 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19144 * window.c (window_loop, size_window):
19145 (run_window_configuration_change_hook, enlarge_window): Likewise.
19146
19147 * window.c (display_buffer): Now static.
19148 (size_window): Mark variables that gcc -Wuninitialized
19149 does not deduce are never used uninitialized.
19150 * window.h (check_all_windows): New decl, to forestall
19151 gcc -Wmissing-prototypes diagnostic.
19152 * dispextern.h (bidi_dump_cached_states): Likewise.
19153
19154 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19155 shadowing.
19156 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19157 Include <limits.h>.
19158 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19159 and to avoid gcc -Wuninitialized warning.
19160 (load_charset_map): Mark variables that gcc -Wuninitialized
19161 does not deduce are never used uninitialized.
19162 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19163
19164 * coding.c (coding_set_source, coding_set_destination):
19165 Use "else { /* comment */ }" rather than "else /* comment */;"
19166 for clarity, and to avoid gcc -Wempty-body warning.
19167 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19168 a block, when the outer 'i' will do.
19169 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19170 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19171 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19172 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19173 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19174 Rename locals to avoid shadowing.
19175 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19176 * coding.c (emacs_mule_char, encode_invocation_designation):
19177 Now static, since they're not used elsewhere.
19178 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19179 (decode_coding_object, encode_coding_object, detect_coding_system):
19180 (decode_coding_emacs_mule): Mark variables that gcc
19181 -Wuninitialized does not deduce are never used uninitialized.
19182 (detect_coding_iso_2022): Initialize a local variable that might
19183 be used uninitialized. Leave a FIXME because it's not clear that
19184 this initialization is needed. (Bug#8211)
19185 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19186 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19187 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19188 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19189 Remove unused macros.
19190
19191 * category.c (hash_get_category_set): Remove unused local var.
19192 (copy_category_table): Now static, since it's not used elsewhere.
19193 * character.c (string_count_byte8): Likewise.
19194
19195 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19196 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19197
19198 * chartab.c (copy_sub_char_table): Now static, since it's not used
19199 elsewhere.
19200 (sub_char_table_ref_and_range, char_table_ref_and_range):
19201 Rename locals to avoid shadowing.
19202 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19203
19204 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19205 (BIDI_BOB): Remove unused macro.
19206
19207 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19208 deduce are never used uninitialized.
19209 * term.c (encode_terminal_code): Likewise.
19210
19211 * term.c (encode_terminal_code): Now static. Remove unused local.
19212
19213 * tparam.h: New file.
19214 * term.c, tparam.h: Include it.
19215 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19216 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19217 Move these decls to tparam.h, and make them agree with what
19218 is actually in tparam.c. The previous trick of using incompatible
19219 decls in different modules does not conform to the C standard.
19220 All callers of tparam changed to use tparam's actual API.
19221 * tparam.c (tparam1, tparam, tgoto):
19222 Use const pointers where appropriate.
19223
19224 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19225 * cm.h (struct cm): Likewise.
19226 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19227 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19228 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19229 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19230 (turn_on_face, init_tty): Likewise.
19231 * termchar.h (struct tty_display_info): Likewise.
19232
19233 * term.c (term_mouse_position): Rename local to avoid shadowing.
19234
19235 * alloc.c (mark_ttys): Move decl from here ...
19236 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19237
19238 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19239
19240 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19241
19242 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19243
19244 * search.c (compile_pattern_1): Remove argument regp, unused since
19245 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19246 (compile_pattern): Don't pass it.
19247
19248 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19249
19250 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19251 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19252 for ! HAVE_GTK3.
19253 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19254
19255 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19256
19257 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19258 gdk_window_get_screen, gdk_window_get_geometry,
19259 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19260 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19261 (xg_get_pixbuf_from_pixmap): New function.
19262 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19263 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19264 Call xg_get_pixbuf_from_pixmap instead of
19265 gdk_pixbuf_get_from_drawable.
19266 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19267 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19268 (xg_check_special_colors): Use GtkStyleContext and its functions
19269 for HAVE_GTK3.
19270 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19271 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19272 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19273 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19274 Call gtk_widget_get_preferred_size.
19275 (xg_frame_resized): gdk_window_get_geometry only takes 5
19276 parameters.
19277 (xg_win_to_widget, xg_event_is_for_menubar):
19278 Call gdk_x11_window_lookup_for_display.
19279 (xg_set_widget_bg): New function.
19280 (delete_cb): New function.
19281 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19282 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19283 (xg_set_background_color): Call xg_set_widget_bg.
19284 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19285 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19286 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19287 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19288 if ! HAVE_GTK3.
19289 (update_frame_tool_bar): Call gtk_widget_hide.
19290 (xg_initialize): Use GDK_KEY_g.
19291
19292 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19293 if ! HAVE_GTK3
19294 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19295
19296 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19297 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19298 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19299
19300 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19301
19302 * w32xfns.c (select_palette): Check success of RealizePalette against
19303 GDI_ERROR, not zero.
19304
19305 See ChangeLog.11 for earlier changes.
19306
19307 ;; Local Variables:
19308 ;; coding: utf-8
19309 ;; End:
19310
19311 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19312
19313 This file is part of GNU Emacs.
19314
19315 GNU Emacs is free software: you can redistribute it and/or modify
19316 it under the terms of the GNU General Public License as published by
19317 the Free Software Foundation, either version 3 of the License, or
19318 (at your option) any later version.
19319
19320 GNU Emacs is distributed in the hope that it will be useful,
19321 but WITHOUT ANY WARRANTY; without even the implied warranty of
19322 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19323 GNU General Public License for more details.
19324
19325 You should have received a copy of the GNU General Public License
19326 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.