]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Fix MS-Windows build broken by fixing bug #12776 on Posix platforms.
[gnu-emacs] / src / ChangeLog
1 2012-11-01 Eli Zaretskii <eliz@gnu.org>
2
3 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4
5 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
6
7 Fix crash when using Emacs as commit editor for git (Bug#12697).
8 * callproc.c (setpgrp): Remove macro, as we now use setpgid
9 and it is configured in conf_post.h.
10 (Fcall_process): Don't invoke both setsid and setpgid; the former
11 is enough, if it exists.
12 * callproc.c (Fcall_process, child_setup):
13 * process.c (create_process): Use setpgid.
14 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
15 for the real thing.
16 * dispnew.c (init_display): Initialize the foreground group
17 if we are running a tty display.
18 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
19 * lisp.h (init_foreground_group): New decl.
20 * sysdep.c (inherited_pgroup): New static var.
21 (init_foreground_group, tcsetpgrp_without_stopping)
22 (narrow_foreground_group, widen_foreground_group): New functions.
23 (init_sys_modes): Narrow foreground group.
24 (reset_sys_modes): Widen foreground group.
25
26 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
27
28 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
29
30 2012-10-31 Martin Rudalics <rudalics@gmx.at>
31
32 * minibuf.c (read_minibuf): Restore current buffer since
33 choose_minibuf_frame calling Fset_frame_selected_window may
34 change it (Bug#12766).
35
36 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
37
38 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
39
40 2012-10-30 Kenichi Handa <handa@gnu.org>
41
42 * font.c (Ffont_at): If WINDOW is specified and it is not
43 displaying the current buffer, signal an error.
44
45 2012-10-29 Daniel Colascione <dancol@dancol.org>
46
47 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
48 preparation for fixing bug#12739, move these functions from
49 here...
50
51 * coding.h, coding.c: ... to here, and compile them only when
52 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
53 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
54
55 2012-10-28 Eli Zaretskii <eliz@gnu.org>
56
57 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
58 (timer_loop, getitimer, setitimer): Use it instead of
59 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
60 'clock'.
61 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
62 literal 10000.
63
64 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
65
66 * nsterm.m (NO_APPDEFINED_DATA): New define.
67 (last_appdefined_event_data): New variable
68 (last_appdefined_event): Remove.
69 (ns_select): Initialize t from last_appdefined_event_data instead
70 of [last_appdefined_event data1].
71 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
72 remove last_appdefined_event (Bug#12698).
73
74 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
75
76 * frame.c (x_set_font): Catch internal error.
77
78 2012-10-27 Eli Zaretskii <eliz@gnu.org>
79
80 Avoid overflow in w32 implementation of interval timers.
81 When possible, for ITIMER_PROF count only times the main thread
82 actually executes.
83 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
84 'volatile ULONGLONG' types. All the other data which was
85 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
86 (GetThreadTimes_Proc): New typedef.
87 (w32_get_timer_time): New function, returns a suitable time value
88 for the timer.
89 (timer_loop): Enter critical section when accessing ULONGLONG
90 values of the itimer_data struct, as these accesses are no longer
91 atomic. Call 'w32_get_timer_time' instead of 'clock'.
92 Remove unused variable.
93 (init_timers): Initialize s_pfn_Get_Thread_Times.
94 (start_timer_thread): Don't assign itimer->caller_thread here.
95 (getitimer): Assign itimer->caller_thread here.
96 (setitimer): Always call getitimer to get the value of ticks_now.
97 (sys_spawnve): Avoid compiler warning about format mismatch.
98
99 2012-10-26 Eli Zaretskii <eliz@gnu.org>
100
101 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
102 mouse movement events if the menu bar is active. This avoids
103 producing a busy "hour-glass" cursor by Windows if the mouse
104 pointer is positioned over a tooltip shown for some menu item.
105
106 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
107
108 Don't assume process IDs fit in int.
109 * emacs.c (shut_down_emacs) [!DOS_NT]:
110 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
111 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
112 Use pid_t, not int, to store process IDs, as 'int'
113 is not wide enough on a few platforms (e.g., AIX and IRIX).
114
115 2012-10-23 Kenichi Handa <handa@gnu.org>
116
117 The following change is to make face-font-rescale-alist work
118 correctly for non-ASCII fonts.
119
120 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
121 (font_open_for_lface): Handle Vface_font_rescale_alist.
122
123 2012-10-23 Chong Yidong <cyd@gnu.org>
124
125 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
126
127 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
128
129 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
130 for screen font.
131 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
132
133 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
134 event (Bug#12681).
135
136 2012-10-21 Glenn Morris <rgm@gnu.org>
137
138 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
139
140 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
141
142 Port to OpenBSD 5.1.
143 * frame.c (Fmouse_position, Fmouse_pixel_position):
144 * xdisp.c (produce_stretch_glyph):
145 Declare local vars only when they're needed.
146 This is clearer and avoids a warning on OpenBSD about unused vars.
147 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
148 This is safer, and avoids OpenBSD warnings about unused vars.
149 * keyboard.c (record_menu_key): Remove unnecessary decl.
150 (poll_timer): Define only if POLL_FOR_INPUT is defined.
151 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
152 as our definition clashes with OpenBSD's.
153 * xfaces.c (load_face_colors, check_lface_attrs)
154 (get_lface_attributes_no_remap, get_lface_attributes)
155 (lface_fully_specified_p, x_supports_face_attributes_p)
156 (tty_supports_face_attributes_p, face_fontset, realize_face)
157 (realize_x_face, realize_tty_face):
158 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
159 merely Lisp_Object *. This is more informative and avoids
160 a warning on OpenBSD about accessing beyond an object's size.
161
162 2012-10-20 Chong Yidong <cyd@gnu.org>
163
164 * lread.c (Fload): Doc fix (Bug#12592).
165
166 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
167
168 * font.c (Ffont_at): Fix previous change.
169
170 2012-10-19 Eli Zaretskii <eliz@gnu.org>
171
172 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
173 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
174 for the reasons.
175
176 * alloc.c (NSTATICS): Decrease to 0x800.
177
178 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
179
180 * fns.c (Fnreverse): Include the problem element when signalling an
181 error (bug#12677).
182
183 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
184
185 * nsterm.m (ns_select): Check writefds before call to
186 FD_ISSET (Bug#12668).
187
188 2012-10-18 Daniel Colascione <dancol@dancol.org>
189
190 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
191 (staticpro): If we run out of staticpro slots, die with an
192 informative error instead of just calling emacs_abort.
193
194 2012-10-18 Martin Rudalics <rudalics@gmx.at>
195
196 Fix two flaws reported by Dmitry Antipov.
197 * window.c (Ftemp_output_buffer_show): Remove.
198 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
199 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
200
201 2012-10-17 Eli Zaretskii <eliz@gnu.org>
202
203 * makefile.w32-in ($(BLD)/w32.$(O)):
204 ($(BLD)/vm-limit.$(O)):
205 ($(BLD)/term.$(O)):
206 ($(BLD)/unexw32.$(O)):
207 ($(BLD)/fileio.$(O)):
208 ($(BLD)/dispnew.$(O)): Update dependencies.
209
210 * w32term.h (w32_initialize_display_info, initialize_w32_display):
211 Add prototypes.
212
213 * w32proc.c: Include ctype.h.
214
215 * w32.h (init_environment, check_windows_init_file)
216 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
217 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
218 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
219 (sys_link): Add prototypes.
220
221 * w32.c: Include w32select.h.
222 (sys_access, e_malloc, sys_select): Add prototypes.
223 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
224
225 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
226
227 * unexw32.c: Include lisp.h and w32.h.
228
229 * term.c [WINDOWSNT]: Include w32term.h.
230
231 * process.c [WINDOWSNT]: Add prototype of sys_select.
232
233 * fileio.c [WINDOWSNT]: Include w32.h.
234
235 * dispnew.c [WINDOWSNT]: Include w32.h.
236
237 * cygw32.c (Fcygwin_convert_path_to_windows)
238 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
239 Lisp_Object values. (Bug#12661)
240
241 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
242 to Lisp_Object. (Bug#12661)
243
244 2012-10-17 Kenichi Handa <handa@gnu.org>
245
246 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
247 invalidate.
248
249 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
250
251 * buffer.c (Fkill_buffer): When unchaining the marker,
252 reset its buffer pointer to NULL (Bug#12652).
253
254 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
255
256 Do not verify indirection counters of killed buffers (Bug#12579).
257 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
258 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
259
260 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
261
262 * alloc.c (Fmake_byte_code): Fix typo in comment.
263 * print.c (print_interval): Define as static to match prototype.
264 * indent.c (disptab_matches_widthtab, recompute_width_table):
265 Convert to eassert.
266
267 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
268
269 * editfns.c (get_system_name): Remove.
270 * lisp.h (get_system_name): Remove prototype.
271 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
272 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
273
274 2012-10-15 Daniel Colascione <dancol@dancol.org>
275
276 * dbusbind.c: Add comment explaining reason for previous change.
277
278 2012-10-15 Martin Rudalics <rudalics@gmx.at>
279
280 * window.c (Fwindow_end): Rewrite check whether cached position
281 can be used (Bug#12600).
282 (resize_frame_windows, grow_mini_window, shrink_mini_window):
283 Set windows_or_buffers_changed.
284
285 2012-10-15 Daniel Colascione <dancol@dancol.org>
286
287 * dbusbind.c: Fix cygw32 build break when compiling with dbus
288 enabled by undefining the symbol "interface", which the platform
289 headers define to something incompatible.
290
291 2012-10-14 Daniel Colascione <dancol@dancol.org>
292
293 * image.c (init_tiff_functions, init_imagemagick_functions)
294 (init_svg_functions): Fix cygw32 build break by using these
295 functions only when WINDOWSNT _and_ HAVE_NTGUI.
296
297 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
298
299 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
300
301 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
302
303 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
304
305 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
306
307 * coding.c (detect_coding): Set coding->id before calling
308 this->detector.
309
310 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
311
312 * fileio.c: Formatting fixes.
313
314 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
315
316 Fix some stat-related races.
317 * fileio.c (Fwrite_region): Avoid race condition if a file is
318 removed or renamed by some other process immediately after Emacs
319 writes it but before Emacs stats it. Do not assume that stat (or
320 fstat) succeeds.
321 * image.c (slurp_file): Resolve the file name with fopen + fstat
322 rather than stat + fopen.
323 (pbm_read_file) [0]: Remove unused code with stat race.
324 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
325 Remove ineffective code with stat race.
326
327 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
328
329 * doc.c (get_doc_string): Don't signal an error if the file is missing.
330
331 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
332
333 * nsterm.m (hold_event_q): New static variable.
334 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
335 ! q_event_ptr.
336 (hold_event): New function.
337 (ns_read_socket): If hold_event_q have events, store them and
338 return (Bug#12384).
339 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
340 is zero (Bug#12384).
341
342 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
343
344 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
345
346 2012-10-12 Eli Zaretskii <eliz@gnu.org>
347
348 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
349
350 * fileio.c (check_existing): New function.
351 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
352 instead of calling 'stat', when what's needed is to check whether
353 a file exists. This avoids expensive system calls on MS-Windows.
354 (Bug#12587)
355
356 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
357
358 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
359 determine whether a file exists and is not a directory.
360
361 * lisp.h (check_existing): Add prototype.
362
363 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
364
365 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
366
367 2012-10-12 Glenn Morris <rgm@gnu.org>
368
369 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
370
371 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
372
373 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
374
375 * eval.c (Fautoload): Remember previous autoload status in load-history.
376
377 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
378
379 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
380 * lread.c (load_each_byte, new_backquote_flag, readchar)
381 (read_filtered_event, lisp_file_lexically_bound_p)
382 (safe_to_load_version, Fload, complete_filename_p, openp)
383 (build_load_history, readevalloop, read_escape, read1)
384 (string_to_number, read_vector, read_list):
385 * macros.c (Fstart_kbd_macro):
386 * marker.c (CONSIDER):
387 * menu.c (parse_single_submenu, digest_single_submenu)
388 (find_and_return_menu_selection, Fx_popup_menu):
389 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
390 (Ftry_completion):
391 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
392 (ns_menu_show):
393 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
394 (xmenu_show, xdialog_show):
395 Use bool for booleans.
396 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
397 as it's not a predicate. All uses changed. Omit unnecessary
398 buffer termination.
399
400 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
401
402 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
403 (save_excursion_restore): Do not restore mark if it was not saved.
404
405 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
406
407 * marker.c (cached_modiff): EMACS_INT, not int.
408
409 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
410 instead of having a wrong decl.
411 * nsmenu.m (waiting_for_input): Remove wrong decl.
412
413 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
414
415 keyboard.c, keymap.c: Use bool for booleans.
416 * dispnew.c (sit_for): Distinguish between 3-way display_option
417 and boolean do_display.
418 * keyboard.c (single_kboard, this_command_key_count_reset)
419 (waiting_for_input, echoing, immediate_quit, input_pending)
420 (interrupt_input, interrupts_deferred, pop_kboard)
421 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
422 (command_loop_1, adjust_point_for_property)
423 (safe_run_hooks_error, input_polling_used, read_char):
424 (help_char_p, readable_events, kbd_buffer_events_waiting)
425 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
426 (lucid_event_type_list_p, get_input_pending):
427 (gobble_input, menu_separator_name_p, menu_bar_item)
428 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
429 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
430 (keyremap_step, test_undefined, read_key_sequence)
431 (detect_input_pending, detect_input_pending_ignore_squeezables)
432 (detect_input_pending_run_timers, requeued_events_pending_p)
433 (quit_throw_to_read_char, Fset_input_interrupt_mode):
434 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
435 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
436 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
437 (accessible_keymaps_1, Fkey_description, push_key_description):
438 (shadow_lookup, struct where_is_internal_data)
439 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
440 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
441 (describe_map, describe_vector):
442 * menu.c (single_menu_item):
443 * nsmenu.m (ns_update_menubar):
444 * process.c (wait_reading_process_output):
445 * search.c (scan_buffer, scan_newline):
446 Use bool for boolean.
447 * keyboard.c (timers_run, swallow_events)
448 (detect_input_pending_run_timers):
449 * process.c (wait_reading_process_output):
450 Use unsigned for counter where wraparound-on-overflow is desired,
451 since unsigned is guaranteed to have that behavior and signed is not.
452 (read_char): Use ptrdiff_t for string length.
453 (get_input_pending): Remove first argument, since it was always
454 the same pointer-to-int (now pointer-to-boolean) &input_pending,
455 and behave as if it had that value. Return new value of
456 input_pending. All callers changed.
457 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
458 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
459 a string length.
460 * keymap.c (push_key_description): Omit last arg, which was always 1.
461 All callers changed.
462
463 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
464
465 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
466
467 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
468 ($(BLD)/term.$(O)): Update dependencies.
469
470 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
471
472 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
473 * lisp.h (enum pvec_type): Adjust comments and omit explicit
474 initializer for PVEC_NORMAL_VECTOR.
475
476 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
477
478 Clean out old termopts cruft.
479 * termopts.h (flow_control, meta_key): Remove unused decls.
480 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
481 Don't include termopts.h.
482
483 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
484
485 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
486
487 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
488
489 * commands.h (immediate_quit): Remove duplicate decl.
490
491 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
492
493 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
494 caching.
495 (nsfont_open): Remove setting of Vfonts_in_cache.
496 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
497
498 2012-10-09 Eli Zaretskii <eliz@gnu.org>
499
500 * w32fns.c (w32_last_error): Change the return value to DWORD, to
501 match what GetLastError returns. Explain why the function is
502 needed.
503
504 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
505 'is_tooltip_frame', to avoid confusion with its global namesake.
506
507 2012-10-08 Daniel Colascione <dancol@dancol.org>
508
509 * xdisp.c (start_hourglass): Call w32_note_current_window when
510 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
511 build that caused Emacs to display the hourglass cursor forever.
512
513 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
514 which is broken under remote desktop, calculate the number of
515 colors available for a display based on the display's number of
516 planes and number of bits per pixel per plane. (bug#10397).
517
518 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
519
520 * nsfont.m (Vfonts_in_cache): New variable.
521 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
522 are used. Add cached fonts to Vfonts_in_cache.
523 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
524
525 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
526
527 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
528 in nt/config.nt.
529 (FONT_H): Define after FRAME_H.
530 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
531 Update dependencies.
532
533 * w32term.c: Remove leftover declaration of keyboard_codepage.
534
535 2012-10-08 Eli Zaretskii <eliz@gnu.org>
536
537 * makefile.w32-in (FONT_H): Add $(FRAME_H).
538 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
539 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
540 (GLOBAL_SOURCES): Add cygw32.c.
541 ($(BLD)/unexw32.$(O)):
542 ($(BLD)/w32.$(O)):
543 ($(BLD)/w32console.$(O)):
544 ($(BLD)/w32fns.$(O)):
545 ($(BLD)/w32heap.$(O)):
546 ($(BLD)/w32menu.$(O)):
547 ($(BLD)/w32proc.$(O)): Add w32common.h.
548
549 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
550 'const char *'.
551 (x_to_w32_color): Don't modify the argument, modify a copy instead.
552
553 2012-10-08 Daniel Colascione <dancol@dancol.org>
554
555 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
556 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
557 accidental message numbering hole. Change other messages to
558 match.
559
560 * w32select.h (HAVE_W32SELECT): Remove.
561
562 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
563 w32common.h instead of w32heap.h.
564
565 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
566 (get_allocation_unit, get_processor_type, get_w32_major_version)
567 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
568 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
569 (OS_NT, os_subtype, cache_system_info): Move declarations to
570 w32common.
571
572 * w32heap.c: Include w32common.h.
573 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
574 (w32_minor_version, w32_build_number, w32_subtype):
575 Remove duplicate definitions.
576
577 * w32fns.c: Include w32common.h; include w32heap.h only in
578 WINDOWSNT.
579
580 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
581 Use `report_file_error' instead of `error' in order to better
582 inform users of what went wrong. Increase NTGUI_UNICODE file
583 dialog box file name length to 32k, the maximum allowed by the NT
584 kernel.
585
586 * w32common.h: New file.
587 (ROUND_UP, ROUND_DOWN, get_page_size)
588 (get_allocation_unit, get_processor_type, get_w32_major_version)
589 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
590 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
591 (OS_NT, os_subtype, cache_system_info): Move here.
592
593 * unexw32.c, unexcw.c: Include w32common.h.
594
595 * emacs.c (main): Use (defined (WINDOWSNT) || defined
596 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
597 to call syms_of_w32select.
598
599 * cygw32.h: Remove obsolete EXFUN declarations.
600
601 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
602
603 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
604 of w32inevt.o from SOME_MACHINE_OBJECTS.
605
606 2012-10-08 Daniel Colascione <dancol@dancol.org>
607
608 * image.c: Permanent fix for JPEG compilation issue --- limit
609 jpeglib `boolean' redefinition to Cygwin builds.
610
611 2012-10-08 Eli Zaretskii <eliz@gnu.org>
612
613 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
614
615 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
616 Cygwin.
617
618 2012-10-08 Daniel Colascione <dancol@dancol.org>
619
620 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
621 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
622 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
623 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
624 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
625 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
626 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
627 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
628 now a supported configuration.
629
630 * Makefile.in: consolidate image variables into LIBIMAGE; add
631 W32_OBJ and W32_LIBS. Compile new files.
632
633 * conf_post.h:
634 (_DebPrint) declare tracing facility for W32 debugging. We need
635 to unify tracing later.
636
637 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
638 unconditional use of W32 Unicode functions. Cygwin runs only on
639 100% Unicode operating systems.
640
641 * cygw32.c: New file. Define Cygwin-specific facilities.
642 (Fcygwin_convert_path_to_windows)
643 (Fcygwin_convert_path_from_windows): New user functions for
644 accessing Cygwin path-munging routines.
645
646 * cygw32.h: New file.
647 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
648 UTF-16LE strings temporarily inside non-Lisp-visible string
649 objects.
650
651 (w32_strerror): Just what it says on the tin.
652
653 * emacs.c: Make the NS fork-then-exec code for daemon-launching
654 also run for Cygwin; both systems have the same problem with using
655 GUI facilities in a forked child. Also call syms_of_cygw32,
656 syms_of_w32select in correct places.
657
658 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
659 needs fork-then-exec for daemon launching.
660
661 * font.h: Include frame.h.
662
663 * image.c: Use the image library cache machinery only when we're
664 compiling for native WINDOWSNT; Cygwin can use shared libraries
665 like any other Unixlike system.
666
667 * keyboard.c: Clarify a comment regarding the input loop.
668
669 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
670 functions directly instead of trying to detect at runtime that our
671 host operating system supports them. We make this change for two
672 reasons: Cygwin lacks support for the multibyte character
673 conversion functions used by the legacy menu code, and Cygwin
674 never needs to rely on non-Unicode APIs.
675
676 * unexw32.c (hinst): Declare extern.
677
678 * w32.c: Change header order;
679 (w32_strerror): Move to w32fns.c because we need it for
680 non-WINDOWSNT builds.
681
682 * w32.h: Add #error macro to make sure we don't include w32.h for
683 Cygwin builds. Remove w32select declarations.
684
685 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
686 w32fns.c. w32console.c is WINDOWSNT-only.
687
688 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
689 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
690 POSIXy alternative.
691 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
692 (w32_major_version, w32_minor_version, w32_build_number)
693 (os_subtype, sound_type): Define here
694 (w32_defined_color): Make color parameter const for consistency
695 with other _defined_color functions.
696 (w32_createwindow): Unconditionally call w32_init_class instead of
697 doing so only when hprevinst is non-NULL. Plumbing hprevinst
698 through the code is complex and unnecessary because class
699 registration is practically free.
700 (w32_name_of_message): New EMACSDEBUG-only function.
701 (Fset_message_beep): Move here
702 (Fx_open_connection): Require that the display name for Windows be
703 "w32" for consistency, emacsclient disambiguation, and maybe, one
704 day, multi-window-system support.
705 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
706 Cygwin files for W32 GUI facilities, since these clearly don't
707 expect Cygwin names.
708 (_DebPrint): Define.
709 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
710 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
711 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
712 (w32_last_error): Remove.
713
714 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
715
716 * w32heap.c (syspage_mask): Declare here.
717 (cache_system_info): Remove.
718
719 * w32inevt.c (faked_key): Define globally, not statically.
720 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
721 (w32_console_toggle_lock_key): Move to w32fns.c.
722
723 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
724
725 * w32proc.c (_DebPrint): Move to w32fns.c.
726 * w32select.c: Include string.h, stdio.h for Cygwin.
727 * w32select.h: New File.
728
729 * w32term.c: Include io.h for non-CYGWIN builds; needed for
730 get_osfhandle.
731 (w32_message_fd): New variable. Under Cygwin, holds the file
732 descriptor the system used to tell us about pending thread
733 messages.
734
735 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
736 that prevented compilation under non-WINDOWSNT systems.
737
738 (w32_initialize): Open /dev/windows and assign it to
739 w32_message_fd. Provide w32 feature.
740
741 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
742 (WM_EMACS_INPUT_READY): add.
743 (prepend_msg, w32_message_fd): Declare globally.
744
745 * w32xfns.c:
746 (keyboard_handle): Use only when WINDOWSNT.
747 (notify_msg_ready): New function. Posts a message to the main
748 thread's message queue under CYGWIN, which wakes up the main
749 thread from select(2) by making the /dev/windows file descriptor
750 ready. Under WINDOWSNT, it sets an event the same way the old
751 code did.
752
753 (post, prepend_msg): Actually call notify_msg_ready instead of
754 setting the input event directly.
755
756 2012-10-07 Eli Zaretskii <eliz@gnu.org>
757
758 * ralloc.c (relinquish): If a heap is ready to be relinquished,
759 but it still has blocs in it, don't return it to the system,
760 instead of aborting. (Bug#12402)
761
762 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
763
764 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
765
766 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
767 MAC_OS_X_VERSION_10_6.
768 (syms_of_nsterm): Remove comment about Panther and above for
769 ns-antialias-text.
770 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
771 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
772 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
773
774 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
775 MAC_OS_X_VERSION_10_4.
776
777 * nsmenu.m (fillWithWidgetValue:): Remove code for <
778 MAC_OS_X_VERSION_10_2.
779
780 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
781
782 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
783 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
784
785 * nsterm.m (ns_in_resize): Remove (Bug#12479).
786 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
787 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
788 Remove ns_in_resize check.
789 (ns_clear_frame_area): Remove resize handle code.
790
791 * nsfns.m (ns_in_resize): Remove.
792 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
793 Remove ns_in_resize check.
794
795 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
796
797 Improve sys_siglist detection.
798 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
799 defined as a macro, as is done in Solaris.
800 (sys_siglist_entries): New macro.
801 (save_strsignal): Use it.
802 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
803 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
804
805 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
806
807 * nsfns.m (Fx_create_frame): Call x_default_parameter with
808 fullscreen/Fullscreen.
809
810 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
811 tobar_height is new.
812
813 * nsterm.m (x_make_frame_visible): Check for fullscreen.
814 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
815 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
816 (windowDidResize:): Check for correct window if old style fullscreen.
817 Capitalize word in comment. Remove incorrect comment.
818 (initFrameFromEmacs:): tbar_height renamed tibar_height.
819 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
820 error in drawing background.
821 (toggleFullScreen:): Remove comment. Rearrange calls.
822 Set toolbar values to zero, save old height in tobar_height.
823 Restore tool bar height when leaving fullscreen.
824 (canBecomeMainWindow): New function.
825
826 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
827
828 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
829
830 2012-10-05 Eli Zaretskii <eliz@gnu.org>
831
832 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
833
834 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
835 that time stamps of directories could also be changed.
836 Don't request the too broad GENERIC_WRITE, only the more restrictive
837 FILE_WRITE_ATTRIBUTES access rights.
838
839 * fileio.c (Fset_file_times): Special-case ignoring errors for
840 directories only on MSDOS, not on MS-Windows.
841
842 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
843
844 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
845
846 2012-10-04 Eli Zaretskii <eliz@gnu.org>
847
848 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
849 see whether CreateFile failed.
850
851 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
852
853 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
854 to avoid similar races.
855 * keyboard.c (pending_signals): Now bool, not int.
856
857 Port timers to OpenBSD, plus check for timer failures.
858 OpenBSD problem reported by Han Boetes.
859 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
860 and/or setitimer.
861 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
862 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
863 like OpenBSD, which has timer_settime but does not declare it.
864 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
865 whether to use itimerspec-related primitives. All uses of
866 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
867
868 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
869
870 * profiler.c (handle_profiler_signal): Fix a malloc race
871 that caused Emacs to hang on Fedora 17 when profiling Lisp.
872
873 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
874
875 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
876
877 2012-10-02 Eli Zaretskii <eliz@gnu.org>
878
879 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
880 consistent with the change in return value of 'safe_strsignal'.
881
882 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
883
884 Prefer plain 'static' to 'static inline' (Bug#12541).
885 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
886 (bidi_set_sor_type, bidi_push_embedding_level)
887 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
888 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
889 (bidi_cache_search, bidi_cache_ensure_space)
890 (bidi_cache_iterator_state, bidi_cache_find)
891 (bidi_peek_at_next_level, bidi_set_paragraph_end)
892 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
893 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
894 Now 'static', not 'static inline'.
895
896 Count overruns when profiling; change units to ns.
897 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
898 Give extra weight to samples after overruns, to attempt to count
899 the time more accurately.
900 (setup_cpu_timer): Change sampling interval units from ms to ns, since
901 the underlying primitives nominally do ns.
902 (Fprofiler_cpu_start): Document the change. Mention that
903 the sampling intervals are only approximate.
904
905 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
906
907 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
908
909 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
910 case for the special 0 coding-system.
911
912 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
913 (Fmake_overlay): Remove redundant tests.
914 (fix_start_end_in_overlays): Remove redundant recentering.
915
916 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
917
918 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
919 Update dependencies.
920
921 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
922
923 Fix a malloc race condition involving strsignal.
924 A signal can arrive in the middle of a malloc, and Emacs's signal
925 handler can invoke strsignal, which can invoke malloc, which is
926 not portable. This race condition bug makes Emacs hang on GNU/Linux.
927 Fix it by altering the signal handler so that it does not invoke
928 strsignal.
929 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
930 * process.c (status_message): Use const pointer, in case strsignal
931 is #defined to safe_strsignal.
932 * sysdep.c (sys_siglist, init_signals): Always define and
933 initialize a substitute sys_siglist if the system does not define
934 one, even if HAVE_STRSIGNAL.
935 (safe_strsignal): Rename from strsignal. Always define,
936 using sys_siglist. Return a const pointer.
937 * syssignal.h (safe_strsignal): New decl.
938 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
939
940 2012-10-01 Eli Zaretskii <eliz@gnu.org>
941
942 * w32proc.c (timer_loop): Fix code that waits for timer
943 expiration, to avoid high CPU usage.
944
945 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
946
947 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
948 (sweep_weak_table): Remove redundant prototypes.
949
950 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
951
952 * emacs.c: Move the inclusion of TERM_HEADER after including
953 windows.h on WINDOWSNT. This avoids compilation problems with
954 MSVC.
955
956 2012-10-01 Eli Zaretskii <eliz@gnu.org>
957
958 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
959 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
960 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
961 as the previous version used 'void *'.
962
963 * ralloc.c (ROUNDUP): Fix last change.
964 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
965 'size_t'.
966
967 * w32proc.c <disable_itimers>: New static flag.
968 (init_timers): Initialize it to zero, after creating the critical
969 sections used by the timer threads.
970 (term_timers): Set to 1 before deleting the critical sections.
971 (getitimer, setitimer): If disable_itimers is non-zero, return an
972 error indication without doing anything. Reported by Fabrice
973 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
974 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
975 return results.
976 [!HAVE_SETITIMER]: Behave as the previous version that didn't
977 support timers.
978
979 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
980 term_ntproc after all the other bookkeeping, to get timers working
981 as long as possible.
982
983 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
984
985 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
986 Suggested by Juri Linkov in
987 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
988
989 Prefer plain 'static' to 'static inline' (Bug#12541).
990 With static functions, modern compilers inline pretty well by
991 themselves; advice from programmers often hurts as much as it helps.
992 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
993 this change shrinks the text size of the Emacs executable by 1.1%
994 without affecting CPU significantly in my benchmark.
995 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
996 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
997 (mark_maybe_object, mark_maybe_pointer, bounded_number):
998 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
999 (bset_auto_fill_function, bset_auto_save_file_format)
1000 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1001 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1002 (bset_cache_long_line_scans, bset_case_fold_search)
1003 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1004 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1005 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1006 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1007 (bset_header_line_format, bset_indicate_buffer_boundaries)
1008 (bset_indicate_empty_lines, bset_invisibility_spec)
1009 (bset_left_fringe_width, bset_major_mode, bset_mark)
1010 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1011 (bset_name, bset_overwrite_mode, bset_pt_marker)
1012 (bset_right_fringe_width, bset_save_length)
1013 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1014 (bset_scroll_up_aggressively, bset_selective_display)
1015 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1016 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1017 (set_buffer_overlays_after):
1018 * category.c (bset_category_table):
1019 * charset.c (read_hex):
1020 * coding.c (produce_composition, produce_charset)
1021 (handle_composition_annotation, handle_charset_annotation)
1022 (char_encodable_p):
1023 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1024 (assign_row, set_frame_matrix_frame, make_current)
1025 (add_row_entry):
1026 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1027 * fns.c (maybe_resize_hash_table):
1028 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1029 * gmalloc.c (register_heapinfo):
1030 * image.c (lookup_image_type):
1031 * intervals.c (set_interval_object, set_interval_left)
1032 (set_interval_right, copy_interval_parent, rotate_right)
1033 (rotate_left, balance_possible_root_interval):
1034 * keyboard.c (kset_echo_string, kset_kbd_queue)
1035 (kset_keyboard_translate_table, kset_last_prefix_arg)
1036 (kset_last_repeatable_command, kset_local_function_key_map)
1037 (kset_overriding_terminal_local_map, kset_real_last_command)
1038 (kset_system_key_syms, clear_event, set_prop):
1039 * lread.c (digit_to_number):
1040 * marker.c (attach_marker, live_buffer, set_marker_internal):
1041 * nsterm.m (ns_compute_glyph_string_overhangs):
1042 * process.c (pset_buffer, pset_command)
1043 (pset_decode_coding_system, pset_decoding_buf)
1044 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1045 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1046 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1047 * syntax.c (bset_syntax_table, dec_bytepos):
1048 * terminal.c (tset_param_alist):
1049 * textprop.c (interval_has_some_properties)
1050 (interval_has_some_properties_list):
1051 * window.c (wset_combination_limit, wset_dedicated)
1052 (wset_display_table, wset_hchild, wset_left_fringe_width)
1053 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1054 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1055 (wset_right_fringe_width, wset_right_margin_cols)
1056 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1057 (wset_vertical_scroll_bar_type, wset_window_parameters):
1058 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1059 (wset_column_number_displayed, wset_region_showing)
1060 (window_box_edges, run_window_scroll_functions)
1061 (append_glyph_string_lists, prepend_glyph_string_lists)
1062 (append_glyph_string, set_glyph_string_background_width)
1063 (append_glyph, append_composite_glyph)
1064 (take_vertical_position_into_account):
1065 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1066 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1067 (lface_hash, lface_same_font_attributes_p, lookup_face):
1068 * xml.c (libxml2_loaded_p):
1069 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1070 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1071 Now 'static', not 'static inline'.
1072
1073 * bidi.c: Tune.
1074 (bidi_copy_it): Do the whole copy with a single memcpy.
1075 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1076
1077 Revert the FOLLOW-SYMLINKS change for file-attributes.
1078 Doing it right would require several changes to Tramp, and there's
1079 not enough time to get that tested before the freeze today.
1080 * dired.c (directory_files_internal, Ffile_attributes):
1081 Undo last change.
1082
1083 * frame.c (x_report_frame_params): Port better to wider ints.
1084 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1085 or that pointers can be printed in 15 decimal digits.
1086 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1087
1088 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1089
1090 Support x64 build on MS-Windows.
1091 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1092 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1093 compatibility with x64.
1094 (x_get_focus_frame): Add prototype.
1095
1096 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1097 defining an XRectangle structure.
1098
1099 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1100 arithmetics for compatibility with x64.
1101
1102 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1103 compatibility with x64.
1104
1105 * w32heap.h: Adjust prototypes and declarations.
1106
1107 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1108 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1109 DWORD, long, and unsigned long, for compatibility with x64.
1110 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1111 (sbrk): Argument is now of type ptrdiff_t.
1112
1113 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1114 less than 0x0500.
1115 (w32_msg_pump): Use WPARAM type for 'result'.
1116
1117 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1118 architecture.
1119 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1120 compatibility with x64.
1121
1122 * vm-limit.c (lim_data): Now size_t.
1123 (check_memory_limits): Adjust prototypes of real_morecore and
1124 __morecore to receive argument of type ptrdiff_t. Use size_t for
1125 five_percent and data_size.
1126
1127 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1128 variables, for compatibility with x64.
1129 (rva_to_section, offset_to_section, relocate_offset)
1130 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1131 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1132 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1133 for compatibility with x64.
1134
1135 * sysdep.c (STDERR_FILENO): Define if not already defined.
1136
1137 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1138 (__morecore): Argument type is now ptrdiff_t.
1139 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1140 (relinquish): Use ptrdiff_t type for 'excess'.
1141 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1142
1143 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1144 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1145 instead of a literal number.
1146
1147 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1148 (min): Define only if not already defined.
1149
1150 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1151 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1152 hosts.
1153
1154 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1155 'bitmaps' is a pointer.
1156
1157 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1158
1159 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1160
1161 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1162
1163 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1164 * dired.c (directory_files_internal, Ffile_attributes):
1165 New arg follow_symlinks. All uses changed.
1166
1167 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1168
1169 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1170
1171 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1172
1173 Support atimers and CPU profiler via profile.c on MS-Windows.
1174 * w32proc.c (sig_mask, crit_sig): New static variables.
1175 (sys_signal): Support SIGALRM and SIGPROF.
1176 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1177 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1178 sigfillset, and sigprocmask are no longer no-ops.
1179 (sigismember): New function.
1180 (struct itimer_data): New definition.
1181 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1182 (crit_prof): New static variables.
1183 (MAX_SINGLE_SLEEP): New definition.
1184 (timer_loop, stop_timer_thread, term_timers, init_timers)
1185 (start_timer_thread, getitimer, setitimer): New functions.
1186 (alarm): No longer a no-op, calls setitimer.
1187
1188 * w32.c (term_ntproc): Call term_timers.
1189 (init_ntproc): Make sure all signals are unblocked at startup, to
1190 erase any traces of dumping. Call init_timers.
1191
1192 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1193 Windows-specific code to display the hourglass mouse pointer is no
1194 longer used.
1195 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1196 to hourglass timer expiration.
1197 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1198 Remove, no longer used.
1199 (w32_note_current_window, show_hourglass, hide_hourglass):
1200 New functions, in support of hourglass cursor display similar to other
1201 window systems.
1202 (syms_of_w32fns): Don't initialize hourglass_timer.
1203
1204 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1205 WINDOWSNT as well.
1206 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1207
1208 * w32.h (init_timers, term_timers): Add prototypes.
1209
1210 2012-09-30 Kenichi Handa <handa@gnu.org>
1211
1212 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1213 to the buffer relocation which may be caused by ccl_driver.
1214
1215 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1216
1217 * xfns.c (Fx_file_dialog): Update comment.
1218
1219 * w32fns.c (Fx_file_dialog): Update comment.
1220
1221 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1222 Initialize panel name field if OSX >= 10.6.
1223
1224 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1225
1226 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1227
1228 * nsterm.m (NEW_STYLE_FS): New define.
1229 (ns_fullscreen_hook, windowWillEnterFullScreen)
1230 (windowDidEnterFullScreen, windowWillExitFullScreen)
1231 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1232 (setFSValue): New functions.
1233 (EmacsFSWindow): New implementation.
1234 (canBecomeKeyWindow): New function for EmacsFSWindow.
1235 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1236 (dealloc): Release nonfs_window if in fullscreen.
1237 (updateFrameSize:): Call windowDidMove to update top/left.
1238 (windowWillResize:toSize:): Check if frame is still maximized.
1239 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1240 next_maximized, maximized_width, maximized_height and nonfs_window.
1241 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1242 tbar_height.
1243 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1244 fullscreen. Set maximized_width/height. Act on next_maximized.
1245
1246 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1247 (EmacsView): Add variables for fullscreen.
1248 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1249 (EmacsFSWindow): New interface for fullscreen.
1250
1251 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1252
1253 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1254
1255 2012-09-30 Chong Yidong <cyd@gnu.org>
1256
1257 * fns.c (Frandom): Doc fix.
1258
1259 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1260
1261 * window.c (Vwindow_combination_limit): New default value.
1262 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1263
1264 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1265
1266 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1267 Suggested by Eli Zaretskii in
1268 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1269
1270 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1271
1272 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1273 HAVE_TIMER_SETTIME is defined.
1274
1275 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1276
1277 Profiler improvements: more-accurate timers, overflow checks.
1278 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1279 signal.h, setjmp.h. Include systime.h instead.
1280 (saturated_add): New function.
1281 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1282 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1283 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1284 New static vars.
1285 (enum profiler_cpu_running): New enum.
1286 (profiler_cpu_running): Now of that enum type, not bool.
1287 All uses changed to store the new value.
1288 (handle_profiler_signal): Rename from sigprof_handler_1,
1289 for consistency with other handlers. Do not check whether
1290 cpu_log is a hash-table if garbage collecting, since it
1291 doesn't matter in that case.
1292 (deliver_profiler_signal): Rename from sigprof_handler,
1293 for consistency with other handlers.
1294 (setup_cpu_timer): New function, with much of what used to be in
1295 Fprofiler_cpu_start. Check for out-of-range argument.
1296 Prefer timer_settime if available, and prefer
1297 thread cputime clocks, then process cputime clocks, then
1298 monotonic clocks, to the old realtime clock. Use make_timeval
1299 to round more-correctly when falling back to setitimer.
1300 (Fprofiler_cpu_start): Use it.
1301 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1302 Don't assume that passing NULL as the 2nd argument of setitimer
1303 is the same as passing a pointer to all-zero storage.
1304 Ignore SIGPROF afterwards.
1305 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1306 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1307 non-fatal signal handlers. Ignore SIGPROF on startup.
1308 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1309 in profiler.c, since sysdep.c now uses it.
1310
1311 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1312 Suggested by Eli Zaretskii in
1313 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1314
1315 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1316
1317 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1318
1319 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1320
1321 * lisp.h (struct backtrace): Remove indirection for `function' field.
1322 * xdisp.c (redisplay_internal):
1323 * profiler.c (record_backtrace, sigprof_handler_1):
1324 * alloc.c (Fgarbage_collect):
1325 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1326 (Fbacktrace_frame): Adjust accordingly.
1327
1328 2012-09-28 Glenn Morris <rgm@gnu.org>
1329
1330 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1331 (Frun_hook_with_args_until_failure): Doc fixes.
1332
1333 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1334
1335 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1336 Qautomatic_redisplay and change the symbol name. All users changed.
1337
1338 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1339
1340 * profiler.c (sigprof_handler): Fix race condition.
1341
1342 2012-09-28 Glenn Morris <rgm@gnu.org>
1343
1344 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1345
1346 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1347
1348 Check more robustly for timer_settime.
1349 * Makefile.in (LIB_TIMER_TIME): New macro.
1350 (LIBES): Add it.
1351 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1352 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1353 call timer_settime.
1354
1355 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1356
1357 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1358
1359 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1360
1361 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1362
1363 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1364
1365 * character.h (MAYBE_UNIFY_CHAR): Remove.
1366 * charset.c, charset.h (maybe_unify_char): Now static.
1367 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1368 Since this stuff is now private to charset.c, there's no need for
1369 a public macro and no need to inline by hand.
1370
1371 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1372 Stefan Monnier <monnier@iro.umontreal.ca>
1373 Juanma Barranquero <lekktu@gmail.com>
1374
1375 * profiler.c: New file.
1376 * Makefile.in (base_obj): Add profiler.o.
1377 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1378 ($(BLD)/profiler.$(O)): New target.
1379 * emacs.c (main): Call syms_of_profiler.
1380 * alloc.c (Qautomatic_gc): New constant.
1381 (MALLOC_PROBE): New macro.
1382 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1383 (total_bytes_of_live_objects): New function.
1384 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1385 Call malloc_probe for the memory profiler.
1386 (syms_of_alloc): Define Qautomatic_gc.
1387 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1388 race condition.
1389 (struct backtrace): Move definition...
1390 * lisp.h (struct backtrace): ..here.
1391 (Qautomatic_gc, profiler_memory_running): Declare vars.
1392 (malloc_probe, syms_of_profiler): Declare functions.
1393 * xdisp.c (Qautomatic_redisplay): New constant.
1394 (redisplay_internal): Record itself in backtrace_list.
1395 (syms_of_xdisp): Define Qautomatic_redisplay.
1396
1397 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1398 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1399
1400 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1401
1402 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1403
1404 Prefer POSIX timers if available.
1405 They avoid a race if the timer is too close to the current time.
1406 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1407 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1408 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1409
1410 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1411
1412 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1413 CHAR_STRING_ADVANCE.
1414 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1415 STRING_CHAR_ADVANCE.
1416
1417 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1418
1419 Move Vlibrary_cache to emacs.c and reset before dumping.
1420
1421 * lisp.h (reset_image_types): Declare.
1422 [WINDOWSNT] (Vlibrary_cache): Declare.
1423
1424 * image.c (reset_image_types): New function.
1425
1426 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1427 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1428 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1429
1430 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1431 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1432
1433 * w32.h (Vlibrary_cache): Do not declare.
1434
1435 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1436
1437 * w32proc.c (sys_signal): Handle all signals defined by the
1438 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1439 handlers for signals supported by Windows. Don't override
1440 term_ntproc as the handler for SIGABRT.
1441 (sigaction): Rewrite to call sys_signal instead of duplicating its
1442 code.
1443 (sys_kill): Improve commentary.
1444
1445 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1446 consistency with a signature of a signal handler. All callers
1447 changed.
1448 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1449 install term_ntproc as a signal handler for SIGABRT, as that
1450 should be done by the dumped Emacs.
1451
1452 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1453
1454 * w32select.c (term_w32select): Protect against repeated
1455 invocation by setting clipboard_owner to NULL after calling
1456 DestroyWindow.
1457
1458 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1459 and term_ntproc to their modified signatures.
1460
1461 * character.c (char_string, string_char): Remove calls to
1462 MAYBE_UNIFY_CHAR. See the discussion starting at
1463 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1464 for the details.
1465
1466 2012-09-25 Chong Yidong <cyd@gnu.org>
1467
1468 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1469
1470 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1471
1472 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1473 when encountering an unknown bytecode.
1474
1475 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1476
1477 image.c, indent.c: Use bool for booleans.
1478 * dispextern.h (struct image_type): Members valid_p, load, init
1479 now return bool, not int. All uses changed.
1480 * image.c: Omit unnecessary static decls.
1481 (x_create_bitmap_mask, x_build_heuristic_mask):
1482 Return void, not int, since callers don't care about the return value.
1483 (x_create_bitmap_mask, define_image_type, valid_image_p)
1484 (struct image_keyword, parse_image_spec, image_spec_value)
1485 (check_image_size, image_background)
1486 (image_background_transparent, x_clear_image_1)
1487 (postprocess_image, lookup_image, x_check_image_size)
1488 (x_create_x_image_and_pixmap, xbm_image_p)
1489 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1490 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1491 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1492 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1493 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1494 (png_image_p, init_png_functions, png_load_body, png_load)
1495 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1496 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1497 (init_gif_functions, gif_load, imagemagick_image_p)
1498 (imagemagick_load_image, imagemagick_load, svg_image_p)
1499 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1500 (gs_load):
1501 * nsimage.m (ns_load_image):
1502 * nsterm.m (ns_defined_color):
1503 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1504 * xfns.c (x_defined_color):
1505 * xterm.c (x_alloc_lighter_color_for_widget)
1506 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1507 (x_alloc_lighter_color):
1508 * indent.c (disptab_matches_widthtab, current_column)
1509 (scan_for_column, string_display_width, indented_beyond_p)
1510 (compute_motion, vmotion, Fvertical_motion):
1511 Use bool for booleans.
1512
1513 2012-09-24 Chong Yidong <cyd@gnu.org>
1514
1515 * chartab.c (Fset_char_table_default): Obsolete function removed.
1516
1517 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1518
1519 Move pid_t related decls out of lisp.h.
1520 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1521 (interruptible_wait_for_termination):
1522 Move these decls from lisp.h to syswait.h, since they use pid_t.
1523 Needed on FreeBSD; see Herbert J. Skuhra in
1524 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1525 * callproc.c: Include syswait.h.
1526
1527 gnutls.c, gtkutil.c: Use bool for boolean.
1528 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1529 (emacs_gnutls_handle_error):
1530 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1531 (xg_hide_tooltip, xg_create_frame_widgets)
1532 (create_dialog, xg_uses_old_file_dialog)
1533 (xg_get_file_with_chooser, xg_get_file_with_selection)
1534 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1535 (xg_item_label_same_p, xg_update_menubar)
1536 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1537 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1538 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1539 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1540 (update_frame_tool_bar, free_frame_tool_bar):
1541 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1542 * nsmenu.m (ns_update_menubar):
1543 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1544 * xfns.c (Fx_show_tip) [USE_GTK]:
1545 Use bool for boolean.
1546 * gtkutil.c (xg_update_frame_menubar):
1547 * xmenu.c (update_frame_menubar):
1548 Return void, not int, since caller ignores return value.
1549 * gtkutil.c (xg_change_toolbar_position):
1550 Return void, not 1.
1551
1552 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1553
1554 * makefile.w32-in (BLOCKINPUT_H): Remove.
1555 (SYSSIGNAL_H): New macro.
1556 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1557 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1558 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1559 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1560 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1561 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1562 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1563 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1564 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1565 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1566 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1567 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1568 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1569 ($(BLD)/w32xfns.$(O)): Update dependencies.
1570
1571 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1572
1573 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1574 fatal_error_backtrace.
1575
1576 * w32proc.c (sys_kill): Undo last change: don't do anything when
1577 invoked to deliver SIGABRT to our own process. This is now
1578 handled by emacs_raise.
1579
1580 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1581
1582 * w32term.c (w32_read_socket): Remove leftover reference to
1583 interrupt_input_pending.
1584
1585 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1586
1587 Do not use SA_NODEFER.
1588 Problem reported by Dani Moncayo in
1589 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1590 * alloc.c (die):
1591 * sysdep.c (emacs_abort): Do not reset signal handler.
1592 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1593 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1594 wanted even on POSIXish hosts, and it doesn't work on Windows.
1595
1596 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1597
1598 * xterm.c (x_term_init): Call fixup_locale before and after calling
1599 gtk_init (Bug#12392).
1600
1601 2012-09-23 Chong Yidong <cyd@gnu.org>
1602
1603 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1604 Vdynamic_library_alist.
1605
1606 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1607 (Fgnutls_available_p): Caller changed.
1608
1609 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1610 (Flibxml_parse_xml_region): Likewise.
1611
1612 * dispextern.h (struct image_type): Remove arg from init function.
1613
1614 * image.c (Finit_image_library, lookup_image_type)
1615 (define_image_type): Remove now-unneeded second arg.
1616 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1617 (init_tiff_functions, init_gif_functions, init_svg_functions):
1618 Arglist and w32_delayed_load calling convention changed.
1619 (gs_type): Remove init_gs_functions; there is no such function.
1620 (valid_image_p, make_image): Fix caller to lookup_image_type.
1621
1622 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1623
1624 Simplify and avoid signal-handling races (Bug#12471).
1625 * alloc.c (die):
1626 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1627 Avoid recursive loop if there's a fatal error in the function itself.
1628 * atimer.c (pending_atimers):
1629 * blockinput.h: Don't include "atimer.h"; no longer needed.
1630 (interrupt_input_pending): Remove. All uses removed.
1631 pending_signals now counts both atimers and ordinary interrupts.
1632 This is less racy than having three separate pending-signal flags.
1633 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1634 (input_blocked_p):
1635 Rename from their upper-case counterparts BLOCK_INPUT,
1636 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1637 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1638 This makes it easier to access volatile variables more accurately.
1639 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1640 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1641 that's more reliable if the code is buggy and sets
1642 interrupt_input_blocked to a negative value. All uses changed.
1643 * atimer.c (deliver_alarm_signal):
1644 Remove. No need to deliver this to the parent; any thread can
1645 handle this signal now. All uses replaced by underlying handler.
1646 * atimer.c (turn_on_atimers):
1647 * dispnew.c (handle_window_change_signal):
1648 * emacs.c (handle_danger_signal):
1649 * keyboard.c (kbd_buffer_get_event):
1650 Don't reestablish signal handler; not needed with sigaction.
1651 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1652 (UNBLOCK_INPUT_TO):
1653 Rework to avoid unnecessary accesses to volatile variables.
1654 (UNBLOCK_INPUT_TO): Now a function.
1655 (totally_unblock_input, unblock_input): New decls.
1656 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1657 (init_data): Remove. Necessary stuff now done in init_signal.
1658 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1659 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1660 (fatal_error_code): Remove; no longer needed.
1661 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1662 it doesn't always backtrace. All uses changed. No need to reset
1663 signal to default, since sigaction and/or die does that for us now.
1664 Use emacs_raise (FOO), not kill (getpid (), FOO).
1665 (main): Check more-accurately whether we're dumping.
1666 Move fatal-error setup to sysdep.c
1667 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1668 * gtkutil.c (xg_get_file_name, xg_get_font):
1669 Remove no-longer-needed signal-mask manipulation.
1670 * keyboard.c, process.c (POLL_FOR_INPUT):
1671 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1672 * keyboard.c (read_avail_input): Remove.
1673 All uses replaced by gobble_input.
1674 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1675 (kbd_buffer_store_event_hold, gobble_input):
1676 (record_asynch_buffer_change) [USABLE_SIGIO]:
1677 (store_user_signal_events):
1678 No need to mess with signal mask.
1679 (gobble_input): If blocking input and there are terminals, simply
1680 set pending_signals to 1 and return. All hooks changed to not
1681 worry about whether input is blocked.
1682 (process_pending_signals): Clear pending_signals before processing
1683 them, in case a signal comes in while we're processing.
1684 By convention callers now test pending_signals before calling us.
1685 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1686 New functions, to support changes to blockinput.h.
1687 (handle_input_available_signal): Now extern.
1688 (reinvoke_input_signal): Remove. All uses replaced by
1689 handle_async_input.
1690 (quit_count): Now volatile, since a signal handler uses it.
1691 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1692 All callers changed. Block SIGINT only if not already blocked.
1693 Clear sigmask reliably, even if Fsignal returns, which it can.
1694 Omit unnecessary accesses to volatile var.
1695 (quit_throw_to_read_char): No need to restore sigmask.
1696 * keyboard.c (gobble_input, handle_user_signal):
1697 * process.c (wait_reading_process_output):
1698 Call signal-handling code rather than killing ourselves.
1699 * lisp.h: Include <float.h>, for...
1700 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1701 (pending_signals): Now volatile.
1702 (syms_of_data): Now const if IEEE floating point.
1703 (handle_input_available_signal) [USABLE_SIGIO]:
1704 (terminate_due_to_signal, record_child_status_change): New decls.
1705 * process.c (create_process): Avoid disaster if memory is exhausted
1706 while we're processing a vfork, by tightening the critical section
1707 around the vfork.
1708 (send_process_frame, process_sent_to, handle_pipe_signal)
1709 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1710 ignores SIGPIPE.
1711 (send_process): No need for setjmp/longjmp any more, since the
1712 SIGPIPE stuff is now gone. Instead, report an error if errno
1713 is EPIPE.
1714 (record_child_status_change): Now extern. PID and W are now args.
1715 Return void, not bool. All callers changed.
1716 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1717 Remove. All uses removed. This bug should be fixed now in a
1718 different way.
1719 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1720 and record the child status change directly. This avoids the
1721 need to futz with the signal mask.
1722 (process_fatal_action): Move here from emacs.c.
1723 (emacs_sigaction_flags): New function, containing
1724 much of what used to be in emacs_sigaction_init.
1725 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1726 caught by emacs, to make races less likely.
1727 (deliver_process_signal): Rename from handle_on_main_thread.
1728 All uses changed.
1729 (BACKTRACE_LIMIT_MAX): Now at top level.
1730 (thread_backtrace_buffer, threadback_backtrace_pointers):
1731 New static vars.
1732 (deliver_thread_signal, deliver_fatal_thread_signal):
1733 New functions, for more-accurate delivery of thread-specific signals.
1734 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1735 (deliver_arith_signal): Handle in this thread, not
1736 in the main thread, since it's triggered by this thread.
1737 (maybe_fatal_sig): New function.
1738 (init_signals): New arg DUMPING so that we can be more accurate
1739 about whether we're dumping. Caller changed.
1740 Treat thread-specific signals differently from process-general signals.
1741 Block all signals while handling fatal error; that's safer.
1742 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1743 on IEEE hosts.
1744 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1745 Ignore SIGPIPE unless batch.
1746 (emacs_backtrace): Output backtrace for the appropriate thread,
1747 which is not necessarily the main thread.
1748 * syssignal.h: Include <stdbool.h>.
1749 (emacs_raise): New macro.
1750 * xterm.c (x_connection_signal): Remove; no longer needed
1751 now that we use sigaction.
1752 (x_connection_closed): No need to mess with sigmask now.
1753 (x_initialize): No need to reset SIGPIPE handler here, since
1754 init_signals does this for us now.
1755
1756 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1757
1758 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1759 background rect may be larger (Bug#12245).
1760
1761 2012-09-23 Chong Yidong <cyd@gnu.org>
1762
1763 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1764
1765 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1766
1767 * .gdbinit: Just stop at fatal_error_backtrace.
1768 See Stefan Monnier's request in
1769 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1770 Remove no-longer-used query of system type.
1771
1772 2012-09-22 Chong Yidong <cyd@gnu.org>
1773
1774 * search.c (Freplace_match): Doc fix (Bug#12325).
1775
1776 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1777
1778 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1779 (Fline_end_position): Doc fix.
1780
1781 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1782
1783 2012-09-22 Chong Yidong <cyd@gnu.org>
1784
1785 * dispextern.h (struct image_type): Add new slot, storing a type
1786 initialization function.
1787
1788 * image.c (define_image_type): Call the image initializer function
1789 if it is defined. Arguments and return value changed.
1790 (valid_image_p, make_image): Callers changed.
1791 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1792 (gif_type, imagemagick_type, svg_type, gs_type):
1793 Add initialization functions.
1794 (Finit_image_library): Call lookup_image_type.
1795 (CHECK_LIB_AVAILABLE): Macro deleted.
1796 (lookup_image_type): Call define_image_type here, rather than via
1797 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1798 (syms_of_image): Move define_image_type calls for xbm_type and
1799 pbm_type to lookup_image_type.
1800
1801 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1802
1803 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1804 'idle_timers' from here ...
1805 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1806 lists, to avoid infloops when the timer does something stupid,
1807 like reinvoke itself with the same or smaller time-out.
1808 (Bug#12447)
1809
1810 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1811
1812 * window.c (Fsplit_window_internal): Handle only Qt value of
1813 Vwindow_combination_limit separately.
1814 (Qtemp_buffer_resize): New symbol.
1815 (Vwindow_combination_limit): New default value.
1816 Rewrite doc-string.
1817
1818 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1819
1820 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1821 the new overlay string. (Bug#10159)
1822
1823 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1824
1825 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1826 or that fprintf is async-signal-safe. POSIX doesn't require
1827 either assumption.
1828
1829 2012-09-22 Chong Yidong <cyd@gnu.org>
1830
1831 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1832 (Bug#8207).
1833
1834 2012-09-22 Kenichi Handa <handa@gnu.org>
1835
1836 * composite.c (composition_reseat_it): Handle the case that a
1837 grapheme cluster is not covered by a single font (Bug#12352).
1838
1839 2012-09-21 Chong Yidong <cyd@gnu.org>
1840
1841 * image.c (define_image_type): Avoid adding duplicate types to
1842 image_types (Bug#12463). Suggested by Jörg Walter.
1843
1844 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1845
1846 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1847 (print_load_command_name): Add case LC_DATA_IN_CODE.
1848 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1849
1850 2012-09-21 Glenn Morris <rgm@gnu.org>
1851
1852 * eval.c (Frun_hook_with_args_until_success)
1853 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1854
1855 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1856
1857 * fileio.c (Ffile_selinux_context): Only call freecon when
1858 lgetfilecon succeeded.
1859 (Fset_file_selinux_context): Likewise. (Bug#12444)
1860
1861 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1862
1863 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1864 reordering, locate the cursor by calling set_cursor_from_row; if
1865 that fails, clear the desired glyph matrix before returning a
1866 failure indication to the caller. Fixes leaving garbled display
1867 when fast scrolling with a down-key. (Bug#12403)
1868 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1869 scrolling through multibyte text.
1870
1871 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1872
1873 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1874 calling mark_vectorlike since that's the one that marks the window.
1875 (mark_discard_killed_buffers): Mark the final cdr.
1876 * window.h (struct window): Move prev/next_buffers to the
1877 non-standard fields.
1878 * window.c (make_window): Initialize prev/next_buffers manually.
1879
1880 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1881
1882 Omit unused arg EXPECTED from socket hooks.
1883 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1884 * nsterm.m (ns_term_init):
1885 * termhooks.h (struct terminal.read_socket_hook):
1886 * w32inevt.c (w32_console_read_socket):
1887 * w32term.c (w32_read_socket):
1888 * xterm.c (XTread_socket):
1889 Omit unused arg EXPECTED. All callers changed.
1890 (store_user_signal_events): Return void, not int, since callers no
1891 longer care about the return value. All uses changed.
1892
1893 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1894
1895 * w32gui.h (XParseGeometry): Do not declare.
1896
1897 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1898
1899 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1900 Ignore 'expected'. See Eli Zaretskii in
1901 <http://bugs.gnu.org/12471#8> (last line).
1902
1903 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1904 (XParseGeometry): Now static. Substitute extremal values for
1905 values that are out of range.
1906
1907 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1908
1909 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1910
1911 * nsfns.m (XParseGeometry): Remove.
1912 (Fx_create_frame): Call x_set_offset to correctly interpret
1913 top_pos in geometry.
1914
1915 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1916 (Fx_parse_geometry): If there is a space in string, call
1917 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1918
1919 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1920
1921 * search.c (scan_buffer): Use character positions in calls to
1922 region_cache_forward and region_cache_backward, not byte
1923 positions. (Bug#12196)
1924
1925 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1926 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1927
1928 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1929 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1930 emacs_blocked_malloc, now deleted.
1931
1932 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1933
1934 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1935 The workaround was for improving performance on Solaris 2.4, but
1936 is getting in the way now. Emacs will still work if someone is
1937 still running Solaris 2.4 in a museum somewhere; Sun dropped
1938 support for Solaris 2.4 in 2003.
1939 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1940 * process.c (create_process) [HAVE_WORKING_VFORK]:
1941 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1942 since Emacs no longer uses vfork on that platform.
1943
1944 2012-09-17 Glenn Morris <rgm@gnu.org>
1945
1946 * emacs.c: Use COPYRIGHT.
1947
1948 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1949
1950 Remove configure's --without-sync-input option (Bug#12450).
1951 When auditing signal-handling in preparation for cleaning it up,
1952 I found that SYNC_INPUT has race conditions and would be a real
1953 pain to fix. Since it's an undocumented and deprecated
1954 configure-time option, now seems like a good time to remove it.
1955 Also see <http://bugs.gnu.org/11080#16>.
1956 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1957 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1958 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1959 (malloc_hysteresis):
1960 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1961 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1962 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1963 (dont_register_blocks, bytes_used_when_reconsidered)
1964 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1965 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1966 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1967 Remove. All uses removed.
1968 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1969 implementation, one that depends on whether the new macro
1970 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1971 is defined.
1972 * atimer.c (run_timers, handle_alarm_signal):
1973 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1974 (handle_async_input, process_pending_signals)
1975 (handle_input_available_signal, init_keyboard):
1976 * nsterm.m (ns_read_socket):
1977 * process.c (wait_reading_process_output):
1978 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1979 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1980 (emacs_write):
1981 * xterm.c (XTread_socket):
1982 Assume SYNC_INPUT.
1983 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1984 * eval.c (handling_signal): Remove. All uses removed.
1985 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1986 All uses replaced with the SYNC_INPUT version.
1987 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1988 Remove decls.
1989 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1990 Now static.
1991
1992 * font.c (Ffont_shape_gstring): Remove unused local.
1993
1994 2012-09-16 Glenn Morris <rgm@gnu.org>
1995
1996 * Makefile.in (clean): No longer run nextstep's clean.
1997
1998 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1999 (ns_frag): Remove.
2000 (ns-app): Move here from ns.mk, and simplify.
2001 (clean): Simplify nextstep entry.
2002 * ns.mk: Remove file.
2003
2004 2012-09-17 Kenichi Handa <handa@gnu.org>
2005
2006 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2007 not covert the last few charactes.
2008
2009 2012-09-16 Kenichi Handa <handa@gnu.org>
2010
2011 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2012 here, but just check the validity of glyphs in the glyph-string.
2013
2014 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2015
2016 * window.c (Fwindow_parameter, Fset_window_parameter):
2017 Accept any window as argument (Bug#12452).
2018
2019 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2020
2021 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2022 to ns_term_init to avoid memory leak.
2023
2024 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2025 explicit retain/release.
2026 (ns_term_init): Only allow one display. Initialize outerpool and
2027 ns_*_types.
2028
2029 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2030
2031 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2032 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2033 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2034 the Microsoft problem in a different way, by altering ../nt/config.nt.
2035
2036 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2037
2038 * w32xfns.c:
2039 * w32uniscribe.c:
2040 * w32term.c:
2041 * w32select.c:
2042 * w32reg.c:
2043 * w32proc.c:
2044 * w32menu.c:
2045 * w32inevt.c:
2046 * w32heap.c:
2047 * w32font.c:
2048 * w32fns.c:
2049 * w32console.c:
2050 * w32.c:
2051 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2052 by lisp.h. This completes removal of setjmp.h inclusion
2053 erroneously announced in the previous commit. (Bug#12446)
2054
2055 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2056 more accurate.
2057
2058 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2059 not defined as a macro. The latter happens on MS-Windows.
2060 (Bug#12446)
2061
2062 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2063
2064 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2065 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2066 Some instances of '#include <setjmp.h>' removed, if the
2067 only reason for the instance was because "lisp.h" was included.
2068 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2069 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2070 and _longjmp with the new symbols. Emacs already uses _setjmp if
2071 available, so this change affects only POSIXish hosts that have
2072 sigsetjmp but not _setjmp, such as some versions of Solaris and
2073 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2074 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2075 (png_load_body) [HAVE_PNG]:
2076 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2077 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2078 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2079 since PNG requires jmp_buf. This is the only exception to the
2080 general rule that we now use sys_setjmp and sys_longjmp.
2081 This exception is OK since this code does not change the signal
2082 mask or longjmp out of a signal handler.
2083
2084 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2085
2086 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2087 Include "syssignal.h", for 'main_thread'.
2088
2089 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2090
2091 Avoid out-of-range marker position (Bug#12426).
2092 * insdel.c (replace_range, replace_range_2):
2093 Adjust markers before overlays, as suggested by comments.
2094 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2095 Remove redundant check before calling offset_intervals.
2096
2097 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2098
2099 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2100 current buffer (Bug#12387).
2101
2102 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2103
2104 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2105
2106 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2107
2108 Use a more backwards-compatible timer format (Bug#12430).
2109 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2110 vector element, not from the 4th, since PSECS is now at the end.
2111 (Fcurrent_idle_time): Doc fix.
2112
2113 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2114
2115 Function to mark objects and remove killed buffers at once.
2116 * alloc.c (discard_killed_buffers): Rename to ...
2117 (mark_discard_killed buffers) ... new name. Add marking
2118 of remaining objects. Fix comment. Adjust users.
2119 (mark_object): Do not touch frame buffer lists here.
2120 * frame.c (delete_frame): Reset frame buffer lists here.
2121
2122 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2123
2124 Better workaround for GNOME bug when --enable-gcc-warnings.
2125 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2126 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2127 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2128
2129 Simplify SIGIO usage (Bug#12408).
2130 The code that dealt with SIGIO was crufty and confusing, e.g., it
2131 played tricks like "#undef SIGIO" but these tricks were not used
2132 consistently. Simplify mostly by not #undeffing standard symbols,
2133 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2134 or not as we please) rather than "defined SIGIO" (standard symbol
2135 that we probably shouldn't #undef).
2136 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2137 Modules that need it can include it.
2138 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2139 * dispextern.h (ignore_sigio): New decl.
2140 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2141 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2142 * emacs.c (shut_down_emacs):
2143 * keyboard.c (kbd_buffer_store_event_hold):
2144 Use ignore_sigio rather than invoking 'signal' directly.
2145 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2146 for FIONREAD.
2147 (FIONREAD, SIGIO): Do not #undef.
2148 (tty_read_avail_input): Use #error rather than a syntax error.
2149 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2150 for I_PIPE, used by SETUP_SLAVE_PTY.
2151 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2152 * sysdep.c (croak): Remove; no longer needed. This bit of
2153 temporary code, with Fred N. Fish's comment that it's temporary,
2154 has been in Emacs since at least 1992!
2155 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2156 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2157 * syssignal.h (croak): Remove decl.
2158 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2159 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2160 now that we're termios-only.
2161 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2162 * term.c (dissociate_if_controlling_tty): Use #error rather than
2163 a run-time error.
2164
2165 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2166 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2167 to work around GNOME bug 683906.
2168 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2169 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2170 This works around GCC bug 54561.
2171
2172 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2173
2174 More fixes for 'volatile' and setjmp/longjmp.
2175 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2176 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2177 (png_load_body) [HAVE_PNG]:
2178 (jpeg_load_body) [HAVE_JPEG]:
2179 New function, with most of the old parent function's body.
2180 (png_load) [HAVE_PNG]:
2181 (jpeg_load) [HAVE_JPEG]:
2182 Invoke the new function, to avoid longjmp munging our locals.
2183 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2184 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2185 longjmp is passed 2, as the C standard doesn't guarantee this.
2186 Instead, store the failure code into mgr->failure_code.
2187
2188 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2189
2190 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2191 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2192 (syms_of_keyboard): Remove support for unread-command-char.
2193
2194 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2195
2196 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2197 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2198 violation. (Bug#12426)
2199
2200 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2201
2202 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2203
2204 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2205
2206 * eval.c: Add `inhibit-debugger'.
2207 (Qinhibit_debugger): New symbol.
2208 (call_debugger): Bind it instead of Qdebug_on_error.
2209 (maybe_call_debugger): Test Vinhibit_debugger.
2210 (syms_of_eval): Define inhibit-debugger.
2211 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2212 (syms_of_xdisp): Remove inhibit-debug-on-message.
2213
2214 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2215
2216 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2217 If a nonvolatile local variable is written before a _longjmp to
2218 the frame containing the variable, and is read after the _longjmp,
2219 the value read is indeterminate. Some local variables of type
2220 'struct handler' and 'struct catchtag' are used in this way, so
2221 mark each of their slots as volatile if the slot can be set before
2222 _longjmp and read afterwards.
2223 * lisp.h (struct handler): var and chosen_clause are now volatile.
2224 (struct catchtag): val, next, and pdlcount are now volatile.
2225
2226 * bidi.c (bidi_push_it, bidi_pop_it):
2227 * fns.c (copy_hash_table):
2228 * image.c (define_image_type):
2229 * keyboard.c (kbd_buffer_store_event_hold):
2230 * process.c (Fprocess_send_eof):
2231 * xfaces.c (x_create_gc) [HAVE_NS]:
2232 * xgselect.c (xg_select):
2233 Prefer assignment to memcpy when either will do.
2234
2235 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2236 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2237 time an item is removed. No need to mark this function 'inline';
2238 the compiler knows better than we do.
2239
2240 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2241
2242 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2243 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2244 to change_frame_size (Bug#12388).
2245 (windowDidResize:): Pass YES to updateFrameSize.
2246
2247 * nsterm.h: Add delay parameter to updateFrameSize.
2248
2249 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2250
2251 Discard killed buffers from deleted window and frame objects.
2252 This reduces an amount of references to killed buffers and
2253 helps GC to reclaim them faster.
2254 * alloc.c (discard_killed_buffers): New function.
2255 (mark_object): Use it for deleted windows and frames.
2256 (mark_object): If symbol's value is set up for a killed buffer
2257 or deleted frame, restore its global binding.
2258 * data.c (swap_in_global_binding): Add GC notice.
2259 (swap_in_symval_forwarding): Use convenient set_blv_where.
2260 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2261 * window.h: ... to here.
2262
2263 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2264
2265 Convenient macro to check whether the buffer is live.
2266 * buffer.h (BUFFER_LIVE_P): New macro.
2267 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2268 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2269
2270 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2271
2272 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2273 composition cases (Bug#12364).
2274
2275 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2276 overhang of succeeding glyphs overlapping box cursor.
2277
2278 * w32term.c (x_draw_glyph_string): Likewise.
2279
2280 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2281
2282 Simplify, document, and port floating-point (Bug#12381).
2283 The porting part of this patch fixes bugs on non-IEEE platforms
2284 with frexp, ldexp, logb.
2285 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2286 Now static.
2287 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2288 support, by removing commented-out code and briefly listing the
2289 C89 functions excluded. The commented-out stuff was confusing
2290 maintenance, e.g., we thought we needed cbrt but it was commented out.
2291 (logb): Remove decl; no longer needed.
2292 (isfinite): New macro, if not already supplied.
2293 (isnan): Don't replace any existing macro.
2294 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2295 are present on all C89 platforms.
2296 (Ffrexp): Do not special-case zero, as frexp does the right thing
2297 for that case.
2298 (Flogb): Do not use logb, as it doesn't have the desired meaning
2299 on hosts that use non-base-2 floating point. Instead, stick with
2300 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2301 frexp, to avoid getting an unspecified result.
2302
2303 * xdisp.c (Qinhibit_debug_on_message): Now static.
2304
2305 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2306
2307 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2308 NSBezierPath (Bug#12131).
2309
2310 2012-09-10 Chong Yidong <cyd@gnu.org>
2311
2312 * fns.c (Fdelq, Fdelete): Doc fix.
2313
2314 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2315
2316 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2317 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2318
2319 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2320
2321 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2322 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2323 Use it.
2324
2325 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2326
2327 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2328 left fringe if the window has a left margin. This avoids leaving
2329 traces of the cursor because its leftmost pixel is not drawn over.
2330
2331 * dispnew.c (update_window_line): When the left margin area of a
2332 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2333 that screen line. (Bug#12277)
2334
2335 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2336
2337 Assume C89 or later for math functions (Bug#12381).
2338 This simplifies the code, and makes it a bit smaller and faster,
2339 and (most important) makes it easier to clean up signal handling
2340 since we can stop worring about floating-point exceptions in
2341 library code. That was a problem before C89, but the problem
2342 went away many years ago on all practical Emacs targets.
2343 * data.c, image.c, lread.c, print.c:
2344 Don't include <math.h>; no longer needed.
2345 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2346 might be autoconfigured, as that never happens.
2347 * data.c (fmod):
2348 * doprnt.c (DBL_MAX_10_EXP):
2349 * print.c (DBL_DIG):
2350 Remove. C89 or later always defines these.
2351 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2352 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2353 (arith_error, domain_error, domain_error2):
2354 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2355 no longer needed -- we simply return what C returns. All uses removed.
2356 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2357 the wrapped code.
2358 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2359 Remove. All uses expanded, as these macros are no longer used
2360 more than once and are now more trouble than they're worth.
2361 (Ftan): Use tan, not sin / cos.
2362 (Flogb): Assume C89 frexp.
2363 (fmod_float): Assume C89 fmod.
2364 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2365 (init_floatfns): Remove. All uses removed.
2366
2367 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2368
2369 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2370 compositeToPoint for OSX < 10.6 (Bug#12390).
2371
2372 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2373
2374 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2375 This produces more-accurate results.
2376
2377 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2378
2379 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2380 changes (Bug#12088).
2381
2382 2012-09-08 Chong Yidong <cyd@gnu.org>
2383
2384 * syntax.c (Fstring_to_syntax): Doc fix.
2385
2386 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2387
2388 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2389 in the internal border.
2390 (x_set_window_size): Remove static variables and their usage.
2391 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2392 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2393 Remove fringe/internal border adjustment (Bug#11052).
2394 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2395 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2396 (ns_fix_rect_ibw): Remove.
2397 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2398 (ns_dumpglyphs_box_or_relief): Ditto.
2399 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2400 adjustment.
2401 (ns_dumpglyphs_image): Ditto.
2402 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2403 border adjustment.
2404 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2405 their usage. Add fringe_extended_p and its use as in other terms.
2406 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2407 scroll bar was removed.
2408 (updateFrameSize): New function.
2409 (windowDidResize): Move code to updateFrameSize and call it.
2410
2411 * nsterm.h (EmacsView): Add updateFrameSize.
2412
2413 2012-09-07 Chong Yidong <cyd@gnu.org>
2414
2415 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2416
2417 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2418
2419 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2420
2421 More signal-handler cleanup (Bug#12327).
2422 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2423 Problem introduced when merging patches. Noted by Eli Zaretskii in
2424 <http://bugs.gnu.org/12327#67>.
2425 * floatfns.c: Comment fix.
2426 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2427 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2428 and anyway the declaration is harmless even if SIGDANGER is not defined.
2429 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2430 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2431 source files not surprisingly expected syssignal.h to define, or
2432 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2433 Include <sys/ioctl.h>, for FIONREAD.
2434 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2435 This eliminates a problem whereby other files mysteriously had
2436 to include "syssignal.h" before including "systty.h" if they
2437 wanted to use "#ifdef SIGIO".
2438
2439 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2440
2441 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2442
2443 * w32.c (sigemptyset): Empty the set.
2444 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2445
2446 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2447
2448 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2449
2450 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2451 (mark_object): Likewise for frame objects.
2452
2453 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2454
2455 * syssignal.h (handle_on_main_thread): Always declare,
2456 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2457 This ports to platforms without HAVE_PTHREAD.
2458
2459 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 Signal-handler cleanup (Bug#12327).
2462 Emacs's signal handlers were written in the old 4.2BSD style with
2463 sigblock and sigmask and so forth, and this led to some
2464 inefficiencies and confusion. Rewrite these to use
2465 pthread_sigmask etc. without copying signal sets around. Also,
2466 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2467 'signal', and instead use functions that do not attempt to take
2468 over the system name space. This patch causes Emacs's text
2469 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2470 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2471 Do not include <signal.h> or "syssignal.h", as these
2472 modules do not use signals.
2473 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2474 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2475 Do not include <signal.h>, as "syssignal.h" does that for us now.
2476 * atimer.c (sigmask_atimers): New function.
2477 (block_atimers, unblock_atimers): New functions,
2478 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2479 All uses replaced.
2480 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2481 no longer needed here.
2482 * emacs.c (main): Inspect existing signal handler with sigaction,
2483 so that there's no need to block and unblock SIGHUP.
2484 * sysdep.c (struct save_signal): New member 'action', replacing
2485 old member 'handler'.
2486 (save_signal_handlers, restore_signal_handlers):
2487 Use sigaction instead of 'signal' to save and restore.
2488 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2489 New function. All users of 'signal' modified to use set_sighandler
2490 if they're writeonly, and to use sys_signal if they're read+write.
2491 (emacs_sigaction_init, forwarded_signal): New functions.
2492 (sys_signal): Remove. All uses replaced by calls to sigaction
2493 and emacs_sigaction_init, or by direct calls to 'signal'.
2494 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2495 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2496 all uses replaced by pthread_sigmask etc. calls.
2497 * syssignal.h: Include <signal.h>.
2498 (emacs_sigaction_init, forwarded_signal): New decls.
2499 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2500 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2501 (sigmask, sys_sigmask): Remove; no longer needed.
2502 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2503 (sigblock, sigunblock, sigfree):
2504 (sigsetmask) [!defined sigsetmask]:
2505 Remove. All uses replaced by pthread_sigmask.
2506 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2507 no longer need to be replaced, and its typical old uses
2508 are now done via emacs_sigaction_init and sigaction.
2509 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2510 (sys_sigdel): Remove; unused.
2511 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2512
2513 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2514
2515 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2516 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2517
2518 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 Explicitly mark buffer_defaults and buffer_local_symbols.
2521 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2522 mark_local_symbols here.
2523 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2524 since special buffers aren't marked here any more.
2525 (allocate_buffer): Chain new buffer with all_buffers here...
2526 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2527 not here.
2528 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2529 (syms_of_buffer): Remove staticpro of the above.
2530 (init_buffer_once): Set names for buffer_defaults and
2531 buffer_local_symbols.
2532
2533 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2534
2535 Use bool for booleans in font-related modules.
2536 * font.c (font_intern_prop, font_style_to_value)
2537 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2538 (generate_otf_features, font_check_otf_features, font_check_otf)
2539 (font_match_p, font_list_entities, font_at):
2540 * fontset.c (fontset_id_valid_p, reorder_font_vector
2541 (fontset_find_font, Fset_fontset_font)
2542 (face_suitable_for_char_p) [0]:
2543 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2544 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2545 (m17n_flt_initialized, ftfont_shape_by_flt):
2546 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2547 * nsfont.m (nsfont_draw):
2548 * w32font.c (w32font_draw):
2549 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2550 Use bool for booleans.
2551 * font.h: Adjust to above API changes.
2552 (struct font, struct font_driver, struct font_driver_list):
2553 Use bool for booleans.
2554 (struct font): Remove useless member encoding_type.
2555 All users removed.
2556 * fontset.c, xftfont.c: Omit unnecessary static decls.
2557
2558 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2559
2560 * alloc.c (mark_object): Revert window marking code
2561 since it's unsafe for the Fset_window_configuration.
2562
2563 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2564
2565 Fix race conditions with signal handlers and errno (Bug#12327).
2566 Be more systematic about preserving errno whenever a signal
2567 handler returns, even if it's not in the main thread. Do this by
2568 renaming signal handlers to distinguish between signal delivery
2569 and signal handling. All uses changed.
2570 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2571 * data.c (deliver_arith_signal): Rename from arith_error.
2572 * dispnew.c (deliver_window_change_signal): Rename from
2573 window_change_signal.
2574 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2575 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2576 * keyboard.c (deliver_input_available_signal): Rename from
2577 input_available_signal.
2578 (deliver_user_signal): Rename from handle_user_signal.
2579 (deliver_interrupt_signal): Rename from interrupt_signal.
2580 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2581 (deliver_child_signal): Rename from sigchld_handler.
2582 * atimer.c (handle_alarm_signal):
2583 * data.c (handle_arith_signal):
2584 * dispnew.c (handle_window_change_signal):
2585 * emacs.c (handle_fatal_signal, handle_danger_signal):
2586 * keyboard.c (handle_input_available_signal):
2587 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2588 * process.c (handle_pipe_signal, handle_child_signal):
2589 New functions, with the actual signal-handling code taken from the
2590 original respective signal handlers, sans the sporadic attempts to
2591 preserve errno, since that's now done by handle_on_main_thread.
2592 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2593 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2594 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2595 Move to sysdep.c.
2596 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2597 Move initialization of main_thread to sysdep.c's init_signals.
2598 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2599 our usage, and simplifies the mainline code.
2600 (record_child_status_change): New static function, as a helper
2601 for handle_child_signal, and with most of the old child handler's
2602 contents.
2603 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2604 (handle_child_signal): Use the above.
2605 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2606 Moved here from emacs.c.
2607 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2608 code moved here from emacs.c's main function.
2609 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2610 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2611 This lets callers save and restore errno properly.
2612
2613 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2614
2615 Remove redundant or unused things here and there.
2616 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2617 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2618 * editfns.c (Fcompare_buffer_substrings): Likewise.
2619 * frame.h (struct terminal, struct font_driver_list):
2620 Remove redundant declarations.
2621 * window.h (Qleft, Qright): Likewise.
2622
2623 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2624
2625 Do not mark objects from deleted buffers, windows and frames.
2626 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2627 (mark_object): Likewise for windows and frames.
2628
2629 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2630
2631 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2632 buffer_defaults and buffer_local_symbols as valid objects.
2633 Return special value to denote them.
2634
2635 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2636
2637 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2638 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2639 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2640 (file_name_absolute_p, Fsubstitute_in_file_name):
2641 (check_executable, check_writable, Ffile_accessible_directory_p)
2642 (Fset_file_selinux_context, Fdefault_file_modes)
2643 (Finsert_file_contents, choose_write_coding_system)
2644 (Fwrite_region, build_annotations, a_write, e_write)
2645 (Fdo_auto_save):
2646 * filelock.c (boot_time_initialized, get_boot_time)
2647 (get_boot_time_1, lock_file_1, within_one_second):
2648 * floatfns.c (in_float):
2649 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2650 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2651 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2652 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2653 * window.c (compare_window_configurations):
2654 Use bool for booleans.
2655 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2656 (Fdefault_file_modes): Now mode_t, not int, for modes.
2657 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2658 (internal_delete_file): Now returns void, not a (boolean) int,
2659 since nobody was looking at the return value.
2660 * lisp.h, window.h: Adjust to above API changes.
2661
2662 * xdisp.c (set_message): Simplify and reindent last change.
2663
2664 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2665
2666 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2667
2668 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2669
2670 * eval.c (call_debugger): Make the function non-static so that we
2671 can call it from set_message.
2672
2673 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2674 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2675
2676 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 Give more-useful info on a fatal error (Bug#12328).
2679 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2680 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2681 of doing the work ourselves.
2682 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2683 do most of the work.
2684 (fatal_error_backtrace): New function, taken from the guts
2685 of the old fatal_error_signal, but with a new option to output
2686 a backtrace.
2687 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2688 info about the signal than just its number.
2689 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2690 * sysdep.c: Include <execinfo.h>
2691 (emacs_backtrace): New function, taken partly from the previous
2692 code of the 'die' function.
2693 (emacs_abort): Call fatal_error_backtrace rather than abort.
2694
2695 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2696
2697 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2698 eager (load-time) macro-expansion.
2699 * lisp.mk (lisp): Add macroexp.
2700
2701 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 Simplify redefinition of 'abort' (Bug#12316).
2704 Do not try to redefine the 'abort' function. Instead, redo
2705 the code so that it calls 'emacs_abort' rather than 'abort'.
2706 This removes the need for the NO_ABORT configure-time macro
2707 and makes it easier to change the abort code to do a backtrace.
2708 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2709 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2710 Remove; sysdep.c's emacs_abort now takes its place.
2711 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2712 'abort' changed to use 'emacs_abort'.
2713 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2714 (abort) [!defined abort]: Rename to ...
2715 (emacs_abort): ... new name.
2716 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2717 the place of the old 'abort' in emacs.c.
2718 * w32.c, w32fns.c (abort): Do not #undef.
2719 * w32.c (emacs_abort): Rename from w32_abort.
2720
2721 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2722
2723 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2724 offsets[j].dv, since the y axis of the screen coordinates points
2725 down, while the y axis of the font definition coordinates points
2726 up. This fixes display of Arabic diacritics such as KASRA and
2727 KASRATAN. (Bug#11860)
2728
2729 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2730
2731 Be more systematic about _setjmp vs setjmp.
2732 * alloc.c (test_setjmp, mark_stack):
2733 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2734 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2735 (png_load, my_error_exit, jpeg_load):
2736 * process.c (send_process_trap, send_process):
2737 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2738 The underscored versions are up to 30x faster on some hosts.
2739 Formerly, the code used setjmp+longjmp sometimes and
2740 _setjmp+_longjmp at other times, with no particular reason to
2741 prefer setjmp+longjmp.
2742
2743 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2744
2745 Fix minor problem found by static checking.
2746 * buffer.c (Fdelete_all_overlays): Return nil.
2747
2748 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2749
2750 * buffer.c (Fdelete_all_overlays): New function.
2751
2752 2012-09-03 Chong Yidong <cyd@gnu.org>
2753
2754 * gtkutil.c: Add extern decl for Qxft.
2755
2756 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2757
2758 * emacs.c, eval.c: Use bool for boolean.
2759 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2760 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2761 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2762 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2763 (main, decode_env_path, Fdaemon_initialized):
2764 * eval.c (call_debugger, Finteractive_p, interactive_p):
2765 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2766 (maybe_call_debugger, Fbacktrace):
2767 * process.c (read_process_output, exec_sentinel):
2768 Use bool for booleans.
2769 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2770 All callers changed.
2771 * eval.c (interactive_p): Omit always-true boolean argument
2772 EXCLUDE_SUBRS_P. All callers changed.
2773 * dispextern.h, lisp.h: Reflect above API changes.
2774 * firstfile.c (dummy): Use the address of 'main', whose signature
2775 won't change, instead of the address of 'initialize', whose
2776 signature just changed from int to bool.
2777 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2778 * msdos.c (fatal_error_in_progress): ... from here.
2779 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2780 of incrementing it.
2781 (redisplay_internal, unwind_redisplay): Simply clear
2782 REDISPLAYING_P when unwinding, instead of saving its previous,
2783 always-false value and then restoring it.
2784
2785 Clean up some extern decls.
2786 Mostly, this hoists extern decls out of .c files and into .h files.
2787 That way, we're more likely to catch errors if the interfaces change.
2788 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2789 declare xg_mark_data.
2790 * dispextern.h (x_frame_parm_handlers):
2791 * font.h (Qxft):
2792 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2793 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2794 (Qultra_bold, Qoblique, Qitalic):
2795 Move extern decl here from .c file.
2796 * alloc.c (xg_mark_data) [USE_GTK]:
2797 * doc.c (Qclosure):
2798 * eval.c (Qlexical_binding):
2799 * fns.c (time) [!HAVE_UNISTD_H]:
2800 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2801 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2802 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2803 * lread.c (Qinternal_interpreter_environment):
2804 * minibuf.c (Qbuffer):
2805 * process.c (QCfamily, QCfilter):
2806 * widget.c (free_frame_faces):
2807 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2808 * xfont.c (x_clear_errors):
2809 * xterm.c (x_frame_parm_handlers):
2810 Remove now-redundant extern decls.
2811 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2812 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2813 Now static.
2814 * xfaces.c: Remove unnecessary static decls.
2815 * xterm.c (updating_frame): Remove decl of nonexistent object.
2816
2817 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2818 when building globals.h, as the objects that are not built on
2819 this host are not needed to compile C files on this host.
2820
2821 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2822
2823 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2824
2825 * frame.h: Add missing prototype for x_wm_set_size_hint.
2826
2827 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2828
2829 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2830 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2831 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2832 (Fsubstitute_command_keys):
2833 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2834 (save_excursion_save, save_excursion_restore)
2835 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2836 (format_time_string, general_insert_function)
2837 (make_buffer_string, make_buffer_string_both)
2838 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2839 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2840 (copy_text, insert_1, insert_1_both, insert_from_string)
2841 (insert_from_string_before_markers, insert_from_string_1)
2842 (insert_from_buffer, insert_from_buffer_1, replace_range)
2843 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2844 (del_range_2, modify_region):
2845 * intervals.c (intervals_equal, balance_possible_root_interval)
2846 (adjust_intervals_for_insertion, merge_properties_sticky)
2847 (graft_intervals_into_buffer, lookup_char_property)
2848 (adjust_for_invis_intang, set_point_both)
2849 (get_property_and_range, compare_string_intervals)
2850 (set_intervals_multibyte_1, set_intervals_multibyte):
2851 * keyboard.c (decode_timer):
2852 Use bool for boolean.
2853 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2854 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2855
2856 2012-09-02 Chong Yidong <cyd@gnu.org>
2857
2858 * keymap.c (push_key_description): Print M-TAB as C-M-i
2859 (Bug#11758).
2860
2861 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2862
2863 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2864 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2865 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2866 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2867 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2868 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2869 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2870
2871 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2872
2873 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2874 more than one grapheme cluster passed to the shaper: compute the
2875 offset adjustment values separately for each cluster. (Bug#11860)
2876
2877 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2878 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2879 about implicit conversions from integer to pointer.
2880
2881 2012-09-01 Daniel Colascione <dancol@dancol.org>
2882
2883 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2884 system used too early.
2885
2886 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2887
2888 Better seed support for (random).
2889 * emacs.c (main): Call init_random.
2890 * fns.c (Frandom): Set the seed from a string argument, if given.
2891 Remove long-obsolete Gentzel cruft.
2892 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2893 (init_random): New function.
2894
2895 2012-09-01 Daniel Colascione <dancol@dancol.org>
2896
2897 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2898 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2899 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2900 x_wm_set_size_hint, x_query_colors, x_real_positions,
2901 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2902 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2903 all of which have been moved to common code.
2904
2905 * xfaces.c: Include TERM_HEADER instead of listing all possible
2906 window-system headers.
2907
2908 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2909 to match header.
2910
2911 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2912 directly accessing frame internals.
2913
2914 * w32font.h: Include font.h. Define syms_of_w32font and
2915 globals_of_w32font.
2916
2917 * process.c: Include TERM_HEADER instead of listing all possible
2918 window-system headers.
2919
2920 * nsterm.h: Remove declarations now in frame.h.
2921 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2922
2923 * menu.c: Include TERM_HEADER instead of listing all possible
2924 window-system headers.
2925
2926 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2927 window system.
2928
2929 * keyboard.c: Include TERM_HEADER instead of listing all possible
2930 window-system headers.
2931
2932 * image.c: Include TERM_HEADER instead of listing all possible
2933 window-system headers. Declare Vlibrary_cache when compiling for
2934 Windows.
2935
2936 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2937 window system declarations.
2938
2939 * frame.h: Move common functions here: set_frame_menubar,
2940 x_set_window_size, x_sync, x_get_focus_frame,
2941 x_set_mouse_position, x_set_mouse_pixel_position,
2942 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2943 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2944 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2945 x_activate_menubar, x_real_positions, x_bitmap_icon,
2946 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2947 and x_query_colors.
2948
2949 * frame.c: Include TERM_HEADER instead of listing all possible
2950 window-system headers.
2951
2952 * font.c: Include TERM_HEADER instead of listing all possible
2953 window-system headers.
2954
2955 * emacs.c: Include TERM_HEADER.
2956
2957 * dispnew.c: Include TERM_HEADER instead of listing all possible
2958 window-system headers.
2959
2960 * ccl.h: Include character.h.
2961
2962 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2963 the current window system; include in list of objects to link into
2964 Emacs.
2965
2966 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2967
2968 Remove mark_ttys function and fix tty_display_info initialization.
2969 * lisp.h (mark_ttys): Remove prototype.
2970 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2971 to mark_ttys because all possible values of 'top_frame' slot are
2972 the frames which are reachable from Vframe_list.
2973 * term.c (mark_ttys): Remove.
2974 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2975
2976 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2977
2978 Change struct frame bitfields from unsigned char to unsigned.
2979 * frame.h (struct frame): Change type of 'display_preempted',
2980 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2981 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2982 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2983 bitfields from unsigned char to unsigned.
2984
2985 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2986
2987 Remove unused member of struct x_output and struct w32_output.
2988 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2989 * w32term.h (struct w32_output): Likewise.
2990
2991 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2992
2993 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2994 does not become zero (Bug#12234).
2995
2996 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2997
2998 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2999 for GCC 4.7.1 x86-64.
3000
3001 2012-08-30 Glenn Morris <rgm@gnu.org>
3002
3003 * lread.c (init_lread): For out-of-tree builds, only add the
3004 source directory's site-lisp dir to the load-path if it exists,
3005 consistent with in-tree builds. (Bug#12302)
3006
3007 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3008
3009 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
3010 button_values to NULL. Call setStykeMask so dialogs get a close button.
3011 (windowShouldClose:): Set window_closed.
3012 (dealloc): New member, free button_values.
3013 (process_dialog:): Make member function. Remove window argument,
3014 replace window with self. Count buttons and allocate and store values
3015 in button_values.
3016 (addButton:value:row:): value is int with the name tag. Call setTag
3017 with tag. Remove return self, declare return value as void.
3018 (addString:row:): Remove return self, declare return value as void.
3019 (addSplit): Remove return self, declare return value as void.
3020 (clicked:): Remove return self, declare return value as void.
3021 Set dialog_return to button_values[seltag]. Code formatting change.
3022 (initFromContents:isQuestion:): Adjust call to process_dialog.
3023 Code formatting change.
3024 (timeout_handler:): Set timer_fired to YES.
3025 (runDialogAt:): Set timer_fired to NO.
3026 Handle click on close button as quit.
3027
3028 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3029 Add window_closed and button_values. Add void as return value for
3030 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3031 Add process_dialog as new member.
3032
3033 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3034
3035 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3036 is not one of the heaps we manage. (Bug#12242)
3037
3038 2012-08-28 Glenn Morris <rgm@gnu.org>
3039
3040 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3041
3042 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3043
3044 * window.c (Fset_window_configuration): Remove handling of
3045 auto-buffer-name window parameter. Install revision of reverted
3046 fix.
3047
3048 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3049
3050 Do not allow to set major mode for a dead buffer.
3051 * buffer.c (Fset_buffer_major_mode): Signal an error
3052 if the buffer is dead.
3053 (Fother_buffer, other_buffer_safely): Remove redundant
3054 nested declaration.
3055
3056 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3057
3058 Always use set_buffer_if_live to restore original buffer at unwind.
3059 * buffer.h (record_unwind_current_buffer): New function.
3060 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3061 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3062 * undo.c, window.c: Adjust users.
3063 * buffer.c (set_buffer_if_live): Fix comment.
3064
3065 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3066
3067 Fix usage of set_buffer_internal.
3068 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3069 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3070 * coding.c (decode_coding): Omit redundant test.
3071 * fileio.c (decide_coding_unwind): Likewise.
3072 * fns.c (secure_hash): Likewise.
3073 * insdel.c (modify_region): Likewise.
3074 * keyboard.c (command_loop_1): Likewise.
3075 * print.c (PRINTFINISH): Likewise.
3076 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3077
3078 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3079
3080 * dispnew.c: Use bool for boolean.
3081 (frame_garbaged, display_completed, delayed_size_change)
3082 (fonts_changed_p, add_window_display_history)
3083 (add_frame_display_history, verify_row_hash)
3084 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3085 (row_equal_p, realloc_glyph_pool)
3086 (allocate_matrices_for_frame_redisplay)
3087 (showing_window_margins_p)
3088 (adjust_frame_glyphs_for_frame_redisplay)
3089 (build_frame_matrix_from_leaf_window, make_current)
3090 (mirrored_line_dance, mirror_line_dance, update_frame)
3091 (update_window_tree, update_single_window)
3092 (check_current_matrix_flags, update_window, update_text_area)
3093 (update_window_line, set_window_update_flags, scrolling_window)
3094 (update_frame_1, scrolling, buffer_posn_from_coords)
3095 (do_pending_window_change, change_frame_size)
3096 (change_frame_size_1, sit_for):
3097 Use bool for boolean.
3098 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3099 and remove last int (actually boolean) argument, which was always 0.
3100 All callers changed.
3101 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3102 * dispextern.h (struct composition_it): Use bool for boolean.
3103 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3104 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3105 * dired.c (file_name_completion):
3106 Use bool for boolean. (This was missed in an earlier change.)
3107
3108 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3109
3110 * window.c (Fset_window_configuration): Revert first part of
3111 last change.
3112
3113 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3114
3115 * nsterm.h (NSPanel): New class variable dialog_return.
3116
3117 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3118 Initialize dialog_return.
3119 (windowShouldClose:): Use stop instead of stopModalWithCode.
3120 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3121 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3122 event.
3123 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3124 modal loop returns.
3125
3126 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3127
3128 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3129 * composite.c (find_composition, composition_gstring_p)
3130 (composition_reseat_it, find_automatic_composition):
3131 * data.c (let_shadows_buffer_binding_p)
3132 (let_shadows_global_binding_p, set_internal, make_blv)
3133 (Fmake_variable_buffer_local, Fmake_local_variable)
3134 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3135 (cons_to_signed, arith_driver):
3136 * dbusbind.c (xd_in_read_queued_messages):
3137 * dired.c (directory_files_internal, file_name_completion):
3138 Use bool for booleans.
3139 * dired.c (file_name_completion):
3140 * process.h (fd_callback):
3141 Omit int (actually boolean) argument. It wasn't being used.
3142 All uses changed.
3143 * composite.h, lisp.h: Reflect above API changes.
3144
3145 * cmds.c, coding.c: Use bool for booleans.
3146 * cmds.c (move_point, Fself_insert_command):
3147 * coding.h (struct composition status, struct coding_system):
3148 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3149 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3150 (emacs_mule_char, decode_coding_emacs_mule)
3151 (encode_coding_emacs_mule, detect_coding_iso_2022)
3152 (decode_coding_iso_2022, encode_invocation_designation)
3153 (encode_designation_at_bol, encode_coding_iso_2022)
3154 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3155 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3156 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3157 (encode_coding_raw_text, detect_coding_charset)
3158 (decode_coding_charset, encode_coding_charset, detect_eol)
3159 (detect_coding, get_translation_table, produce_chars)
3160 (consume_chars, reused_workbuf_in_use)
3161 (make_conversion_work_buffer, code_conversion_save)
3162 (decode_coding_object, encode_coding_object)
3163 (detect_coding_system, char_encodable_p)
3164 (Funencodable_char_position, code_convert_region)
3165 (code_convert_string, code_convert_string_norecord)
3166 (Fset_coding_system_priority):
3167 * fileio.c (Finsert_file_contents):
3168 Use bool for booleans.
3169 * coding.h, lisp.h: Reflect above API changes.
3170 * coding.c: Remove unnecessary static function decls.
3171 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3172 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3173 not a boolean 'int', since callers never look at the return value.
3174 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3175 * coding.h (decoding_buffer_size, encoding_buffer_size)
3176 (emacs_mule_string_char): Remove unused extern decls.
3177 (struct iso_2022_spec, struct coding_system):
3178 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3179 (struct emacs_mule_spec): Remove unused field 'full_support'.
3180 All initializations removed.
3181 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3182
3183 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3184
3185 Fix spare memory change (Bug#12286).
3186 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3187 (valid_lisp_object_p): Likewise.
3188
3189 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3190
3191 * window.c (Fset_window_configuration): Record any window's old
3192 buffer if it's replaced (see Bug#8789). If the new current
3193 buffer doesn't appear in the selected window, go to its old
3194 point (Bug#12208).
3195
3196 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3197
3198 Special MEM_TYPE_SPARE to denote reserved memory.
3199 * alloc.c (enum mem_type): New memory type.
3200 (refill_memory_reserve): Use new type for spare memory.
3201 This prevents live_cons_p and live_string_p from incorrect
3202 detection of uninitialized objects from spare memory as live.
3203
3204 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3205
3206 Spelling fixes.
3207 * Makefile.in (.PHONY): versioclean -> versionclean.
3208
3209 Remove unused external symbols.
3210 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3211 * window.c (Qwindow_valid_p, decode_valid_window):
3212 Now static, not extern.
3213 * data.c (Qinterval): Remove; unused.
3214 (syms_of_data): Do not define 'interval'.
3215 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3216 * window.h (decode_valid_window):
3217 Remove decls.
3218
3219 * character.c, charset.c, chartab.c: Use bool for booleans.
3220 * character.c (lisp_string_width, string_count_byte8)
3221 (string_escape_byte8):
3222 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3223 (load_charset_map_from_file, map_charset_chars)
3224 (Fdefine_charset_internal, define_charset_internal)
3225 (Fdeclare_equiv_charset, find_charsets_in_text)
3226 (Ffind_charset_region, char_charset, Fiso_charset):
3227 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3228 (sub_char_table_set, sub_char_table_set_range)
3229 (char_table_set_range, optimize_sub_char_table)
3230 (map_sub_char_table):
3231 Use bool for boolean.
3232 * character.c (str_to_unibyte): Omit last boolean argument; it was
3233 always 0. All callers changed.
3234 * character.h, charset.h: Adjust to match previous changes.
3235 * character.h (char_printable_p): Remove decl of nonexistent function.
3236 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3237 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3238 are all boolean, so make them single-bit bitfields.
3239
3240 * lisp.h (ASET): Remove attempt to detect side effects.
3241 It was meant to be temporary and it often doesn't work,
3242 because when IDX has side effects the behavior of IDX==IDX
3243 is undefined. See Stefan Monnier in
3244 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3245
3246 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3247
3248 * lisp.h (functionp): New function (extracted from Ffunctionp).
3249 (FUNCTIONP): Use it.
3250 * eval.c (Ffunctionp): Use it.
3251
3252 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3253
3254 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3255 as that's faster and simpler than static storage. Don't bother
3256 with the g_main_context_query overhead if g_main_context_pending
3257 says no events are pending.
3258 (gfds, gfds_size): Remove these static vars.
3259 (xgselect_initialize): Remove; no longer needed.
3260 All uses and decls removed.
3261
3262 * emacs.c (fatal_error_signal_hook): Remove.
3263 All uses removed. This leftover from old code was always 0.
3264
3265 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3266 * casefiddle.c (casify_object, casify_region):
3267 * casetab.c (set_case_table):
3268 * category.c, category.h (word_boundary_p):
3269 * category.h (CHAR_HAS_CATEGORY):
3270 Use bool for booleans, instead of int.
3271
3272 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3273
3274 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3275
3276 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3277
3278 On assertion failure, print backtrace if available.
3279 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3280 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3281 * Makefile.in (LIB_EXECINFO): New macro.
3282 (LIBES): Use it.
3283
3284 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3285 * bytecode.c (exec_byte_code):
3286 * callint.c (check_mark, Fcall_interactively):
3287 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3288 (getenv_internal, sync_process_alive, call_process_exited):
3289 * lisp.h (USE_SAFE_ALLOCA):
3290 Use bool for booleans, instead of int.
3291 * lisp.h, process.h: Adjust prototypes to match above changes.
3292 * callint.c (Fcall_interactively): Don't assume the mark's
3293 offset fits in 'int'.
3294
3295 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3296
3297 * buffer.c, buffer.h: Use bool for boolean.
3298 * buffer.c (reset_buffer_local_variables)
3299 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3300 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3301 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3302 (overlay_touches_p, overlay_strings, Foverlay_put)
3303 (report_overlay_modification, call_overlay_mod_hooks):
3304 (mmap_enlarge, mmap_set_vars):
3305 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3306 Use bool for booleans, instead of int.
3307 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3308 since the 1-or-0 return value is always ignored anyway.
3309 (mmap_initialized_p):
3310 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3311 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3312
3313 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3314
3315 * bidi.c: Use bool for boolean.
3316 This is a bit more readable, and makes the text segment of bidi.o
3317 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3318 Presumably it's faster too.
3319 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3320 Now bool.
3321 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3322 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3323 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3324 (bidi_explicit_dir_char, bidi_level_of_next_char)
3325 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3326 Use bool for booleans, instead of int.
3327 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3328 (bidi_unshelve_cache): Adjust decls to match code.
3329
3330 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3331
3332 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3333 argument.
3334
3335 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3338 * atimer.h: Include <stdbool.h>.
3339
3340 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3341
3342 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3343 compile time tests instead of run time tests on systems that do
3344 not use them.
3345 (FRAME_MAC_P): Remove leftover from deleted code.
3346 * frame.c (syms_of_frame): Remove leftover from deleted code.
3347
3348 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3349
3350 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3351
3352 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3353
3354 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3355 Otherwise, the compiler complains about (A?B:C) where B is void
3356 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3357 (fontset_add): Return void, for FONTSET_ADD.
3358
3359 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3360
3361 * alloc.c: Use bool for booleans.
3362 (gc_in_progress, abort_on_gc)
3363 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3364 (dont_register_blocks) [GC_MALLOC_CHECK]:
3365 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3366 (check_string_bytes, make_specified_string, memory_full)
3367 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3368 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3369 (mark_stack, valid_pointer_p, make_pure_string)
3370 (Fgarbage_collect, survives_gc_p, gc_sweep):
3371 Use bool for booleans, instead of int.
3372 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3373 Remove unused local.
3374 * alloc.c (PURE_POINTER_P):
3375 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3376 * editfns.c (Fformat):
3377 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3378 (Fdo_auto_save):
3379 * fns.c (sweep_weak_table):
3380 * lisp.h (suppress_checking, push_message, survives_gc_p)
3381 (make_pure_string, gc_in_progress, abort_on_gc):
3382 * lread.c (readchar, read1):
3383 * print.c (Fprin1_to_string):
3384 * xdisp.c (push_message):
3385 Use bool for booleans affected directly or indirectly by
3386 alloc.c's changes.
3387
3388 Make recently-introduced setters macros.
3389 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3390 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3391 (set_fontset_default, set_fontset_fallback): Rename from their
3392 upper-case counterparts, and make them functions rather than macros.
3393 This is more consistent with the other recently-introduced setters.
3394 These don't need to be inline, since they're local.
3395
3396 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3397
3398 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3399 the loop (Bug#12247).
3400
3401 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3402
3403 * lisp.h (vcopy): Use memcpy rather than our own loop.
3404 This fixes a performance regression introduced by the recent
3405 addition of vcopy. This means 'vcopy' will need to be modified
3406 for a copying collector, but that's OK. Also, tighten the
3407 checking in the assertion.
3408
3409 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3410
3411 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3412 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3413 non-base glyph for the width of the base character, according to
3414 what x_draw_composite_glyph_string_foreground expects.
3415 Generate WADJUST value according to composition_gstring_width's
3416 expectations, to produce correct width of the composed character.
3417 Reverse the sign of the DU offset produced by ScriptPlace.
3418
3419 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3420
3421 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3422
3423 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3424
3425 Avoid direct writes to contents member of struct Lisp_Vector.
3426 * lisp.h (vcopy): New function to copy data into vector.
3427 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3428 * fns.c (Ffillarray): Use ASET.
3429 * keyboard.c (timer_check_2): Use AREF and ASET.
3430 (append_tool_bar_item, Frecent_keys): Use vcopy.
3431 * lread.c (read_vector): Use ASET.
3432 * msdos.c (Frecent_doskeys): Use vcopy.
3433 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3434 (Finternal_merge_in_global_face): Use ASET and vcopy.
3435 * xfont.c (xfont_list_pattern): Likewise.
3436
3437 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3438
3439 * window.c (Fwindow_point): For the selected window always return
3440 the position of its buffer's point.
3441 (Fset_window_point): For the selected window always go in its
3442 buffer to the specified position.
3443
3444 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3445
3446 Setter macros for fontsets.
3447 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3448 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3449 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3450 Adjust users.
3451
3452 2012-08-20 Glenn Morris <rgm@gnu.org>
3453
3454 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3455 Don't assume that `ln -f' works.
3456
3457 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3458
3459 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3460 and later about non-assignments with no effect. See discussion at
3461 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3462 details.
3463
3464 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3465
3466 Inline setter functions for Lisp_Objects slots of struct specbinding.
3467 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3468 Adjust users.
3469
3470 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3471
3472 * window.c (select_window): Always make selected window's buffer
3473 current.
3474
3475 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3476
3477 Use AREF and ASET for docstrings of category tables.
3478 * category.h (CATEGORY_DOCSTRING): Use AREF.
3479 (SET_CATEGORY_DOCSTRING): Use ASET.
3480 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3481
3482 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3483
3484 Inline setter functions for hash table members.
3485 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3486 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3487 (set_hash_key_and_value, set_hash_index, set_hash_next)
3488 (set_hash_hash): New functions.
3489 * charset.c, fns.c: Adjust users.
3490
3491 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3492
3493 Inline getter and setter functions for per-buffer values.
3494 * buffer.h (per_buffer_default, set_per_buffer_default)
3495 (per_buffer_value, set_per_buffer_value): New functions.
3496 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3497 * buffer.c, data.c: Adjust users.
3498
3499 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3500
3501 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3502
3503 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3504
3505 Rely on <config.h> + <unistd.h> to declare 'environ',
3506 as gnulib does this if the system doesn't.
3507 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3508 Remove declaration. MS-Windows declares it on stdlib.h which is
3509 included by conf_post.h.
3510 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3511 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3512 * vm-limit.c: Include <unistd.h>, for 'environ'.
3513
3514 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3515 (start_of_data): Remove decl; mem-limits.h provides it.
3516
3517 * xdisp.c (handle_invisible_prop): Make it a bit faster
3518 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3519
3520 2012-08-19 Chong Yidong <cyd@gnu.org>
3521
3522 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3523 ends (Bug#3874).
3524
3525 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3526
3527 * .gdbinit: Use call instead of set when calling a function in the
3528 inferior.
3529
3530 * data.c (set_internal): Don't use set_blv_found.
3531 (Fkill_local_variable): Likewise.
3532
3533 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3534
3535 * nsfont.m (ns_ascii_average_width): Ensure the string
3536 ascii_printable is initialized with a null-terminated character
3537 array. Otherwise, it can contain undesired extra characters.
3538
3539 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3540
3541 port new setting code to Sun C 5.8 2005/10/13
3542 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3543 Return void, not Lisp_Object. Otherwise, the compiler
3544 complains about (A?B:C) where B is void and C is Lisp_Object
3545 when compiling CHAR_TABLE_SET, due to the recent change to
3546 the API of sub_char_table_set_contents.
3547
3548 2012-08-18 Chong Yidong <cyd@gnu.org>
3549
3550 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3551 for the string case (Bug#3874).
3552
3553 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3554
3555 * buffer.h (BSET): Remove (Bug#12215).
3556 Replace all uses with calls to new setter functions.
3557 (bset_bidi_paragraph_direction, bset_case_canon_table)
3558 (bset_case_eqv_table, bset_directory, bset_display_count)
3559 (bset_display_time, bset_downcase_table)
3560 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3561 (bset_last_selected_window, bset_local_var_alist)
3562 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3563 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3564 (bset_width_table):
3565 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3566 (bset_auto_fill_function, bset_auto_save_file_format)
3567 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3568 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3569 (bset_cache_long_line_scans, bset_case_fold_search)
3570 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3571 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3572 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3573 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3574 (bset_header_line_format, bset_indicate_buffer_boundaries)
3575 (bset_indicate_empty_lines, bset_invisibility_spec)
3576 (bset_left_fringe_width, bset_major_mode, bset_mark)
3577 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3578 (bset_name, bset_overwrite_mode, bset_pt_marker)
3579 (bset_right_fringe_width, bset_save_length)
3580 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3581 (bset_scroll_up_aggressively, bset_selective_display)
3582 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3583 (bset_word_wrap, bset_zv_marker):
3584 * category.c (bset_category_table):
3585 * syntax.c (bset_syntax_table):
3586 New setter functions.
3587
3588 * process.h (PSET): Remove (Bug#12215).
3589 Replace all uses with calls to new setter functions.
3590 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3591 (PROCESS_INLINE): New macro.
3592 (pset_childp): New setter function.
3593 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3594 * process.c (PROCESS_INLINE):
3595 Define to EXTERN_INLINE, so that the corresponding functions
3596 are compiled into code.
3597 (pset_buffer, pset_command, pset_decode_coding_system)
3598 (pset_decoding_buf, pset_encode_coding_system)
3599 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3600 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3601 (pset_type, pset_write_queue): New setter functions.
3602
3603 * window.h (WSET): Remove (Bug#12215).
3604 Replace all uses with calls to new setter functions.
3605 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3606 (WINDOW_INLINE): New macro.
3607 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3608 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3609 (wset_total_lines, wset_vertical_scroll_bar)
3610 (wset_window_end_pos, wset_window_end_valid)
3611 (wset_window_end_vpos): New setter functions.
3612 * window.c (WINDOW_INLINE):
3613 Define to EXTERN_INLINE, so that the corresponding functions
3614 are compiled into code.
3615 (wset_combination_limit, wset_dedicated, wset_display_table)
3616 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3617 (wset_new_normal, wset_new_total, wset_next_buffers)
3618 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3619 (wset_prev_buffers, wset_right_fringe_width)
3620 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3621 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3622 (wset_window_parameters):
3623 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3624 (wset_column_number_displayed, wset_region_showing):
3625 New setter functions.
3626
3627 * termhooks.h (TSET): Remove (Bug#12215).
3628 Replace all uses with calls to new setter functions.
3629 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3630 (TERMHOOKS_INLINE): New macro.
3631 (tset_charset_list, tset_selection_alist): New setter functions.
3632 * terminal.c (TERMHOOKS_INLINE):
3633 Define to EXTERN_INLINE, so that the corresponding functions
3634 are compiled into code.
3635 (tset_param_alist): New setter function.
3636
3637 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3638
3639 * keyboard.h (KSET): Remove (Bug#12215).
3640 Replace all uses with calls to new setter functions.
3641 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3642 (KEYBOARD_INLINE): New macro.
3643 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3644 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3645 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3646 New setter functions.
3647 * keyboard.c (KEYBOARD_INLINE):
3648 Define to EXTERN_INLINE, so that the corresponding functions
3649 are compiled into code.
3650 (kset_echo_string, kset_kbd_queue)
3651 (kset_keyboard_translate_table, kset_last_prefix_arg)
3652 (kset_last_repeatable_command, kset_local_function_key_map)
3653 (kset_overriding_terminal_local_map, kset_real_last_command)
3654 (kset_system_key_syms): New setter functions.
3655
3656 * frame.h (FSET): Remove (Bug#12215).
3657 Replace all uses with calls to new setter functions.
3658 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3659 (FRAME_INLINE): New macro.
3660 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3661 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3662 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3663 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3664 (fset_param_alist, fset_root_window, fset_scroll_bars)
3665 (fset_selected_window, fset_title, fset_tool_bar_items)
3666 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3667 * frame.c (FRAME_INLINE):
3668 Define to EXTERN_INLINE, so that the corresponding functions
3669 are compiled into code.
3670 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3671
3672 A few more naming-convention fixes for getters and setters.
3673 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3674 and rename from buffer_overlays_set_before.
3675 (set_buffer_overlays_after): Move here from buffer.h, and rename
3676 from buffer_overlays_set_after.
3677 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3678 All uses changed.
3679 (set_buffer_intervals): Rename from buffer_set_intervals.
3680 * intervals.c (set_interval_object): Move here from intervals.h,
3681 and rename from interval_set_object.
3682 (set_interval_left): Move here from intervals.h, and rename from
3683 interval_set_left.
3684 (set_interval_right): Move here from intervals.h, and rename from
3685 interval_set_right.
3686 (copy_interval_parent): Move here from intervals.h, and rename from
3687 interval_copy_parent.
3688 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3689 (set_interval_plist): Rename from interval_set_plist.
3690 Return void, not Lisp_Object, since no caller uses the result.
3691 * lisp.h (string_intervals): Rename from string_get_intervals.
3692 (set_string_intervals): Rename from string_set_intervals.
3693
3694 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3695 (set_char_table_contents): Rename from char_table_set_contents.
3696 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3697 All uses changed. See the end of
3698 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3699
3700 * lisp.h (CSET): Remove (Bug#12215).
3701 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3702 (set_char_table_purpose): New functions,
3703 replacing CSET. All uses changed. For example, replace
3704 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3705 "set_char_table_parent (char_table, parent);".
3706 The old version was confusing because it used the same name
3707 'parent' for two different things.
3708
3709 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3710
3711 Functions to get and set Lisp_Object fields of buffer-local variables.
3712 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3713 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3714 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3715 * data.c, eval.c, frame.c: Adjust users.
3716
3717 2012-08-17 Chong Yidong <cyd@gnu.org>
3718
3719 * xfaces.c (merge_face_vectors): If the target font specfies a
3720 font spec, make the font's attributes take precedence over
3721 directly-specified attributes.
3722 (merge_face_ref): Recognize :font.
3723
3724 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3725
3726 Do not use memcpy for copying intervals.
3727 * intervals.c (reproduce_interval): New function.
3728 (reproduce_tree, reproduce_tree_obj): Use it.
3729 (reproduce_tree_obj): Remove prototype.
3730
3731 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3732
3733 * lisp.h (duration_to_sec_usec): Remove unused decl.
3734
3735 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3736
3737 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3738 to an allocated instance of NSString, not to the class itself.
3739
3740 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3741
3742 * makefile.w32-in (C_CTYPE_H): New macro.
3743 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3744 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3745 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3746
3747 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3748
3749 Use ASCII tests for character types.
3750 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3751 * xfns.c, xterm.c:
3752 Don't include <ctype.h>; was not needed.
3753 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3754 * sysdep.c, xfaces.c:
3755 Include <c-ctype.h> instead of <ctype.h>.
3756 * nsterm.m: Include <c-ctype.h>.
3757 * charset.c (read_hex):
3758 * doc.c (Fsnarf_documentation):
3759 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3760 (DRIVE_LETTER) [DOS_NT]:
3761 (Ffile_name_directory, Fexpand_file_name)
3762 (Fsubstitute_in_file_name):
3763 * font.c (font_parse_xlfd, font_parse_fcname):
3764 * frame.c (x_set_font_backend):
3765 * gtkutil.c (xg_get_font):
3766 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3767 * nsimage.m (hexchar):
3768 * nsterm.m (ns_xlfd_to_fontname):
3769 * sysdep.c (system_process_attributes):
3770 * xfaces.c (hash_string_case_insensitive):
3771 Use C-locale tests instead of locale-specific tests for character
3772 types, since we want the ASCII interpretation here, not the
3773 interpretation suitable for whatever happens to be the current locale.
3774
3775 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3776
3777 Consistently check windows for validity/liveness
3778 (Bug#11984, Bug#12025, Bug#12026).
3779 * lisp.h (CHECK_VALID_WINDOW): New macro.
3780 * window.c (decode_window): Rename to decode_live_window.
3781 (decode_valid_window, Fwindow_valid_p): New functions.
3782 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3783 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3784 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3785 (Fwindow_prev_sibling, Fwindow_combination_limit)
3786 (Fset_window_combination_limit, Fwindow_use_time)
3787 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3788 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3789 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3790 (Fwindow_hscroll, Fset_window_hscroll)
3791 (Fwindow_redisplay_end_trigger)
3792 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3793 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3794 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3795 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3796 (Fwindow_end, Fset_window_point, Fset_window_start)
3797 (Fpos_visible_in_window_p, Fwindow_line_height)
3798 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3799 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3800 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3801 (Fset_window_parameter, Fwindow_display_table)
3802 (Fset_window_display_table, Fdelete_other_windows_internal)
3803 (Fset_window_buffer, Fset_window_new_total)
3804 (Fset_window_new_normal, Fdelete_window_internal)
3805 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3806 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3807 (Fwindow_scroll_bars): Check whether argument window is a valid or
3808 live window. Update doc-strings.
3809 (syms_of_window): New symbol Qwindow_valid_p.
3810 * keyboard.c (Fposn_at_x_y): Check whether argument
3811 frame_or_window denotes a valid window.
3812
3813 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3814
3815 Fix previous char table change.
3816 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3817 * chartab.c (optimize_sub_char_table): Likewise.
3818
3819 2012-08-16 Chong Yidong <cyd@gnu.org>
3820
3821 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3822
3823 * xfont.c (xfont_open):
3824 * xftfont.c (xftfont_open): Set the font's max_width field.
3825
3826 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3827 min_width to space_width and average_width to the average over
3828 printable ASCII characters.
3829 (ns_char_width): Code cleanup.
3830 (ns_ascii_average_width): New utility function.
3831
3832 * font.h (struct font): Update comments.
3833
3834 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3835
3836 Simple interface to set Lisp_Object fields of character tables.
3837 * lisp.h (CSET): New macro.
3838 (char_table_set_extras, char_table_set_contents)
3839 (sub_char_table_set_contents): New function.
3840 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3841 * syntax.c: Adjust users.
3842
3843 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3844
3845 * eval.c (eval_sub): Bind lexical-binding.
3846 * lread.c (Qlexical_binding): Make non-static.
3847
3848 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3849
3850 * nsmenu.m (popupSession): Remove.
3851 (pop_down_menu): Remove endModalSession.
3852 (timeout_handler:): New method.
3853 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3854 Call runModalForWindow. Check timer_fired when it returns.
3855 If not set, cancel timer and break out of loop.
3856 Otherwise loop again, with a new timeout.
3857
3858 * nsterm.m: Include fcntl.h if present.
3859 (fd_entry, t_readfds, inNsSelect): Remove.
3860 (select_writefds, select_valid, select_timeout, selfds)
3861 (select_mutex, apploopnr): Add.
3862 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3863 Otherwise call kbd_buffer_store_event.
3864 (ns_send_appdefined): Remove release of fd_entry.
3865 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3866 Increment and decrement apploopnr.
3867 (ns_select): If no file descriptors, just do a NSTimer.
3868 Otherwise copy read/write masks and start select thread (fd_handler).
3869 Start main loop and wait for application defined event.
3870 Inform select thread to stop selecting after main loop is exited.
3871 (ns_term_init): Create selfds pipe and set non-blocking.
3872 Initialize select_mutex. Start the select thread (fd_handler).
3873 (fd_handler:): Loop forever, wait for info from the main thread
3874 to either start or stop selecting. When select returns, send
3875 and appdefined event.
3876 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3877 If not call kbd_buffer_store_event.
3878
3879 * nsterm.h (EmacsApp): fd_handler takes id argument.
3880 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3881
3882 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3883
3884 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3885
3886 * region-cache.c (move_cache_gap): Update gap_len using the actual
3887 growth of the boundaries array. Do not change cache_len.
3888 (Bug#12196)
3889
3890 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3891
3892 Generalize and cleanup font subsystem checks.
3893 * font.h (FONT_DEBUG, font_assert): Remove.
3894 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3895 Change font_assert to eassert. Use eassert where appropriate.
3896
3897 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3898
3899 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3900
3901 2012-08-15 Chong Yidong <cyd@gnu.org>
3902
3903 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3904 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3905 extract the font descriptor instead of just the font name.
3906 In that case, return a font spec instead of a string.
3907 (x_last_font_name): Move to this file from xfns.c.
3908
3909 * xfns.c (Fx_select_font): The return value can also be a font
3910 spec. Move x_last_font_name management to gtkutil.c.
3911
3912 * xfaces.c: Make font weight and style symbols non-static.
3913
3914 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3915
3916 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3917 (bug#12117).
3918
3919 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3920
3921 * alloc.c (Fgarbage_collect): Use plural form consistently.
3922
3923 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3924
3925 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3926 iteration through the command loop. Fixes a problem whereby mouse
3927 movements are ignored until the first mouse click.
3928
3929 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3930
3931 Use bool, not int, for Lisp booleans.
3932 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3933 makes Emacs a bit smaller and presumably a bit faster.
3934 * lisp.h: Include <stdbool.h>.
3935 (struct Lisp_Boolfwd, defvar_bool):
3936 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3937 * regex.c [!emacs]: Include <stdbool.h>.
3938 (false, true): Remove; <stdbool.h> does this for us now.
3939
3940 2012-08-14 Chong Yidong <cyd@gnu.org>
3941
3942 * character.c (Fcharacterp): Doc fix (Bug#12076).
3943
3944 * data.c (Findirect_variable): Doc fix (Bug#11040).
3945
3946 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3947
3948 * editfns.c (Fformat): Doc fix (Bug#12059).
3949 (Fsave_current_buffer): Doc fix (Bug#11542).
3950
3951 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3952
3953 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3954 (bug#12022).
3955
3956 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3957
3958 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3959 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3960 * minibuf.c (choose_minibuf_frame, read_minibuf):
3961 * w32fns.c (x_create_tip_frame):
3962 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3963 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3964
3965 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3966
3967 * intervals.c (offset_intervals): Remove obsolete comment.
3968
3969 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3970
3971 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3972
3973 2012-08-14 Gergely Risko <gergely@risko.hu>
3974
3975 * coding.c (decode_coding): Record buffer modification before
3976 disabling undo_list (Bug#11773).
3977
3978 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3979
3980 Revert and cleanup some recent overlay changes.
3981 * buffer.h (enum overlay_type): Remove.
3982 (buffer_get_overlays, buffer_set_overlays): Likewise.
3983 (buffer_set_overlays_before, buffer_set_overlays_after):
3984 New function. Adjust users.
3985 (unchain_both): Add eassert.
3986
3987 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3988
3989 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3990
3991 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3992
3993 * gtkutil.c (xg_mark_data): Don't assume C99.
3994
3995 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3996
3997 * gtkutil.c (xg_frame_tb_info): New struct.
3998 (TB_INFO_KEY): New define.
3999 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4000 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4001 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4002 if not present.
4003 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
4004 is up to date. Otherwise store new data.
4005 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4006
4007 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4008
4009 Use KSET for write access to Lisp_Object members of struct kboard.
4010 * keyboard.h (KSET): New macro.
4011 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4012 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4013 * xterm.c: Adjust users.
4014
4015 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4016
4017 Use BSET for write access to Lisp_Object members of struct buffer.
4018 * buffer.h (BSET): New macro.
4019 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4020 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4021 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4022 * window.c, xdisp.c, xfns.c: Adjust users.
4023
4024 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4025
4026 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4027
4028 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4029
4030 * nsterm.m (not_in_argv): New function.
4031 (application:openFile, application:openTempFile:):
4032 (application:openFileWithoutUI:, application:openFiles:): Open file
4033 if not_in_argv returns non-zero (bug#12171).
4034
4035 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4036 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4037 Define for Gtk+ versions less than 3.2.
4038 (xg_get_font_name): Use those functions/macros here.
4039 Reported by Frans Oilinki <moilinki@gmail.com>.
4040
4041 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4042
4043 * unexmacosx.c (copy_data_segment): Copy initialized data in
4044 statically linked libraries from input file rather than memory.
4045
4046 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4047 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4048 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4049
4050 2012-08-10 Glenn Morris <rgm@gnu.org>
4051
4052 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4053 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4054
4055 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4056
4057 Fix last change to allow compilation with low optimization levels.
4058 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4059 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4060
4061 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4062
4063 Use common inline syntax in intervals.h.
4064 * intervals.h (INTERVALS_INLINE): New macro.
4065 Change all users from LISP_INLINE.
4066
4067 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4068
4069 Define Qnone once for all platforms.
4070 * frame.c (Qnone): Define here.
4071 (syms_of_frame): DEFSYM it.
4072 * lisp.h (Qnone): New declaration.
4073 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4074 * xfns.c: Remove duplication. Adjust users.
4075
4076 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4077
4078 Remove unused macros from intervals.h.
4079 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4080 * intervals.c: Adjust comment.
4081
4082 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4083
4084 * w32fns.c <w32_unicode_gui>: New static variable.
4085 (globals_of_w32fns): Initialize it according to os_subtype.
4086 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4087 testing os_subtype.
4088
4089 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4090 Eli Zaretskii <eliz@gnu.org>
4091
4092 Fix bug #10299 with Unicode characters sent by customized
4093 keyboards created by MSKLC.
4094 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4095 (w32_init_class): Use it to initialize the Emacs class with either
4096 ANSI or Unicode API calls.
4097 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4098 later.
4099 (w32_wnd_proc): If the character code sent by WM_CHAR or
4100 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4101 original message. Call DefWindowProcW on NT and later.
4102
4103 2012-08-10 Glenn Morris <rgm@gnu.org>
4104
4105 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4106
4107 * lisp.h (DIRECTORY_SEP): Let configure set it.
4108
4109 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4110
4111 Use TSET for write access to Lisp_Object slots of struct terminal.
4112 * termhooks.h (TSET): New macro.
4113 * coding.c, terminal.c, xselect.c: Adjust users.
4114
4115 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4116
4117 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4118 the failing expression, include them in the error message.
4119 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4120 * lisp.h (internal_condition_case_n): Update declaration.
4121
4122 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4123
4124 Inline functions to examine and change buffer overlays.
4125 * buffer.c (unchain_both): New function.
4126 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4127 (buffer_has_overlays): New function.
4128 (enum overlay_type): New enum.
4129 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4130 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4131
4132 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4133
4134 Inline functions to examine and change buffer intervals.
4135 * alloc.c (mark_interval_tree): Remove.
4136 (MARK_INTERVAL_TREE): Simplify.
4137 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4138 * intervals.c (buffer_balance_intervals): New function.
4139 (graft_intervals_into_buffer): Adjust indentation.
4140 (set_intervals_multibyte): Simplify.
4141 * buffer.h (BUF_INTERVALS): Remove.
4142 (buffer_get_intervals, buffer_set_intervals): New function.
4143 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4144 * intervals.c, textprop.c: Adjust users.
4145
4146 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4147
4148 Inline functions to examine and change string intervals.
4149 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4150 (string_get_intervals, string_set_intervals): New function.
4151 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4152 * lread.c, print.c, textprop.c: Adjust users.
4153
4154 2012-08-08 Glenn Morris <rgm@gnu.org>
4155
4156 * lisp.mk (lisp): Remove language/persian.elc.
4157
4158 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4159
4160 Cleanup intervals.
4161 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4162 (NULL_INTERVAL_P): Likewise. Adjust users.
4163 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4164 Adjust comment. Move under #if 0.
4165 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4166 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4167
4168 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4169
4170 Check total length of intervals with eassert.
4171 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4172 * intervals.c: Change all users to eassert.
4173
4174 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4175
4176 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4177 Rename fields to match removal of FGET and WGET and disuse of
4178 INTERNAL_FIELD in Lisp_Cons.
4179
4180 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4181
4182 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4183 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4184 name since all xname users are fixed long time ago. Do not
4185 use INTERNAL_FIELD.
4186 (set_symbol_name, set_symbol_function, set_symbol_plist):
4187 (set_symbol_next, set_overlay_plist): New function.
4188 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4189 (struct Lisp_Overlay): Likewise.
4190 (CVAR, MVAR, SVAR): Remove.
4191 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4192 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4193 * xterm.c: Adjust users.
4194 * .gdbinit: Change to use name field of struct Lisp_Symbol
4195 where appropriate.
4196
4197 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4198
4199 Basic functions to set Lisp_Object and pointer slots of intervals.
4200 * intervals.h (interval_set_parent, interval_set_object):
4201 (interval_set_left, interval_set_right, interval_set_plist):
4202 (interval_copy_parent): New function.
4203 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4204 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4205 Adjust indentation.
4206 (INTERVAL_SIZE): Remove. Adjust users.
4207 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4208
4209 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4210
4211 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4212 * process.h (PGET): Remove.
4213 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4214 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4215
4216 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4217
4218 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4219 * window.h (WGET): Remove.
4220 (struct window): Do not use INTERNAL_FIELD.
4221 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4222 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4223 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4224 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4225 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4226 Adjust users.
4227
4228 2012-08-07 Chong Yidong <cyd@gnu.org>
4229
4230 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4231 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4232 (Fdelete_window_internal): Signal an error if the window is not on
4233 a live frame (Bug#12025).
4234
4235 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4236
4237 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4238 * frame.h (FGET): Remove.
4239 (struct frame): Do not use INTERNAL_FIELD.
4240 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4241 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4242 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4243 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4244
4245 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4246
4247 * w32.c: Silence compiler warnings.
4248 (map_w32_filename): Remove unused variable `is_fat'.
4249 (chase_symlinks): Add parentheses around expression.
4250
4251 2012-08-06 Glenn Morris <rgm@gnu.org>
4252
4253 * sysdep.c: Respect BROKEN_GETWD.
4254
4255 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4256 Let configure handle it.
4257 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4258
4259 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4260
4261 Use GCALIGNMENT where appropriate.
4262 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4263 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4264 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4265
4266 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4267
4268 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4269 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4270
4271 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4272
4273 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4274 that should be sufficient for everyone.
4275
4276 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4277
4278 * keyboard.c (timer_check_2): Add break so timer_check returns next
4279 timeout.
4280
4281 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4282
4283 Fix Windows build errors introduced after converting to WGET and WSET.
4284 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4285 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4286
4287 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4288
4289 * nsterm.m (ns_frame_rehighlight): Use FSET.
4290
4291 * nsmenu.m (ns_update_menubar): Use FSET.
4292
4293 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Separate read and write access to Lisp_Object slots of Lisp_Process.
4296 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4297 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4298
4299 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4300
4301 Separate read and write access to Lisp_Object slots of struct window.
4302 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4303 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4304 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4305 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4306 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4307 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4308 Adjust users.
4309
4310 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4311
4312 Fix Windows build errors introduced after converting to FGET and FSET.
4313 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4314 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4315 (w32_judge_scroll_bars): Change to use FSET.
4316 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4317
4318 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4319
4320 Fix replacement typo.
4321 * window.c (replace_window): Set root_window instead of
4322 selected_window. This fixes a total window subsystem
4323 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4324
4325 2012-08-06 Glenn Morris <rgm@gnu.org>
4326
4327 * lisp.mk (lisp): Add language/persian.elc.
4328
4329 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4330
4331 Separate read and write access to Lisp_Object slots of struct frame.
4332 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4333 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4334 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4335 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4336 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4337
4338 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4339
4340 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4341
4342 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4343
4344 Generalize common compile-time constants.
4345 * lisp.h (header_size, bool_header_size, word_size): Now here.
4346 (struct Lisp_Vector): Add comment.
4347 (struct Lisp_Bool_Vector): Move up to define handy constants.
4348 (VECSIZE, PSEUDOVECSIZE): Simplify.
4349 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4350 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4351 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4352 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4353 * xfont.c, xmenu.c: Use word_size where appropriate.
4354
4355 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4356
4357 * search.c (Freplace_match): Treat \? in the replacement text
4358 literally (Bug#8161).
4359
4360 2012-08-05 Chong Yidong <cyd@gnu.org>
4361
4362 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4363 * frame.c (Vdelete_frame_functions):
4364 * emacs.c (Vkill_emacs_hook): Doc fix.
4365
4366 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4367
4368 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4369 --with-x-toolkit=no builds.
4370 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4371
4372 2012-08-04 Chong Yidong <cyd@gnu.org>
4373
4374 * syntax.c (Fmodify_syntax_entry): Doc fix.
4375
4376 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4377
4378 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4379 * w32.c (init_environment): Change the default values of many
4380 environment variables in dflt_envvars[] to NULL, to avoid pushing
4381 them into environment when they were not already defined.
4382 Remove the code that deletes site-lisp subdirectories from the default
4383 value of EMACSLOADPATH, as it is no longer needed.
4384 (check_windows_init_file): Now external, not static.
4385 Use Vload_path as is, without adding anything, as this function is now
4386 called when Vload_path is already set up.
4387
4388 * w32.h (check_windows_init_file): Add prototype.
4389
4390 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4391 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4392 compatibility with Posix platforms.
4393 (main): Move the call to check_windows_init_file to here from
4394 w32.c.
4395 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4396 any, in the DEFALT argument into the root of the Emacs build or
4397 installation tree, as appropriate.
4398
4399 * callproc.c (init_callproc_1): Call decode_env_path instead of
4400 doing its equivalent by hand.
4401 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4402 the code that sets Vexec_path run on MS-Windows.
4403
4404 * lread.c (init_lread): Add comments to #ifdef's.
4405
4406 * msdos.c (dos_set_window_size, IT_update_begin)
4407 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4408 instead of direct references.
4409
4410 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4411
4412 Export DEFAULT_REHASH_* to GDB.
4413 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4414 Now constants, not macros.
4415
4416 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4417
4418 Remove unnecessary casts involving pointers.
4419 These casts are no longer needed now that we assume C89 or later,
4420 since they involve casting to or from void *.
4421 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4422 (make_pure_float, make_pure_vector):
4423 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4424 * macros.c (Fstart_kbd_macro):
4425 * menu.c (find_and_return_menu_selection):
4426 * minibuf.c (read_minibuf_noninteractive):
4427 * sysdep.c (closedir):
4428 * xdisp.c (x_produce_glyphs):
4429 * xfaces.c (compare_fonts_by_sort_order):
4430 * xfns.c (x_real_positions, select_visual):
4431 * xselect.c (x_stop_queuing_selection_requests)
4432 (x_get_window_property, x_get_window_property_as_lisp_data):
4433 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4434 Remove unnecessary pointer casts.
4435 * alloc.c (record_xmalloc): New function.
4436 * lisp.h (record_xmalloc): New decl.
4437 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4438 more like a function. This is because the pointer cast is not
4439 needed. All uses changed.
4440 * print.c (print_string, print_error_message): Avoid length recalc.
4441
4442 Improve fix for macroexp crash with debugging (Bug#12118).
4443 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4444 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4445 not supposed to be invoked from the garbage collector.
4446 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4447 (gc_aset): New function, which is like ASET but can be
4448 used in the garbage collector.
4449 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4450 (set_hash_index): Use it instead of ASET.
4451
4452 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4453
4454 Support symlinks on latest versions of MS-Windows.
4455 * w32.c: Include winioctl.h and aclapi.h.
4456 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4457 (revert_to_self): Forward declarations of static functions.
4458 <static BOOL g_b_init_get_security_info>:
4459 <g_b_init_create_symbolic_link>: New static flags.
4460 (globals_of_w32): Initialize them to zero.
4461 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4462 (map_w32_filename): Improve commentary. Simplify switch.
4463 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4464 headers (most versions of MinGW w32api don't).
4465 (get_security_info, create_symbolic_link)
4466 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4467 New functions.
4468 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4469 in the argument file name.
4470 (sys_access): Call unc_volume_file_attributes only if
4471 GetFileAttributes fails with network-related error codes.
4472 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4473 have the required privileges.
4474 (get_file_security_desc_by_name): Rename from
4475 get_file_security_desc.
4476 (stat_worker): New function, with most of the guts of 'stat', and
4477 with addition of handling of symlinks and support for 'lstat'.
4478 If possible, get file's attributes and security information by
4479 handle, not by name. Produce S_IFLNK bit for symlinks, when
4480 called from 'lstat'.
4481 (stat, lstat): New functions, call 'stat_worker'.
4482 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4483 symlinks when the underlying filesystem supports them.
4484
4485 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4486
4487 Fix macroexp crash on Windows with debugging (Bug#12118).
4488 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4489 checking subscripts; problem introduced with the recent
4490 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4491 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4492 since it's used in non-static inline functions now.
4493
4494 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4495 Don't assume buffer size fits in 'int'. Remove unused local.
4496
4497 Use C99-style 'extern inline' if available.
4498 * buffer.h (BUFFER_INLINE):
4499 * category.h (CATEGORY_INLINE):
4500 * character.h (CHARACTER_INLINE):
4501 * charset.h (CHARSET_INLINE):
4502 * composite.h (COMPOSITE_INLINE):
4503 * dispextern.h (DISPEXTERN_INLINE):
4504 * lisp.h (LISP_INLINE):
4505 * systime.h (SYSTIME_INLINE):
4506 New macro, replacing 'static inline' in this header.
4507 * buffer.h, category.h, character.h, charset.h, composite.h:
4508 * dispextern.h, lisp.h, systime.h:
4509 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4510 * alloc.c (LISP_INLINE):
4511 * buffer.c (BUFFER_INLINE):
4512 * category.c (CATEGORY_INLINE):
4513 * character.c (CHARACTER_INLINE):
4514 * charset.c (CHARSET_INLINE):
4515 * composite.c (COMPOSITE_INLINE):
4516 * dispnew.c (DISPEXTERN_INLINE):
4517 * sysdep.c (SYSTIME_INLINE):
4518 Define to EXTERN_INLINE, so that the corresponding functions
4519 are compiled into code.
4520 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4521 (INLINE_HEADER_END): New macros.
4522 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4523 since it's used in non-static inline functions now.
4524 (VALMASK) [!USE_LSB_TAG]: Likewise.
4525
4526 2012-08-02 Glenn Morris <rgm@gnu.org>
4527
4528 * s/: Remove empty directory.
4529
4530 * s/ms-w32.h: Move to ../nt/inc.
4531 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4532 Update for new ms-w32.h location.
4533
4534 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4535
4536 Port to Solaris 8.
4537 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4538
4539 2012-08-02 Glenn Morris <rgm@gnu.org>
4540
4541 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4542 hard-coding the path separator.
4543
4544 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4545
4546 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4547 This how ASET and AREF are supposed to work, and makes
4548 it easier to think about future improvements. See
4549 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4550 * charset.h (set_charset_attr): New function.
4551 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4552 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4553 (aref_addr): New function. All uses of &AREF(...) changed.
4554 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4555 (set_hash_index): New functions. All lvalue-style uses of
4556 HASH_KEY etc. changed.
4557 * keyboard.c (set_prop): New function. All lvalue-style uses
4558 of PROP changed.
4559
4560 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4561
4562 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4563 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4564 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4565 * nsfns.m (ns_set_name_as_filename): Likewise.
4566 * nsmenu.m (ns_update_menubar): Likewise.
4567 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4568
4569 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4570
4571 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4572 Adapt to latest changes in field names of the corresponding Lisp
4573 objects.
4574
4575 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4576
4577 2012-08-01 Glenn Morris <rgm@gnu.org>
4578
4579 * s/msdos.h: Remove file.
4580 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4581 * Makefile.in (S_FILE): Remove.
4582 (config_h): Remove S_FILE.
4583
4584 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4585
4586 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4587 Remove; moved to nt/config.nt.
4588
4589 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4590
4591 Use INTERNAL_FIELD for conses and overlays.
4592 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4593 Remove obsolete comment.
4594 (MVAR): New macro.
4595 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4596 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4597
4598 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4599
4600 Use INTERNAL_FIELD for symbols.
4601 * lisp.h (SVAR): New macro. Adjust users.
4602 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4603 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4604
4605 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4606
4607 Use INTERNAL_FIELD for processes.
4608 * process.h (PVAR): New macro. Adjust style.
4609 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4610 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4611
4612 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4613
4614 Use INTERNAL_FIELD for windows.
4615 * window.h (WVAR): New macro.
4616 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4617 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4618 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4619 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4620 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4621 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4622
4623 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4624
4625 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4626
4627 2012-08-01 Glenn Morris <rgm@gnu.org>
4628
4629 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4630 Move to configure.ac.
4631
4632 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4633
4634 * makefile.w32-in (CONFIG_H): Update dependencies.
4635 (CONF_POST_H): New macro.
4636
4637 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4638
4639 2012-07-31 Glenn Morris <rgm@gnu.org>
4640
4641 * Makefile.in (S_FILE): No longer set by configure.
4642
4643 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4644 is available.
4645 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4646
4647 * process.h (NULL_DEVICE):
4648 * emacs.c (SEPCHAR):
4649 * editfns.c (USER_FULL_NAME): Let configure set them.
4650
4651 * s/README, s/template.h: Remove files.
4652
4653 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4654
4655 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4656 Move to configure.ac.
4657
4658 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4659
4660 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4661 resulting renaming of 'struct frame' members.
4662
4663 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4664
4665 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4666 after introduction of FVAR.
4667
4668 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4669
4670 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4671
4672 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4673 instead of compositeToPoint.
4674 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4675
4676 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4677
4678 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4679
4680 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4681 * lisp.h (INTERNAL_FIELD): New macro.
4682 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4683 (BVAR): Change to use INTERNAL_FIELD.
4684 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4685 (KVAR): Change to use INTERNAL_FIELD.
4686 * frame.h (FVAR): New macro.
4687 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4688 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4689 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4690 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4691 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4692
4693 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4694
4695 Miscellaneous fixes for non-default X toolkits.
4696 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4697 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4698 Move under #ifdef USE_LUCID.
4699 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4700 definition and usage to avoid warnings.
4701
4702 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4703
4704 * nsterm.m (openFiles): Fix previous checkin.
4705
4706 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4707
4708 * indent.c (compute_motion): Remove unused local.
4709
4710 2012-07-31 Glenn Morris <rgm@gnu.org>
4711
4712 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4713
4714 * conf_post.h [USG5_4]:
4715 Move remaining contents of s/usg5-4-common.h here.
4716 * s/usg5-4-common.h: Remove file.
4717
4718 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4719 * s/irix6-5.h: Remove file.
4720
4721 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4722 * s/darwin.h: Remove file.
4723
4724 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4725 * s/hpux10-20.h: Remove file, which is now empty.
4726
4727 2012-07-30 Glenn Morris <rgm@gnu.org>
4728
4729 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4730 * Makefile.in (config_h): Add conf_post.h.
4731 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4732
4733 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4734
4735 * nsterm.m (ns_do_open_file): New variable.
4736 (ns_term_init): Set ns_do_open_file to YES after run returns.
4737 (openFile, openTempFile, openFileWithoutUI, openFiles):
4738 Open files only if ns_do_open_file.
4739
4740 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4741
4742 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4743 This no-op macro hasn't been needed for many years.
4744 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4745
4746 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4747 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4748 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4749 gdb_make_enums_visible.
4750 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4751 (DIRECTORY_SEP): Now a constant, not a macro.
4752
4753 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4754
4755 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4756 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4757
4758 * w32term.c <w32_keyboard_codepage>: Renamed from
4759 keyboard_codepage and now external. All users changed.
4760
4761 * w32term.h: Add declaration of w32_keyboard_codepage.
4762
4763 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4764 the codepage to translate keys to Unicode. If this argument is
4765 -1, use the value returned by GetConsoleCP. All callers changed.
4766
4767 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4768
4769 Update .PHONY listings in makefiles.
4770 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4771 bootstrap-clean, distclean, maintainer-clean, versioclean,
4772 extraclean, frc.
4773
4774 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4775 This is a bit clearer. Fix some commentary typos.
4776
4777 2012-07-30 Glenn Morris <rgm@gnu.org>
4778
4779 * s/netbsd.h: Let configure include signal.h if needed.
4780 Remove file, which is now empty.
4781
4782 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4783 Let configure set them.
4784 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4785 No more need to undefine.
4786
4787 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4788
4789 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4790 non-single-byte char when adding meta modifier. (Bug#12090)
4791
4792 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4793
4794 Convert safe_call to use variable number of arguments.
4795 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4796 (safe_call2): Fix comment.
4797 * lisp.h (safe_call): Adjust prototype.
4798 * coding.c (encode_coding_object): Change to use safe_call2.
4799 * xfaces.c (merge_face_heights): Change to use safe_call1.
4800
4801 2012-07-30 Glenn Morris <rgm@gnu.org>
4802
4803 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4804 does that unconditionally. Remove file, which is now empty.
4805
4806 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4807 Remove empty files.
4808
4809 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4810
4811 Export to GDB most of lisp.h's remaining object-like macros.
4812 * lisp.h (min, max): Move earlier, because they're used earlier now.
4813 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4814 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4815 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4816 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4817 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4818 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4819 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4820 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4821 Now constants, for GDB. They need not be macros.
4822 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4823 Now constants, for GDB, as well as macros, for static initializers.
4824 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4825 Move to after the definition of struct Lisp_Char_Table,
4826 since the former now needs that type defined.
4827 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4828 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4829 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4830 New enums, for gdb_make_enums_visible.
4831 (GLYPH_MODE_LINE_FACE): Remove; unused.
4832 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4833 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4834 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4835 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4836 enum maxargs, enum MAX_ALLOCA.
4837 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4838 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4839 no longer needed, now that they are done in lisp.h.
4840
4841 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4842
4843 Cleanup string bytes checking.
4844 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4845 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4846 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4847 (check_sblock, compact_small_strings): Simplify.
4848
4849 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4850
4851 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4852 These macros are confusing and no longer need to be defined, as
4853 the enum values now suffice. All uses replaced with definiens.
4854 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4855
4856 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4857
4858 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4859 ($(BLD)/w32console.$(O)): Update dependencies.
4860
4861 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4862
4863 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4864 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4865 time. Adjust users.
4866 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4867
4868 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4869
4870 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4871 setting sitelisp (Bug#12010).
4872
4873 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4874
4875 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4876
4877 * w32heap.c (cache_system_info):
4878 * w32.c (sys_rename):
4879 * w32proc.c (find_child_console, sys_kill): All users changed.
4880
4881 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4882
4883 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4884
4885 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4886
4887 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4888
4889 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4890
4891 Cleanup statistics calculation in Fgarbage_collect.
4892 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4893 Fix zombies percentage calculation. Simplify elapsed time calculation.
4894
4895 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4896
4897 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4898 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4899 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4900 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4901 (replace_range, replace_range_2, del_range_2): Change to eassert.
4902 * marker.c (byte_char_debug_check): Adjust style.
4903
4904 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4905
4906 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4907 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4908 long-ago-commented-out code that talks about "WIN32".
4909 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4910 All uses changed.
4911
4912 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4913
4914 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4915 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4916 Simplify by using alignof.
4917 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4918 * lisp.h: Include <stdalign.h>.
4919 (GCALIGNMENT): New macro and constant.
4920 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4921 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4922 (stdalign): New macro, if not already defined.
4923
4924 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4925
4926 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4927 * w32inevt.c: Include w32inevt.h.
4928 (w32_read_console_input): New inline function, calls either
4929 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4930 w32_console_unicode_input.
4931 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4932 (w32_kbd_patch_key, key_event): Use the codepage returned by
4933 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4934 (key_event): use uChar.UnicodeChar only if
4935 w32_console_unicode_input is non-zero.
4936
4937 * w32console.c: Include w32heap.h.
4938 <w32_console_unicode_input>: New global variable.
4939 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4940 family of Windows, zero otherwise.
4941
4942 * w32inevt.h: Declare w32_console_unicode_input.
4943
4944 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4945 --without-x. (Bug#11742)
4946
4947 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4948
4949 Adjust GDB to reflect pvec_type changes (Bug#12036).
4950 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4951 2012-07-04 changes to pseudovector representation.
4952 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4953
4954 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4955
4956 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4957 bus address.
4958 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4959
4960 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4961
4962 * alloc.c (listn): Fix the order the arguments are consed onto the
4963 list.
4964
4965 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4966 enumeration constants, as PURE and HEAP are too general, and clash
4967 with other headers and sources, such as gmalloc.c and the
4968 MS-Windows system headers. All users changed.
4969
4970 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4971
4972 Revert last save_excursion_save and save_excursion_restore changes.
4973 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4974 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4975
4976 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4977
4978 Fix recently-introduced typos in Windows port.
4979 Reported by Martin Rudalics <rudalics@gmx.at>.
4980 * w32.c (init_environment): Replace comma with semicolon.
4981 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4982
4983 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4984
4985 Improve GDB symbol export (Bug#12036).
4986 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4987 arms of an 'if', not using conditional expressions; otherwise GDB
4988 complains about the types in the unevaluated arm when the argument
4989 is an integer literal.
4990 (xgetint): Simplify expression.
4991 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4992 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4993 Zaretskii in <http://bugs.gnu.org/12036#13>.
4994 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4995 needed now that we have gdb_make_enums_visible.
4996 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4997 (enum enum_USE_LSB_TAG):
4998 New enum types, packaging up enums that need to be exported to GDB.
4999
5000 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5001
5002 Utility function to make a list from specified amount of objects.
5003 * lisp.h (enum constype): New datatype.
5004 (listn): New prototype.
5005 * alloc.c (listn): New function.
5006 (Fmemory_use_count, syms_of_alloc): Use it.
5007 * buffer.c (syms_of_buffer): Likewise.
5008 * callint.c (syms_of_callint): Likewise.
5009 * charset.c (define_charset_internal): Likewise.
5010 * coding.c (syms_of_coding): Likewise.
5011 * keymap.c (syms_of_keymap): Likewise.
5012 * search.c (syms_of_search): Likewise.
5013 * syntax.c (syms_of_syntax): Likewise.
5014 * w32.c (init_environment): Likewise.
5015 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5016 * xdisp.c (syms_of_xdisp): Likewise.
5017 * xfns.c (syms_of_xfns): Likewise.
5018
5019 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5020
5021 Fast save_excursion_save and save_excursion_restore.
5022 * lisp.h (struct Lisp_Excursion): New data type.
5023 (PVEC_EXCURSION): New pseudovector type.
5024 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5025 to deal with it. Adjust comments.
5026 (init_marker, attach_marker): New prototype.
5027 (unchain_marker): Adjust prototype.
5028 * marker.c (attach_marker): Change to global.
5029 (init_marker): New function.
5030 * alloc.c (Fmake_marker, build_marker): Use it.
5031 (build_marker): More easserts.
5032 (mark_object): Handle struct Lisp_Excursion.
5033 * editfns.c (save_excursion_save, save_excursion_restore):
5034 Reimplement to use struct Lisp_Excursion. Add comments.
5035
5036 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5037
5038 Fix export of symbols to GDB (Bug#12036).
5039 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5040 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5041 emacs.c, as this is a more-suitable home. Had this been done earlier
5042 the fix for 12036 would have avoided some of the problems noted in
5043 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5044 would have been more obvious.
5045 * emacs.c: Do not include <verify.h>; no longer needed.
5046 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5047 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5048 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5049 Remove; now done in lisp.h.
5050 * lisp.h (PUBLISH_TO_GDB): New macro.
5051 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5052 (DATA_SEG_BITS): Use it.
5053 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5054 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5055 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5056 not be usable in #if. This simplifies things.
5057
5058 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5059
5060 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5061
5062 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5063
5064 Simplify export of symbols to GDB (Bug#12036).
5065 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5066 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5067 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5068 Adjust to changes in lisp.h and emacs.c, by using
5069 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5070 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5071 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5072 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5073 instead of gdb_valbits.
5074 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5075 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5076 instead of gdb_array_mark_flag.
5077 (xboolvector): Get size from $->size, not $->header.size.
5078 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5079 (xreload, hook-run, hookpost-run): Remove.
5080 * emacs.c: Include <verify.h>.
5081 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5082 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5083 Remove.
5084 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5085 (gdb_USE_LSB_TAG): New enum constants.
5086 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5087 Also define these as enum constants, so they're visible to GDB.
5088 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5089 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5090 as constants, so they're visible to GDB.
5091 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5092 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5093 Now enum constants, not macros, so they're visible to GDB.
5094 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5095 more convenient now. All uses changed.
5096 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5097 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5098
5099 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5100
5101 Explicitly free restriction data that are not needed anymore.
5102 * editfns.c (save_restriction_restore): Free restriction data.
5103
5104 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5105
5106 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5107 add argument, tune behavior, and adjust all callers.
5108
5109 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 Use typedef for EMACS_INT, EMACS_UINT.
5112 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5113 than macros. This simplifies debugging in the usual case, since
5114 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5115 and it allows expressions involving EMACS_INT casts.
5116 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5117
5118 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5119
5120 * nsterm.m (ns_read_socket): Return early if there is a modal
5121 window (Bug#12043).
5122
5123 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5124
5125 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5126 that FOCUS-FRAME can be omitted.
5127
5128 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5129
5130 Adjust buffer text indirection counters at the end of Fkill_buffer.
5131 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5132 buffer is definitely dead. This should really fix an issue reported
5133 by Christoph Scholtes again. (Bug#12007).
5134 (init_buffer_once): Initialize indirection counters of
5135 buffer_defaults and buffer_local_symbols (for sanity and safety).
5136
5137 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5138
5139 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5140 and continuation glyphs on tooltip frames, leave them at zero.
5141 Avoids continued lines in tooltips. (Bug#11832)
5142
5143 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5144
5145 Simplify copy_overlay.
5146 * buffer.c (copy_overlay): Simplify. Use build_marker.
5147 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5148
5149 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5150
5151 * print.c (print_object): Don't crash when a frame's name is nil
5152 or invalid. (Bug#12025)
5153
5154 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5155 it signals an error when a tooltip frame is being created.
5156
5157 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5158
5159 Cleanup miscellaneous objects allocation and initialization.
5160 * alloc.c (allocate_misc): Change to static. Add argument to
5161 specify the subtype. Adjust comment and users.
5162 (build_overlay): New function.
5163 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5164 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5165 (allocate_misc): Remove prototype.
5166 (build_overlay): Add prototype.
5167
5168 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5169
5170 Swap buffer text indirection counters in Fbuffer_swap_text.
5171 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5172 This avoids crash reported by Christoph Scholtes at
5173 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5174
5175 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5176
5177 * nsmenu.m (Popdown_data): New struct.
5178 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5179 free Popdown_data.
5180 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5181 (initWithContentRect): Make imgView and contentView non-static
5182 and autorelease them. Also autorelease img and matrix (Bug#12005).
5183 (dealloc): Remove (Bug#12005).
5184
5185 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5186
5187 Adjust consing_since_gc when objects are explicitly freed.
5188 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5189 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5190 (free_cons, free_misc): Subtract object size from consing_since_gc.
5191
5192 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5193
5194 Simplify and cleanup markers positioning code.
5195 * marker.c (attach_marker): More useful eassert.
5196 (live_buffer, set_marker_internal): New function.
5197 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5198 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5199
5200 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5201
5202 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5203 as it's limited by the amount of memory, not by INT_MAX.
5204
5205 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5206
5207 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5208 in special-event-map. See the discussion at
5209 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5210 for the reasons.
5211
5212 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5213 info.dwItemData. Fixes crashes on 64-bit Windows.
5214 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5215
5216 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5217
5218 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5219 (conversationIdentifier): Return value is NSInteger.
5220 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5221
5222 2012-07-21 Chong Yidong <cyd@gnu.org>
5223
5224 * window.c (decode_any_window): Signal an error if the window is
5225 on a dead frame (Bug#11984).
5226
5227 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5228
5229 Add indirection counting to speed up Fkill_buffer.
5230 * buffer.h (struct buffer): New member.
5231 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5232 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5233 base buffer indirection counter.
5234 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5235 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5236 through buffer list if indirection counter is 0.
5237
5238 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5239
5240 Extend the value returned by Fgarbage_collect with heap statistics.
5241 * alloc.c (Qheap): New symbol.
5242 (syms_of_alloc): DEFSYM it.
5243 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5244 (Fmemory_free): Remove.
5245 (syms_of_alloc): Don't defsubr it.
5246 * buffer.c (Fcompact_buffer): Remove.
5247 (syms_of_buffer): Don't defsubr it.
5248
5249 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5250
5251 Make maybe_gc inline.
5252 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5253 * lisp.h (consing_since_gc, gc_relative_threshold)
5254 (memory_full_cons_threshold): Revert declaration.
5255 (maybe_gc): Remove prototype, define as inline.
5256 * alloc.c: Remove old commented-out code.
5257 (consing_since_gc, gc_relative_threshold)
5258 (memory_full_cons_threshold): Revert to global.
5259 (maybe_gc): Remove.
5260
5261 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5262
5263 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5264 * lisp.h (build_unibyte_string): New function.
5265 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5266 * sysdep.c, w32fns.c, xfns.c: Use it.
5267 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5268 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5269 Adjust users accordingly.
5270 * font.h (font_open_by_name): Adjust prototype.
5271
5272 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5273
5274 Cleanup calls to Fgarbage_collect.
5275 * lisp.h (maybe_gc): New prototype.
5276 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5277 Remove declarations.
5278 * alloc.c (maybe_gc): New function.
5279 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5280 Make them static.
5281 * bytecode.c (MAYBE_GC): Use maybe_gc.
5282 * eval.c (eval_sub, Ffuncall): Likewise.
5283 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5284 to avoid dependency from auto-save feature.
5285
5286 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5287
5288 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5289 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5290 'for_each_per_buffer_object_at'.
5291 All uses changed. It's better to use upper-case for macros that
5292 cannot be implemented as functions, to give the reader a clue
5293 that they're special.
5294
5295 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5296
5297 * alloc.c (Fgarbage_collect): Tweak docstring.
5298
5299 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5300
5301 Tweak the value returned from Fgarbage_collect again.
5302 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5303 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5304 Adjust documentation.
5305 (total_vector_bytes): Rename to total_vector_slots, adjust
5306 accounting.
5307 (total_free_vector_bytes): Rename to total_free_vector_slots,
5308 adjust accounting.
5309 (Qstring_bytes, Qvector_slots): New symbols.
5310 (syms_of_alloc): DEFSYM them.
5311
5312 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5313
5314 Buffer compaction primitive which may be used from Lisp.
5315 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5316 (syms_of_buffer): Register Fcompact_buffer.
5317 * alloc.c (Fgarbage_collect): Use compact_buffer.
5318 * buffer.h (compact_buffer): New prototype.
5319 (struct buffer_text): New member.
5320
5321 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5322
5323 New macro to iterate over all buffers, miscellaneous cleanups.
5324 * lisp.h (all_buffers): Remove declaration.
5325 * buffer.h (all_buffers): Add declaration, with comment.
5326 (for_each_buffer): New macro.
5327 * alloc.c (Fgarbage_collect, mark_object): Use it.
5328 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5329 (init_buffer): Likewise.
5330 * data.c (Fset_default): Likewise.
5331 * coding.c (code_conversion_restore): Remove redundant check
5332 for dead buffer.
5333 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5334
5335 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5336
5337 Fix bug that created negative-length intervals.
5338 * intervals.c (merge_interval_right, merge_interval_left):
5339 Do not zero out this interval if it is absorbed by its children,
5340 as this interval's total length doesn't change in that case. See
5341 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5342
5343 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5344
5345 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5346 when invoking (make-bool-vector N t) and N is a positive
5347 multiple of 8 -- the last 8 bits were mistakenly cleared.
5348
5349 Remove some struct layout assumptions in bool vectors.
5350 * alloc.c (bool_header_size): New constant.
5351 (header_size, word_size): Move earlier, as they're now used earlier.
5352 Use 'word_size' in a few more places, where it's appropriate.
5353 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5354 padding before the data member of a bool vector.
5355 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5356 than doing the check by hand with an abort ().
5357
5358 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5359
5360 * eval.c (Fdefvar): Don't check constants since we only set the var if
5361 it's not yet defined anyway (bug#11904).
5362
5363 * lisp.h (last_undo_boundary): Declare new var.
5364 * keyboard.c (command_loop_1): Set it.
5365 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5366 were auto-added by the command loop (bug#11774).
5367
5368 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5369
5370 * w32font.c (Qsymbol): Remove local definition.
5371 (syms_of_w32font): Don't DEFSYM it.
5372
5373 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5374
5375 Fix sweep_vectors to handle large bool vectors correctly.
5376 * alloc.c (sweep_vectors): Account total_vector_bytes for
5377 bool vectors larger than VBLOCK_BYTES_MAX.
5378
5379 2012-07-18 Chong Yidong <cyd@gnu.org>
5380
5381 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5382 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5383
5384 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5385
5386 Return more descriptive data from Fgarbage_collect.
5387 Suggested by Stefan Monnier in
5388 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5389 * alloc.c (bounded_number): New function.
5390 (total_buffers, total_vectors): New variable.
5391 (total_string_size): Rename to total_string_bytes, adjust users.
5392 (total_vector_size): Rename to total_vector_bytes, adjust users.
5393 (sweep_vectors): Account total_vectors and total_vector_bytes.
5394 (Fgarbage_collect): New return value. Adjust documentation.
5395 (gc_sweep): Account total_buffers.
5396 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5397 (VECTOR_SIZE): Remove.
5398 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5399 (Qinterval, Qmisc): New symbols.
5400 (syms_of_data): Initialize them.
5401 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5402 (Qcons, Qbuffer): New declarations.
5403
5404 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5405
5406 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5407 Round up, not down. Improve doc.
5408
5409 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5410
5411 Restore old code in allocate_string_data to avoid Faset breakage.
5412 Reported by Julien Danjou <julien@danjou.info> in
5413 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5414 * alloc.c (allocate_string_data): Restore old code with minor
5415 adjustments, fix comment to explain this subtle issue.
5416
5417 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5418
5419 Remove FILE_SYSTEM_CASE.
5420 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5421
5422 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5423 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5424 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5425 call-process-region passes it through expand-file-name.
5426
5427 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5428
5429 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5430
5431 Fix crash when creating indirect buffer (Bug#11917)
5432 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5433 Don't handle unbound variables specially if non-zero.
5434 (Fbuffer_local_variables): Pass zero.
5435 (clone_per_buffer_values): Pass non-zero.
5436
5437 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5438
5439 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5440 to make the loop interruptible.
5441
5442 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5443
5444 * gnutls.c (emacs_gnutls_handshake): Only retry if
5445 GNUTLS_E_INTERRUPTED.
5446
5447 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5448
5449 Cleanup and convert miscellaneous checks to eassert.
5450 * alloc.c (mark_interval): Fix comment, partially rephrase
5451 old comment from intervals.h (see below).
5452 * intervals.c (find_interval, adjust_intervals_for_insertion)
5453 (delete_interval, adjust_intervals_for_deletion)
5454 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5455 Convert to eassert.
5456 (adjust_intervals_for_insertion, make_new_interval):
5457 Remove obsolete and unused code.
5458 * intervals.h (struct interval): Remove obsolete comment.
5459 * textprotp.c (erase_properties): Remove unused code.
5460 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5461 (Fremove_list_of_text_properties): Convert to eassert.
5462
5463 2012-07-17 Chong Yidong <cyd@gnu.org>
5464
5465 * editfns.c (Finsert_char): Doc fix.
5466
5467 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5468
5469 Fix previous change to make Fmemory_free always accurate.
5470 * alloc.c (make_interval): Update total_free_intervals.
5471 (make_float): Likewise for total_free_floats.
5472 (free_cons, Fcons): Likewise for total_free_conses.
5473 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5474 Likewise for total_free_vector_bytes.
5475 (Fmake_symbol): Likewise for total_free_symbols.
5476 (bytes_free): Remove.
5477
5478 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5479
5480 Simple free memory accounting feature.
5481 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5482 (sweep_vectors): Accumulate size of free vectors.
5483 (Fgarbage_collect): Setup bytes_free.
5484 (Fmemory_free): New function.
5485 (syms_of_alloc): Register it.
5486
5487 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5488
5489 Cleanup overlays checking.
5490 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5491 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5492 eassert and OVERLAYP.
5493 (sort_overlays): Change to use OVERLAYP.
5494
5495 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5496
5497 * editfns.c (Finsert_char): Make it interactive, and make the
5498 second arg optional. Copy interactive spec and docstring from
5499 ucs-insert.
5500
5501 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5502
5503 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5504 Unlike the other wrapped functions, fabs has an unspecified
5505 effect on errno.
5506
5507 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5508
5509 * nsterm.m (keyDown): Interpret flags without left/right bits
5510 as the left key (Bug#11670).
5511
5512 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5513
5514 Remove empty and useless init functions.
5515 * lisp.h (init_character_once, init_fns, init_image)
5516 (init_filelock, init_sound): Remove prototype.
5517 * character.c (init_character_once): Remove.
5518 * filelock.c (init_filelock): Likewise.
5519 * fns.c (init_fns): Likewise.
5520 * image.c (init_image): Likewise.
5521 * sound.c (init_sound): Likewise.
5522 * emacs.c (main): Adjust accordingly.
5523
5524 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5525
5526 * gtkutil.h: Tiny cleanups.
5527 (use_old_gtk_file_dialog): Remove useless declaration.
5528 (xg_uses_old_file_dialog): Add suggested const attribute.
5529
5530 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5531
5532 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5533 (bidi_paragraph_init): Use it to limit search forward for a strong
5534 directional character in abnormally large paragraphs full of
5535 neutral or weak characters. (Bug#11943)
5536
5537 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5538
5539 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5540 the toolbar (Bug#9451).
5541 (xg_make_tool_item): Give the widget event box a transparent
5542 background.
5543
5544 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5545
5546 Cleanup basic allocation variables and functions.
5547 * alloc.c (ignore_warnings, init_intervals, init_float)
5548 (init_cons, init_symbol, init_marker): Remove.
5549 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5550 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5551 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5552 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5553 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5554 (staticidx, init_alloc_once, init_strings, free_ablock):
5555 Remove redundant initialization.
5556 * fns.c (init_weak_hash_tables): Remove.
5557 * lisp.h (init_weak_hash_tables): Remove prototype.
5558
5559 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5560
5561 Use zero_vector where appropriate.
5562 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5563 accordingly.
5564 * lisp.h (zero_vector): New declaration.
5565 * font.c (null_vector): Remove.
5566 (syms_of_font): Remove initialization and staticpro.
5567 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5568 * keymap.c (Faccessible_keymaps): Likewise.
5569
5570 2012-07-15 Leo Liu <sdl.web@gmail.com>
5571
5572 * fringe.c: Fix typo in comments.
5573
5574 2012-07-14 Leo Liu <sdl.web@gmail.com>
5575
5576 * fringe.c: Add a new bitmap exclamation-mark.
5577
5578 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5579
5580 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5581
5582 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5583 (HAVE_MENUS): Don't define, defined by editing config.in with
5584 msdos/sed2v2.inp.
5585 (GMALLOC_INHIBIT_VALLOC): Don't define.
5586 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5587
5588 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5589
5590 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5591
5592 2012-07-14 Glenn Morris <rgm@gnu.org>
5593
5594 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5595 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5596 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5597
5598 2012-07-13 Glenn Morris <rgm@gnu.org>
5599
5600 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5601
5602 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5603 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5604
5605 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5606
5607 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5608 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5609 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5610 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5611 where appropriate.
5612 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5613 as boolean expression.
5614 (x_set_window_size): Remove unused variable toolbar.
5615 (ns_get_color_default, ns_mod_to_lisp): Remove.
5616 (ns_mouse_position): Remove unused variables xchar and ychar.
5617 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5618 (ns_set_vertical_scroll_bar): Remove unused variable count.
5619 (ns_delete_terminal): Remove unused variable i.
5620 (ns_term_init): Remove unused variables r, g and b.
5621 (mouseDown): Remove unused variable window.
5622 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5623 (initFrameFromEmacs): Remove unused variable vbextra.
5624 (mouseEntered): Remove unused variables p and dpyinfo.
5625 (mouseExited): Remove unused variables p and r.
5626 (ns_define_frame_cursor, ns_clear_frame_area)
5627 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5628 (menuDown): Assign [sender tag] to variable and cast the variable.
5629
5630 * nsterm.h (menuDown): Add id as type to argument sender.
5631 (ns_display_info_for_name): Add Lisp_Object argument.
5632 (ns_term_init): Add Lisp_Object argument.
5633 (ns_map_event_to_object): Add void argument.
5634 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5635 prototype with arguments and only declare if __OBJC__.
5636 (nxatoms_of_nsselect): Add void argument.
5637 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5638 (ns_alloc_autorelease_pool): Add void argument.
5639 (ns_release_autorelease_pool): Add void* argument.
5640 (ns_get_defaults_value): Add const char* argument.
5641
5642 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5643 (initFromContents): Use SSDATA where appropriate.
5644 (ns_update_menubar): Add braces to ambigous if-else.
5645 (initWithTitle): Put () around assignment in if statement.
5646 (ns_menu_show): Remove unused variables window and keymap.
5647 (update_frame_tool_bar): Remove unused variable selected_p.
5648 (initWithContentRect): Remove unused variable this_cmd_name.
5649
5650 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5651 appropriate.
5652 (setXBMColor): Remove unused variable len.
5653 (setPixmapData): Put () around assignment in loop statement.
5654
5655 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5656 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5657 where appropriate.
5658 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5659 around assignment in loop statement.
5660 (nsfont_open): Remove unused variable i.
5661 (nsfont_open): Remove unused variable len.
5662 (nsfont_draw): Remove unused variable cs.
5663
5664 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5665 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5666 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5667 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5668 (Fns_font_name, Fns_perform_service)
5669 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5670 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5671 (ns_set_name): Remove unused variable view.
5672 (x_set_menu_bar_lines): Remove unused variable olines.
5673 (x_set_tool_bar_lines): Remove unused variable root_window.
5674 (Fns_list_colors): Put () around assignment in while statement.
5675 (Fns_perform_service): Remove unused variable len.
5676 (Fns_display_usable_bounds): Remove unused variable top.
5677 (syms_of_nsfns): Remove unused variable i.
5678
5679 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5680 memcpy (Bug#11907).
5681
5682 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5683
5684 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5685 and free it with DestroyExceptionInfo (Bug#11558).
5686
5687 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5688
5689 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5690 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5691 Set here, not in nt/config.nt.
5692
5693 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5694
5695 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5696 cursor overflow into the last glyph on display line when the right
5697 fringe is off. (Bug#11832)
5698
5699 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5700
5701 * xdisp.c (produce_special_glyphs): Now static.
5702 * dispextern.h (produce_special_glyphs): Remove decl.
5703
5704 2012-07-13 Glenn Morris <rgm@gnu.org>
5705
5706 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5707 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5708
5709 * s/usg5-4-common.h (USG, USG5):
5710 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5711 * s/sol2-6.h (SOLARIS2):
5712 * s/irix6-5.h (IRIX6_5):
5713 * s/hpux10-20.h (USG, USG5, HPUX):
5714 * s/gnu-linux.h (USG, GNU_LINUX):
5715 * s/freebsd.h (BSD_SYSTEM):
5716 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5717 * s/cygwin.h (CYGWIN):
5718 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5719 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5720
5721 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5722
5723 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5724
5725 2012-07-13 Glenn Morris <rgm@gnu.org>
5726
5727 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5728
5729 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5730
5731 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5732 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5733
5734 2012-07-12 Glenn Morris <rgm@gnu.org>
5735
5736 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5737
5738 * process.c (init_process_emacs): Rename from init_process.
5739 The old name is also the name of a Mach system call.
5740 * lisp.h, emacs.c: Update for this name change.
5741 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5742 longer needed.
5743
5744 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5745
5746 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5747 memmove call that removes glyphs covered by the left truncation
5748 glyph. Improve commentary.
5749 (display_line): Fix display of continuation glyphs on GUI frames
5750 when the right fringe is turned off and variable-size fonts are
5751 used in the window. Move the code that appends a stretch glyph to
5752 produce_special_glyphs, so that it could be used for truncation
5753 and continuation glyphs alike.
5754 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5755 glyph of a suitably computed width, to align the special glyphs at
5756 the window margin. Code moved from display_line. (Bug#11832)
5757
5758 2012-07-12 Glenn Morris <rgm@gnu.org>
5759
5760 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5761
5762 * s/gnu-linux.h, s/hpux10-20.h:
5763 Do not unconditionally define HAVE_XRMSETDATABASE.
5764
5765 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5766
5767 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5768
5769 Fix typos that broke OS X build.
5770 Reported by Randal L. Schwartz in
5771 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5772 * nsterm.m (ns_timeout): Add missing local decl.
5773 (ns_get_color): snprintf -> sprintf, to fix typo.
5774
5775 2012-07-12 Glenn Morris <rgm@gnu.org>
5776
5777 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5778 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5779 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5780 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5781
5782 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5783 Move PTY_OPEN to configure.
5784
5785 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5786 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5787 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5788
5789 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5790
5791 Use empty_unibyte_string where applicable.
5792 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5793 * lread.c (read1): Likewise.
5794 * xsettings.c (syms_of_xsettings): Likewise.
5795
5796 2012-07-12 Glenn Morris <rgm@gnu.org>
5797
5798 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5799 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5800 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5801 * s/hpux10-20.h (RUN_TIME_REMAP):
5802 * s/bsd-common.h (TABDLY): Move to configure.
5803
5804 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5805
5806 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5807
5808 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5809 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5810
5811 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5812
5813 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5814 * s/template.h: Move NARROWPROTO to configure.
5815
5816 2012-07-11 Glenn Morris <rgm@gnu.org>
5817
5818 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5819 unused since 2011-01-17 change to systty.h.
5820
5821 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5822 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5823 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5824
5825 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5826
5827 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5828
5829 2012-07-11 Glenn Morris <rgm@gnu.org>
5830
5831 * s/darwin.h, s/gnu-linux.h, s/template.h:
5832 Move INTERRUPT_INPUT to configure.
5833
5834 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5835
5836 Minor adjustments to interning code.
5837 * lisp.h (intern, intern_c_string): Redefine as static inline
5838 wrappers for intern_1 and intern_c_string_1, respectively.
5839 (intern_1, intern_c_string_1): Rename prototypes.
5840 * lread.c (intern_1, intern_c_string_1, oblookup):
5841 Simplify Vobarray checking.
5842 * font.c (font_intern_prop): Likewise. Adjust comment.
5843 * w32font.c (intern_font_name): Likewise.
5844
5845 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5846
5847 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5848
5849 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5850 of Fcar/Fcdr if possible.
5851 * font.c (check_otf_features): Likewise.
5852 * fontset.c (Fnew_fontset): Likewise.
5853 * gnutls.c (Fgnutls_boot): Likewise.
5854 * minibuf.c (read_minibuf): Likewise.
5855 * msdos.c (IT_set_frame_parameters): Likewise.
5856 * xmenu.c (Fx_popup_dialog): Likewise.
5857 * w32menu.c (Fx_popup_dialog): Likewise.
5858
5859 2012-07-11 Glenn Morris <rgm@gnu.org>
5860
5861 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5862 since nothing has defined it on these platforms.
5863
5864 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5865 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5866
5867 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5868 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5869 Move CLASH_DETECTION to configure.
5870
5871 * s/gnu.h: Remove file, which is now empty.
5872
5873 * s/gnu.h, s/gnu-linux.h:
5874 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5875
5876 2012-07-11 John Wiegley <johnw@newartisans.com>
5877
5878 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5879 function attribute, so we only use it if it exists in the
5880 compiler.
5881
5882 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5883
5884 Avoid call to strlen in fast_c_string_match_ignore_case.
5885 * search.c (fast_c_string_match_ignore_case): Change to use
5886 length argument. Adjust users accordingly.
5887 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5888
5889 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5890
5891 Assume mkdir, rmdir.
5892 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5893 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5894
5895 Assume rename.
5896 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5897
5898 Assume perror.
5899 * s/hpux10-20.h (HAVE_PERROR): Remove.
5900 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5901 Remove dummy definition, as this problem was obsolete long ago.
5902
5903 Assume strerror.
5904 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5905
5906 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5907
5908 Avoid calls to strlen in font processing functions.
5909 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5910 (font_open_by_name): Change to use length argument.
5911 Adjust users accordingly.
5912 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5913 Adjust prototypes.
5914 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5915 Change to return ptrdiff_t.
5916 (xfont_list_pattern, xfont_match): Use length returned by
5917 xfont_decode_coding_xlfd.
5918 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5919
5920 2012-07-11 Glenn Morris <rgm@gnu.org>
5921
5922 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5923 Move DONT_REOPEN_PTY to configure.
5924
5925 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5926 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5927
5928 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5929
5930 Remove "#define unix" that is no longer needed (Bug#11905).
5931 * s/aix4-2.h (unix): Remove; no longer needed.
5932
5933 EMACS_TIME simplification (Bug#11875).
5934 This replaces macros (which typically do not work in GDB)
5935 with functions, typedefs and enums, making the code easier to debug.
5936 The functional style also makes code easier to read and maintain.
5937 * systime.h: Include <sys/time.h> on all hosts, not just if
5938 WINDOWSNT, since 'struct timeval' is needed in general.
5939 (EMACS_TIME): Now a typedef, not a macro.
5940 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5941 not macros.
5942 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5943 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5944 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5945 (EMACS_TIME_LE): Now functions, not macros.
5946 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5947 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5948 which are not functions. All uses rewritten to use:
5949 (make_emacs_time): New function.
5950 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5951 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5952 not functions. All uses rewritten to use the following, respectively:
5953 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5954 (add_emacs_time, sub_emacs_time): New functions.
5955 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5956 * fileio.c (Fcopy_file):
5957 * xterm.c (XTflash): Get the current time closer to when it's used.
5958 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5959
5960 * bytecode.c (targets): Suppress -Woverride-init warnings.
5961
5962 Simplify by avoiding confusing use of strncpy etc.
5963 * doc.c (Fsnarf_documentation):
5964 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5965 * frame.c (Fmake_terminal_frame):
5966 * gtkutil.c (get_utf8_string):
5967 * lread.c (openp):
5968 * nsmenu.m (ns_update_menubar):
5969 * regex.c (regerror):
5970 Prefer memcpy to strncpy and strncat when either will do.
5971 * fileio.c (Fsubstitute_in_file_name):
5972 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5973 (menu_separator_name_p):
5974 * nsmenu.m (ns_update_menubar):
5975 Prefer memcmp to strncmp when either will do.
5976 * nsterm.m: Include <ftoastr.h>.
5977 (ns_get_color):
5978 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5979 Prefer snprintf to strncpy.
5980 * nsterm.m (ns_term_init):
5981 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5982 * nsterm.m (ns_term_init):
5983 Avoid the need for strncpy, by using build_string or
5984 make_unibyte_string directly. Use dtoastr, not snprintf.
5985 * process.c (Fmake_network_process): Diagnose service names that
5986 are too long, rather than silently truncating them or creating
5987 non-null-terminated names.
5988 (Fnetwork_interface_info): Likewise, for interface names.
5989 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5990 Prefer sprintf to strncat.
5991 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5992 Prefer vsnprintf to vsprintf + strncpy.
5993
5994 2012-07-10 Glenn Morris <rgm@gnu.org>
5995
5996 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5997 Clarify fallback case.
5998
5999 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6000
6001 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6002 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6003 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
6004 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
6005 where argument type is known to be a Lisp_Cons.
6006
6007 2012-07-10 Tom Tromey <tromey@redhat.com>
6008
6009 * bytecode.c (BYTE_CODE_THREADED): New macro.
6010 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6011 (enum byte_code_op): New type.
6012 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6013 (exec_byte_code): Use them. Use token threading when applicable.
6014
6015 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6016
6017 Optimize pure C strings initialization.
6018 * lisp.h (make_pure_string): Fix prototype.
6019 (build_pure_c_string): New function, defined as static inline. This
6020 provides a better opportunity to optimize away calls to strlen when
6021 the function is called with compile-time constant argument.
6022 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6023 argument, adjust users accordingly. Use build_pure_c_string where
6024 appropriate.
6025 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6026 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6027 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6028
6029 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6030
6031 Avoid calls to strlen in miscellaneous functions.
6032 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6033 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6034 * lread.c (openp): Likewise.
6035
6036 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6037
6038 Avoid calls to strlen in path processing functions.
6039 * fileio.c (file_name_as_directory): Add comment. Change to add
6040 srclen argument and return the length of result. Adjust users
6041 accordingly.
6042 (directory_file_name): Fix comment. Change to add srclen argument,
6043 swap 1st and 2nd arguments to obey the common convention.
6044 Adjust users accordingly.
6045 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6046
6047 2012-07-10 Glenn Morris <rgm@gnu.org>
6048
6049 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6050 Move PENDING_OUTPUT_COUNT definition to configure.
6051
6052 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6053 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6054 * s/gnu.h (DATA_START): Move definitions to configure.
6055
6056 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6057 We include usg5-4-common.h, which defines them both.
6058
6059 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6060 O_RDONLY already includes it).
6061
6062 Stop ns builds setting the EMACSLOADPATH environment variable.
6063 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6064 Now it does not set EMACSLOADPATH, just returns the load-path string.
6065 * nsterm.h: Update accordingly.
6066 * lread.c [HAVE_NS]: Include nsterm.h.
6067 (init_lread) [HAVE_NS]: Use ns_load_path.
6068 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6069
6070 2012-07-09 Glenn Morris <rgm@gnu.org>
6071
6072 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6073 since the included bsd-common.h does so.
6074
6075 Stop ns builds setting the EMACSPATH environment variable.
6076 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6077 (ns_init_paths): Do not set EMACSPATH.
6078 * nsterm.h (ns_exec_path): Add it.
6079 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6080 Use ns_exec_path.
6081
6082 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6083
6084 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6085
6086 * process.c (wait_reading_process_output): 'waitchannels' was unset
6087 when read_kbd || !NILP (wait_for_cell); fix this.
6088
6089 Add GCC-style 'const' attribute to functions that can use it.
6090 * character.h (char_resolve_modifier_mask):
6091 * keyboard.h (make_ctrl_char):
6092 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6093 (init_character_once, next_almost_prime, init_fns, init_image)
6094 (flush_pending_output, init_sound):
6095 * mem-limits.h (start_of_data):
6096 * menu.h (finish_menu_items):
6097 Add ATTRIBUTE_CONST.
6098 * emacs.c (DEFINE_DUMMY_FUNCTION):
6099 Declare the dummy function with ATTRIBUTE_CONST.
6100 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6101 Add decls with ATTRIBUTE_CONST.
6102
6103 Minor improvements to make_formatted_string.
6104 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6105 where int is good enough, as vsprintf returns an int.
6106 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6107
6108 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6109
6110 Use make_formatted_string to avoid double length calculation.
6111 * lisp.h (make_formatted_string): New prototype.
6112 * alloc.c (make_formatted_string): New function.
6113 * buffer.c (Fgenerate_new_buffer_name): Use it.
6114 * dbusbind.c (syms_of_dbusbind): Likewise.
6115 * editfns.c (Fcurrent_time_zone): Likewise.
6116 * filelock.c (get_boot_time): Likewise.
6117 * frame.c (make_terminal_frame, set_term_frame_name)
6118 (x_report_frame_params): Likewise.
6119 * image.c (gs_load): Likewise.
6120 * minibuf.c (get_minibuffer): Likewise.
6121 * msdos.c (dos_set_window_size): Likewise.
6122 * process.c (make_process): Likewise.
6123 * xdisp.c (ensure_echo_area_buffers): Likewise.
6124 * xsettings.c (apply_xft_settings): Likewise.
6125
6126 2012-07-09 Glenn Morris <rgm@gnu.org>
6127
6128 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6129 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6130 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6131 * nsterm.h (ns_etc_directory): Add it.
6132 * callproc.c [HAVE_NS]: Include nsterm.h.
6133 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6134
6135 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6136
6137 Move marker debugging code under MARKER_DEBUG.
6138 * marker.c (MARKER_DEBUG): Move marker debugging code under
6139 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6140 for bootstrap with --enable-checking (~3x slowdown reported
6141 by Juanma Barranquero <lekktu@gmail.com>).
6142 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6143
6144 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6145
6146 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6147 See <http://bugs.gnu.org/11825#29>.
6148
6149 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6150
6151 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6152 has no font, use the frame's font. (Bug#11813)
6153 (display_line): Add commentary about displaying truncation glyphs
6154 on GUI frames.
6155 (produce_special_glyphs): Move here from term.c.
6156
6157 * term.c (produce_special_glyphs): Move to xdisp.c.
6158
6159 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6160 section.
6161
6162 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6163
6164 * xdisp.c (display_line): Avoid warning about implicit declaration
6165 of FRAME_FONT.
6166
6167 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6168
6169 * lisp.h: Remove empty conditional.
6170
6171 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6172
6173 * lread.c (load_path_check): Now static.
6174
6175 Fix some minor --with-ns problems found by static checking.
6176 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6177 (x_set_font) [!HAVE_X_WINDOWS]:
6178 * image.c (xpm_load_image) [HAVE_NS]:
6179 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6180 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6181 Remove unused local.
6182 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6183 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6184 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6185 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6186 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6187 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6188 Fix pointer signedness problem.
6189 * xfaces.c (FRAME_X_FONT_TABLE):
6190 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6191
6192 2012-07-07 Glenn Morris <rgm@gnu.org>
6193
6194 * lread.c (load_path_check): New function, split from init_lread.
6195 (init_lread): Reorganize. Motivation:
6196 If EMACSLOADPATH is set, check/warn about that rather than the
6197 defaults, which we are not going to use. Hence we can remove
6198 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6199 Don't warn if site-lisp directories are missing.
6200 If not installed, start from a blank load-path, since
6201 PATH_LOADSEARCH refers to the eventual installation directories.
6202
6203 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6204
6205 Support truncation and continuation glyphs on GUI frames, when
6206 fringes are disabled. (Bug#11832)
6207 * xdisp.c (init_iterator): Get dimensions of truncation and
6208 continuation glyphs even if on GUI frames.
6209 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6210 or both, are absent.
6211 (start_display, move_it_in_display_line_to): Handle the case of a
6212 GUI frame without a fringe to display continuation or truncation
6213 glyphs.
6214 (insert_left_trunc_glyphs): Support GUI frames: make sure
6215 truncation glyphs overwrite enough glyphs from the current line to
6216 have sufficient space in pixels.
6217 (display_line): Support truncation and continuation glyphs on GUI
6218 frames. If some spare pixels are left on the line after inserting
6219 the truncation glyphs, fill that space with a stretch glyph of a
6220 suitably computed width.
6221
6222 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6223 produce_glyphs, to support GUI sessions.
6224
6225 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6226
6227 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6228
6229 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6230
6231 Do not require float-time's arg to fit in time_t (Bug#11825).
6232 This works better on hosts where time_t is unsigned, and where
6233 float-time is applied to the (negative) difference between two times.
6234 * editfns.c (decode_time_components): Last arg is now double *,
6235 not int *, and means to store all the result as a double, without
6236 worrying about whether the seconds part fits in time_t.
6237 All callers changed.
6238 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6239 All callers changed.
6240 (Ffloat_time): Do not fail merely because the specified time falls
6241 outside of time_t range.
6242
6243 2012-07-07 Glenn Morris <rgm@gnu.org>
6244
6245 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6246 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6247 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6248
6249 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6250
6251 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6252 Update dependencies.
6253
6254 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6255
6256 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6257
6258 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6259 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6260 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6261 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6262 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6263 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6264
6265 * xfont.c (compare_font_names): Redo to omit the need for casts.
6266
6267 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6268
6269 * xfns.c (Fx_change_window_property): Doc fix.
6270 * w32fns.c (Fx_change_window_property): Doc fix.
6271
6272 * w32fns.c (Fx_window_property): Accept the same arguments as the
6273 X Windows version. Doc fix.
6274 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6275
6276 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6277 Eli Zaretskii <eliz@gnu.org>
6278
6279 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6280 Windows-specific code from nt/config.nt moved here.
6281 Obsolete settings removed.
6282
6283 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6284
6285 * process.c: Avoid unnecessary calls to gettime.
6286 (wait_reading_process_output): Don't get the time of day
6287 when gobbling data immediately and not waiting, as there's no need
6288 for it in that case. This removes a FIXME.
6289
6290 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6291
6292 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6293 is defined (Bug#11768).
6294
6295 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6296
6297 Fix marker debugging code.
6298 * marker.c (byte_char_debug_check): Do not perform the check
6299 if buffer is not multibyte.
6300 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6301 Call byte_char_debug_check with correct arguments.
6302
6303 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6304
6305 Compile marker debugging code only if ENABLE_CHECKING is defined.
6306 * marker.c (byte_char_debug_check, count_markers):
6307 Use only if ENABLE_CHECKING is defined.
6308 (byte_debug_flag): Remove.
6309 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6310 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6311
6312 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6313
6314 Avoid code repetition in marker-related functions.
6315 * marker.c (attach_marker): New function.
6316 (Fset_marker, set_marker_restricted, set_marker_both)
6317 (set_marker_restricted_both): Use it.
6318 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6319 Consistently rename charno to charpos.
6320 (marker_position): Add eassert.
6321 (marker_byte_position): Convert to eassert.
6322
6323 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6324
6325 Simplify list operations in unchain_overlay and unchain_marker.
6326 * buffer.c (unchain_overlay): Simplify. Add comment.
6327 * marker.c (unchain_marker): Simplify. Fix comments.
6328
6329 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6330
6331 Introduce fast path for the widely used marker operation.
6332 * alloc.c (build_marker): New function.
6333 * lisp.h (build_marker): New prototype.
6334 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6335 * composite.c (autocmp_chars): Likewise.
6336 * editfns.c (buildmark): Remove.
6337 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6338 (save_restriction_save): Use build_marker.
6339 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6340 * window.c (save_window_save): Likewise.
6341
6342 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6343
6344 Do not use Fdelete_overlay in delete_all_overlays
6345 to avoid redundant calls to unchain_overlay.
6346 * buffer.c (drop_overlay): New function.
6347 (delete_all_overlays, Fdelete_overlay): Use it.
6348 * minibuf.c (get_minibuffer): Fix comment.
6349
6350 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6351
6352 Port to OpenBSD 5.1 amd64.
6353 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6354 This is needed for OpenBSD, and should be harmless on all BSD systems.
6355 Also, include <sys/sysctl.h>, as it should be available on all
6356 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6357 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6358 use p_pid member, not kp_proc.pid.
6359
6360 2012-07-06 Glenn Morris <rgm@gnu.org>
6361
6362 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6363
6364 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6365
6366 More xmalloc and related cleanup.
6367 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6368 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6369 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6370 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6371 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6372 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6373 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6374 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6375 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6376 * xterm.c:
6377 Omit needless casts involving void * pointers and allocation.
6378 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6379 as the former is more robust if P's type is changed.
6380 Prefer xzalloc to xmalloc + memset 0.
6381 Simplify malloc-or-realloc to realloc.
6382 Don't worry about xmalloc returning a null pointer.
6383 Prefer xstrdup to xmalloc + strcpy.
6384 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6385 growing it.
6386 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6387 alloca of a constant.
6388
6389 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6390
6391 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6392 hscroll is larger than the line width. Fixes long and futile
6393 looping inside extend_face_to_end_of_line (on a TTY) producing
6394 glyphs that are not needed and thrown away.
6395
6396 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6397
6398 * marker.c (set_marker_restricted_both): Simplify by using
6399 clip_to_bounds.
6400
6401 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6402
6403 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6404
6405 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6406
6407 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6408 not defined (Bug#11768).
6409 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6410 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6411 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6412 followed by gtk_box_set_homogeneous (Bug#11768).
6413 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6414 (update_theme_scrollbar_width, xg_create_scroll_bar):
6415 Use gtk_scrollbar_new (Bug#11768).
6416 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6417 (is_box_type): New function (Bug#11768).
6418 (xg_tool_item_stale_p): Call is_box_type.
6419 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6420 with default display (Bug#11768).
6421
6422 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6423
6424 * xdisp.c (window_hscroll_limited): New function.
6425 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6426 coordinates when window's hscroll is set to insanely large
6427 values. (Bug#11857)
6428
6429 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6430
6431 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6432 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6433
6434 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6435
6436 Cleanup xmalloc.
6437 * lisp.h (xzalloc): New prototype. Omit needless casts.
6438 * alloc.c (xzalloc): New function. Omit needless casts.
6439 * charset.c: Omit needless casts. Convert all calls to
6440 xmalloc with following memset to xzalloc.
6441 * dispnew.c: Likewise.
6442 * fringe.c: Likewise.
6443 * image.c: Likewise.
6444 * sound.c: Likewise.
6445 * term.c: Likewise.
6446 * w32fns.c: Likewise.
6447 * w32font.c: Likewise.
6448 * w32term.c: Likewise.
6449 * xfaces.c: Likewise.
6450 * xfns.c: Likewise.
6451 * xterm.c: Likewise.
6452 * atimer.c: Omit needless casts.
6453 * buffer.c: Likewise.
6454 * callproc.c: Likewise.
6455 * ccl.c: Likewise.
6456 * coding.c: Likewise.
6457 * composite.c: Likewise.
6458 * doc.c: Likewise.
6459 * doprnt.c: Likewise.
6460 * editfns.c: Likewise.
6461 * emacs.c: Likewise.
6462 * eval.c: Likewise.
6463 * filelock.c: Likewise.
6464 * fns.c: Likewise.
6465 * gtkutil.c: Likewise.
6466 * keyboard.c: Likewise.
6467 * lisp.h: Likewise.
6468 * lread.c: Likewise.
6469 * minibuf.c: Likewise.
6470 * msdos.c: Likewise.
6471 * print.c: Likewise.
6472 * process.c: Likewise.
6473 * region-cache.c: Likewise.
6474 * search.c: Likewise.
6475 * sysdep.c: Likewise.
6476 * termcap.c: Likewise.
6477 * terminal.c: Likewise.
6478 * tparam.c: Likewise.
6479 * w16select.c: Likewise.
6480 * w32.c: Likewise.
6481 * w32reg.c: Likewise.
6482 * w32select.c: Likewise.
6483 * w32uniscribe.c: Likewise.
6484 * widget.c: Likewise.
6485 * xdisp.c: Likewise.
6486 * xmenu.c: Likewise.
6487 * xrdb.c: Likewise.
6488 * xselect.c: Likewise.
6489
6490 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6491
6492 * fileio.c (time_error_value): Check the right error number.
6493 Problem reported by Troels Nielsen in
6494 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6495
6496 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6497
6498 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6499 This should be fixed in a better way; see Eli Zaretskii in
6500 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6501 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6502
6503 * fileio.c (time_error_value): Rename from special_mtime.
6504 The old name's problems were noted by Eli Zaretskii in
6505 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6506
6507 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6508 This variable's comment says Emacs needs at least one GDB-visible
6509 symbol of type enum pvec_type, to work around GDB problems.
6510 The symbol's value doesn't matter.
6511
6512 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6513 that causes compilation to fail on pre-C99 compilers.
6514
6515 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6516
6517 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6518 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6519
6520 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6521
6522 * buffer.c (init_buffer_once): Fix initialization of
6523 headers for buffer_defaults and buffer_local_symbols.
6524 Reported by Juanma Barranquero <lekktu@gmail.com>.
6525
6526 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6527
6528 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6529 * lisp.h (enum pvec_type): Use fewer bits.
6530 (PSEUDOVECTOR_SIZE_BITS): New constant.
6531 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6532 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6533 change in pvec_type.
6534 (PSEUDOVECTOR_TYPEP): New macro.
6535 (TYPED_PSEUDOVECTORP): Use it.
6536 * fns.c (internal_equal): Adapt code to extract pvectype.
6537 * emacs.c (gdb_pvec_type): Update type.
6538 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6539 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6540 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6541 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6542 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6543 abusing vector->header.next.nbytes.
6544 (live_vector_p): Use PVEC_TYPE.
6545 (mark_object): Adapt code to extract pvectype. Use switch.
6546
6547 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6548
6549 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6550 Tighten new eassert a bit.
6551
6552 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6553
6554 Fix compilation with --enable-gcc-warnings and -O1
6555 optimization level.
6556 * doprnt.c (doprnt): Change type of tem to int, initialize
6557 to avoid compiler warning. Add eassert.
6558 * search.c (simple_search): Initialize match_byte to avoid
6559 compiler warning. Add eassert.
6560
6561 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6562
6563 Avoid weird behavior with large horizontal scrolls.
6564 Without this change, for example, large hscroll values would
6565 mess up Emacs's display on Fedora 15 x86, presumably due to
6566 overflows in int calculations in the display code.
6567 Also, if buffers had long lines, Emacs would freeze.
6568 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6569 (set_window_hscroll): New function, containing the old guts of
6570 Fset_window_hscroll. Return the clipped value.
6571 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6572 This avoids the need to check against PTRDIFF_MAX.
6573
6574 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6575
6576 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6577
6578 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6579
6580 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6581
6582 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6583 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6584 since GCC 4.4.6 issues a bogus warning for them.
6585
6586 Fix bugs in file timestamp newness comparisons.
6587 * fileio.c (Ffile_newer_than_file_p):
6588 * lread.c (Fload): Use full timestamp resolution of files,
6589 not just the 1-second resolution, so that files that are only
6590 slightly newer still count as newer.
6591 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6592 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6593
6594 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6595
6596 * fileio.c: Improve handling of file time marker. (Bug#11852)
6597 (special_mtime): New function.
6598 (Finsert_file_contents, Fverify_visited_file_modtime):
6599 Use it to set special mtime values consistently.
6600
6601 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6602
6603 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6604 marker for non-existing file. (Bug#11852)
6605
6606 2012-07-03 Glenn Morris <rgm@gnu.org>
6607
6608 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6609 and did not make it into globals.h).
6610
6611 2012-07-03 Tom Tromey <tromey@redhat.com>
6612
6613 * window.c (Fset_window_margins, Fset_window_fringes)
6614 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6615 * textprop.c (Fprevious_property_change): No longer static.
6616 * syntax.c (Fsyntax_table_p): No longer static.
6617 * process.c (Fget_process, Fprocess_datagram_address): No longer
6618 static.
6619 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6620 * keyboard.c (Fcommand_execute): No longer static.
6621 Remove EXFUN.
6622 * insdel.c (Fcombine_after_change_execute): No longer static.
6623 * image.c (Finit_image_library): No longer static.
6624 * fileio.c (Fmake_symbolic_link): No longer static.
6625 * eval.c (Ffetch_bytecode): No longer static.
6626 * editfns.c (Fuser_full_name): No longer static.
6627 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6628 No longer static.
6629 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6630 static.
6631 * dired.c (Ffile_attributes): No longer static.
6632 * composite.c (Fcomposition_get_gstring): No longer static.
6633 * callproc.c (Fgetenv_internal): No longer static.
6634
6635 * ccl.h: Remove EXFUNs.
6636 * buffer.h: Remove EXFUNs.
6637 * dispextern.h: Remove EXFUNs.
6638 * intervals.h: Remove EXFUNs.
6639 * fontset.h: Remove EXFUN.
6640 * font.h: Remove EXFUNs.
6641 * dosfns.c (system_process_attributes): Remove EXFUN.
6642 * keymap.h: Remove EXFUNs.
6643 * lisp.h: Remove EXFUNs.
6644 * w32term.h: Remove EXFUNs.
6645 * window.h: Remove EXFUNs.
6646 * xsettings.h: Remove EXFUN.
6647 * xterm.h: Remove EXFUN.
6648
6649 2012-07-03 Glenn Morris <rgm@gnu.org>
6650
6651 * lisp.h (Frandom): Make it visible to C.
6652 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6653 buffer for invisible buffers. (Bug#1229)
6654
6655 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6656
6657 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6658 values which aren't power of 2.
6659 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6660 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6661 accordingly.
6662
6663 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6664
6665 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6666
6667 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6668
6669 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6670
6671 * alloc.c (allocate_vector_block): Remove redundant
6672 calls to mallopt if DOUG_LEA_MALLOC is defined.
6673 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6674 avoid calls to mallopt if zero_vector is returned.
6675
6676 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6677
6678 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6679 is enabled, avoid dereferencing NULL current_sblock if
6680 running undumped.
6681
6682 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6683
6684 Cleanup basic buffer management.
6685 * buffer.h (struct buffer): Change layout to use generic vector
6686 marking code. Fix some comments. Change type of 'clip_changed'
6687 to bitfield. Remove unused #ifndef old.
6688 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6689 (GET_OVERLAYS_AT): Fix indentation.
6690 (for_each_per_buffer_object_at): New macro.
6691 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6692 (Fbuffer_local_variables): Use it.
6693 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6694 * alloc.c (allocate_buffer): Adjust to match new layout of
6695 struct buffer. Fix comment.
6696 (mark_overlay): New function.
6697 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6698 Lisp area of struct buffer.
6699 (mark_object): Use it. Adjust marking of misc objects
6700 and related comments.
6701
6702 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6703
6704 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6705 wrapper that is not needed because the wrapped code is a no-op (zero
6706 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6707 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6708
6709 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6710
6711 * alloc.c (mark_buffer): Simplify. Remove prototype.
6712 (mark_object): Add comment. Reorganize marking of vector-like
6713 objects. Use CHECK_LIVE for all vector-like objects except buffers
6714 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6715 Avoid redundant calls to mark_vectorlike for bool vectors.
6716
6717 2012-06-30 Glenn Morris <rgm@gnu.org>
6718
6719 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6720
6721 * epaths.in (PATH_SITELOADSEARCH): New.
6722 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6723 This is rather than relying on --enable-locallisppath elements
6724 having "site-lisp" in their names. (Bug#10208#25, 11658)
6725
6726 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6727
6728 * w32proc.c (sys_select): Accept and ignore one more argument.
6729
6730 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6731
6732 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6733 (pselect) [!MS_DOS]: Redirect to sys_select.
6734
6735 * sysdep.c: Don't include dos.h and dosfns.h.
6736
6737 * process.c (sys_select):
6738 * msdos.c (sys_select): Accept one more argument and ignore it.
6739
6740 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6741 adapt data types and code to that.
6742
6743 * dosfns.c:
6744 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6745 which clashes with the gnulib function of the same name.
6746
6747 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6748
6749 * font.c (font_style_to_value, font_style_symbolic)
6750 (font_prop_validate_style): Add type checks for values in
6751 font_style_table.
6752
6753 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6754 argument.
6755 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6756 uses.
6757
6758 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6759
6760 * xdisp.c (try_window_id): Undo last change.
6761
6762 * w32.c (getwd): Adjust commentary about startup_dir.
6763 (init_environment): Always call sys_access, even in non-MSVC
6764 builds. Don't chdir to the directory of the Emacs executable.
6765 This undoes code from 1997 which was justified by the need to
6766 "avoid conflicts when removing and renaming directories". But its
6767 downside was that every relative file name was being interpreted
6768 relative to the directory of the Emacs executable, which can never
6769 be TRT. In particular, it broke sys_access when called with
6770 relative file names.
6771 (sys_access): Map GetLastError to errno.
6772
6773 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6774
6775 * window.h (struct window): Change type of 'fringes_outside_margins'
6776 to bitfield. Fix comment. Adjust users accordingly.
6777 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6778 Adjust comment.
6779 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6780 to ptrdiff_t.
6781
6782 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6783
6784 * gnutls.c (emacs_gnutls_handshake):
6785 Add QUIT to make the loop interruptible.
6786
6787 2012-06-29 Glenn Morris <rgm@gnu.org>
6788
6789 * charset.c (init_charset): Make lack of etc/charsets fatal.
6790
6791 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6792
6793 * editfns.c (region_limit): Fix type mismatch.
6794
6795 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6796
6797 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6798 undefined. Convert from xassert to eassert.
6799 * nsmenu.m: Convert from xassert to eassert.
6800 * nsterm.m: Likewise.
6801
6802 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6803
6804 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6805
6806 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6807
6808 Avoid integer overflow on scroll-left and scroll-right.
6809 * window.c (HSCROLL_MAX): New macro.
6810 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6811 overflow when requested scroll falls outside ptrdiff_t range.
6812
6813 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6814
6815 * window.h (struct window): Change type of 'hscroll',
6816 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6817 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6818 Adjust users accordingly.
6819 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6820 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6821 from EMACS_INT to ptrdiff_t.
6822 (make_window): Omit redundant initialization.
6823
6824 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6825
6826 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6827
6828 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6829
6830 * window.h (struct window): Change type of 'use_time' and
6831 'sequence_number' from Lisp_Object to int.
6832 * frame.c (make_frame): Adjust users accordingly.
6833 * print.c (print_object): Likewise.
6834 * window.c (select_window, Fwindow_use_time, make_parent_window)
6835 (make_window): Likewise.
6836
6837 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6838
6839 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6840 enabled with --enable-checking=[all,glyphs] configure option.
6841 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6842 adjust comments accordingly.
6843 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6844 undefined, adjust comments accordingly.
6845 * image.c: Likewise.
6846 * scroll.c: Likewise.
6847 * w32fns.c: Likewise.
6848 * w32term.c: Likewise.
6849 * xdisp.c: Likewise.
6850 * xfaces.c: Likewise.
6851 * xfns.c: Likewise.
6852 * xterm.c: Likewise.
6853
6854 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6855
6856 Generalize run-time debugging checks.
6857 * dispextern.h (XASSERTS): Remove.
6858 * fontset.c (xassert): Remove.
6859 Convert from xassert to eassert.
6860 * alloc.c: Convert from xassert to eassert.
6861 * bidi.c: Likewise.
6862 * dispnew.c: Likewise.
6863 * fns.c: Likewise.
6864 * fringe.c: Likewise.
6865 * ftfont.c: Likewise.
6866 * gtkutil.c: Likewise.
6867 * image.c: Likewise.
6868 * keyboard.c: Likewise.
6869 * menu.c: Likewise.
6870 * process.c: Likewise.
6871 * scroll.c: Likewise.
6872 * sound.c: Likewise.
6873 * term.c: Likewise.
6874 * w32console.c: Likewise.
6875 * w32fns.c: Likewise.
6876 * w32term.c: Likewise.
6877 * window.c: Likewise.
6878 * xdisp.c: Likewise.
6879 * xfaces.c: Likewise.
6880 * xfns.c: Likewise.
6881 * xselect.c: Likewise.
6882 * xterm.c: Likewise.
6883
6884 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6885
6886 * fns.c (maybe_resize_hash_table): Output message when growing the
6887 purify-hashtable.
6888
6889 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6890
6891 * alloc.c (allocate_string_data): Remove dead code.
6892 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6893 avoid GCC warning about unused macro.
6894
6895 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6896
6897 * alloc.c (allocate_string): Omit intervals initialization.
6898 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6899 as in make_pure_string and make_pure_c_string.
6900
6901 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6902
6903 * alloc.c (allocate_string): Fix last change.
6904
6905 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6906
6907 * alloc.c (allocate_string): Remove two redundant calls
6908 to memset, add explicit initialization where appropriate.
6909
6910 2012-06-27 Glenn Morris <rgm@gnu.org>
6911
6912 * lisp.mk (lisp): Remove paths.elc.
6913
6914 2012-06-27 Chong Yidong <cyd@gnu.org>
6915
6916 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6917
6918 2012-06-26 John Wiegley <johnw@newartisans.com>
6919
6920 * unexmacosx.c (copy_data_segment): Add two section names used
6921 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6922
6923 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6924 when building with Clang.
6925
6926 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6927
6928 * eval.c (Fapply): Allow calling it with a single argument.
6929
6930 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6931
6932 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6933 _stricmp and _strnicmp.
6934 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6935
6936 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6937
6938 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6939 allocated window.
6940 (allocate_process): Likewise for new process.
6941 (allocate_terminal): Change to use offsetof.
6942 (allocate_frame): Likewise.
6943 * frame.c (make_frame): Omit redundant initialization.
6944 * window.c (make_parent_window): Use memset.
6945 (make_window): Omit redundant initialization.
6946 * process.c (make_process): Omit redundant initialization.
6947 * terminal.c (create_terminal): Likewise.
6948
6949 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6950
6951 * term.c (delete_tty): Remove redundant call to memset.
6952
6953 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6954
6955 * alloc.c: Remove build_string.
6956 * lisp.h: Define build_string as static inline. This provides
6957 a better opportunity to optimize away calls to strlen when the
6958 function is called with compile-time constant argument.
6959 * image.c (imagemagick_error): Convert to build_string.
6960 * w32proc.c (sys_spawnve): Likewise.
6961 * xterm.c (x_term_init): Likewise.
6962
6963 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6964
6965 Use sprintf return value instead of invoking strlen on result.
6966 In the old days this wasn't portable, since some sprintf
6967 implementations returned char *. But they died out years ago and
6968 Emacs already assumes sprintf returns int.
6969 Similarly for float_to_string.
6970 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6971 * ccl.c (ccl_driver):
6972 * character.c (string_escape_byte8):
6973 * data.c (Fnumber_to_string):
6974 * doprnt.c (doprnt):
6975 * print.c (print_object):
6976 * xdisp.c (message_dolog):
6977 * xfns.c (syms_of_xfns):
6978 Use sprintf or float_to_string result to avoid need to call strlen.
6979 * data.c (Fnumber_to_string):
6980 Use make_unibyte_string, since the string must be ASCII.
6981 * lisp.h, print.c (float_to_string): Now returns int length.
6982 * term.c (produce_glyphless_glyph):
6983 Use sprintf result rather than recomputing it.
6984
6985 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6986 * Makefile.in (ALL_CFLAGS):
6987 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6988 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6989
6990 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6991
6992 * dispextern.h (xstrcasecmp): Define to library function
6993 strcasecmp if available.
6994 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6995
6996 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6997
6998 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6999 Avoid comma operator.
7000 * menu.c (push_submenu_start, push_submenu_end)
7001 (push_left_right_boundary, push_menu_pane): Likewise.
7002 * msdos.c (dos_rawgetc): Likewise.
7003
7004 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7005
7006 * xfns.c (xic_create_fontsetname): Remove redundant calls
7007 to memset.
7008
7009 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7010
7011 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7012 sprintf already null-terminates its output.
7013
7014 * xfns.c (x_window): Remove redundant cast.
7015
7016 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7017
7018 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7019 `const char *' to `char *' to avoid compiler warning.
7020
7021 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7022
7023 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7024 instead of truncating it to 63 (admittedly a generous limit).
7025
7026 * process.c: Fix spelling and caps in comments.
7027
7028 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7029
7030 * emacs.c (setpgrp): Remove definition, unused.
7031 * sysdep.c (setpgrp): Remove definition, not used in this file.
7032
7033 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7034
7035 * makefile.w32-in: Update dependencies.
7036
7037 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7038
7039 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7040 (SYSTIME_H): Add nt/inc/sys/time.h.
7041
7042 * systime.h [WINDOWSNT]: Include sys/time.h.
7043
7044 * s/ms-w32.h (struct timespec): Definition moved from
7045 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7046
7047 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7048
7049 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7050 * buffer.h (buffer_slot_type_mismatch):
7051 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7052 * eval.c (unwind_to_catch):
7053 * image.c (my_png_error, my_error_exit):
7054 * keyboard.c (quit_throw_to_read_char, user_error)
7055 (Fexit_recursive_edit, Fabort_recursive_edit):
7056 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7057 (wrong_type_argument, buffer_overflow, __executable_start)
7058 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7059 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7060 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7061 (fatal):
7062 (child_setup) [!DOS_NT]:
7063 * lread.c (end_of_file_error, invalid_syntax):
7064 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7065 * puresize.h (pure_write_error):
7066 * search.c (matcher_overflow):
7067 * sound.c (sound_perror, alsa_sound_perror):
7068 * sysdep.c, syssignal.h (croak):
7069 * term.c (maybe_fatal, vfatal):
7070 * textprop.c (text_read_only):
7071 * undo.c (user_error):
7072 * unexmacosx.c (unexec_error):
7073 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7074 Use _Noreturn rather than NO_RETURN.
7075 No need for separate decl merely because of _Noreturn.
7076 * sound.c (sound_warning, parse_sound):
7077 Remove unnecessary forward decls.
7078
7079 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7080
7081 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7082 * lisp.h (WAIT_READING_MAX): New macro.
7083 * dispnew.c (Fsleep_for, sit_for):
7084 * keyboard.c (kbd_buffer_get_event):
7085 * process.c (Faccept_process_output):
7086 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7087 This improves on the previous patch, which introduced a bug
7088 when time_t is unsigned and as wide as intmax_t.
7089 See <http://bugs.gnu.org/9000#51>.
7090
7091 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7092
7093 * dispnew.c (sit_for, Fsleep_for):
7094 * keyboard.c (kbd_buffer_get_event):
7095 * process.c (Faccept_process_output): Avoid compiler warnings when
7096 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7097
7098 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7099
7100 * makefile.w32-in: Update dependencies.
7101
7102 * w32.c (ltime): Add return type and declare static.
7103 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7104
7105 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7106
7107 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7108 Privately reported by Herbert J. Skuhra.
7109 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7110 All uses changed.
7111 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7112 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7113
7114 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7115
7116 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7117 last argument of make_unibyte_string.
7118
7119 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7120 language ID in the event parameters.
7121
7122 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7123 event.code, not the obscure "character set ID".
7124
7125 2012-06-23 Chong Yidong <cyd@gnu.org>
7126
7127 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7128
7129 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7130
7131 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7132 * w32.c (fdutimens): New function.
7133
7134 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7135
7136 * s/ms-w32.h (pselect): Redirect to sys_select.
7137
7138 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7139
7140 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7141 in the logic of incrementing and decrementing the value of
7142 use_relocatable_buffers.
7143
7144 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7145
7146 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7147 Privately reported by Herbert J. Skuhra.
7148 [__FreeBSD__]: Remove "*/" typo after "#include".
7149 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7150 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7151 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7152 Don't assume EMACS_TIME and struct timeval are the same type.
7153
7154 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7155
7156 Support higher-resolution time stamps (Bug#9000).
7157 The time stamps are only nanosecond-resolution at the C level,
7158 since that's the best that any real-world system supports now.
7159 But they are picosecond-resolution at the Lisp level, as that's
7160 easy, and leaves room for future OS improvements.
7161
7162 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7163 (LIBES): Use it.
7164
7165 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7166 Don't get current time unless it's needed.
7167
7168 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7169 now provides it if it's absent.
7170 (start_atimer): Port to higher-res time stamps.
7171 Check for time stamp overflow. Don't get current time more
7172 often than is needed.
7173
7174 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7175 Include systime.h, not time.h.
7176 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7177
7178 * dired.c: Include stat-time.h.
7179 (Ffile-attributes): File times now have higher resolution.
7180
7181 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7182 (struct image): Timestamp now has higher resolution.
7183
7184 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7185 has at least microseconds now. All uses removed.
7186 (update_frame, update_single_window, update_window, update_frame_1)
7187 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7188 (duration_to_sec_usec): Remove; no longer needed.
7189
7190 * editfns.c (time_overflow): Now extern.
7191 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7192 (float-time, Fformat_time_string, Fcurrent_time_string)
7193 (Fcurrent_time_zone): Accept and generate higher-resolution
7194 time stamps.
7195 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7196 (decode_time_components, lisp_seconds_argument): New functions.
7197 (make_time): Now static.
7198 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7199 Report an error if the time is invalid, rather than having the caller
7200 do that.
7201
7202 * fileio.c: Include <stat-time.h>
7203 (Fcopy_file): Copy higher-resolution time stamps.
7204 Prefer to set the time stamp via a file descriptor if that works.
7205 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7206 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7207 (Fvisited_file_modtime, Fset_visited_file_modtime):
7208 Support higher-resolution time stamps.
7209
7210 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7211
7212 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7213
7214 * image.c (prepare_image_for_display, clear_image_cache)
7215 (lookup_image): Port to higer-resolution time stamps.
7216
7217 * keyboard.c (start_polling, bind_polling_period):
7218 Check for time stamp overflow.
7219 (read_char, kbd_buffer_get_event, timer_start_idle)
7220 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7221 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7222 Port to higher-resolution time stamps. Do not assume time_t is signed.
7223 (decode_timer): New function. Timers are now vectors of length 9,
7224 not 8, to accommodate the picosecond component.
7225 (timer_check_2): Use it.
7226
7227 * nsterm.m (select_timeout, timeval_subtract): Remove.
7228 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7229 as they're a bit more accurate and handle overflow better.
7230 (ns_select): Change prototype to be compatible with pselect.
7231 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7232 * nsterm.h (ns_select): Adjust prototype.
7233
7234 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7235 us-resolution time stamps.
7236 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7237
7238 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7239
7240 * lisp.h (time_overflow): New decl.
7241 (wait_reading_process_output): First arg is now intmax_t, not int,
7242 to accommodate larger waits.
7243
7244 * process.h (struct Lisp_Process.read_output_delay):
7245 Now counts nanoseconds, not microseconds.
7246 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7247 EMACS_HAS_USECS.
7248 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7249 (wait_reading_process_output):
7250 Port to ns-resolution time stamps.
7251 (Faccept_process_output, wait_reading_process_output):
7252 Check for time stamp overflow. Do not assume time_t is signed.
7253 (select_wrapper): Remove; we now use pselect.
7254 (Fprocess_attributes): Now generates ns-resolution time stamps.
7255
7256 * sysdep.c: Include utimens.h. Don't include utime.h
7257 or worry about struct utimbuf; gnulib does that for us now.
7258 (gettimeofday): Remove; gnulib provides a substitute.
7259 (make_timeval): New function.
7260 (set_file_times): Now sets ns-resolution time stamps.
7261 New arg FD; all uses changed.
7262 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7263 (system_process_attributes):
7264 Now returns ns-resolution time stamp. All uses changed.
7265 Check for time stamp overflow.
7266
7267 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7268 provides a substitute now.
7269
7270 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7271 since it guarantees struct timespec.
7272 (EMACS_TIME): Now struct timespec, so that we can support
7273 ns-resolution time stamps.
7274 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7275 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7276 (EMACS_USECS): Remove.
7277 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7278 so multiply the arg by 1000 before storing it.
7279 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7280 New macros.
7281 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7282 Port to ns-resolution time stamps.
7283 (EMACS_TIME_NEG_P): Remove; replaced by....
7284 (EMACS_TIME_SIGN): New macro.
7285 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7286 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7287 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7288 (make_timeval, make_lisp_time, decode_time_components): New decls.
7289 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7290 that it mishandled time_t overflow. You can't compare by subtracting!
7291 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7292 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7293
7294 * term.c: Include <sys/time.h>.
7295 (timeval_to_Time): New function, for proper overflow wraparound.
7296 (term_mouse_position, term_mouse_click): Use it.
7297
7298 * undo.c (record_first_change): Support higher-resolution time stamps
7299 in the undo buffer.
7300 (Fprimitive_undo): Use them when restoring time stamps.
7301
7302 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7303 (w32_get_internal_run_time):
7304 Port to higher-resolution Emacs time stamps.
7305 (ltime): Now accepts single 64-bit integer, as that's more convenient
7306 for callers.
7307
7308 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7309
7310 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7311 for compatibility with pselect. Support ns-resolution time stamps.
7312
7313 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7314
7315 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7316 Check for time stamp overflow, and support ns-resolution time stamps.
7317
7318 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7319 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7320 (timeval_subtract): Remove; no longer needed.
7321 (XTflash, XTring_bell, x_wait_for_event):
7322 Port to ns-resolution time stamps. Don't assume time_t is signed.
7323
7324 2012-06-22 Chong Yidong <cyd@gnu.org>
7325
7326 * xdisp.c (x_consider_frame_title): Revert last change.
7327
7328 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7329
7330 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7331 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7332 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7333 staticidx goes up to 1597 out of 1600 = 0x640.)
7334
7335 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7336
7337 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7338 Otherwise, the umask might be mistakenly 0 while handling input signals.
7339
7340 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7341
7342 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7343
7344 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7345
7346 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7347 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7348 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7349 access to `contents' member of Lisp_Vector objects with AREF and ASET
7350 where appropriate.
7351
7352 2012-06-19 Chong Yidong <cyd@gnu.org>
7353
7354 * frame.c (delete_frame): When selecting a frame on a different
7355 text terminal, do not alter the terminal's top-frame.
7356
7357 * xdisp.c (format_mode_line_unwind_data): Record the target
7358 frame's selected window and its terminal's top-frame.
7359 (unwind_format_mode_line): Restore them.
7360 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7361 Callers changed.
7362 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7363 since tty frames can be explicitly named.
7364 (prepare_menu_bars): Likewise.
7365
7366 * term.c (Ftty_top_frame): New function.
7367
7368 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 Port byte-code-meter to modern targets.
7371 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7372 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7373 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7374 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7375 (METER_1, METER_2): Simplify.
7376
7377 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7378
7379 * data.c (Fdefalias): Return `symbol' (bug#11686).
7380
7381 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7382
7383 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7384 gets killed during executing of this function (Bug#11665).
7385 Try to always return Qt when the buffer has been actually killed.
7386 (Vkill_buffer_query_functions): In doc-string say that functions
7387 run by this hook should not change the current buffer.
7388
7389 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 Fix recently-introduced process.c problems found by static checking.
7392 * process.c (write_queue_push, write_queue_pop, send_process):
7393 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7394 (write_queue_pop): Fix pointer signedness problem.
7395 (send_process): Remove unused local.
7396
7397 2012-06-17 Chong Yidong <cyd@gnu.org>
7398
7399 * xdisp.c (redisplay_internal): No need to redisplay terminal
7400 frames that are not on top.
7401
7402 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7403
7404 * process.c (make_process): Initialize write_queue.
7405 (write_queue_push, write_queue_pop): New functions.
7406 (send_process): Use them to maintain correct ordering of process
7407 writes (Bug#10815).
7408
7409 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7410
7411 * lisp.h (eassert): Assume C89 or later.
7412 This removes the need for CHECK.
7413 (CHECK): Remove. Its comments about always evaluating its
7414 argument were confusing, as 'eassert' typically does not evaluate
7415 its argument.
7416
7417 * coding.c (produce_chars): Use ptrdiff_t, not int.
7418
7419 * xterm.c (x_draw_underwave): Check for integer overflow.
7420 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7421
7422 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7423
7424 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7425 referenced (Bug#11583).
7426
7427 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7428
7429 Implement wave-style variant of underlining.
7430 * dispextern.h (face_underline_type): New enum.
7431 (face): Add field for underline type.
7432 * nsterm.m (ns_draw_underwave): New function.
7433 (ns_draw_text_decoration): Use it.
7434 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7435 New functions.
7436 (x_draw_glyph_string): Use them.
7437 * xfaces.c (Qline, Qwave): New Lisp objects.
7438 (check_lface_attrs, merge_face_ref)
7439 (Finternal_set_lisp_face_attribute, realize_x_face):
7440 Handle wave-style underline face attributes.
7441 * xterm.c (x_draw_underwave): New function.
7442 (x_draw_glyph_string): Use it.
7443
7444 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7445
7446 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7447 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7448 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7449 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7450 ($(BLD)/w32select.$(O)): Update dependencies.
7451
7452 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7453
7454 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7455 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7456 * character.c (_fetch_multibyte_char_p): Remove.
7457 * alloc.c: Include "character.h" before "buffer.h".
7458 * bidi.c: Likewise.
7459 * buffer.c: Likewise.
7460 * bytecode.c: Likewise.
7461 * callint.c: Likewise.
7462 * callproc.c: Likewise.
7463 * casefiddle.c: Likewise.
7464 * casetab.c: Likewise.
7465 * category.c: Likewise.
7466 * cmds.c: Likewise.
7467 * coding.c: Likewise.
7468 * composite.c: Likewise.
7469 * dired.c: Likewise.
7470 * dispnew.c: Likewise.
7471 * doc.c: Likewise.
7472 * dosfns.c: Likewise.
7473 * editfns.c: Likewise.
7474 * emacs.c: Likewise.
7475 * fileio.c: Likewise.
7476 * filelock.c: Likewise.
7477 * font.c: Likewise.
7478 * fontset.c: Likewise.
7479 * fringe.c: Likewise.
7480 * indent.c: Likewise.
7481 * insdel.c: Likewise.
7482 * intervals.c: Likewise.
7483 * keyboard.c: Likewise.
7484 * keymap.c: Likewise.
7485 * lread.c: Likewise.
7486 * macros.c: Likewise.
7487 * marker.c: Likewise.
7488 * minibuf.c: Likewise.
7489 * nsfns.m: Likewise.
7490 * nsmenu.m: Likewise.
7491 * print.c: Likewise.
7492 * process.c: Likewise.
7493 * regex.c: Likewise.
7494 * region-cache.c: Likewise.
7495 * search.c: Likewise.
7496 * syntax.c: Likewise.
7497 * term.c: Likewise.
7498 * textprop.c: Likewise.
7499 * undo.c: Likewise.
7500 * unexsol.c: Likewise.
7501 * w16select.c: Likewise.
7502 * w32fns.c: Likewise.
7503 * w32menu.c: Likewise.
7504 * window.c: Likewise.
7505 * xdisp.c: Likewise.
7506 * xfns.c: Likewise.
7507 * xmenu.c: Likewise.
7508 * xml.c: Likewise.
7509 * xselect.c: Likewise.
7510
7511 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7512
7513 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7514 If all the glyphs of the glyph row came from strings, and we have no
7515 cursor positioning clues, put the cursor on the first glyph of the
7516 row.
7517 (handle_face_prop): Use chunk-relative overlay string index when
7518 indexing into it->string_overlays array. (Bug#11653)
7519 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7520 the rightmost. (Bug#11720)
7521
7522 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7523
7524 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7525 (CATEGORY_MEMBER): Enforce 1/0 value.
7526 * category.c (_temp_category_set): Remove.
7527
7528 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7529
7530 * window.c (Fdelete_other_windows_internal)
7531 (Fdelete_window_internal): Don't access frame's mouse highlight
7532 info of the initial frame. (Bug#11677)
7533
7534 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7535
7536 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7537 Assume USE_2_TAGS_FOR_INTS.
7538 (xreload): Adjust $tagmask width to match recent lisp.h change.
7539
7540 Simplify lisp.h in minor ways that should not affect code.
7541 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7542 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7543 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7544 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7545 (INTTYPEBITS): New macro, for clarity.
7546 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7547 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7548 Simplify now that USE_LSB_TAG is always defined.
7549 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7550 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7551
7552 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7553
7554 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7555
7556 2012-06-13 Glenn Morris <rgm@gnu.org>
7557
7558 * s/bsd-common.h (BSD4_3):
7559 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7560
7561 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7562
7563 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7564 instead of union.
7565 (XLI, XIL): Define.
7566 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7567 Use them.
7568 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7569 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7570 * alloc.c (widen_to_Lisp_Object): Remove.
7571 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7572 * frame.c (delete_frame): Remove outdated comment.
7573 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7574 USE_LISP_UNION_TYPE.
7575 (Fw32_unregister_hot_key): Likewise.
7576 (Fw32_toggle_lock_key): Likewise.
7577 * w32menu.c (add_menu_item): Likewise.
7578 (w32_menu_display_help): Use XIL instead of checking
7579 USE_LISP_UNION_TYPE.
7580 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7581 (init_heap): Likewise.
7582 * w32term.c (w32_read_socket): Update comment.
7583
7584 2012-06-13 Glenn Morris <rgm@gnu.org>
7585
7586 * s/usg5-4-common.h, src/s/unixware.h:
7587 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7588
7589 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7590
7591 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7592
7593 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7594 * alloc.c (make_number) [!defined make_number]:
7595 Remove, as lisp.h always defines this now.
7596 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7597 (roundup_size): Verify that it is a power of 2.
7598 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7599 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7600 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7601 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7602 USE_LSB_TAG now is always defined to be either 0 or 1.
7603 All uses changed.
7604 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7605 code works fine either way, and efficiency is not a concern here,
7606 as the union type is for debugging, not for production.
7607 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7608 Use an inline function on all platforms when using the union type,
7609 since this is simpler and 'static inline' can be used portably
7610 within Emacs now.
7611 (LISP_INITIALLY_ZERO): New macro.
7612 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7613 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7614
7615 2012-06-12 Glenn Morris <rgm@gnu.org>
7616
7617 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7618
7619 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7620
7621 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7622 Move BROKEN_SIGIO to configure.
7623
7624 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7625 Move NO_TERMIO to configure.
7626
7627 2012-06-12 Chong Yidong <cyd@gnu.org>
7628
7629 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7630 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7631 MagickExportImagePixels is undefined.
7632
7633 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * image.c (imagemagick_load_image): Remove unused label.
7636
7637 2012-06-11 Glenn Morris <rgm@gnu.org>
7638
7639 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7640 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7641 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7642 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7643
7644 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7645
7646 * alloc.c (make_byte_code): New function.
7647 (Fmake_byte_code): Use it. Don't purify here.
7648 * lread.c (read1): Use it as well to avoid extra allocation.
7649
7650 2012-06-11 Chong Yidong <cyd@gnu.org>
7651
7652 * image.c (imagemagick_load_image): Implement transparency.
7653
7654 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7655
7656 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7657 account for preceding backslashes. (Bug#11663)
7658
7659 2012-06-09 Chong Yidong <cyd@gnu.org>
7660
7661 * term.c: Support italics in capable terminals (Bug#9652).
7662 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7663 (turn_on_face): Output using TS_enter_italic_mode if available.
7664 Don't handle unused blinking and alt-charset cases.
7665 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7666 and tty_alt_charset_p cases.
7667 (tty_capable_p, init_tty): Support italics.
7668
7669 * termchar.h (struct tty_display_info): Add field for italics.
7670 Remove unused blink field.
7671
7672 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7673 Handle slant.
7674
7675 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7676 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7677 tty_alt_charset_p. Add tty_italic_p.
7678
7679 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7680
7681 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7682 dbus_type_is_basic if available.
7683 (xd_extract_signed, xd_extract_unsigned): Rename from
7684 extract_signed and extract_unsigned, respectively. Adapt callers.
7685
7686 2012-06-09 Chong Yidong <cyd@gnu.org>
7687
7688 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7689
7690 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7691 case (Bug#9752).
7692
7693 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7694
7695 * xdisp.c (vmessage): Treat frame message as multibyte.
7696 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7697 would generate the diagnostic "Making \302\247 buffer-local while
7698 let-bound!".
7699
7700 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7701
7702 * dispnew.c (showing_window_margins_p): Undo last change, which
7703 was done due to an inadvertent commit.
7704 (adjust_frame_glyphs_for_frame_redisplay): Do call
7705 showing_window_margins_p.
7706
7707 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7708
7709 * eval.c (Fmake_var_non_special): New primitive.
7710 (syms_of_eval): Defsubr it.
7711 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7712
7713 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7714
7715 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7716 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7717
7718 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7719
7720 * alloc.c (allocate_vectorlike): Fix last change.
7721
7722 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7723
7724 Block-based vector allocation of small vectors.
7725 * lisp.h (struct vectorlike_header): New field `nbytes',
7726 adjust comment accordingly.
7727 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7728 to denote vector blocks. Adjust users (live_vector_p,
7729 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7730 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7731 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7732 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7733 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7734 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7735 (roundup_size): New constant.
7736 (struct vector_block): New data type.
7737 (vector_blocks, vector_free_lists, zero_vector): New variables.
7738 (all_vectors): Rename to `large_vectors'.
7739 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7740 (sweep_vectors): New functions.
7741 (allocate_vectorlike): Return `zero_vector' as the only vector of
7742 0 items. Allocate new vector from block if vector size is less than
7743 or equal to VBLOCK_BYTES_MAX.
7744 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7745 (init_alloc_once): Add call to init_vectors.
7746
7747 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7748
7749 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7750
7751 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7752
7753 * doprnt.c (doprnt): Truncate multibyte char correctly.
7754 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7755 would mishandle a string argument "Xc" if X was a multibyte
7756 character of length 2: it would truncate after X's first byte
7757 rather than including all of X.
7758
7759 2012-06-06 Chong Yidong <cyd@gnu.org>
7760
7761 * buffer.c (word_wrap): Doc fix.
7762
7763 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7764
7765 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7766
7767 2012-06-03 Glenn Morris <rgm@gnu.org>
7768
7769 * xdisp.c (tool-bar-style): Doc fix.
7770
7771 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7772
7773 * Makefile.in (PAXCTL): Define.
7774 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7775 binary via PaX flags if the paxctl utility is available.
7776 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7777 Restore PaX flags to their default. (Bug#11398)
7778
7779 2012-06-03 Chong Yidong <cyd@gnu.org>
7780
7781 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7782 buffer (Bug#11226).
7783
7784 2012-06-03 Chong Yidong <cyd@gnu.org>
7785
7786 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7787 (note_mode_line_or_margin_highlight): If there is no help echo,
7788 use mode-line-default-help-echo. Handle the case where the mouse
7789 position is past the end of the mode line string.
7790
7791 * buffer.c (buffer_local_value_1): New function, split from
7792 Fbuffer_local_value; can return Qunbound.
7793 (Fbuffer_local_value): Use it.
7794 (Vmode_line_format): Docstring tweaks.
7795
7796 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7797
7798 * sysdep.c (system_process_attributes): Improve comment.
7799
7800 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7801
7802 * keyboard.c: Export real-this-command to Elisp.
7803 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7804 and DEFVAR it. Update all users.
7805
7806 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7807
7808 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7809
7810 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7811 Convert pctcpu and pctmem to Lisp float properly.
7812 Let the compiler fold better, as 100.0/0x8000 is exact.
7813
7814 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7815
7816 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7817 cons_block.
7818
7819 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7820
7821 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7822
7823 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7824
7825 For a 'struct window', replace some Lisp_Object fields to
7826 bitfields where appropriate, remove unused fields.
7827 * window.h (struct window): Remove unused 'last_mark_x' and
7828 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7829 change its type from Lisp_Object to bitfield.
7830 Change type of 'force_start', 'optional_new_start',
7831 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7832 fields from Lisp_Object to bitfield. Adjust users accordingly.
7833
7834 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7835
7836 Pacify gcc -Wdouble-precision when using Xaw.
7837 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7838 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7839 Use 'float' consistently, rather than 'float' in most places
7840 and 'double' in a couple of places.
7841
7842 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7843
7844 * xdisp.c (handle_stop): Detect whether we have overlay strings
7845 loaded by testing it->current.overlay_string_index to be
7846 non-negative, instead of checking whether n_overlay_strings is
7847 positive. (Bug#11587)
7848
7849 2012-05-31 Chong Yidong <cyd@gnu.org>
7850
7851 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7852
7853 * doc.c (Fsubstitute_command_keys): Doc fix.
7854
7855 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7856
7857 * search.c (search_buffer): Remove calls to
7858 r_alloc_inhibit_buffer_relocation, as it is now called by
7859 maybe_unify_char, which was the cause of relocation of buffer text
7860 in bug#11519.
7861
7862 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7863
7864 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7865 for the duration of call to load_charset, to avoid problems with
7866 callers of maybe_unify_char that access buffer text through C
7867 pointers.
7868
7869 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7870 decrement the inhibition flag, instead of just setting or
7871 resetting it.
7872
7873 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7874
7875 Remove obsolete '#define static' cruft.
7876 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7877 This #undef was "temporary" in 2000; it is no longer needed
7878 now that '#define static' has gone away.
7879 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7880 (gray_bitmap_bits): Remove; no longer needed.
7881 All uses replaced with definiens.
7882 * xterm.c: Include "bitmaps/gray.xbm".
7883
7884 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7885
7886 Clean up __executable_start, monstartup when --enable-profiling.
7887 The following changes affect the code only when profiling.
7888 * dispnew.c (__executable_start): Rename from safe_bcopy.
7889 Define only on platforms that need it.
7890 * emacs.c: Include <sys/gmon.h> when profiling.
7891 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7892 (__executable_start): Remove decl, since lisp.h does it now.
7893 (safe_bcopy): Remove decl; no longer has that name.
7894 (main): Coalesce #if into single bit of code, for simplicity.
7895 Cast pointers to uintptr_t, since standard libraries want integers
7896 and not pointers.
7897 * lisp.h (__executable_start): New decl.
7898
7899 2012-05-31 Glenn Morris <rgm@gnu.org>
7900
7901 * image.c (Fimagemagick_types): Doc fix.
7902
7903 2012-05-30 Jim Meyering <meyering@redhat.com>
7904
7905 * callproc.c (Fcall_process_region): Include directory component
7906 in mkstemp error message (Bug#11586).
7907
7908 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7909
7910 * alloc.c, lisp.h (make_pure_vector): Now static.
7911
7912 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7913
7914 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7915 Move to byte-run.el.
7916 (Fautoload): Do the hash-doc more carefully.
7917 * data.c (Fdefalias): Purify definition, except for keymaps.
7918 (Qdefun): Move from eval.c.
7919 * lisp.h (Qdefun): Remove.
7920 * lread.c (read1): Tiny simplification.
7921
7922 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7923
7924 Do not create empty overlays with the evaporate property (Bug#9642).
7925 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7926 Bug#9642, but explicitly check that the buffer the overlay would
7927 be moved to is live and rearrange lines to make sure that errors
7928 will not put the overlay in an inconsistent state.
7929 (Fdelete_overlay): Cosmetics.
7930
7931 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7932
7933 * w32term.c (my_bring_window_to_top): New function.
7934 (x_raise_frame): Use handle returned by DeferWindowPos, which
7935 could be different from the original one.
7936 Call my_bring_window_to_top instead of my_set_foreground_window.
7937 (Bug#11513)
7938
7939 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7940 by calling BringWindowToTop.
7941
7942 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7943 (WM_EMACS_END): Increase by one.
7944
7945 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7946
7947 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7948 This avoids undefined behavior that might cause the eassert
7949 to not catch an out-of-range value.
7950
7951 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7952
7953 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7954 Update dependencies.
7955
7956 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7957
7958 * bidi.c (bidi_mirror_char): Fix last change.
7959
7960 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7961
7962 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7963 when referring to sectname field in printf format.
7964
7965 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7966
7967 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7968 Only r_alloc_inhibit_buffer_relocation needed to be added;
7969 the others were already declared.
7970
7971 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7972 before checking whether it's out of range. Put the check inside
7973 eassert. See
7974 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7975
7976 2012-05-27 Ken Brown <kbrown@cornell.edu>
7977
7978 * callproc.c (Fcall_process): Restore a line that was accidentally
7979 commented out in the 2011-02-13 change (bug#11547).
7980
7981 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7982
7983 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7984 defined on ralloc.c.
7985
7986 * buffer.c [REL_ALLOC]: Remove prototypes of
7987 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7988 they are now on lisp.h.
7989
7990 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7991
7992 * search.c (search_buffer): Use it to inhibit relocation of buffer
7993 text while re_search_2 is doing its job, because re_search_2 is
7994 passed C pointers to buffer text. (Bug#11519)
7995
7996 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7997 Update value to 24.
7998
7999 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8000 state after an additional call to move_it_in_display_line_to, keep
8001 the values of it->max_ascent and it->max_descent found for the
8002 entire line.
8003 (pos_visible_p): Revert the comparison against bottom_y to what it
8004 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8005 (Bug#11464)
8006
8007 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8008
8009 Fix coding-related core dumps with gcc -ftrapv.
8010 The code was computing A - B, where A and B are pointers, and B is
8011 random garbage. This can lead to core dumps on platforms that
8012 have special pointer registers, and it also leads to core dumps on
8013 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8014 A - B only when B is initialized properly.
8015 * coding.c (coding_set_source, coding_set_destination): Return void.
8016 (coding_change_source, coding_change_destinations): New functions,
8017 with the old behaviors of coding_set_source and coding_set_destination.
8018 All callers that need an offset changed to use these new functions.
8019
8020 2012-05-26 Glenn Morris <rgm@gnu.org>
8021
8022 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8023
8024 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8025
8026 Extend mouse support on W32 text-mode console.
8027 * xdisp.c (draw_row_with_mouse_face):
8028 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8029
8030 * w32console.c: Include window.h.
8031 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8032 New functions.
8033 (initialize_w32_display): Initialize mouse-highlight data.
8034
8035 * w32inevt.c: Include termchar.h and window.h.
8036 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8037 moves, call note_mouse_highlight. If help_echo changed, call
8038 gen_help_event to produce help-echo message in the echo area.
8039 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8040 highlight info.
8041
8042 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8043
8044 * lread.c (read1): Simplify slightly to avoid an overflow warning
8045 with GCC 4.7.0 on x86-64.
8046
8047 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8048
8049 * bidi.c (bidi_mirror_char): Revert last change: an int is
8050 definitely wide enough here.
8051
8052 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8053
8054 Fix integer width and related bugs (Bug#9874).
8055 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8056 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8057 (string_bytes, check_sblock, allocate_string_data):
8058 (compact_small_strings, Fmake_bool_vector, make_string)
8059 (make_unibyte_string, make_multibyte_string)
8060 (make_string_from_bytes, make_specified_string)
8061 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8062 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8063 (mark_vectorlike):
8064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8065 (allocate_pseudovector):
8066 Use int, not EMACS_INT, where int is wide enough.
8067 (inhibit_garbage_collection, Fgarbage_collect):
8068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8069 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8070 int might not be wide enough.
8071 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8072 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8073 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8074 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8075 (bidi_level_of_next_char, bidi_move_to_visually_next):
8076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8077 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8078 (Fkill_buffer, Fset_buffer_major_mode)
8079 (advance_to_char_boundary, Fbuffer_swap_text)
8080 (Fset_buffer_multibyte, overlays_at, overlays_in)
8081 (overlay_touches_p, struct sortvec, record_overlay_string)
8082 (overlay_strings, recenter_overlay_lists)
8083 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8084 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8085 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8086 (Foverlay_recenter, last_overlay_modification_hooks_used)
8087 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8089 (validate_region): Omit unnecessary test for b <= e,
8090 since that's guaranteed by the previous test.
8091 (adjust_overlays_for_delete): Avoid pos + length overflow.
8092 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8093 (report_overlay_modification):
8094 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8095 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8096 Omit pointer cast, which isn't needed anyway, and doesn't work
8097 after the EMACS_INT -> ptrdiff_t change.
8098 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8099 * buffer.h: Adjust decls to match defn changes elsewhere.
8100 (struct buffer_text, struct buffer):
8101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8102 Use EMACS_INT, not int, where int might not be wide enough.
8103 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8104 not int, to avoid needless 32-bit limit on 64-bit hosts.
8105 (exec_byte_code): Use tighter memory-full test, one that checks
8106 for alloca overflow. Don't compute the address of the object just
8107 before an array, as that's not portable. Use EMACS_INT, not
8108 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8109 * callint.c (Fcall_interactively):
8110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8111 * callproc.c (call_process_kill, Fcall_process):
8112 Don't assume pid_t fits into an Emacs fixnum.
8113 (call_process_cleanup, Fcall_process, child_setup):
8114 Don't assume pid_t fits into int.
8115 (call_process_cleanup, Fcall_process, delete_temp_file)
8116 (Fcall_process_region):
8117 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8118 (Fcall_process): Simplify handling of volatile integers.
8119 Use int, not EMACS_INT, where int will do.
8120 * casefiddle.c (casify_object, casify_region, operate_on_word)
8121 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8123 (casify_object): Avoid integer overflow when overallocating buffer.
8124 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8125 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8126 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8127 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8128 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8129 integers are now checked earlier. All uses replaced with XINT.
8130 (ccl_driver):
8131 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8132 For CCL_MapSingle, check that content and value are in int range.
8133 (ccl_driver, Fregister_code_conversion_map):
8134 Check that Vcode_version_map_vector is a vector.
8135 (resolve_symbol_ccl_program): Check that vector header is in range.
8136 Always copy the vector, so that we can check its contents reliably
8137 now rather than having to recheck each instruction as it's being
8138 executed. Check that vector words fit in 'int'.
8139 (ccl_get_compiled_code, Fregister_ccl_program)
8140 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8141 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8142 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8143 contents are in range.
8144 (Fccl_execute_on_string): Check that status is in range.
8145 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8146 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8147 Accept and return EMACS_INT, not int, because callers can pass values
8148 out of 'int' range.
8149 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8150 (multibyte_chars_in_text, parse_str_as_multibyte)
8151 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8152 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8153 (string_escape_byte8, Fget_byte):
8154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8155 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8156 avoid mishandling large integers.
8157 * character.h: Adjust decls to match defn changes elsewhere.
8158 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8159 (Ffind_charset_region):
8160 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8161 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8162 (load_charset_map_from_vector, Fdefine_charset_internal):
8163 Don't assume fixnum fits in int.
8164 (load_charset_map_from_vector, Fmap_charset_chars):
8165 Remove now-unnecessary CHECK_NATNUMs.
8166 (Fdefine_charset_internal): Check ranges here, more carefully.
8167 Don't rely on undefined behavior with signed left shift overflow.
8168 Don't assume unsigned int fits into fixnum, or that fixnum fits
8169 into unsigned int. Don't require max_code to be a valid fixnum;
8170 that's not true for gb10830 4-byte on a 32-bit host. Allow
8171 invalid_code to be a cons, for the same reason. Require code_offset
8172 to be a character. Avoid int overflow if max_char is close
8173 to INT_MAX.
8174 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8175 this is intended anyway and avoids some undefined behavior.
8176 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8177 INDEX_TO_CODE_POINT, as that's what it expects.
8178 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8179 * charset.h (DECODE_CHAR): Return int, not unsigned;
8180 this is what was intended anyway, and it avoids undefined behavior.
8181 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8182 integer-overflow issues.
8183 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8184 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8185 where the argument is EMACS_INT, and this behavior is not intended.
8186 * chartab.c (Fmake_char_table, Fset_char_table_range)
8187 (uniprop_get_decoder, uniprop_get_encoder):
8188 Don't assume fixnum fits in int.
8189 * cmds.c (move_point): New function, that does the gist of
8190 Fforward_char and Fbackward_char, but does so while checking
8191 for integer overflow more accurately.
8192 (Fforward_char, Fbackward_char): Use it.
8193 (Fforward_line, Fend_of_line, internal_self_insert)
8194 (internal_self_insert):
8195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8196 Fix a FIXME, by checking for integer overflow when calculating
8197 target_clm and actual_clm.
8198 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8199 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8200 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8201 (coding_alloc_by_making_gap, alloc_destination)
8202 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8203 (encode_coding_utf_16, detect_coding_emacs_mule)
8204 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8205 (detect_coding_iso_2022, decode_coding_iso_2022)
8206 (encode_invocation_designation, encode_designation_at_bol)
8207 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8208 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8209 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8210 (encode_coding_ccl, encode_coding_raw_text)
8211 (detect_coding_charset, decode_coding_charset)
8212 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8213 (produce_composition, produce_charset, produce_annotation)
8214 (decode_coding, handle_composition_annotation)
8215 (handle_charset_annotation, consume_chars, decode_coding_gap)
8216 (decode_coding_object, encode_coding_object, detect_coding_system)
8217 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8218 (code_convert_region, code_convert_string)
8219 (Fdefine_coding_system_internal)
8220 (coding_set_source, coding_set_destination):
8221 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8222 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8223 (Fdefine_coding_system_internal):
8224 Don't assume fixnums fit in int.
8225 (decode_coding_gap, decode_coding_object, encode_coding_object)
8226 (Fread_coding_system, Fdetect_coding_region)
8227 (Funencodable_char_position, Fcheck_coding_systems_region)
8228 (get_translation, handle_composition_annotation, consume_chars):
8229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8230 (consume_chars): Rewrite to not calculate an address outside buffer.
8231 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8232 Don't access memory outside of the args array.
8233 (Fdefine_coding_system_internal): Check for charset-id overflow.
8234 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8235 result of ENCODE_CHAR.
8236 * coding.h: Adjust decls to match defn changes elsewhere.
8237 (struct coding_system):
8238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8239 * composite.c (get_composition_id, find_composition)
8240 (run_composition_function, update_compositions)
8241 (compose_text, composition_gstring_put_cache)
8242 (composition_gstring_p, composition_gstring_width)
8243 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8244 (composition_compute_stop_pos, composition_reseat_it)
8245 (composition_update_it, struct position_record)
8246 (find_automatic_composition, composition_adjust_point)
8247 (Fcomposition_get_gstring, Ffind_composition_internal):
8248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8249 (update_compositions):
8250 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8251 * composite.h: Adjust decls to match defn changes elsewhere.
8252 (struct composition):
8253 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8254 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8255 Do not attempt to compute the address of the object just before a
8256 buffer; this is not portable.
8257 (Faref, Faset):
8258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8259 (Faset): Use int, not EMACS_INT, where int is wide enough.
8260 (Fstring_to_number): Don't assume fixnums fit in int.
8261 (Frem): Don't assume arg is nonnegative.
8262 * dbusbind.c (xd_append_arg): Check for integers out of range.
8263 (Fdbus_call_method): Don't overflow the timeout int.
8264 (extract_signed, extract_unsigned): New functions.
8265 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8266 (xd_get_connection_references): Return ptrdiff_t, not int.
8267 All uses changed.
8268 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8269 (xd_read_message_1):
8270 Use int, not unsigned, where the dbus API uses int.
8271 (Fdbus_message_internal): Don't overflow mtype.
8272 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8273 * dired.c (directory_files_internal, file_name_completion, scmp)
8274 (file_name_completion_stat):
8275 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8276 (file_name_completion): Don't overflow matchcount.
8277 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8278 * dispextern.h: Adjust decls to match defn changes elsewhere.
8279 (struct text_pos, struct glyph, struct bidi_saved_info)
8280 (struct bidi_string_data, struct bidi_it, struct composition_it)
8281 (struct it):
8282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8283 (struct display_pos, struct composition_it, struct it):
8284 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8285 * dispnew.c (increment_matrix_positions)
8286 (increment_row_positions, mode_line_string)
8287 (marginal_area_string):
8288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8289 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8290 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8291 (duration_to_sec_usec): New function, to check for overflow better.
8292 (Fsleep_for, sit_for): Use it.
8293 * doc.c (get_doc_string, store_function_docstring):
8294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8295 (get_doc_string, Fsnarf_documentation):
8296 Use int, not EMACS_INT, where int is wide enough.
8297 (get_doc_string):
8298 Use SAFE_ALLOCA, not alloca.
8299 Check for overflow when converting EMACS_INT to off_t.
8300 * doprnt.c (doprnt):
8301 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8302 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8303 Don't assume uid_t fits into fixnum.
8304 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8305 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8306 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8307 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8308 (general_insert_function)
8309 (Finsert_char, make_buffer_string, make_buffer_string_both)
8310 (update_buffer_properties, Fbuffer_substring)
8311 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8312 (Fsubst_char_in_region, check_translation)
8313 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8314 (transpose_markers, Ftranspose_regions):
8315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8316 (clip_to_bounds): Move to lisp.h as an inline function).
8317 (Fconstrain_to_field): Don't assume integers are nonnegative.
8318 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8319 (Fsubst_char_in_region, Fsave_restriction):
8320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8321 (Femacs_pid): Don't assume pid_t fits into fixnum.
8322 (lo_time): Use int, not EMACS_INT, when int suffices.
8323 (lisp_time_argument): Check for usec out of range.
8324 (Fencode_time): Don't assume fixnum fits in int.
8325 (Fuser_login_name, Fuser_full_name): Signal an error
8326 if a uid argument is out of range, rather than relying on
8327 undefined behavior.
8328 (Fformat_time_string): Remove now-unnecessary check.
8329 lisp_time_argument checks for out-of-range usec now.
8330 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8331 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8332 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8333 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8334 (init_cmdargs, Fdump_emacs):
8335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8336 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8337 the bottom (typically) 32 bits of the fixnum.
8338 * eval.c (specpdl_size, call_debugger):
8339 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8340 (when_entered_debugger, Fbacktrace_debug):
8341 Don't assume fixnum can fit in int.
8342 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8343 the object just before a buffer; this is not portable.
8344 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8345 (grow_specpdl, unbind_to):
8346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8347 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8348 (grow_specpdl): Simplify allocation by using xpalloc.
8349 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8350 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8351 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8352 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8353 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8354 (a_write, e_write):
8355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8356 (Fcopy_file, non_regular_nbytes, read_non_regular)
8357 (Finsert_file_contents):
8358 Use int, not EMACS_INT, where int is wide enough.
8359 (READ_BUF_SIZE): Verify that it fits in int.
8360 (Finsert_file_contents): Check that counts are in proper range,
8361 rather than assuming fixnums fit into ptrdiff_t etc.
8362 Don't assume fixnums fit into int.
8363 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8364 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8365 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8366 (string_char_to_byte, string_byte_to_char)
8367 (string_make_multibyte, string_to_multibyte)
8368 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8369 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8370 (substring_both, Fdelete, internal_equal, Ffillarray)
8371 (Fclear_string, mapcar1)
8372 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8373 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8374 (larger_vector, make_hash_table, maybe_resize_hash_table)
8375 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8376 (Fmaphash, secure_hash):
8377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8378 (concat): Check for string index and length overflow.
8379 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8380 (Frequire):
8381 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8382 (larger_vector): New API (vec, incr_min, size_max) replaces old
8383 one (vec, new_size, init). This catches size overflow.
8384 INIT was removed because it was always Qnil.
8385 All callers changed.
8386 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8387 the upper bound on a hash table index size.
8388 (make_hash_table, maybe_resize_hash_table): Use it.
8389 (secure_hash): Computer start_byte and end_byte only after
8390 they're known to be in ptrdiff_t range.
8391 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8392 (Ffont_get_glyphs, Ffont_at):
8393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8394 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8395 (Flist_fonts, Fopen_font):
8396 Don't assume fixnum can fit in int.
8397 (check_gstring): Don't assume index can fit in int.
8398 (font_match_p): Check that fixnum is a character, not a nonnegative
8399 fixnum, since the later code needs to stuff it into an int.
8400 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8401 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8402 conversion overflow issues.
8403 (Fopen_font): Check for integer out of range.
8404 (Ffont_get_glyphs): Don't assume index can fit in int.
8405 * font.h: Adjust decls to match defn changes elsewhere.
8406 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8407 integer overflow.
8408 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8409 printmax_t, where ptrdiff_t is wide enough.
8410 (Finternal_char_font):
8411 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8412 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8413 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8414 (Fset_frame_position, x_set_frame_parameters)
8415 (x_set_line_spacing, x_set_border_width)
8416 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8417 Check that fixnums are in proper range for system types.
8418 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8420 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8421 Use SAFE_ALLOCA_LISP, not alloca.
8422 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8423 intptr_t is wide enough.
8424 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8425 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8426 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8427 Check for fixnum out of range.
8428 * ftfont.c (ftfont_list): Don't assume index fits in int.
8429 Check that fixnums are in proper range for system types.
8430 (ftfont_shape_by_flt):
8431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8432 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8433 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8434 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8435 Check that fixnums are in proper range for system types.
8436 * gnutls.h: Adjust decls to match defn changes elsewhere.
8437 * gtkutil.c (xg_dialog_run):
8438 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8439 (update_frame_tool_bar):
8440 Check that fixnums are in proper range for system types.
8441 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8442 (lookup_image): Check that fixnums are in range for system types.
8443 * indent.c (last_known_column, last_known_column_point):
8444 (current_column_bol_cache):
8445 (skip_invisible, current_column, check_display_width):
8446 (check_display_width, scan_for_column, current_column_1)
8447 (Findent_to, Fcurrent_indentation, position_indentation)
8448 (indented_beyond_p, Fmove_to_column, compute_motion):
8449 (Fcompute_motion, Fvertical_motion):
8450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8451 (last_known_column_modified): Use EMACS_INT, not int.
8452 (check_display_width):
8453 (Fcompute_motion):
8454 Check that fixnums and floats are in proper range for system types.
8455 (compute_motion): Don't assume index or fixnum fits in int.
8456 (compute_motion, Fcompute_motion):
8457 Use int, not EMACS_INT, when it is wide enough.
8458 (vmotion): Omit local var start_hpos that is always 0; that way
8459 we don't need to worry about overflow in expressions involving it.
8460 * indent.h: Adjust decls to match defn changes elsewhere.
8461 (struct position):
8462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8463 Use int, not EMACS_INT, where int is wide enough.
8464 Remove unused members ovstring_chars_done and tab_offset;
8465 all uses removed.
8466 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8467 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8468 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8469 (make_gap, copy_text, insert, insert_and_inherit)
8470 (insert_before_markers, insert_before_markers_and_inherit)
8471 (insert_1, count_combining_before, count_combining_after)
8472 (insert_1_both, insert_from_string)
8473 (insert_from_string_before_markers, insert_from_string_1)
8474 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8475 (adjust_after_replace, adjust_after_insert, replace_range)
8476 (replace_range_2, del_range, del_range_1, del_range_byte)
8477 (del_range_both, del_range_2, modify_region)
8478 (prepare_to_modify_buffer, signal_before_change)
8479 (signal_after_change, Fcombine_after_change_execute):
8480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8481 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8482 (balance_an_interval, split_interval_right, split_interval_left)
8483 (find_interval, next_interval, update_interval)
8484 (adjust_intervals_for_insertion, delete_node, delete_interval)
8485 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8486 (static_offset_intervals, offset_intervals)
8487 (merge_interval_right, merge_interval_left, make_new_interval)
8488 (graft_intervals_into_buffer, temp_set_point_both)
8489 (temp_set_point, set_point, adjust_for_invis_intang)
8490 (set_point_both, move_if_not_intangible, get_property_and_range)
8491 (get_local_map, copy_intervals, copy_intervals_to_string)
8492 (compare_string_intervals, set_intervals_multibyte_1):
8493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8494 * intervals.h: Adjust decls to match defn changes elsewhere.
8495 (struct interval):
8496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8497 * keyboard.c (this_command_key_count, this_single_command_key_start)
8498 (before_command_key_count, before_command_echo_length, echo_now)
8499 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8500 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8501 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8502 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8504 (last_non_minibuf_size, last_point_position, echo_truncate)
8505 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8506 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8507 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8508 (stuff_buffered_input):
8509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8510 (last_auto_save, command_loop_1, read_char):
8511 Use EMACS_INT, not int, to avoid integer overflow.
8512 (record_char): Avoid overflow in total_keys computation.
8513 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8514 * keyboard.h: Adjust decls to match defn changes elsewhere.
8515 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8516 (Fkey_description, Fdescribe_vector, Flookup_key):
8517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8518 (click_position): New function, to check that positions are in range.
8519 (Fcurrent_active_maps):
8520 (describe_command):
8521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8522 (Faccessible_keymaps, Fkey_description):
8523 (preferred_sequence_p):
8524 Don't assume fixnum can fit into int.
8525 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8526 Check for integer overflow in size calculations.
8527 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8528 avoid mishandling large integers.
8529 * lisp.h: Adjust decls to match defn changes elsewhere.
8530 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8531 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8532 (struct Lisp_Marker):
8533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8534 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8535 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8536 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8537 All callers changed.
8538 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8539 Assume the arg has valid form, since it always does.
8540 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8541 unsigned integer system type.
8542 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8543 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8545 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8546 (duration_to_sec_usec): New decl.
8547 * lread.c (read_from_string_index, read_from_string_index_byte)
8548 (read_from_string_limit, readchar, unreadchar, openp)
8549 (read_internal_start, read1, oblookup):
8550 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8551 (Fload, readevalloop, Feval_buffer, Feval_region):
8552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8553 (openp): Check for out-of-range argument to 'access'.
8554 (read1): Use int, not EMACS_INT, where int is wide enough.
8555 Don't assume fixnum fits into int.
8556 Fix off-by-one error that can read outside a buffer.
8557 (read_filtered_event): Use duration_to_sec_usec
8558 to do proper overflow checking on durations.
8559 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8560 in size calculation.
8561 (Fexecute_kbd_macro):
8562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8563 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8564 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8565 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8566 (set_marker_both, set_marker_restricted_both, marker_position)
8567 (marker_byte_position, Fbuffer_has_markers_at):
8568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8569 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8570 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8571 It now merely ensures that the menu is large enough, without
8572 necessarily growing it, as this avoids some integer overflow issues.
8573 All callers changed.
8574 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8576 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8577 Use SAFE_ALLOCA_LISP, not alloca.
8578 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8579 to EMACS_INT. Check that fixnums are in proper range for system types.
8580 * minibuf.c (minibuf_prompt_width, string_to_object)
8581 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8582 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8583 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8584 (get_minibuffer, read_minibuf_unwind):
8585 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8586 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8587 this simplifies overflow checking. All callers changed.
8588 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8589 (Ftest_completion):
8590 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8591 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8592 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8593 Check that fixnums are in proper range for system types.
8594 (Fx_create_frame, Fx_show_tip):
8595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8596 * nsfont.m (ns_findfonts, nsfont_list_family):
8597 Don't assume fixnum fits in long.
8598 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8600 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8601 wide enough.
8602 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8603 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8604 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8605 (PRINTDECLARE, PRINTPREPARE):
8606 (strout, print_string):
8607 (print, print_preprocess, print_check_string_charset_prop)
8608 (print_object):
8609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8610 (PRINTDECLARE):
8611 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8613 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8614 (printchar, strout): Use xpalloc to catch size calculation overflow.
8615 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8616 (print_error_message): Use SAFE_ALLOCA, not alloca.
8617 (print_object): Use int, not EMACS_INT, where int is wide enough.
8618 (print_depth, new_backquote_output, print_number_index):
8619 Use ptrdiff_t, not int, where int might not be wide enough.
8620 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8621 (Fset_process_window_size, Fformat_network_address)
8622 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8623 (sigchld_handler):
8624 Check that fixnums are in proper range for system types.
8625 (Fsignal_process): Simplify by avoiding a goto.
8626 Check for process-ids out of pid_t range rather than relying on
8627 undefined behavior.
8628 (process_tick, update_tick): Use EMACS_INT, not int.
8629 (Fformat_network_address, read_process_output, send_process)
8630 (Fprocess_send_region, status_notify):
8631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8632 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8633 (wait_reading_process_output, read_process_output, exec_sentinel):
8634 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8635 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8636 (Faccept_process_output): Use duration_to_sec_usec to do proper
8637 overflow checking on durations.
8638 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8639 Don't assume pid_t fits in int.
8640 * process.h (struct Lisp_Process): Members tick and update_tick
8641 are now of type EMACS_INT, not int.
8642 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8643 configured --with-wide-int.
8644 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8645 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8646 * search.c (looking_at_1, string_match_1):
8647 (fast_string_match, fast_c_string_match_ignore_case)
8648 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8649 (scan_newline, find_before_next_newline, search_command)
8650 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8651 (set_search_regs, wordify):
8652 (Freplace_match):
8653 (Fmatch_data):
8654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8655 (string_match_1, search_buffer, set_search_regs):
8656 (Fmatch_data):
8657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8658 (wordify): Check for overflow in size calculation.
8659 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8660 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8661 Check that fixnums are in proper range for system types.
8662 * sound.c (struct sound_device)
8663 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8665 (Fplay_sound_internal):
8666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8667 * syntax.c (struct lisp_parse_state, find_start_modiff)
8668 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8669 (Fparse_partial_sexp):
8670 Don't assume fixnums can fit in int.
8671 (struct lisp_parse_state, find_start_pos, find_start_value)
8672 (find_start_value_byte, find_start_begv)
8673 (update_syntax_table, char_quoted, dec_bytepos)
8674 (find_defun_start, prev_char_comend_first, back_comment):
8675 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8676 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8678 (Finternal_describe_syntax_value): Check that match_lisp is a
8679 character, not an integer, since the code stuffs it into int.
8680 (scan_words, scan_sexps_forward):
8681 Check that fixnums are in proper range for system types.
8682 (Fforward_word):
8683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8684 (scan_sexps_forward):
8685 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8686 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8687 * syntax.h: Adjust decls to match defn changes elsewhere.
8688 (struct gl_state_s):
8689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8690 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8691 MOST_POSITIVE_FIXNUM.
8692 * sysdep.c (wait_for_termination_1, wait_for_termination)
8693 (interruptible_wait_for_termination, mkdir):
8694 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8695 (emacs_read, emacs_write):
8696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8697 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8698 and double all fit in int.
8699 * term.c (set_tty_color_mode):
8700 Check that fixnums are in proper range for system types.
8701 * termhooks.h (struct input_event):
8702 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8703 * textprop.c (validate_interval_range, interval_of)
8704 (Fadd_text_properties, set_text_properties_1)
8705 (Fremove_text_properties, Fremove_list_of_text_properties)
8706 (Ftext_property_any, Ftext_property_not_all)
8707 (copy_text_properties, text_property_list, extend_property_ranges)
8708 (verify_interval_modification):
8709 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8710 (Fnext_single_char_property_change)
8711 (Fprevious_single_char_property_change):
8712 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8713 (copy_text_properties):
8714 Check for integer overflow in index calculation.
8715 * undo.c (last_boundary_position, record_point, record_insert)
8716 (record_delete, record_marker_adjustment, record_change)
8717 (record_property_change):
8718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8719 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8720 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8721 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8722 (Fx_hide_tip, Fx_file_dialog):
8723 * w32menu.c (set_frame_menubar):
8724 Use ptrdiff_t, not int, for consistency with rest of code.
8725 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8726 (select_window, Fdelete_other_windows_internal)
8727 (window_scroll_pixel_based, window_scroll_line_based)
8728 (Frecenter, Fset_window_configuration):
8729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8730 (Fset_window_hscroll, run_window_configuration_change_hook)
8731 (set_window_buffer, temp_output_buffer_show, scroll_command)
8732 (Fscroll_other_window, Frecenter):
8733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8734 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8735 Don't assume fixnum fits in int.
8736 (Fset_window_scroll_bars):
8737 Check that fixnums are in proper range for system types.
8738 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8739 (string_pos, c_string_pos, number_of_chars, init_iterator)
8740 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8741 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8742 (compute_display_string_end, handle_face_prop)
8743 (face_before_or_after_it_pos, handle_invisible_prop)
8744 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8745 (display_prop_intangible_p, string_buffer_position_lim)
8746 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8747 (get_overlay_strings_1, get_overlay_strings)
8748 (iterate_out_of_display_property, forward_to_next_line_start)
8749 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8750 (get_next_display_element, set_iterator_to_next)
8751 (get_visually_first_element, compute_stop_pos_backwards)
8752 (handle_stop_backwards, next_element_from_buffer)
8753 (move_it_in_display_line_to, move_it_in_display_line)
8754 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8755 (add_to_log, message_dolog, message_log_check_duplicate)
8756 (message2, message2_nolog, message3, message3_nolog
8757 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8758 (current_message_1, truncate_echo_area, truncate_message_1)
8759 (set_message, set_message_1, store_mode_line_noprop)
8760 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8761 (text_outside_line_unchanged_p, check_point_in_composition)
8762 (reconsider_clip_changes)
8763 (redisplay_internal, set_cursor_from_row, try_scrolling)
8764 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8765 (redisplay_window, find_last_unchanged_at_beg_row)
8766 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8767 (trailing_whitespace_p, find_row_edges, display_line)
8768 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8769 (display_mode_element, store_mode_line_string)
8770 (pint2str, pint2hrstr, decode_mode_spec)
8771 (display_count_lines, display_string, draw_glyphs)
8772 (x_produce_glyphs, x_insert_glyphs)
8773 (rows_from_pos_range, mouse_face_from_buffer_pos)
8774 (fast_find_string_pos, mouse_face_from_string_pos)
8775 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8777 (safe_call, init_from_display_pos, handle_fontified_prop)
8778 (handle_single_display_spec, load_overlay_strings)
8779 (with_echo_area_buffer, setup_echo_area_for_printing)
8780 (display_echo_area, echo_area_display)
8781 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8782 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8783 (redisplay_window, dump_glyph_row, display_mode_line)
8784 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8785 (handle_display_spec, display_prop_string_p):
8786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8787 (handle_single_display_spec, build_desired_tool_bar_string)
8788 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8789 (get_specified_cursor_type):
8790 Check that fixnums are in proper range for system types.
8791 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8792 (Flookup_image_map):
8793 Don't assume fixnums fit in int.
8794 (compare_overlay_entries):
8795 Avoid mishandling comparisons due to subtraction overflow.
8796 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8797 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8798 (handle_tool_bar_click):
8799 Use int, not unsigned, since we prefer signed and the signedness
8800 doesn't matter here.
8801 (get_next_display_element, next_element_from_display_vector):
8802 Use int, not EMACS_INT, when int is wide enough.
8803 (start_hourglass): Use duration_to_sec_usec to do proper
8804 overflow checking on durations.
8805 * xfaces.c (Fbitmap_spec_p):
8806 Check that fixnums are in proper range for system types.
8807 (compare_fonts_by_sort_order):
8808 Avoid mishandling comparisons due to subtraction overflow.
8809 (Fx_family_fonts, realize_basic_faces):
8810 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8811 (Fx_family_fonts):
8812 Don't assume fixnum fits in int.
8813 Use SAFE_ALLOCA_LISP, not alloca.
8814 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8815 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8816 (face_at_buffer_position, face_for_overlay_string)
8817 (face_at_string_position):
8818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8819 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8820 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8821 (Fx_show_tip):
8822 Check that fixnums are in proper range for system types.
8823 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8824 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8826 (Fx_change_window_property): Don't assume fixnums fit in int.
8827 * xfont.c (xfont_chars_supported):
8828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8829 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8830 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8832 * xml.c (parse_region):
8833 * xrdb.c (magic_file_p):
8834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8835 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8836 (x_get_local_selection, x_reply_selection_request)
8837 (x_handle_selection_request, wait_for_property_change):
8838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8839 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8840 short is wide enough.
8841 (x_send_client_event): Don't assume fixnum fits in int.
8842 * xterm.c (x_x_to_emacs_modifiers):
8843 Don't assume EMACS_INT overflows nicely into int.
8844 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8845 may come from Lisp.
8846 (handle_one_xevent): NATNUMP can eval its arg twice.
8847 (x_connection_closed):
8848 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8849 * xterm.h: Adjust decls to match defn changes elsewhere.
8850 (struct scroll_bar): Use struct vectorlike_header
8851 rather than rolling our own approximation.
8852 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8853
8854 2012-05-25 Glenn Morris <rgm@gnu.org>
8855
8856 * lisp.mk (lisp): Update for more files being compiled now.
8857
8858 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8859
8860 * lread.c: Remove `read_pure' which makes no difference.
8861 (read_pure): Remove var.
8862 (unreadpure): Remove function.
8863 (readevalloop): Don't call read_list with -1 flag.
8864 (read1, read_vector): Don't test read_pure any more.
8865 (read_list): Simplify.
8866
8867 * fileio.c, character.h: Minor style tweaks.
8868
8869 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8870
8871 * window.h (clip_changed): Remove useless declaration.
8872
8873 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8874
8875 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8876 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8877
8878 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8879
8880 Remove src/m/*.
8881 This directory predates autoconf and is no longer needed nowadays.
8882 Move its few remaining bits of functionality to where they're needed.
8883 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8884 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8885 * m/template.h: Remove.
8886 * Makefile.in (M_FILE): Remove. All uses removed.
8887 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8888 * lisp.h (USE_LSB_TAG):
8889 * mem-limits.h (EXCEEDS_LISP_PTR):
8890 Use VAL_MAX, not VALBITS, in #if.
8891 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8892 (EMACS_UINT): Define unconditionally now.
8893 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8894 (BITS_PER_EMACS_INT): New constants, replacing
8895 what used to be in config.h, but not useful in #if.
8896 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8897 define them any more.
8898 (VAL_MAX): New macro.
8899 (VALMASK): Use it.
8900 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8901 BITS_PER_EMACS_INT, in #if.
8902 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8903 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8904 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8905 * s/ms-w32.h (DATA_START):
8906 Move here from removed file m/intel386.h.
8907 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8908 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8909
8910 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8911
8912 Assume C89 or later.
8913 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8914 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8915 (xrealloc):
8916 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8917 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8918 * textprop.c, tparam.c (NULL): Remove.
8919 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8920 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8921 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8922 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8923 * xterm.c (input_signal_count): Assume volatile works.
8924
8925 2012-05-21 Ken Brown <kbrown@cornell.edu>
8926
8927 * xgselect.c (xg_select): Fix first argument in call to 'select'
8928 (bug#11508).
8929
8930 2012-05-20 Ken Brown <kbrown@cornell.edu>
8931
8932 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8933 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8934
8935 2012-05-19 Ken Brown <kbrown@cornell.edu>
8936
8937 * xfns.c (x_in_use): Remove `static' qualifier.
8938 * xterm.h (x_in_use): Declare.
8939 * xgselect.c: Include xterm.h.
8940 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8941 and `display_arg' (bug#9754).
8942
8943 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8944
8945 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8946
8947 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8948 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8949
8950 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8951
8952 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8953
8954 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8955 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8956
8957 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8958 reference to image_cache->refcount.
8959 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8960
8961 2012-05-17 Juri Linkov <juri@jurta.org>
8962
8963 * search.c (Fword_search_regexp, Fword_search_backward)
8964 (Fword_search_forward, Fword_search_backward_lax)
8965 (Fword_search_forward_lax): Move functions to isearch.el
8966 (bug#10145, bug#11381).
8967
8968 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8969
8970 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8971
8972 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8973
8974 * lread.c (init_obarray): Declare Qt and Qnil as special.
8975
8976 2012-05-14 Glenn Morris <rgm@gnu.org>
8977
8978 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8979 Put "libexec" before "bin", for the sake of init_callproc_1.
8980
8981 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8982
8983 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8984
8985 * unexaix.c: Port to more-recent AIX compilers.
8986 (report_error, report_error_1, make_hdr, copy_sym)
8987 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8988 Make arguments const char *, not char *, to avoid violations of C
8989 standard and to fix some AIX warnings reported by Gilles Pion.
8990
8991 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8992
8993 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8994 already have overlays loaded.
8995 (handle_single_display_spec): Before returning without displaying
8996 fringe bitmap, synchronize the bidi iterator with the main display
8997 iterator, by calling iterate_out_of_display_property.
8998 (iterate_out_of_display_property): Detect buffer iteration by
8999 testing that it->string is a Lisp string.
9000 (get_next_display_element): When the current object is exhausted,
9001 and there's something on it->stack, call set_iterator_to_next to
9002 proceed with what's on the stack, instead of returning zero.
9003 (set_iterator_to_next): If called at the end of a Lisp string,
9004 proceed to consider_string_end without incrementing string
9005 position. Don't increment display vector index past the end of
9006 the display vector. (Bug#11417)
9007 (pos_visible_p): Don't report a position visible when move_it_to
9008 stopped at the last line of window, which happens to be scanned
9009 backwards by the bidi iteration. (Bug#11464)
9010
9011 2012-05-14 Eli Zaretskii <eliz@gnu.org>
9012
9013 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9014 and right-margin display specs even if the spec is invalid or we
9015 are on a TTY, and thus unable to display on the fringes.
9016 That's because the text with the property will not be displayed anyway,
9017 so we need to signal to the caller that this is a "replacing"
9018 display spec. This fixes display when the spec is invalid or we
9019 are on a TTY.
9020
9021 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9022
9023 * unexaix.c (make_hdr): Fix typo in prototype.
9024 This bug broke the build on AIX. Problem reported by Gilles Pion.
9025
9026 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9027
9028 * keyboard.c (kbd_buffer_get_event): Read special events also in
9029 batch mode. (Bug#11415)
9030
9031 2012-05-12 Glenn Morris <rgm@gnu.org>
9032
9033 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9034
9035 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9036
9037 * lisp.mk (lisp): Add newcomment.elc.
9038
9039 2012-05-12 Glenn Morris <rgm@gnu.org>
9040
9041 * Makefile.in (MKDIR_P): New, set by configure.
9042 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9043
9044 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9045
9046 Remove unused function hourglass_started.
9047 * dispextern.h (hourglass_started):
9048 * w32fns.c (hourglass_started):
9049 * xdisp.c (hourglass_started): Remove.
9050
9051 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9052
9053 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9054 Update dependencies.
9055
9056 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9057
9058 * xgselect.c (xg_select): Put maxfds+1 into a var.
9059 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9060
9061 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9062
9063 2012-05-10 Dave Abrahams <dave@boostpro.com>
9064
9065 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9066 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9067
9068 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9069
9070 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9071 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9072 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9073 Initialize xd_registered_buses.
9074
9075 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 Untag more efficiently if USE_LSB_TAG.
9078 This is based on a proposal by YAMAMOTO Mitsuharu in
9079 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9080 For an admittedly artificial (nth 8000 longlist) benchmark on
9081 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9082 Emacs's overall text size by 1%.
9083 * lisp.h (XUNTAG): New macro.
9084 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9085 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9086 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9087 * eval.c (Fautoload):
9088 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9089 * frame.h (XFRAME): Use XUNTAG.
9090
9091 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9092 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9093 Remove unportable assumptions about print widths of types like
9094 dbus_uint32_t.
9095 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9096 intptr_t when converting between pointer and integer, to avoid GCC
9097 warnings about wrong width.
9098
9099 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9100
9101 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9102 stack for each reader_thread, instead of defaulting to 8MB
9103 determined by the linker. This avoids failures in creating
9104 subprocesses on Windows 7, see the discussion in this thread:
9105 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9106
9107 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9108
9109 Fix up display of the *Minibuf-0* buffer in the mini window.
9110 * keyboard.c (read_char): Don't clear the echo area if there's no
9111 message to clear.
9112 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9113 contents of *Minibuf-0*) if there's no message displayed in its stead.
9114
9115 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9116
9117 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9118 batch mode.
9119
9120 2012-05-06 Chong Yidong <cyd@gnu.org>
9121
9122 * lisp.mk (lisp): Update.
9123
9124 2012-05-05 Jim Meyering <meyering@redhat.com>
9125
9126 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9127
9128 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9129
9130 * data.c (PUT_ERROR): New macro.
9131 (syms_of_data): Use it. Add new error type `user-error'.
9132 * undo.c (user_error): New function.
9133 (Fprimitive_undo): Use it.
9134 * print.c (print_error_message): Adjust print style for `user-error'.
9135 * keyboard.c (user_error): New function.
9136 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9137
9138 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9139
9140 Do not limit current-time-string to years 1000..9999.
9141 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9142 (Fcurrent_time_string): Support any year that is supported by the
9143 underlying localtime representation. Don't use asctime, as it
9144 has undefined behavior for years outside the range -999..9999.
9145
9146 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 Fix race conditions involving setenv, gmtime, localtime, asctime.
9149 Without this fix, interrupts could mess up code that uses these
9150 nonreentrant functions, since setting TZ invalidates existing
9151 tm_zone or tzname values, and since most of these functions return
9152 pointers to static storage.
9153 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9154 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9155 Grow the critical sections to include not just invoking
9156 localtime/gmtime, but also accessing these functions' results
9157 including their tm_zone values if any, and any related TZ setting.
9158 (format_time_string): Last arg is now struct tm *, not struct tm **,
9159 so that the struct tm is saved in the critical section.
9160 All callers changed. Simplify allocation of initial buffer, partly
9161 motivated by the fact that memory allocation needs to be outside
9162 the critical section.
9163
9164 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9165
9166 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9167 with RESET_INTERVAL.
9168
9169 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9170 Remove duplicated buffer name initialization.
9171
9172 2012-05-02 Jim Meyering <jim@meyering.net>
9173
9174 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9175
9176 * xfns.c (x_window): Use xstrdup (Bug#11375).
9177
9178 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9179
9180 * xdisp.c (pos_visible_p): If already at a newline from the
9181 display string before the 'while' loop, don't walk back the glyphs
9182 from it3.glyph_row. Solves assertion violation when the display
9183 string begins with a newline (egg.el). (Bug#11367)
9184
9185 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9186
9187 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9188 Move to simple.el.
9189
9190 2012-05-01 Glenn Morris <rgm@gnu.org>
9191
9192 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9193 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9194 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9195 All were removed before 23.1.
9196
9197 * dispnew.c: Remove HAVE_LIBNCURSES test;
9198 it is always true on relevant platforms.
9199
9200 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9201 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9202
9203 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9204
9205 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9206
9207 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9208 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9209 Remove.
9210
9211 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9212
9213 Do not avoid creating empty evaporating overlays (Bug#9642).
9214 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9215 That is, do not delete an evaporating overlay if it becomes
9216 empty after its bounds are adjusted to fit within its buffer.
9217 This fix caused other problems, and I'm reverting it until we get
9218 to the bottom of them.
9219
9220 2012-04-27 Chong Yidong <cyd@gnu.org>
9221
9222 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9223
9224 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9225
9226 * xdisp.c (pos_visible_p): If the window start position is beyond
9227 ZV, start the display from buffer beginning. Prevents assertion
9228 violation in init_iterator when the minibuffer window is scrolled
9229 via the scroll bar.
9230
9231 * window.c (window_scroll_pixel_based): Likewise.
9232
9233 2012-04-27 Chong Yidong <cyd@gnu.org>
9234
9235 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9236
9237 2012-04-27 Glenn Morris <rgm@gnu.org>
9238
9239 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9240 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9241
9242 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9243
9244 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9245 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9246
9247 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9248
9249 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9250 display element, check also the underlying string or buffer
9251 character. (Bug#11341)
9252
9253 * w32menu.c: Include w32heap.h.
9254 (add_menu_item): If the call to AppendMenuW (via
9255 unicode_append_menu) fails, disable Unicode menus only if we are
9256 running on Windows 9X/Me.
9257
9258 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9259
9260 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9261 (xgetint): Add missing shift for LSB tags.
9262
9263 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9264
9265 * keyboard.c (read_char): Don't wipe echo area for select window
9266 events: These might get delayed via `mouse-autoselect-window'
9267 (Bug#11304).
9268
9269 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9270
9271 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9272 manipulation of :loaded-from data.
9273
9274 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9275
9276 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9277 now a cons (bug#11311).
9278
9279 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9280
9281 Do not create empty overlays with the evaporate property (Bug#9642).
9282 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9283 if it becomes empty after its bounds are adjusted to fit within
9284 its buffer. Without this fix, in a nonempty buffer (let ((o
9285 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9286 yields an empty overlay that has the evaporate property, which is
9287 not supposed to happen.
9288
9289 Fix minor GTK3 problems found by static checking.
9290 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9291 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9292 (struct _EmacsFixedClass, emacs_fixed_get_type):
9293 Move decls here from emacsgtkfixed.h, since they needn't be public.
9294 (emacs_fixed_get_type): Now static.
9295 (emacs_fixed_class_init): Omit unused local.
9296 (emacs_fixed_child_type): Remove; unused.
9297 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9298 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9299 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9300 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9301 (EMACS_FIXED_GET_CLASS): Remove; unused.
9302 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9303
9304 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9305 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9306
9307 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9310 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9311 (__malloc_size_t, __malloc_ptrdiff_t):
9312 Remove. All uses removed, replaced by the definiens if needed,
9313 since we can assume C89 or better now.
9314 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9315 (protect_malloc_state, align, get_contiguous_space)
9316 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9317 (malloc_atfork_handler_child, malloc_enable_thread)
9318 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9319 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9320 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9321 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9322 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9323 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9324 Define using prototypes, not old style.
9325 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9326 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9327 (align): Don't assume that signed integer overflow wraps around.
9328 Omit unused local var.
9329 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9330 (_free_internal_nolock, memalign, mallochook, reallochook):
9331 Omit no-longer-needed casts.
9332 (valloc): Use getpagesize, not __getpagesize.
9333 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9334 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9335
9336 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9337
9338 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9339
9340 Move functions from C to Lisp. Make non-blocking method calls
9341 the default. Implement further D-Bus standard interfaces.
9342
9343 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9344 (QCdbus_request_name_allow_replacement)
9345 (QCdbus_request_name_replace_existing)
9346 (QCdbus_request_name_do_not_queue)
9347 (QCdbus_request_name_reply_primary_owner)
9348 (QCdbus_request_name_reply_in_queue)
9349 (QCdbus_request_name_reply_exists)
9350 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9351 (QCdbus_registered_serial, QCdbus_registered_method)
9352 (QCdbus_registered_signal): New Lisp objects.
9353 (XD_DEBUG_MESSAGE): Use sizeof.
9354 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9355 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9356 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9357 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9358 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9359 (xd_signature, xd_append_arg): Allow float for integer types.
9360 (xd_get_connection_references): New function.
9361 (xd_get_connection_address): Rename from xd_initialize.
9362 Return cached address.
9363 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9364 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9365 level.
9366 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9367 Return number of refcounts.
9368 (Fdbus_get_unique_name): Make stronger parameter check.
9369 (Fdbus_message_internal): New defun.
9370 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9371 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9372 (Fdbus_send_signal, Fdbus_register_service)
9373 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9374 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9375 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9376 (Vdbus_compiled_version, Vdbus_runtime_version)
9377 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9378 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9379 (Vdbus_message_type_signal): New defvars.
9380 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9381 Adapt docstring.
9382
9383 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9384
9385 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9386 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9387 Do not assume ptrdiff_t is the same width as 'int'.
9388
9389 * alloc.c: Handle unusual debugging option combinations.
9390 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9391 since the two debugging options are incompatible.
9392 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9393 is defined.
9394 (mem_init, mem_insert, mem_insert_fixup):
9395 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9396 (NEED_MEM_INSERT): Remove; no longer needed.
9397
9398 2012-04-22 Leo Liu <sdl.web@gmail.com>
9399
9400 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9401
9402 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9403
9404 * sysdep.c [__FreeBSD__]: Minor cleanups.
9405 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9406 Use Emacs indenting style more consistently. Avoid some casts.
9407 Use 'double' consistently rather than mixing 'float' and 'double'.
9408
9409 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9410
9411 * sysdep.c (list_system_processes, system_process_attributes):
9412 Add implementation for FreeBSD (Bug#5243).
9413
9414 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9415
9416 * lisp.mk (lisp): Update.
9417
9418 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9419
9420 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9421 It is never used otherwise.
9422
9423 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9424
9425 * print.c (print_preprocess): Only check print_depth if print-circle
9426 is nil.
9427 (print_object): Check for cycles even when print-circle is nil and
9428 print-gensym is t, but only check print_depth if print-circle is nil.
9429
9430 2012-04-20 Chong Yidong <cyd@gnu.org>
9431
9432 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9433 set the status to "failed" and ensure that sentinel is run.
9434
9435 2012-04-20 Glenn Morris <rgm@gnu.org>
9436
9437 * process.c (Fset_process_inherit_coding_system_flag)
9438 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9439 (Fmake_network_process, Fmake_serial_process): Doc fix.
9440
9441 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9442
9443 * xdisp.c (string_buffer_position_lim): Limit starting position to
9444 BEGV.
9445 (set_cursor_from_row): If called for a mode-line or header-line
9446 row, return zero immediately.
9447 (try_cursor_movement): If inside continuation line, don't back up
9448 farther than the first row after the header line, if any.
9449 Don't consider the header-line row as "partially visible", even if
9450 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9451
9452 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9453
9454 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9455 (bug#11238).
9456
9457 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9458 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9459
9460 configure: new option --enable-gcc-warnings (Bug#11207)
9461 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9462 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9463 (ALL_CFLAGS): Use new macros rather than old.
9464 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9465 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9466 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9467 -Wunused-result, -Wunused-variable. This should go away once
9468 the Emacs and Gnulib regex code is merged.
9469 (xmalloc, xrealloc): Now static.
9470
9471 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9472
9473 * dired.c (Fsystem_groups): Remove unused local.
9474
9475 2012-04-17 Glenn Morris <rgm@gnu.org>
9476
9477 * dired.c (Fsystem_users): Doc fix.
9478
9479 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9480
9481 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9482 (syms_of_dired): Add them.
9483
9484 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9485
9486 Fix minor alloc.c problems found by static checking.
9487 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9488 New extern decls, to avoid calling undeclared functions.
9489 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9490 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9491 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9492 (NEED_MEM_INSERT): New macro.
9493 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9494 Remove one incorrect comment and fix another.
9495
9496 Fix minor ralloc.c problems found by static checking.
9497 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9498 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9499 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9500 (r_alloc_sbrk): Now static.
9501
9502 Improve ralloc.c interface checking.
9503 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9504 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9505 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9506 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9507 [REL_ALLOC]: ... to here, to check interface.
9508 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9509 Remove decls. This fixes an "It stinks!".
9510
9511 * alloc.c (which_symbols): Fix alignment issue / type clash.
9512
9513 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9514
9515 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9516 (struct Lisp_Misc_Any): Likewise.
9517 (struct Lisp_Free): Likewise.
9518 * alloc.c (union aligned_Lisp_Symbol): Define.
9519 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9520 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9521 (union aligned_Lisp_Misc): Define.
9522 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9523 aligned_Lisp_Misc instead of union Lisp_Misc.
9524 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9525
9526 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9529 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9530 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9531 * s/netbsd.h, s/sol2-6.h:
9532 Remove definition of GC_MARK_STACK, since the default now works.
9533 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9534 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9535 no longer the default.
9536 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9537
9538 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9539
9540 * lread.c (lisp_file_lexically_bound_p):
9541 Fix hang at ";-*-\n" (bug#11238).
9542
9543 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9544
9545 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9546 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9547
9548 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9549
9550 * nsterm.m (constrainFrameRect): Always constrain when there is only
9551 one screen (Bug#10962).
9552
9553 2012-04-13 Ken Brown <kbrown@cornell.edu>
9554
9555 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9556
9557 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9558
9559 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9560
9561 2012-04-11 Daniel Colascione <dancol@dancol.org>
9562
9563 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9564 against is gone. It's better to use vfork now so that when Cygwin
9565 gains a new, working vfork, we use it automatically (bug#10398).
9566
9567 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9568
9569 * window.c (save_window_save): Obey window-point-insertion-type.
9570
9571 2012-04-11 Glenn Morris <rgm@gnu.org>
9572
9573 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9574
9575 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9576
9577 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9578
9579 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9580
9581 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9582 (force_quit_count): New var.
9583 (handle_interrupt): Use it.
9584
9585 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9586
9587 * w32.c (w32_delayed_load): Record the full path of the library
9588 being loaded (bug#10424).
9589
9590 2012-04-09 Glenn Morris <rgm@gnu.org>
9591
9592 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9593 not just in the obarray, before snarfing them. (Bug#11036)
9594
9595 * Makefile.in ($(leimdir)/leim-list.el):
9596 Pass EMACS rather than BUILT_EMACS.
9597
9598 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9599
9600 * process.c (make_process):
9601 * process.h: Add integer `gnutls_handshakes_tried' member to
9602 process struct.
9603
9604 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9605 Add convenience `GNUTLS_LOG2i' macro.
9606
9607 * gnutls.c (gnutls_log_function2i): Convenience log function.
9608 (emacs_gnutls_read): Use new log functions,
9609 `gnutls_handshakes_tried' process member, and
9610 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9611 attempts per process (connection).
9612
9613 2012-04-09 Chong Yidong <cyd@gnu.org>
9614
9615 * eval.c (Fuser_variable_p, user_variable_p_eh)
9616 (lisp_indirect_variable): Functions deleted.
9617 (Fdefvar): Caller changed.
9618
9619 * callint.c (Finteractive, Fcall_interactively):
9620 * minibuf.c (Fread_variable): Callers changed.
9621
9622 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9623
9624 * xdisp.c (set_cursor_from_row): If the display string appears in
9625 the buffer at position that is closer to point than the position
9626 after the display string, display the cursor on the first glyph of
9627 the display string. Fixes cursor display when a 'display' text
9628 property immediately follows invisible text. (Bug#11094)
9629
9630 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9631
9632 composite.c: use 'double' consistently
9633 * composite.c (get_composition_id): Use 'double' consistently
9634 instead of converting 'float' to 'double' and vice versa; this is
9635 easier to understand and avoids a GCC warning.
9636
9637 2012-04-09 Glenn Morris <rgm@gnu.org>
9638
9639 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9640 preparation for dumping it with emacs. (Bug#4789)
9641 (leimdir): New variable.
9642 ($(leimdir)/leim-list.el): New rule.
9643 (emacs$(EXEEXT)): Depend on leim-list.el.
9644
9645 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9646 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9647 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9648
9649 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9650
9651 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9652 proper alignment.
9653
9654 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9655
9656 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9657 Remove unused local variable.
9658
9659 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9660
9661 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9662 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9663 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9664 objects, as mark_maybe_pointer will catch them otherwise.
9665 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9666 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9667
9668 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9669
9670 Fix typo that broke non-Windows builds.
9671 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9672
9673 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9674
9675 Support building on MS-Windows with libxml2.
9676
9677 * makefile.w32-in (OBJ2): Add xml.$(O).
9678 (GLOBAL_SOURCES): Add xml.c.
9679 ($(BLD)/xml.$(O)): New dependency list.
9680
9681 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9682 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9683 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9684 [!WINDOWSNT]: New macros.
9685 (init_libxml2_functions, libxml2_loaded_p): New functions.
9686 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9687 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9688 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9689 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9690 linked in).
9691 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9692 Call init_libxml2_functions before calling libxml2 functions.
9693 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9694
9695 * emacs.c: Don't include libxml/parser.h.
9696 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9697 xmlCleanupParser directly.
9698
9699 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9700
9701 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9702
9703 * indent.c (Fvertical_motion): If there is a display string at
9704 point, use it.vpos to compute how many lines to backtrack after
9705 move_it_to point. (Bug#11133)
9706
9707 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9708
9709 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9710 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9711 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9712 macros related to unification of CJK characters. For the details,
9713 see the discussion following the message here:
9714 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9715
9716 2012-04-04 Chong Yidong <cyd@gnu.org>
9717
9718 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9719
9720 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9721
9722 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9723 instead of alloca. (Bug#11138)
9724
9725 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9726
9727 * w32menu.c (is_simple_dialog): Properly check lisp types.
9728 (Bug#11141)
9729
9730 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9731
9732 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9733 position we get to after a call to move_it_to fails the
9734 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9735 only if we wind up in a string from display property. (Bug#11063)
9736
9737 * window.c (Fdelete_other_windows_internal): Invalidate the row
9738 and column information about mouse highlight, so that redisplay
9739 restores it after reallocating the glyph matrices. (Bug#7464)
9740
9741 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9742 string comes from a `display' text property, use the buffer
9743 position of that property as if we actually saw that position in
9744 the row's glyphs.
9745 (move_it_by_lines): Remove the assertion that
9746 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9747 violated when there's a before-string at the beginning of a line.
9748 (Bug#11063)
9749
9750 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9751
9752 * xdisp.c (append_space_for_newline): If the default face was
9753 remapped, use the remapped face for the appended newline.
9754 (extend_face_to_end_of_line): Use the remapped default face for
9755 extending the face to the end of the line.
9756 (display_line): Call extend_face_to_end_of_line when the default
9757 face was remapped. (Bug#11068)
9758
9759 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9760
9761 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9762
9763 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9764
9765 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9766
9767 2012-03-27 Glenn Morris <rgm@gnu.org>
9768
9769 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9770 Doc fixes.
9771
9772 2012-03-26 Kenichi Handa <handa@m17n.org>
9773
9774 * dispextern.h (struct glyph): Fix previous change. Change the
9775 bit length of glyphless.ch to 25 (Bug#11082).
9776
9777 2012-03-26 Chong Yidong <cyd@gnu.org>
9778
9779 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9780 (command_loop_1): Use it; inhibit selection update for
9781 handle-select-window too (Bug#8996).
9782
9783 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9784
9785 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9786
9787 2012-03-25 Kenichi Handa <handa@m17n.org>
9788
9789 * dispextern.h (struct glyph): Change the bit length of
9790 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9791
9792 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9793
9794 * s/ms-w32.h (tzname): Include time.h before redirecting to
9795 _tzname. Fixes the MSVC build. (Bug#9960)
9796
9797 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9798
9799 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9800 characters.
9801
9802 * xterm.c (XTread_socket): Only modify handling_signal if
9803 !SYNC_INPUT. (Bug#11080)
9804
9805 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9806
9807 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9808 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9809 when fetching a multibyte character consumes more bytes than
9810 CHAR_BYTES returns, due to unification of CJK characters in
9811 string_char. (Bug#11073)
9812
9813 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9814
9815 * process.c (wait_reading_process_output): Handle pty disconnect
9816 by refraining from sending oneself a SIGCHLD (bug#10933).
9817
9818 2012-03-22 Chong Yidong <cyd@gnu.org>
9819
9820 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9821
9822 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9823 Mark string as coming from a prefix property.
9824 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9825 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9826
9827 2012-03-21 Chong Yidong <cyd@gnu.org>
9828
9829 * xfaces.c (Vface_remapping_alist): Doc fix.
9830
9831 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9832
9833 * w32proc.c (Fw32_set_console_codepage)
9834 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9835 Doc fixes.
9836
9837 2012-03-20 Chong Yidong <cyd@gnu.org>
9838
9839 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9840 to reflect default non-nil value of redisplay-dont-pause.
9841
9842 2012-03-19 Kenichi Handa <handa@m17n.org>
9843
9844 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9845 it fit in a valid range (Bug#11003).
9846
9847 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9848
9849 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9850 that is not from display property, accept the row as a "cursor
9851 row" if one of the string's character has a non-nil `cursor'
9852 property. Fixes cursor positioning when there are newlines in
9853 overlay strings, e.g. in icomplete.el. (Bug#11035)
9854
9855 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9856
9857 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9858
9859 2012-03-12 Chong Yidong <cyd@gnu.org>
9860
9861 * eval.c (inhibit_lisp_code): Rename from
9862 inhibit_window_configuration_change_hook; move from window.c.
9863
9864 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9865 * window.c (run_window_configuration_change_hook)
9866 (syms_of_window): Callers changed.
9867
9868 2012-03-11 Chong Yidong <cyd@gnu.org>
9869
9870 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9871
9872 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9873
9874 2012-03-10 Chong Yidong <cyd@gnu.org>
9875
9876 * frame.c (other_visible_frames): Don't assume the selected frame
9877 is visible (Bug#10955).
9878
9879 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9880
9881 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9882
9883 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9884
9885 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9886 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9887 zero (Bug#10954).
9888
9889 2012-03-03 Glenn Morris <rgm@gnu.org>
9890
9891 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9892
9893 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9894
9895 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9896 position past the first glyph_row that ends at ZV. (Bug#10902)
9897 (redisplay_window, next_element_from_string): Fix typos in
9898 comments.
9899 (redisplay_window): Pass to move_it_vertically the margin in
9900 pixels, not in screen lines.
9901
9902 2012-03-02 Glenn Morris <rgm@gnu.org>
9903
9904 * buffer.c (buffer-list-update-hook): Doc fix.
9905
9906 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9907
9908 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9909 push_it before setting up the iterator for the first overlay
9910 string, even if we have an empty string loaded.
9911 (next_overlay_string): If there's an empty string on the iterator
9912 stack, pop the stack. (Bug#10903)
9913
9914 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9915
9916 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9917 Suggested by Stefan Monnier in
9918 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9919 * alloc.c (widen_to_Lisp_Object): New static function.
9920 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9921 and widening them to Lisp_Objects. This would work even if
9922 USE_LSB_TAG is defined and wide integers are used, which might
9923 happen in a future version of Emacs.
9924
9925 2012-02-25 Chong Yidong <cyd@gnu.org>
9926
9927 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9928 Doc fix.
9929
9930 * xselect.c (Fx_selection_exists_p): Doc fix.
9931 (x_clipboard_manager_save_all): Print an informative message
9932 before saving to clipboard manager.
9933
9934 2012-02-24 Chong Yidong <cyd@gnu.org>
9935
9936 * keyboard.c (process_special_events): Handle all X selection
9937 requests in kbd_buffer, not just the next one (Bug#8869).
9938
9939 2012-02-23 Chong Yidong <cyd@gnu.org>
9940
9941 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9942 call when setting menu-bar-lines and tool-bar-lines parameters.
9943 (unwind_create_frame_1): New helper function.
9944
9945 * window.c (inhibit_window_configuration_change_hook): New var.
9946 (run_window_configuration_change_hook): Obey it.
9947 (syms_of_window): Initialize it.
9948
9949 2012-02-22 Chong Yidong <cyd@gnu.org>
9950
9951 * xterm.c (x_draw_image_relief): Add missing type check for
9952 Vtool_bar_button_margin (Bug#10743).
9953
9954 2012-02-21 Chong Yidong <cyd@gnu.org>
9955
9956 * fileio.c (Vfile_name_handler_alist): Doc fix.
9957
9958 * buffer.c (Fget_file_buffer): Protect against invalid file
9959 handler return value.
9960
9961 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9962
9963 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9964 when computing $valmask.
9965
9966 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9967 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9968 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9969 It's useless in that case, and it can cause problems on hosts
9970 that allocate halves of EMACS_INT values separately.
9971 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9972 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9973 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9974 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9975 it avoids undefined behavior on hosts where shifting right by more
9976 than the word width has undefined behavior.
9977
9978 2012-02-19 Chong Yidong <cyd@gnu.org>
9979
9980 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9981 (Funhandled_file_name_directory, Ffile_name_as_directory)
9982 (Fdirectory_file_name, Fexpand_file_name)
9983 (Fsubstitute_in_file_name): Protect against invalid file handler
9984 return values (Bug#10845).
9985
9986 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9987
9988 * .gdbinit (pitx): Fix incorrect references to fields of the
9989 iterator stack.
9990
9991 2012-02-17 Chong Yidong <cyd@gnu.org>
9992
9993 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9994
9995 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9996
9997 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9998 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9999
10000 2012-02-15 Chong Yidong <cyd@gnu.org>
10001
10002 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10003 marked as special. Also, starting docstrings with * is obsolete.
10004
10005 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10006
10007 * gnutls.c (emacs_gnutls_write): Fix last change.
10008
10009 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10010
10011 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10012 send_process.
10013
10014 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10015
10016 * keymap.c (Fsingle_key_description): Handle char ranges.
10017
10018 2012-02-12 Chong Yidong <cyd@gnu.org>
10019
10020 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10021 as that creates a dangerous corner case.
10022
10023 * window.c (Fdelete_window_internal): Invalidate the mouse
10024 highlight (Bug#9904).
10025
10026 2012-02-12 Glenn Morris <rgm@gnu.org>
10027
10028 * xselect.c (Fx_own_selection_internal)
10029 (Fx_get_selection_internal, Fx_disown_selection_internal)
10030 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10031 * nsselect.m (Fx_own_selection_internal)
10032 (Fx_disown_selection_internal, Fx_selection_exists_p)
10033 (Fx_selection_owner_p, Fx_get_selection_internal):
10034 Sync docs and argument specs with the xselect.c versions.
10035
10036 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10037
10038 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10039
10040 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10041
10042 * w32select.c (Fx_selection_exists_p): Sync doc string and
10043 argument list with xselect.c. (Bug#10783)
10044
10045 * w16select.c (Fx_selection_exists_p): Sync doc string and
10046 argument list with xselect.c. (Bug#10783)
10047
10048 2012-02-10 Glenn Morris <rgm@gnu.org>
10049
10050 * fns.c (Fsecure_hash): Doc fix.
10051
10052 2012-02-09 Kenichi Handa <handa@m17n.org>
10053
10054 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10055
10056 2012-02-07 Chong Yidong <cyd@gnu.org>
10057
10058 * buffer.c (Fbuffer_local_variables)
10059 (buffer_lisp_local_variables): Handle unbound vars correctly;
10060 don't let Qunbound leak into Lisp.
10061
10062 2012-02-07 Glenn Morris <rgm@gnu.org>
10063
10064 * image.c (Fimagemagick_types): Doc fix.
10065
10066 * image.c (imagemagick-render-type): Change it from a lisp object
10067 to an integer. Move the doc here from the lisp manual.
10068 Treat all values not equal to 0 the same.
10069
10070 2012-02-06 Chong Yidong <cyd@gnu.org>
10071
10072 * doc.c (store_function_docstring): Avoid applying docstring of
10073 alias to base function (Bug#2603).
10074
10075 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10076
10077 * .gdbinit (pp1, pv1): Remove redundant defines.
10078 (pr): Use pp.
10079
10080 2012-02-04 Chong Yidong <cyd@gnu.org>
10081
10082 * nsterm.m: Declare a global (Bug#10694).
10083
10084 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10085
10086 * w32.c (get_emacs_configuration_options):
10087 Include --enable-checking, if specified, in the return value.
10088
10089 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10090
10091 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10092 after rounding frame sizes. (Bug#9723)
10093
10094 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10095
10096 * keyboard.c (adjust_point_for_property): Don't position point
10097 before BEGV. (Bug#10696)
10098
10099 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10100
10101 Handle overflow when computing char display width (Bug#9496).
10102 * character.c (char_width): Return EMACS_INT, not int.
10103 (char_width, c_string_width): Check for overflow when
10104 computing the width; this is possible now that individual
10105 characters can have unbounded width. Problem introduced
10106 by merge from Emacs 23 on 2012-01-19.
10107
10108 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10109
10110 * dbusbind.c (Fdbus_register_method): Mention the return value
10111 :ignore in the docstring.
10112
10113 2012-02-02 Glenn Morris <rgm@gnu.org>
10114
10115 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10116
10117 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10118 Unconditionally set to t. (Bug#10673)
10119 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10120 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10121 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10122
10123 2012-02-02 Kenichi Handa <handa@m17n.org>
10124
10125 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10126 0, do not call append_composite_glyph.
10127
10128 2012-02-02 Kenichi Handa <handa@m17n.org>
10129
10130 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10131 NULL (Bug#6988).
10132 (x_produce_glyphs): If the component of a composition is a null
10133 string, set it->pixel_width to 1 to avoid zero-width glyph.
10134
10135 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10136
10137 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10138 first 2 arguments are identical. This makes inserting large
10139 output from a subprocess an order of magnitude faster on
10140 MS-Windows, where all sbrk'ed memory is always contiguous.
10141
10142 2012-01-31 Glenn Morris <rgm@gnu.org>
10143
10144 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10145 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10146 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10147
10148 2012-01-29 Glenn Morris <rgm@gnu.org>
10149
10150 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10151
10152 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10153
10154 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10155
10156 2012-01-28 Chong Yidong <cyd@gnu.org>
10157
10158 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10159
10160 2012-01-26 Chong Yidong <cyd@gnu.org>
10161
10162 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10163
10164 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10165 repeat counts (Bug#10507).
10166
10167 2012-01-26 Glenn Morris <rgm@gnu.org>
10168
10169 * lread.c (syms_of_lread): Doc fix.
10170
10171 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10172
10173 * coding.c (encode_designation_at_bol): Change return value to
10174 EMACS_INT.
10175
10176 2012-01-25 Chong Yidong <cyd@gnu.org>
10177
10178 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10179
10180 2012-01-21 Chong Yidong <cyd@gnu.org>
10181
10182 * floatfns.c (Fcopysign): Make the second argument non-optional,
10183 since nil is not allowed anyway.
10184
10185 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10186
10187 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10188 (send_process): Likewise.
10189
10190 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10191
10192 * window.c (save_window_save, Fcurrent_window_configuration)
10193 (Vwindow_persistent_parameters): Do not use Qstate.
10194 Rewrite doc-strings.
10195
10196 2012-01-19 Kenichi Handa <handa@m17n.org>
10197
10198 * character.c (char_width): New function.
10199 (Fchar_width, c_string_width, lisp_string_width):
10200 Use char_width (Bug#9496).
10201
10202 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10203
10204 * window.c (Vwindow_persistent_parameters): New variable.
10205 (Fset_window_configuration, save_window_save): Handle persistent
10206 window parameters.
10207
10208 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10209
10210 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10211 thrashing the stack of the thread. (Bug#9087)
10212
10213 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10214
10215 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10216
10217 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10218
10219 * xdisp.c (rows_from_pos_range): Handle the case where the
10220 highlight ends on a newline. (Bug#10464)
10221 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10222 he end column for display of highlight that ends on a newline
10223 before a R2L line.
10224
10225 2012-01-11 Glenn Morris <rgm@gnu.org>
10226
10227 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10228 from load-path also when installation-directory is nil. (Bug#10208)
10229
10230 2012-01-10 Glenn Morris <rgm@gnu.org>
10231
10232 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10233
10234 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10235 Update template values to be closer to their typical values these days.
10236
10237 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10238
10239 * xdisp.c (rows_from_pos_range): Accept additional argument
10240 DISP_STRING, and accept any glyph in a row whose object is that
10241 string as eligible for mouse highlight. Fixes mouse highlight of
10242 display strings from overlays. (Bug#10464)
10243
10244 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10245
10246 emacs: fix an auto-save permissions race condition (Bug#10400)
10247 * fileio.c (auto_saving_dir_umask): New static var.
10248 (Fmake_directory_internal): Use it.
10249 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10250 creating the directory. The old code temporarily assigns
10251 too-generous permissions to the directory.
10252 (do_auto_save_eh): Clear it.
10253 (Fdo_auto_save): Catch all errors, not just file errors, so
10254 that the var is always cleared.
10255
10256 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10257
10258 * search.c (scan_buffer): Pass character positions to
10259 know_region_cache, not byte positions. (Bug#6540)
10260
10261 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10262
10263 * w32.c (sys_rename): Report EXDEV when rename of a directory
10264 fails because the target is on another logical disk. (Bug#10284)
10265
10266 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10267
10268 * xterm.c (x_embed_request_focus): New function.
10269
10270 * xterm.h: Add prototype.
10271
10272 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10273
10274 2012-01-05 Glenn Morris <rgm@gnu.org>
10275
10276 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10277
10278 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10279
10280 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10281 Load gnutls_transport_set_lowat only if GnuTLS version is below
10282 2.11.1.
10283 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10284 GnuTLS versions below 2.11.1.
10285
10286 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10287
10288 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10289 to the doc string advising against its use for altering the way
10290 windows are scrolled.
10291
10292 2011-12-28 Kenichi Handa <handa@m17n.org>
10293
10294 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10295 coding-system ASCII compatible only when it does not produce BOM
10296 on encoding (Bug#10383).
10297
10298 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10299
10300 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10301 can scroll.
10302 (create_and_show_popup_menu): Always use menu_position_func for
10303 Gtk3 (Bug#10361).
10304
10305 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10306
10307 * callint.c (Fcall_interactively): Don't truncate prompt string.
10308
10309 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10310
10311 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10312 property that ends at ZV, so that the bidi iteration could be
10313 resumed from there (after widening). (Bug#10360)
10314
10315 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10316
10317 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10318
10319 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10320
10321 * nsterm.m (x_free_frame_resources):
10322 Release f->output_data.ns->miniimage.
10323 (ns_index_color): Fix indentation. Do not retain
10324 color_table->colors[i].
10325
10326 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10327 before returning.
10328
10329 * nsfns.m (x_set_background_color): Assign return value from
10330 ns_index_color to face-background instead of NSColor*.
10331 (ns_implicitly_set_icon_type): Fix indentation.
10332 Change assignment in for loop to comparison.
10333
10334 * emacs.c (ns_pool): New variable.
10335 (main): Assign ns_pool.
10336 (Fkill_emacs): Call ns_release_autorelease_pool.
10337
10338 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10339 autorelease fdesc, release fdAttrs and tdict.
10340 (ns_get_covering_families): Release charset.
10341 (ns_findfonts): Release NSFontDescriptor created with new.
10342 (ns_uni_to_glyphs): Fix indentation.
10343 (setString): Release attrStr before assigning new value.
10344
10345 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10346
10347 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10348 and NS_IMPL_COCOA.
10349 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10350 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10351
10352 2011-12-18 David Reitter <reitter@cmu.edu>
10353
10354 * nsterm.m (ns_term_init): Subscribe for notifications
10355 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10356 to method trackingNotification in EmacsMenu.
10357
10358 * nsmenu.m (trackingMenu): New variable.
10359 (trackingNotification): New method (from Aquamacs).
10360 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10361 from Aquamacs (Bug#7030).
10362
10363 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10364
10365 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10366 (symbol_to_nsstring): Fix indentation.
10367 (ns_symbol_to_pb): New function.
10368 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10369 (Fns_rotate_cut_buffers_internal): Remove.
10370 (Fns_store_selection_internal): Rename from
10371 Fns_store_cut_buffer_internal.
10372 (ns_get_foreign_selection, Fx_own_selection_internal)
10373 (Fx_disown_selection_internal, Fx_selection_exists_p)
10374 (Fns_get_selection_internal, Fns_store_selection_internal):
10375 Use ns_symbol_to_pb and check if return value is nil.
10376 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10377 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10378 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10379 renamed to Sns_store_selection_internal.
10380 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10381 and remove this function.
10382 (ns_handle_selection_clear): Remove, never used.
10383 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10384 here.
10385
10386 2011-12-17 Ken Brown <kbrown@cornell.edu>
10387
10388 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10389 GID is unknown (Bug#10257).
10390
10391 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10392
10393 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10394 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10395 which caused a build failure on GNU/Linux IA-64. This problem was
10396 introduced by my 2011-10-07 patch.
10397
10398 2011-12-15 Juri Linkov <juri@jurta.org>
10399
10400 * image.c (imagemagick_error): New function. (Bug#10112)
10401 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10402 Use `imagemagick_error' where ImageMagick functions return
10403 `MagickFalse'.
10404 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10405 proper order.
10406
10407 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10408
10409 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10410 fill background (Bug#8992).
10411
10412 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10413
10414 * window.c (Vwindow_combination_resize)
10415 (Vwindow_combination_limit): Use t instead of non-nil in
10416 doc-strings.
10417 (Vrecenter_redisplay): Add first sentence of doc-string on
10418 separate line.
10419 (Frecenter): Fix doc-string typo.
10420
10421 2011-12-11 Kenichi Handa <handa@m17n.org>
10422
10423 * coding.c (Funencodable_char_position): Pay attention to the
10424 buffer text relocation (Bug#9389).
10425
10426 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10427
10428 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10429 gtk_init (Bug#10100).
10430
10431 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10432
10433 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10434 IT->string is nil. (Bug#10263)
10435
10436 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10437
10438 * nsterm.h (x_free_frame_resources): Declare.
10439
10440 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10441 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10442
10443 * nsterm.h (ns_get_defaults_value): Declare.
10444
10445 * nsterm.m (ns_default): Call ns_get_defaults_value.
10446
10447 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10448
10449 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10450 (Bug#10170)
10451
10452 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10453
10454 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10455 that where the value of an _OBJC_* symbol points to is in the .bss
10456 section (Bug#10240).
10457
10458 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10459
10460 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10461 after the loop to call ccl_driver at least once (Bug#8619).
10462
10463 2011-12-08 Kenichi Handa <handa@m17n.org>
10464
10465 * ftfont.c (get_adstyle_property): Fix previous change
10466 (Bug#10233).
10467
10468 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10469
10470 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10471 dirs from the default value of EMACSLOADPATH (bug#10208).
10472
10473 2011-12-07 Glenn Morris <rgm@gnu.org>
10474
10475 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10476 installation and source directories as well. (Bug#10208)
10477
10478 2011-12-06 Chong Yidong <cyd@gnu.org>
10479
10480 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10481
10482 2011-12-06 Glenn Morris <rgm@gnu.org>
10483
10484 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10485 as an error, not just -1. (Bug#10217)
10486
10487 2011-12-05 Chong Yidong <cyd@gnu.org>
10488
10489 * keyboard.c (process_special_events): New function.
10490 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10491
10492 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10493
10494 * coding.c (encode_designation_at_bol): Don't use uninitialized
10495 local variable (Bug#9318).
10496
10497 2011-12-05 Kenichi Handa <handa@m17n.org>
10498
10499 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10500 return Qnil (Bug#8046, Bug#10193).
10501
10502 2011-12-05 Kenichi Handa <handa@m17n.org>
10503
10504 * coding.c (encode_designation_at_bol): New args charbuf_end and
10505 dst. Return the number of produced bytes. Callers changed.
10506 (coding_set_source): Return how many bytes coding->source was
10507 relocated.
10508 (coding_set_destination): Return how many bytes
10509 coding->destination was relocated.
10510 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10511 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10512
10513 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10514
10515 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10516 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10517 macro (Bug#9318).
10518
10519 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10520
10521 The following changes are to fix Bug#9318.
10522
10523 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10524 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10525 (encode_coding_iso_2022, encode_coding_sjis)
10526 (encode_coding_big5, encode_coding_charset): Use the above macros.
10527
10528 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10529
10530 * lisp.h (process_quit_flag): Fix external declaration.
10531
10532 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10533
10534 Don't macro-inline non-performance-critical code.
10535 * eval.c (process_quit_flag): New function.
10536 * lisp.h (QUIT): Use it.
10537
10538 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10539
10540 * nsfns.m (get_geometry_from_preferences): New function.
10541 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10542
10543 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10544
10545 * emacs.c (Qkill_emacs): Define.
10546 (syms_of_emacs): Initialize it.
10547 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10548 Qquit_flag to `kill-emacs' instead.
10549 (quit_throw_to_read_char): Add parameter `from_signal'.
10550 All callers changed. Call Fkill_emacs if requested and safe.
10551 * lisp.h (QUIT): Call Fkill_emacs if requested.
10552
10553 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10554
10555 * widget.c (update_wm_hints): Return if wmshell is null.
10556 (widget_update_wm_size_hints): New function.
10557
10558 * widget.h (widget_update_wm_size_hints): Declare.
10559
10560 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10561 widget_update_wm_size_hints (Bug#10104).
10562
10563 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10564
10565 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10566 before a newline, prepare the bidi iterator for consuming the
10567 newline, and keep the current paragraph direction. (Bug#10183)
10568 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10569
10570 2011-12-02 Juri Linkov <juri@jurta.org>
10571
10572 * search.c (Fword_search_regexp): New Lisp function created from
10573 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10574 (Fword_search_backward, Fword_search_forward)
10575 (Fword_search_backward_lax, Fword_search_forward_lax):
10576 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10577 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10578
10579 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10580
10581 * fileio.c (Finsert_file_contents): Move after-change-function call
10582 to before the "handled:" label, since all "goto handled" appear in
10583 cases where the *-change-functions have already been properly called
10584 (bug#10117).
10585
10586 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10587
10588 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10589 waiting for input. (Bug#10169)
10590
10591 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10592
10593 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10594 verifies glyph row's hash code--we have just reallocated the
10595 glyphs, so their contents can be complete garbage. (Bug#10164)
10596
10597 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10598
10599 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10600
10601 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10602
10603 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10604 attributes are tested _before_ calling verify_row_hash, to protect
10605 against GCC re-ordering of the tests. (Bug#10164)
10606
10607 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10608
10609 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10610
10611 * xterm.c (handle_one_xevent): Only set async_visible and friends
10612 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10613 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10614 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10615
10616 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10617
10618 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10619 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10620 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10621 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10622 All uses changed to use GCPRO1 etc.
10623 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10624 Revert to old implementation (i.e., before 2011-03-11).
10625
10626 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10627
10628 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10629 of scroll runs so as to avoid assigning disabled bogus rows and
10630 unnecessary graphics copy operations.
10631
10632 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10633
10634 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10635 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10636 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10637 (malloc, free, realloc, calloc): Redirect to e_* only when
10638 compiling Emacs.
10639
10640 * lisp.h (GCTYPEBITS): Move before first use.
10641 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10642 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10643 this macro definition.
10644
10645 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10646 _MSC_VER.
10647
10648 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10649
10650 * gtkutil.c (xg_create_frame_widgets):
10651 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10652 present with Gtk+ 2.0.
10653
10654 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10655
10656 * fileio.c (Finsert_file_contents): Undo previous change; see
10657 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10658
10659 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10660
10661 Rename locals to avoid shadowing.
10662 * fileio.c (Finsert_file_contents):
10663 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10664 * process.c (wait_reading_process_output):
10665 Rename inner 'proc' to 'p' to avoid shadowing.
10666 Indent for consistency with usual Emacs style.
10667
10668 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10669
10670 * xdisp.c (redisplay_window): If cursor row is not fully visible
10671 after recentering, and scroll-conservatively is set to a large
10672 number, scroll window by a few more lines to make the cursor fully
10673 visible and out of scroll-margin. (Bug#10105)
10674 (start_display): Don't move to the next line if the display should
10675 start at a newline that is part of a display vector or an overlay
10676 string. (Bug#10119)
10677
10678 2011-11-24 Juri Linkov <juri@jurta.org>
10679
10680 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10681 after the `MagickPingImage' call. (Bug#10112)
10682
10683 2011-11-23 Chong Yidong <cyd@gnu.org>
10684
10685 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10686
10687 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10688
10689 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10690 making another buffer current. (Bug#10114)
10691
10692 2011-11-23 Glenn Morris <rgm@gnu.org>
10693
10694 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10695
10696 2011-11-23 Chong Yidong <cyd@gnu.org>
10697
10698 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10699 using it (Bug#5984).
10700
10701 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10702
10703 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10704 and header-lines, as they don't have one computed for them.
10705 (Bug#10098)
10706
10707 * .gdbinit (prow): Make displayed values more self-explaining.
10708 Add row's hash code.
10709
10710 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10711
10712 * process.c (wait_reading_process_output): Fix asynchrounous
10713 GnuTLS socket handling on some versions of the GnuTLS library.
10714 (wait_reading_process_output): Add comment and URL.
10715
10716 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10717
10718 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10719
10720 2011-11-21 Chong Yidong <cyd@gnu.org>
10721
10722 * window.c (Fnext_window, Fprevious_window): Doc fix.
10723
10724 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10725
10726 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10727
10728 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10729
10730 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10731
10732 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10733
10734 * window.c (Fset_window_combination_limit): Rename argument
10735 STATUS to LIMIT.
10736 (Vwindow_combination_limit): Remove "status" from doc-string.
10737
10738 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10739
10740 * m/ibms390.h: Remove.
10741 * m/ibms390x.h: Don't include "ibms390.h".
10742
10743 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10744
10745 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10746 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10747
10748 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10749
10750 * casetab.c (Fset_case_table):
10751 * charset.c (Fcharset_after): Fix typos.
10752
10753 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10754
10755 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10756 Otherwise, valgrind does not work on some platforms.
10757 Problem reported by Andreas Schwab in
10758 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10759 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10760 is set, removing the need for VIRT_ADDRESS_VARIES.
10761 (PURE_P): Use a more-efficient implementation that needs just one
10762 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10763 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10764 to 4 (xorl, subq, cmpq, setbe).
10765 * alloc.c (pure): Always extern now, since that's the
10766 VIRT_ADDR_VARIES behavior.
10767 (PURE_POINTER_P): Use a single comparison, not two, for
10768 consistency with the new puresize.h.
10769 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10770 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10771 Remove VIRT_ADDR_VARIES no longer needed.
10772
10773 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10774
10775 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10776 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10777 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10778 behave as if the cursor position were at the window margin.
10779
10780 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10781 and the cursor position is out of bounds, behave as if the cursor
10782 position were at the window margin. (Bug#10075)
10783
10784 2011-11-18 Chong Yidong <cyd@gnu.org>
10785
10786 * window.c (Fwindow_combination_limit): Make first argument
10787 non-optional, since it is meaningless for live windows like the
10788 selected window.
10789
10790 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10791
10792 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10793
10794 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10795
10796 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10797 (graft_intervals_into_buffer): Simplify.
10798
10799 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10800
10801 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10802 hash values of the two rows.
10803 (copy_row_except_pointers): Preserve the used[] arrays and the
10804 hash values of the two rows. (Bug#10035)
10805 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10806
10807 * xdisp.c (row_hash): New function, body extracted from
10808 compute_line_metrics.
10809 (compute_line_metrics): Call row_hash, instead of computing the
10810 hash code inline.
10811
10812 * dispnew.c (verify_row_hash): Call row_hash for computing the
10813 hash code of a row, instead of duplicating code from xdisp.c.
10814
10815 * dispextern.h (row_hash): Add prototype.
10816
10817 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10818
10819 * frame.c (delete_frame): Don't delete the terminal when the last
10820 X frame is closed if emacs is built with GTK toolkit.
10821
10822 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10823
10824 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10825
10826 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10827
10828 * window.c (Vwindow_splits): Rename to
10829 Vwindow_combination_resize. Suggested by Juri Linkov.
10830 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10831 of Vwindow_splits.
10832
10833 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10834
10835 * nsfns.m (Fns_font_name):
10836 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10837
10838 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10839
10840 * window.h (window): Rename slot "nest" to "combination_limit".
10841 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10842 (Fset_window_nest): Rename to Fset_window_combination_limit.
10843 (Vwindow_nest): Rename to Vwindow_combination_limit.
10844 (recombine_windows, make_parent_window, make_window)
10845 (Fsplit_window_internal, saved_window)
10846 (Fset_window_configuration, save_window_save): Rename all
10847 occurrences of window_nest to window_combination_limit.
10848
10849 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10850
10851 * image.c (imagemagick_load_image): Fix typo.
10852
10853 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10854
10855 * xdisp.c (display_line): Move the call to
10856 highlight_trailing_whitespace before the call to
10857 compute_line_metrics, since the latter needs to see the final
10858 faces of all the glyphs to compute ROW's hash value.
10859 Fixes assertion violations in row_equal_p. (Bug#10035)
10860
10861 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10862
10863 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10864 just return (bug#10044).
10865
10866 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10867
10868 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10869 with user-defined heap size. Bump the default size of the temacs
10870 heap to 27MB, to avoid memory warning when running temacs.
10871 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10872
10873 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10874 current_matrix and desired_matrix. (Bug#9990)
10875 (verify_row_hash) [XASSERTS]: New function.
10876 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10877 that the hash value of glyph rows is correct.
10878
10879 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10880
10881 * window.h (window): Remove splits slot.
10882 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10883 (Fdelete_other_windows_internal, make_parent_window)
10884 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10885 (Fset_window_configuration, save_window_save): Don't deal with
10886 split status of windows.
10887 (saved_window): Remove splits slot.
10888 (Vwindow_splits): Rewrite doc-string.
10889
10890 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10891
10892 * xfns.c (unwind_create_frame):
10893 * nsfns.m (unwind_create_frame):
10894 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10895 Vframe_list (Bug#9999).
10896
10897 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10898
10899 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10900
10901 2011-11-11 Kenichi Handa <handa@m17n.org>
10902
10903 * callproc.c (Fcall_process): Set the member dst_multibyte of
10904 process_coding.
10905
10906 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10907
10908 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10909 avoid a crash (bug#9496).
10910
10911 2011-11-09 Chong Yidong <cyd@gnu.org>
10912
10913 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10914 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10915
10916 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10919
10920 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10921
10922 Avoid some portability problems by eschewing 'extern inline' functions.
10923 The trivial performance wins aren't worth the portability hassles; see
10924 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10925 et seq.
10926 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10927 (window_box_width, window_box_left, window_box_left_offset)
10928 (window_box_right, window_box_right_offset): Undo previous change,
10929 by removing the "extern"s.
10930 * intervals.c (adjust_intervals_for_insertion)
10931 (adjust_intervals_for_deletion): Undo previous change,
10932 making these static again.
10933 (offset_intervals, temp_set_point_both, temp_set_point)
10934 (copy_intervals_to_string): No longer inline.
10935 * xdisp.c (window_text_bottom_y, window_box_width)
10936 (window_box_height, window_box_left_offset)
10937 (window_box_right_offset, window_box_left, window_box_right)
10938 (window_box): No longer inline.
10939
10940 2011-11-08 Chong Yidong <cyd@gnu.org>
10941
10942 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10943 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10944 Signal an error if not a live window.
10945 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10946 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10947
10948 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10949
10950 * lisp.h (syms_of_abbrev): Remove declaration.
10951 Reported by CHENG Gao <chenggao@royau.me>.
10952
10953 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10954
10955 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10956 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10957 of temacs in GUI mode.
10958
10959 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10960
10961 * window.h: Declare delete_all_child_windows instead of
10962 delete_all_subwindows.
10963 * window.c (Fwindow_nest, Fset_window_nest)
10964 (Fset_window_new_total, Fset_window_new_normal)
10965 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10966 (delete_all_subwindows): Rename to delete_all_child_windows.
10967 (Fdelete_other_windows_internal, Fset_window_configuration):
10968 Call delete_all_child_windows instead of delete_all_subwindows.
10969 * frame.c (delete_frame): Call delete_all_child_windows instead
10970 of delete_all_subwindows.
10971
10972 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10973
10974 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10975 This is also needed for porting to any host where GC_MARK_STACK is
10976 not GC_MAKE_GCPROS_NOOPS.
10977 (which_symbols): Use it.
10978
10979 2011-11-07 Kenichi Handa <handa@m17n.org>
10980
10981 * coding.c (coding_set_destination): Check coding->src_pos only
10982 when coding->src_object is a buffer (bug#9910).
10983
10984 * process.c (send_process): Set the member src_multibyte of coding
10985 to 0 (bug#9911) when sending a unibyte text.
10986
10987 * callproc.c (Fcall_process): Set the member src_multibyte of
10988 process_coding to 0 (bug#9912).
10989
10990 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10991
10992 * xmenu.c (cleanup_widget_value_tree): New function.
10993 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10994 calling free_menubar_widget_value_tree directly (Bug#9830).
10995
10996 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10997
10998 Fix some portability problems with 'inline'.
10999 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11000 (window_box_width, window_box_left, window_box_left_offset)
11001 (window_box_right, window_box_right_offset): Declare extern.
11002 Otherwise, these inline functions do not conform to C99 and
11003 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11004 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11005 * intervals.c (adjust_intervals_for_insertion)
11006 (adjust_intervals_for_deletion): Now extern, because otherwise the
11007 extern inline functions 'offset_intervals' couldn't refer to it.
11008 (static_offset_intervals): Remove.
11009 (offset_intervals): Rewrite using the old contents of
11010 static_offset_intervals. The old version didn't conform to C99
11011 because an extern inline function contained a reference to an
11012 identifier with static linkage.
11013
11014 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11015
11016 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11017 GC.
11018
11019 2011-11-06 Eli Zaretskii <eliz@gnu.org>
11020
11021 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11022 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11023 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11024 return Qleft_to_right.
11025
11026 2011-11-06 Chong Yidong <cyd@gnu.org>
11027
11028 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11029 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11030 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11031 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11032 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11033 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11034 (Fwindow_vscroll): Doc fix.
11035 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11036 argument, since it makes no sense to pass a live window and for
11037 consistency with window-child.
11038
11039 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11040
11041 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11042 support MSVC.
11043
11044 2011-11-05 Jason Rumney <jasonr@gnu.org>
11045
11046 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11047 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11048 fonts (Bug#6029).
11049 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11050 bitwise arithmetic preventing use of unicode-sip and non-truetype
11051 opentype fonts.
11052
11053 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11054
11055 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11056 "emacs"-only part.
11057
11058 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11059 initialization code to keep similarity to xfns.c after changes
11060 from 2011-11-05.
11061
11062 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11063
11064 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11065 (unwind_create_frame): New function (Bug#9943).
11066 (Fx_create_frame): Restructure code to be more similar to the one in
11067 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11068 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11069 Move terminal->reference_count++ just before making the frame official
11070 (Bug#9943).
11071
11072 * nsterm.m (x_free_frame_resources): New function.
11073 (x_destroy_window): Move code to x_free_frame_resources.
11074
11075 * xfns.c (unwind_create_frame): Fix comment.
11076 (Fx_create_frame, x_create_tip_frame):
11077 Move terminal->reference_count++ just before making the frame
11078 official. Move initialization of image_cache_refcount and
11079 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11080
11081 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11082
11083 Support MSVC build with newer versions of Visual Studio.
11084 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11085 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11086 nt/gmake.defs.
11087
11088 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11089 which are not supported by MSVC.
11090 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11091 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11092 bitfields.
11093 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11094 types in bitfields.
11095 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11096
11097 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11098
11099 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11100
11101 Support MSVC build with newer versions of Visual Studio.
11102 * w32.c: Don't include w32api.h for MSVC.
11103 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11104
11105 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11106 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11107 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11108 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11109 e_* cousins.
11110 (alloca) [_MSC_VER]: Define to _alloca.
11111
11112 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11113
11114 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11115
11116 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11117
11118 * xdisp.c (note_mouse_highlight): If either of
11119 previous/next-single-property-change returns nil, treat that as
11120 the beginning or the end of the buffer. (Bug#9955)
11121
11122 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11123
11124 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11125 label is not null (Bug#9951).
11126 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11127 may be NULL.
11128
11129 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11130
11131 * window.c (Fwindow_body_size): Mention in the doc string that the
11132 return value is in frame's canonical units. (Bug#9949)
11133
11134 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11135
11136 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11137
11138 * w32fns.c (unwind_create_frame): If needed, free the glyph
11139 matrices of the partially constructed frame. (Bug#9943)
11140 * xfns.c (unwind_create_frame): Likewise.
11141
11142 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11143
11144 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11145 Don't stop backward scan on the continuation glyph, even though
11146 its CHARPOS is positive.
11147 (mouse_face_from_buffer_pos, note_mouse_highlight):
11148 Rename cover_string to disp_string.
11149
11150 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11151
11152 * window.c (temp_output_buffer_show): Don't use
11153 Vtemp_buffer_show_specifiers.
11154 (Vtemp_buffer_show_specifiers): Remove unused variable.
11155
11156 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11157
11158 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11159 past the beginning of the current glyph matrix.
11160
11161 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11162
11163 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11164 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11165 HAVE_GTK3 (Bug#9869).
11166
11167 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11168 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11169
11170 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11171
11172 * xterm.c: Declare x_handle_net_wm_state to return int.
11173 (handle_one_xevent): Check if we are iconified but don't have
11174 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11175 (get_current_wm_state): Return non-zero if not hidden,
11176 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11177 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11178 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11179 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11180
11181 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11182
11183 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11184 so that this new function doesn't get optimized away by a
11185 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11186
11187 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11188
11189 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11190
11191 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11192
11193 Fix the `xbytecode' command.
11194 * .gdbinit (xprintbytestr): New command.
11195 (xwhichsymbols): Rename from `which'; all callers changed.
11196 (xbytecode): Print the byte-code string as well.
11197
11198 2011-10-29 Kim Storm <storm@cua.dk>
11199
11200 * alloc.c (which_symbols): New function.
11201
11202 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11203
11204 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11205 line. (Bug#9903)
11206
11207 2011-10-29 Glenn Morris <rgm@gnu.org>
11208
11209 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11210 Not clear what it was for, and it causes various bugs. (Bug#9839)
11211
11212 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11213
11214 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11215 possible random value that matches one of those tested as
11216 condition to clear the mouse face.
11217
11218 2011-10-28 Chong Yidong <cyd@gnu.org>
11219
11220 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11221
11222 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11223
11224 * window.c (make_window): Initialize phys_cursor_on_p.
11225
11226 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11227
11228 * lisp.h (struct Lisp_Symbol): Update comments.
11229
11230 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11231
11232 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11233
11234 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11235
11236 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11237 <oslsachem@gmail.com> for helping to debug this.
11238
11239 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11240 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11241 (g_b_init_get_glyph_outline_w): New static variables.
11242 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11243 (GetGlyphOutlineW_Proc): New typedefs.
11244 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11245 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11246 New functions.
11247 (w32font_open_internal, compute_metrics):
11248 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11249 instead of calling the "wide" APIs directly.
11250
11251 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11252
11253 * w32.h (syms_of_w32font): Add prototype.
11254
11255 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11256
11257 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11258 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11259 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11260 (Fmove_to_window_line): Doc fix.
11261
11262 2011-10-27 Chong Yidong <cyd@gnu.org>
11263
11264 * process.c (make_process): Set gnutls_state to NULL.
11265
11266 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11267 non-NULL, regardless of GNUTLS_INITSTAGE.
11268 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11269 an error. Set process slots as soon as we allocate them.
11270
11271 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11272
11273 2011-10-27 Chong Yidong <cyd@gnu.org>
11274
11275 * gnutls.c (emacs_gnutls_deinit): New function.
11276 Deallocate credentials structures as well as calling gnutls_deinit.
11277 (Fgnutls_deinit, Fgnutls_boot): Use it.
11278
11279 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11280 (deactivate_process): Call emacs_gnutls_deinit.
11281
11282 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11283
11284 * image.c (x_create_x_image_and_pixmap):
11285 * w32.c (sys_rename, w32_delayed_load):
11286 * w32font.c (fill_in_logfont):
11287 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11288
11289 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11290
11291 * w32fns.c (w32_default_color_map): New function,
11292 extracted from Fw32_default_color_map.
11293 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11294
11295 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11296
11297 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11298
11299 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11300
11301 * keyboard.c (test_undefined): New function (bug#9751).
11302 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11303
11304 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11305
11306 * sysdep.c (init_sys_modes): Fix the check for the controlling
11307 terminal (Bug#6649).
11308
11309 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11310
11311 * dispextern.h (struct bidi_it): New member next_en_type.
11312
11313 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11314 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11315 current character, check also for next_en_type being WEAK_EN.
11316 (bidi_resolve_weak): Don't enter the expensive loop if the current
11317 position is before next_en_pos. Record the bidi type of the first
11318 non-ET, non-BN character we find, in addition to its position.
11319 (bidi_level_of_next_char): Invalidate next_en_type when
11320 next_en_pos is over-stepped.
11321
11322 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11323
11324 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11325 * editfns.c: Rewrite current-time-zone so that it invokes
11326 the equivalent of (format-time-string "%Z") to get the time zone name.
11327 This fixes a bug when the time zone name contains characters that
11328 need converting from the system time locale to Emacs internal format.
11329 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11330 that patch fixed format-time-string to do the conversion, but
11331 I forgot to fix current-time-zone.
11332 (format_time_string): New function, containing most of
11333 what Fformat_time_string used to contain.
11334 (Fformat_time_string): Rewrite in terms of format_time_string.
11335 This doesn't change this function's behavior.
11336 (current-time-zone): Rewrite to use format_time_string.
11337 This fixes the bug reported by Michael Schierl in
11338 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11339 Jason Rumney's 2007-06-07 change worked around this bug, but
11340 didn't fix it.
11341 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11342
11343 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11344
11345 * xdisp.c (start_display): If the character at POS is displayed
11346 via a display vector, reset IT->current.dpvec_index to zero.
11347 (try_window_reusing_current_matrix): If a line ends in a display
11348 vector or the next line starts in a display vector, continue
11349 redrawing the window even though the character position of
11350 start_row was reached.
11351 (Bug#9771, part 2)
11352
11353 2011-10-18 Chong Yidong <cyd@gnu.org>
11354
11355 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11356 with nobreak-char-display too.
11357
11358 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11359
11360 Fix part 3 of bug#9771.
11361 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11362 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11363 non-neutral characters if the current character is a paragraph
11364 separator (a.k.a. Newline). This avoids running the same
11365 expensive loop twice, once when we consume the preceding newline
11366 and the other time when the line actually needs to be displayed.
11367 Avoid the loop when we see neutrals on the base embedding level
11368 following a character whose directionality is the same as the
11369 paragraph's. This avoids running the expensive loop when a line
11370 ends in a long sequence of neutrals, like control characters.
11371 Add assertion against STRONG_AL type. Slightly rearrange code
11372 that determines the type of a neutral given the first non-neutral
11373 that follows it.
11374 (bidi_level_of_next_char): Set next_en_pos to zero when
11375 invalidating its info.
11376
11377 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11378
11379 * xdisp.c (push_display_prop): Determine whether to record string
11380 or buffer position by IT->string, not by IT->method. Allow
11381 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11382 (move_it_vertically_backward): Don't look for character position
11383 immediately after the newline when in a continuation line.
11384 (Bug#9771, part 1)
11385
11386 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11387
11388 * window.c (coordinates_in_window): Rewrite and delabelize
11389 vertical border check. (Bug#5357) (Bug#9618)
11390
11391 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11392
11393 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11394 errors in XSetWindowBorder (bug#9310).
11395
11396 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11397
11398 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11399 avoid crash when xmalloc overrun checking is enabled.
11400
11401 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11402
11403 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11404 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11405 cursor motion with <left> and <right> arrow keys.
11406
11407 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11408 some callers set that themselves.
11409
11410 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11411
11412 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11413 display string and the previous row comes from the same string and
11414 is empty. (Bug#9739) (Bug#9738)
11415
11416 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11417
11418 * doc.c (get_doc_string): Encode file name (bug#9735).
11419
11420 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11421
11422 * bidi.c (bidi_level_of_next_char):
11423 * xdisp.c (get_visually_first_element): Remove old incorrect
11424 comments regarding the Unicode Line Separator character.
11425
11426 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11427
11428 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11429
11430 * alloc.c (Fgc_status): Do not access beyond zombies array
11431 boundary if nzombies > MAX_ZOMBIES.
11432 * alloc.c (dump_zombies): Add missing format specifier.
11433
11434 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11435
11436 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11437 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11438
11439 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11440 Some packages use them to denote characters with modifiers.
11441
11442 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11443
11444 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11445 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11446 matching a pp-number. Rename parameter var to var1.
11447
11448 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11449
11450 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11451
11452 2011-10-08 Glenn Morris <rgm@gnu.org>
11453
11454 * callint.c (Fcall_interactively): Give a more explicit error for the
11455 'c' case with a non-character input. (Bug#8479)
11456
11457 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11458
11459 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11460 lines.
11461 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11462 lines that are hscrolled on the left.
11463
11464 * dispnew.c (buffer_posn_from_coords): Account for a possible
11465 presence of header-line. (Bug#4426)
11466
11467 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11468
11469 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11470 Don't advertise functionality which we discourage or doesn't work.
11471
11472 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11473
11474 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11475 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11476 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11477 this makes Emacs dump core during garbage collection on rare
11478 occasions. sizeof is obviously inferior to offsetof here, so
11479 stick with offsetof.
11480 (GC_POINTER_ALIGNMENT): New macro.
11481 (mark_memory): Omit 3rd (offset) arg; caller changed.
11482 Don't assume EMACS_INT alignment is the same as pointer alignment.
11483
11484 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11485
11486 * keyboard.c (read_key_sequence_remapped): New var.
11487 (read_key_sequence): Compute remapping in the right buffer.
11488 (command_loop_1): Use read_key_sequence's remapping directly.
11489
11490 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11491
11492 * dired.c (file_name_completion): Don't expand file name.
11493 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11494 before checking file name handler.
11495
11496 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11497 they've been requested explicitly (bug#9591).
11498
11499 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11500
11501 * keymap.c (Fsingle_key_description): Use make_specified_string
11502 instead of build_string to build string from push_key_description.
11503 (Bug#5193)
11504
11505 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11506
11507 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11508 This fixes a Y2038 bug on 64-bit hosts.
11509 * buffer.c (reset_buffer):
11510 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11511 (Fclear_buffer_auto_save_failure):
11512 Use 0, not -1, to represent an unset failure time, since time_t
11513 might not be signed.
11514
11515 Remove dependency on glibc malloc internals.
11516 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11517 Move back here from lisp.h, but with their new implementations.
11518 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11519 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11520 * charset.c (charset_table_init): New static var.
11521 (syms_of_charset): Use it instead of xmalloc. This removes a
11522 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11523 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11524 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11525 Move back to alloc.c.
11526 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11527 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11528
11529 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11530
11531 * nsterm.m (windowDidResize): Call x_set_window_size only when
11532 ns_in_resize is true. Otherwise set pixelwidth/height and
11533 call change_frame_size (Bug#9628).
11534
11535 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11536
11537 Port --enable-checking=all to Fedora 14 x86-64.
11538 * charset.c (syms_of_charset): Also account for glibc malloc's
11539 internal overhead when calculating the initial malloc maximum.
11540
11541 Port --enable-checking=all to Fedora 14 x86.
11542 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11543 Move to lisp.h.
11544 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11545 (overrun_check_realloc, overrun_check_free):
11546 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11547 That way, xmalloc returns a properly-aligned pointer even if
11548 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11549 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11550 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11551 into account when calculating the initial malloc maximum.
11552 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11553 Move here from alloc.c, so that charset.c can use it too.
11554 Properly align; the old code wasn't right for common 32-bit hosts
11555 when configured with --enable-checking=all.
11556 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11557 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11558
11559 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11560
11561 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11562 use EDOM.
11563
11564 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11565
11566 * xdisp.c (compute_display_string_end): If there's no display
11567 string at CHARPOS, return -1.
11568
11569 * bidi.c (bidi_fetch_char): When compute_display_string_end
11570 returns a negative value, treat the character as a normal
11571 character not covered by a display string. (Bug#9624)
11572
11573 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11574
11575 * lread.c (Fread_from_string): Fix typo in docstring.
11576
11577 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11578
11579 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11580 newline, reseat the iterator instead of bidi-iterating there one
11581 character at a time. (Bug#9610)
11582 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11583 TO_CHARPOS if the bidi iterator is at base embedding level.
11584
11585 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11586
11587 * lread.c (readevalloop): Use correct code for NBSP.
11588 (read1): Likewise. (Bug#9608)
11589
11590 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11591
11592 * dbusbind.c (Fdbus_register_signal): When service is not
11593 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11594
11595 2011-09-25 Glenn Morris <rgm@gnu.org>
11596
11597 * buffer.c (truncate-lines): Doc fix.
11598
11599 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11600
11601 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11602 (Fset_window_next_buffers): Doc fix.
11603
11604 2011-09-24 Glenn Morris <rgm@gnu.org>
11605
11606 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11607
11608 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11609
11610 Fix minor problems found by static checking.
11611 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11612 * indent.c (Fvertical_motion): Fix == vs = typo.
11613
11614 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11615
11616 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11617 Default value is now t. Doc fix.
11618
11619 * indent.c (Fvertical_motion): Compute and apply the overshoot
11620 logic when moving up, not only when moving down. Fix the
11621 confusing name and values of the it_overshoot_expected variable;
11622 logic changes accordingly. (Bug#9254) (Bug#9549)
11623
11624 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11625 CHARPOS is covered by a display string which includes newlines.
11626 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11627 is covered by a display string with embedded newlines.
11628
11629 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11630
11631 * dbusbind.c (Fdbus_register_signal): Add match rule to
11632 Vdbus_registered_objects_table. (Bug#9581)
11633 (Fdbus_register_method, Vdbus_registered_objects_table):
11634 Fix docstring.
11635
11636 2011-09-24 Jim Meyering <meyering@redhat.com>
11637
11638 do not ignore write error for any output size
11639 The previous change was incomplete.
11640 While it makes emacs --batch detect the vast majority of stdout
11641 write failures, errors were still ignored whenever the output size is
11642 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11643 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11644 && echo FAIL: ignored write error
11645 FAIL: ignored write error
11646 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11647 && echo FAIL: ignored write error
11648 FAIL: ignored write error
11649 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11650
11651 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11652
11653 * emacs.c (Fkill_emacs): In noninteractive mode exit
11654 non-successfully if a write error occurred on stdout. (Bug#9574)
11655
11656 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11657
11658 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11659 the xassert test.
11660
11661 * dispextern.h (struct it): Update the comment documenting what
11662 can it->OBJECT be.
11663
11664 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11665
11666 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11667 a display string, extend search for cursor position to end of row.
11668 (find_row_edges): If the row ends in a newline from a display
11669 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11670 Handle the case of a display string with multiple newlines.
11671 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11672 non-empty line. Fixes confusing cursor motion with arrow keys at
11673 the beginning of a line that starts with whitespace.
11674
11675 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11676
11677 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11678 (bug#9493).
11679
11680 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11681
11682 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11683 boolean (Bug#9154).
11684
11685 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11686
11687 * xdisp.c (display_line): Record maximum and minimum buffer
11688 positions even if no glyphs were produced (e.g., by a zero-width
11689 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11690 buffer positions that will be removed from the glyph row because
11691 they don't fit.
11692 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11693 column is beyond frame width: don't subtract 1 "pixel" when
11694 computing width of the stretch.
11695 (reseat_at_next_visible_line_start): Undo the change made on
11696 2011-09-17 that saved paragraph information and restored it after
11697 the call to `reseat'. (Bug#9545)
11698
11699 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11700
11701 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11702 and turn window cursor on if cleared (Bug#9415).
11703
11704 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11705
11706 * search.c (boyer_moore): Take unibyte characters from pattern
11707 literally. (Bug#9458)
11708
11709 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11710
11711 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11712
11713 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 Fix minor problem found by static checking.
11716 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11717 initialized, to pacify gcc -Wuninitialized.
11718
11719 * fileio.c: Report proper errno when syscall falls.
11720 (Finsert_file_contents): Save and restore errno,
11721 so that report_file_error outputs the correct diagnostic.
11722 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11723
11724 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11725
11726 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11727
11728 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11729
11730 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11731 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11732
11733 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11734
11735 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11736 about the current paragraph and restore it after the call to reseat.
11737
11738 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11739 (bidi_find_paragraph_start): Search back for paragraph beginning
11740 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11741 (bidi_move_to_visually_next): Only trigger paragraph-related
11742 computations when the last character is a newline or at EOB, not
11743 just any NEUTRAL_B. (Bug#9470)
11744
11745 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11746 truncated lines if point is covered by a display string. (Bug#9524)
11747
11748 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11749
11750 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11751 (cons_to_x_long): New function.
11752 (lisp_data_to_selection_data): Use it. Correct the test for
11753 short-versus-long data; it was negated. Break out of vector
11754 loop, for efficiency, when a long datum is discovered.
11755
11756 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11757
11758 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11759
11760 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11761
11762 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11763 GCC PR/17406) by declaring this function with external scope.
11764
11765 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11766
11767 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11768 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11769
11770 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11771
11772 * editfns.c (Fformat): Correctly handle text properties on "%%".
11773
11774 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11775
11776 * xterm.c (x_draw_composite_glyph_string_foreground):
11777 * w32term.c (x_draw_composite_glyph_string_foreground):
11778 * term.c (encode_terminal_code):
11779 * composite.c (composition_update_it, get_composition_id):
11780 * xdisp.c (get_next_display_element)
11781 (fill_composite_glyph_string): Add comments about special meaning
11782 of TAB characters in a composition.
11783
11784 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11785
11786 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11787 This occurs when processing a multibyte format.
11788 Problem reported by Wolfgang Jenker.
11789
11790 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11791
11792 * xdisp.c (try_cursor_movement): Only check for exact match if
11793 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11794
11795 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11796
11797 Remove unused external symbols.
11798 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11799 * xdisp.c (calc_pixel_width_or_height): Now static.
11800 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11801 * indent.c (check_display_width):
11802 * w32term.c: Fix comment to match code.
11803 * xterm.c, xterm.h (x_catching_errors): Remove.
11804
11805 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11806
11807 * xselect.c: Use signed conversions more consistently (Bug#9498).
11808 (selection_data_to_lisp_data): Assume incoming selection data are
11809 signed integers, not unsigned. This is to be consistent with
11810 outgoing selection data, which was modified to use signed integers
11811 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11812 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11813 expects long, not unsigned long.
11814
11815 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11816
11817 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11818 computation of loop end. Reported by Johan Bockgård
11819 <bojohan@gnu.org>.
11820
11821 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11822
11823 * frame.c (Fother_visible_frames_p): Function deleted.
11824
11825 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11826
11827 * indent.c (compute_motion): Process display vector front to back
11828 rather than the other way around. (Bug#2496)
11829
11830 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11831
11832 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11833
11834 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11835
11836 * minibuf.c (Fread_from_minibuffer): Doc fix.
11837
11838 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11839
11840 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11841 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11842
11843 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11844
11845 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11846 value for non-existent files.
11847
11848 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11849
11850 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11851 set its "size" to -1. This will set the modtime_size field of
11852 the corresponding buffer to -1, which is what
11853 verify-visited-file-modtime expects for files that do not exist.
11854 (Bug#9139)
11855
11856 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11857
11858 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11859 here ...
11860 * lisp.h: ... from here. push_key_description is no longer
11861 defined in keyboard.c, so its declaration should not be in
11862 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11863 logically belongs with push_key_description.
11864
11865 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11866
11867 * buffer.h: Include <sys/types.h> instead of <time.h>.
11868 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11869 Problem reported by Herbert J. Skuhra.
11870
11871 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11872
11873 * xml.c (parse_region): Make the parsing work for
11874 non-comment-starting XML files again (bug#9144).
11875
11876 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11877
11878 * image.c (gif_load): Fix calculation of bottom and right corner.
11879 (Bug#9468)
11880
11881 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11882
11883 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11884 redisplay in small windows.
11885
11886 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11887
11888 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11889
11890 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11891
11892 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11893 Operate on live windows only.
11894
11895 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11896
11897 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11898
11899 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11900
11901 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11902 only under bidi iteration.
11903
11904 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11905
11906 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11907
11908 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11909
11910 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11911 Without this fix, the command to link temacs failed due to an
11912 undefined symbol __builtin_isnan. This is because
11913 /usr/include/iso/math_c99.h #defines isnan(x) to
11914 __builtin_isnan(x), but the bundled gcc, which identifies itself
11915 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11916 a __builtin_isnan.
11917 * floatfns.c (isnan): #undef, and then #define to a clone of
11918 what's in data.c.
11919 (Fisnan): Always define, since it's always available now.
11920 (syms_of_floatfns): Always define isnan at the Lisp level.
11921
11922 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11923
11924 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11925
11926 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11927
11928 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11929 The previous code assumed that file offsets (off_t values) fit in
11930 EMACS_INT variables, which is not true on typical 32-bit hosts.
11931 The code messed up by falsely reporting buffer overflow in cases
11932 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11933 when "big" contains more than 2**29 bytes, even though this
11934 inserts just one byte and does not overflow the buffer.
11935 (Finsert_file_contents): Store file offsets as off_t
11936 values, not as EMACS_INT values. Check for overflow when
11937 converting between EMACS_INT and off_t. When checking for
11938 buffer overflow or for overlap, take the offsets into account.
11939 Don't use EMACS_INT for small values where int suffices.
11940 When checking for overlap, fix a typo: ZV was used where
11941 ZV_BYTE was intended.
11942 (Fwrite_region): Don't assume off_t fits into 'long'.
11943 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11944
11945 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11946
11947 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11948
11949 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11950
11951 sprintf-related integer and memory overflow issues (Bug#9412).
11952
11953 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11954 (esprintf, exprintf, evxprintf): New functions.
11955 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11956 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11957 (modify_event_symbol): Do not assume that the length of
11958 name_alist_or_stem is safe to alloca and fits in int.
11959 (Fexecute_extended_command): Likewise for function name and binding.
11960 (Frecursion_depth): Wrap around reliably on integer overflow.
11961 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11962 since some callers pass EMACS_INT values.
11963 (Fsingle_key_description): Don't crash if symbol name contains more
11964 than MAX_ALLOCA bytes.
11965 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11966 (get_minibuffer): Arg is now EMACS_INT, not int.
11967 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11968 (esprintf, exprintf, evxprintf): New decls.
11969 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11970
11971 * dbusbind.c (signature_cat): New function.
11972 (xd_signature, Fdbus_register_signal):
11973 Do not overrun buffer; instead, report string overflow.
11974
11975 * dispnew.c (add_window_display_history): Don't overrun buffer.
11976 Truncate instead; this is OK since it's just a log.
11977
11978 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11979 even if the time zone offset is outlandishly large.
11980 Don't mishandle offset == INT_MIN.
11981
11982 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11983 when creating daemon; the previous buffer-overflow check was incorrect.
11984
11985 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11986 which has the guts of the old verror function.
11987
11988 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11989 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11990
11991 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11992 (font_unparse_xlfd): Don't blindly alloca long strings.
11993 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11994 fits in int, when using sprintf. Use single snprintf to count
11995 length of string rather than counting it via multiple sprintfs;
11996 that's simpler and more reliable.
11997 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11998 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11999 sprintf, in case result does not fit in int.
12000
12001 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12002 (fontset_from_font): Print it.
12003
12004 * frame.c (tty_frame_count): Now printmax_t, not int.
12005 (make_terminal_frame, set_term_frame_name): Print it.
12006 (x_report_frame_params): In X, window IDs are unsigned long,
12007 not signed long, so print them as unsigned.
12008 (validate_x_resource_name): Check for implausibly long names,
12009 and don't assume name length fits in 'int'.
12010 (x_get_resource_string): Don't blindly alloca invocation name;
12011 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12012 not fit in int.
12013
12014 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12015 (xg_check_special_colors, xg_set_geometry):
12016 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12017
12018 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12019 Use esprintf, not sprintf, in case result does not fit in int.
12020
12021 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12022 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12023 it as a large positive number.
12024 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12025 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12026
12027 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12028 in case result does not fit in int.
12029
12030 * print.c (float_to_string): Detect width overflow more reliably.
12031 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12032 buffer overrun. Don't assume list length fits in 'int'. Treat
12033 print length of 0 as 0, not as infinity; to be consistent with other
12034 uses of print length in this function. Don't overflow print length
12035 index. Don't assume hash table size fits in 'long', or that
12036 vectorlike size fits in 'unsigned long'.
12037
12038 * process.c (make_process): Use printmax_t, not int, to format
12039 process-name gensyms.
12040
12041 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12042
12043 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12044 to avoid potential buffer overrun.
12045
12046 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12047 if X resource line is longer than 512 bytes.
12048
12049 * xfns.c (x_window): Make sprintf buffer a bit bigger
12050 to avoid potential buffer overrun.
12051
12052 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12053
12054 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12055
12056 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12057
12058 Integer overflow fixes for scrolling, etc.
12059 Without these, Emacs silently mishandles large integers sometimes.
12060 For example, "C-u 4294967297 M-x recenter" was treated as if
12061 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12062
12063 * xdisp.c (try_window_id): Check Emacs fixnum range before
12064 converting to 'int'.
12065
12066 * window.c (window_scroll_line_based, Frecenter):
12067 Check that an Emacs fixnum is in range before assigning it to 'int'.
12068 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12069 values converted from Emacs fixnums.
12070 (Frecenter): Don't wrap around a line count if it is out of 'int'
12071 range; instead, treat it as an extreme value.
12072 (Fset_window_configuration, compare_window_configurations):
12073 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12074
12075 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12076 that can exceed INT_MAX. Check that EMACS_INT value is in range
12077 before assigning it to the (possibly-narrower) index.
12078 (match_limit): Don't assume that a fixnum can fit in 'int'.
12079
12080 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12081 exceed INT_MAX.
12082
12083 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12084 (Fvertical_motion): Don't wrap around LINES values that don't fit
12085 in 'int'. Instead, treat them as extreme values. This is good
12086 enough for windows, which can't have more than INT_MAX lines anyway.
12087
12088 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12089
12090 * Require libxml/parser.h to avoid compilation warning.
12091
12092 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12093
12094 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12095 since this reportedly can destroy thread storage.
12096
12097 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12098
12099 * syntax.c (find_defun_start): Update all cache variables if
12100 exiting early (Bug#9401).
12101
12102 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12103
12104 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12105
12106 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12107 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12108 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12109
12110 * term.c (tty_append_glyph): New function.
12111 (produce_stretch_glyph): Static function and its prototype deleted.
12112
12113 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12114 Add prototypes.
12115
12116 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12117
12118 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12119 when checking :margin (Bug#9390).
12120 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12121 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12122 so that the name doesn't mislead. All uses changed.
12123
12124 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12125
12126 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12127 set_tty_hooks.
12128
12129 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12130
12131 * xdisp.c (move_it_to): Don't bail out early when reaching
12132 position beyond to_charpos, if we are scanning backwards.
12133 (move_it_vertically_backward): When DY == 0, make sure we get to
12134 the first character in the line after the newline.
12135
12136 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12137
12138 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12139 (ccl_driver): Do not generate an out-of-range pointer.
12140 (Fccl_execute_on_string): Remove unnecessary check for
12141 integer overflow, noted by Stefan Monnier in
12142 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12143 Remove a FIXME that didn't need fixing.
12144 Simplify the newly-introduced buffer reallocation code.
12145
12146 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12147
12148 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12149
12150 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12151
12152 Integer and memory overflow issues (Bug#9196).
12153
12154 * doc.c (get_doc_string): Rework so that
12155 get_doc_string_buffer_size is the actual buffer size, rather than
12156 being 1 less than the actual buffer size; this makes xpalloc more
12157 convenient.
12158
12159 * image.c (x_allocate_bitmap_record, cache_image):
12160 * xselect.c (Fx_register_dnd_atom):
12161 Simplify previous changes by using xpalloc.
12162
12163 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12164 since either will do and ptrdiff_t is convenient with xpalloc.
12165
12166 * charset.c (charset_table_size)
12167 (struct charset_sort_data.priority): Now ptrdiff_t.
12168 (charset_compare): Don't overflow if priorities differ greatly.
12169 (Fsort_charsets): Don't assume list length fits in int.
12170 Check for size-calculation overflow when allocating sort data.
12171 (syms_of_charset): Allocate an initial charset table that is
12172 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12173
12174 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12175
12176 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12177 The actual value is always <= INT_MAX, and leaving it unsigned made
12178 overflow checking harder.
12179
12180 * dispextern.h (struct glyph_matrix.rows_allocated)
12181 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12182 with xpalloc. The values are still always <= INT_MAX.
12183
12184 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12185
12186 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12187 (SAFE_NALLOCA): New macro.
12188
12189 * region-cache.c (struct boundary.pos, find_cache_boundary)
12190 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12191 (set_cache_region, invalidate_region_cache)
12192 (revalidate_region_cache, know_region_cache, region_cache_forward)
12193 (region_cache_backward, pp_cache):
12194 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12195 so that ptrdiff_t * can be passed to xpalloc.
12196 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12197 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12198 (pp_cache): Don't assume cache_len fits in int.
12199 * region-cache.h: Adjust extern decls to match.
12200
12201 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12202 EMACS_INT, since either will do, for xpalloc.
12203
12204 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12205 (xnmalloc, xnrealloc, xpalloc): New functions.
12206
12207 * bidi.c (bidi_shelve_header_size): New constant.
12208 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12209 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12210
12211 * bidi.c (bidi_cache_shrink):
12212 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12213 (overlay_strings):
12214 Don't update size of array until after memory allocation succeeds,
12215 because xmalloc/xrealloc may not return.
12216 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12217 now that we have proper integer overflow checking.
12218 (record_overlay_string, overlay_strings): Catch overflows when
12219 calculating size of overlay_str_buf.
12220
12221 * callproc.c (Fcall_process): Check for size overflow when
12222 calculating size of args2.
12223 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12224 Normally we prefer signed values, but sticking with ptrdiff_t would
12225 require adding more-complicated checks.
12226
12227 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12228 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12229 Redo buffer-overflow calculations to avoid integer overflow.
12230 Add a FIXME comment where memory seems to be over-allocated.
12231
12232 * character.c (Fstring): Check for size-calculation overflow.
12233
12234 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12235 unnecessary integer overflow. Check for size overflow.
12236 (encode_coding_object): Don't update size until xmalloc succeeds.
12237
12238 * composite.c (get_composition_id): Check for overflow in glyph
12239 length calculations.
12240
12241 Integer and memory overflow fixes for display code.
12242 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12243 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12244 (scrolling_window): Check for overflow in size calculations.
12245 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12246 Don't assume glyph table len fits in int.
12247 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12248 (row_table_size): Now ptrdiff_t, not int.
12249 (scrolling_window): Avoid overflow in size calculations.
12250 Don't update size until allocation succeeds.
12251 * fns.c (concat): Check for overflow in size calculations.
12252 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12253 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12254 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12255
12256 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12257 (get_doc_string): Check for size calculation overflow.
12258 Don't update size until allocation succeeds.
12259 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12260 EMACS_INT, where ptrdiff_t will do.
12261 (Fsubstitute_command_keys): Check for string overflow.
12262
12263 * editfns.c (set_time_zone_rule): Don't assume environment length
12264 fits in int.
12265 (message_length): Now ptrdiff_t, not int.
12266 (Fmessage_box): Don't update size until allocation succeeds.
12267 Don't assume message length fits in int.
12268 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12269
12270 * emacs.c (main): Do not reallocate argv, since there is a null at
12271 the end that can be overwritten, and this way there's no need to
12272 worry about size-calculation overflow.
12273 (sort_args): Check for size-calculation overflow.
12274
12275 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12276 alloc succeeds.
12277 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12278
12279 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12280 (x_set_scroll_bar_width, x_figure_window_size):
12281 Check for integer overflow.
12282 (x_set_alpha): Do not assume XINT fits in int.
12283
12284 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12285 This is for the members text_lines, text_cols, total_lines, total_cols,
12286 where the system imposes an 'int' limit.
12287
12288 * fringe.c (Fdefine_fringe_bitmap):
12289 Don't update size until alloc works.
12290
12291 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12292 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12293
12294 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12295 Check for size-calculation overflow.
12296 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12297 do, as we prefer signed integers.
12298 (id_to_widget.max_size, id_to_widget.used)
12299 (xg_store_widget_in_map, xg_remove_widget_from_map)
12300 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12301 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12302 Use and return ptrdiff_t, not int.
12303 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12304 * gtkutil.h: Change prototypes to match the above.
12305
12306 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12307 are duplicate now that they've been promoted to lisp.h.
12308 (x_allocate_bitmap_record, x_alloc_image_color)
12309 (make_image_cache, cache_image, xpm_load):
12310 Don't update size until alloc is done.
12311 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12312 (x_detect_edges):
12313 Check for size calculation overflow.
12314 (ct_colors_allocated_max): New constant.
12315 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12316 overflow.
12317
12318 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12319 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12320 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12321 Use ptrdiff_t, not int, to count maps.
12322 (read_char_minibuf_menu_prompt): Check for overflow in size
12323 calculations. Don't update size until allocation succeeds.
12324 Redo calculations to avoid overflow.
12325 * keyboard.h: Change prototypes to match the above.
12326
12327 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12328 to count maps.
12329 (current_minor_maps): Check for size calculation overflow.
12330 * keymap.h: Change prototypes to match the above.
12331
12332 * lread.c (read1, init_obarray): Don't update size until alloc done.
12333
12334 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12335 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12336
12337 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12338 Now ptrdiff_t, not int.
12339 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12340 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12341
12342 * process.c (Fnetwork_interface_list): Check for overflow
12343 in size calculation.
12344
12345 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12346
12347 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12348 overflow. Don't bother calling xmalloc when xrealloc will do.
12349
12350 * search.c (Freplace_match): Check for size calculation overflow.
12351 (Fset_match_data): Don't assume list lengths fit in 'int'.
12352
12353 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12354 for command line length. Do not attempt to address one before the
12355 beginning of an array, as that's not portable.
12356
12357 * term.c (max_frame_lines): Remove; unused.
12358 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12359 not int.
12360 (encode_terminal_code, calculate_costs): Check for size
12361 calculation overflow.
12362 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12363 table lengths and related sizes. Don't update size until alloc
12364 done. Redo calculations to avoid overflow.
12365 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12366
12367 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12368 subtracting pointers.
12369 (gobble_line): Check for overflow more carefully. Don't update size
12370 until alloc done.
12371
12372 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12373 Don't update size until alloc done.
12374 Redo size calculations to avoid overflow.
12375 Check for size calculation overflow.
12376 (main) [DEBUG]: Fix typo in invoking tparam1.
12377
12378 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12379 Use ptrdiff_t, not int, for sizes.
12380 (store_mode_line_noprop_char): Don't update size until alloc done.
12381
12382 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12383 Use ptrdiff_t, not int, for sizes.
12384 (Finternal_make_lisp_face, cache_face):
12385 Check for size calculation overflow.
12386 (cache_face): Treat size calculation overflows as if they were
12387 memory exhaustion (the usual treatment), rather than aborting.
12388
12389 * xfns.c (x_encode_text, x_set_name_internal)
12390 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12391 sizes, since they can exceed INT_MAX in size. Check for size
12392 calculation overflow.
12393
12394 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12395 (xg_select): Check for size calculation overflow.
12396 Don't update size until alloc done.
12397
12398 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12399 as sprintf is limited to int lengths.
12400
12401 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12402 (X_LONG_MIN): New macros.
12403 Use them to make the following changes clearer.
12404 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12405 This change doesn't affect the value now, but it may help remind
12406 future maintainers not to raise the value too much later.
12407 (SELECTION_QUANTUM): Remove, replacing with ...
12408 (selection_quantum): ... new function, which avoids overflow.
12409 All uses changed.
12410 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12411 assumption that selection length fits in 'int'.
12412 (x_reply_selection_request, x_handle_selection_request)
12413 (x_get_window_property, receive_incremental_selection)
12414 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12415 (lisp_data_to_selection_data, clean_local_selection_data):
12416 Use ptrdiff_t, not int, to record length of selection.
12417 (x_reply_selection_request, x_get_window_property)
12418 (receive_incremental_selection, x_property_data_to_lisp):
12419 Redo calculations to avoid overflow.
12420 (x_reply_selection_request): When sending hint, ceiling it at
12421 X_LONG_MAX rather than relying on wraparound overflow to send
12422 something.
12423 (x_get_window_property, receive_incremental_selection)
12424 (lisp_data_to_selection_data, x_property_data_to_lisp):
12425 Check for size-calculation overflow.
12426 (x_get_window_property, receive_incremental_selection)
12427 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12428 Don't store size until memory allocation succeeds.
12429 (x_get_window_property): Plug memory leak on memory exhaustion.
12430 Don't double-block input; malloc is safe here. Don't assume 2**34
12431 - 4 fits in unsigned long. Add an xassert to check
12432 XGetWindowProperty overflow. Be more careful about overflow
12433 calculations, and distinguish size from memory overflow better.
12434 (receive_incremental_selection): When tracing, don't assume
12435 unsigned int is less than INT_MAX.
12436 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12437 harmful) conversions of unsigned short to int.
12438 (lisp_data_to_selection_data): Don't assume that integers
12439 in the range -65535 through -1 fit in an X unsigned short.
12440 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12441 result parameters unless successful. Rely on cons_to_unsigned
12442 to report problems with elements; the old code wasn't right anyway.
12443 (x_check_property_data): Check for int overflow; we cannot use
12444 a wider type due to X limits.
12445 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12446
12447 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12448
12449 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12450 (x_term_init): Check for size calculation overflow.
12451 (x_color_cells): Don't store size until memory allocation succeeds.
12452 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12453 Don't assume alloca size is less than MAX_ALLOCA.
12454 (x_term_init): Don't assume length fits in int (sprintf is limited
12455 to int size).
12456
12457 Use ptrdiff_t for composition IDs.
12458 * character.c (lisp_string_width):
12459 * composite.c (composition_table_size, n_compositions)
12460 (get_composition_id, composition_gstring_from_id):
12461 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12462 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12463 * window.c (Frecenter):
12464 Use ptrdiff_t, not int, for composition IDs.
12465 * composite.c (get_composition_id): Check for integer overflow.
12466 * composite.h: Adjust prototypes to match the above changes.
12467
12468 Use ptrdiff_t for hash table indexes.
12469 * category.c (hash_get_category_set):
12470 * ccl.c (ccl_driver):
12471 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12472 * coding.c (coding_system_charset_list, detect_coding_system):
12473 * coding.h (struct coding_system.id):
12474 * composite.c (get_composition_id, gstring_lookup_cache):
12475 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12476 * image.c (xpm_get_color_table_h):
12477 * lisp.h (hash_lookup, hash_put):
12478 * minibuf.c (Ftest_completion):
12479 Use ptrdiff_t for hash table indexes, not int (which is too
12480 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12481 32-bit --with-wide-int hosts).
12482
12483 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12484 Add a FIXME comment about memory leaks.
12485 (syms_of_charset): Don't assume xmalloc returns.
12486
12487 Don't assume that stated character widths fit in int.
12488 * character.c (Fchar_width, c_string_width, lisp_string_width):
12489 * character.h (CHAR_WIDTH):
12490 * indent.c (MULTIBYTE_BYTES_WIDTH):
12491 Use sanitize_char_width to avoid undefined and/or bad behavior
12492 with outlandish widths.
12493 * character.h (sanitize_tab_width): Rename from sanitize_width,
12494 now that we have two such functions. All uses changed.
12495 (sanitize_char_width): New inline function.
12496
12497 Don't assume that tab-width fits in int.
12498 * character.h (sanitize_width): New inline function.
12499 (SANE_TAB_WIDTH): New macro.
12500 (ASCII_CHAR_WIDTH): Use it.
12501 * indent.c (sane_tab_width): Remove. All uses replaced by
12502 SANE_TAB_WIDTH (current_buffer).
12503 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12504
12505 * fileio.c: Integer overflow issues with file modes.
12506 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12507
12508 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12509 Remove unreachable code.
12510 (read_hex, load_charset_map_from_file): Check for integer overflow.
12511
12512 * xterm.c: Don't go over XClientMessageEvent limit.
12513 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12514 (x_send_scroll_bar_event): Likewise. Check that the size does not
12515 exceed limits imposed by XClientMessageEvent, as well as the usual
12516 ptrdiff_t and size_t limits.
12517
12518 * keyboard.c: Overflow, signedness and related fixes.
12519 (make_lispy_movement): Use same integer type in forward decl
12520 that is used in the definition.
12521 (read_key_sequence, keyremap_step):
12522 Change bufsize argument back to int, undoing my 2011-03-30 change.
12523 We prefer signed types, and int is wide enough here.
12524 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12525 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12526 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12527 length, not size_t. Use ptrdiff_t for index, not int.
12528 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12529 possibility of integer overflow.
12530
12531 Overflow, signedness and related fixes for images.
12532
12533 * dispextern.h (struct it.stack[0].u.image.image_id)
12534 (struct_it.image_id, struct image.id, struct image_cache.size)
12535 (struct image_cache.used, struct image_cache.ref_count):
12536 * gtkutil.c (update_frame_tool_bar):
12537 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12538 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12539 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12540 * nsmenu.m (update_frame_tool_bar):
12541 * xdisp.c (calc_pixel_width_or_height):
12542 * xfns.c (image_cache_refcount):
12543 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12544 on typical 64-bit hosts.
12545
12546 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12547 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12548 Omit unnecessary casts to int.
12549 (parse_image_spec): Check that integers fall into 'int' range
12550 when the callers expect that.
12551 (image_ascent): Redo ascent calculation to avoid int overflow.
12552 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12553 (lookup_image): Remove unnecessary tests.
12554 (xbm_image_p): Locals are now of int, not EMACS_INT,
12555 since parse_image_check makes sure they fit into int.
12556 (png_load, gif_load, svg_load_image):
12557 Prefer int to unsigned where either will do.
12558 (tiff_handler): New function, combining the cores of the
12559 old tiff_error_handler and tiff_warning_handler.
12560 This function is rewritten to use vsnprintf and thereby avoid
12561 stack buffer overflows. It uses only the features of vsnprintf
12562 that are common to both POSIX and native Microsoft.
12563 (tiff_error_handler, tiff_warning_handler): Use it.
12564 (tiff_load, gif_load, imagemagick_load_image):
12565 Don't assume :index value fits in 'int'.
12566 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12567 (imagemagick_load_image): Check that crop parameters fit into
12568 the integer types that MagickCropImage accepts. Don't assume
12569 Vimagemagick_render_type has a nonnegative value. Don't assume
12570 size_t fits in 'long'.
12571 (gs_load): Use printmax_t to print the widest integers possible.
12572 Check for integer overflow when computing image height and width.
12573
12574 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12575
12576 * xdisp.c (redisplay_window): Don't force window start if point
12577 will be invisible in the resulting window. (Bug#9324)
12578
12579 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12580
12581 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12582 the display spec is of the form `(space ...)'.
12583 (handle_display_spec): Return the value returned by
12584 handle_single_display_spec, not just 1 or zero.
12585 (handle_single_display_spec): If the display spec is of the form
12586 `(space ...)', and specifies display in the text area, return 2
12587 rather than 1.
12588 (try_cursor_movement): Check for the need to scroll more
12589 accurately, and prefer exact match for point under bidi.
12590 Don't advance `row' beyond the last row of the window.
12591
12592 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12593 into disp_prop; all users changed.
12594
12595 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12596 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12597 for the text covered by the display property.
12598
12599 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12600
12601 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12602 Change return value to nil.
12603 (Frecord_buffer): Delete unused function.
12604
12605 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12606
12607 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12608 buffers, return left-to-right.
12609 (set_cursor_from_row): Consider candidate row a win if its glyph
12610 represents a newline and point is on that newline. Fixes cursor
12611 positioning on the newline at EOL of R2L text within L2R
12612 paragraph, and vice versa.
12613 (try_cursor_movement): Check continued rows, in addition to
12614 continuation rows. Fixes unwarranted scroll when point enters a
12615 continued line of R2L text within an L2R paragraph, or vice versa.
12616 (cursor_row_p): Consider the case of point being equal to
12617 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12618 from the end of a short line to the beginning of a continued line
12619 of R2L text within L2R paragraph.
12620 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12621 composed characters.
12622
12623 * bidi.c (bidi_check_type): Use xassert.
12624 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12625 members.
12626
12627 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12628
12629 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12630 a character.
12631
12632 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12633
12634 * nsfont.m (ns_otf_to_script): Fix typo.
12635
12636 2011-08-22 Kenichi Handa <handa@m17n.org>
12637
12638 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12639 extra slot even if the purpose is char-code-property-table.
12640
12641 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12642
12643 * xdisp.c (redisplay_window): When computing centering_position,
12644 account for the height of the header line. (Bug#8874)
12645
12646 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12647 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12648 candidate is selected by the mouse, and that candidate has a
12649 composed character under the mouse.
12650
12651 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12652 coordinates reported by pos-visible-in-window-p for a composed
12653 character in column zero.
12654
12655 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12656
12657 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12658
12659 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12660
12661 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12662 consider it a hit if to_charpos is anywhere in the range of the
12663 composed buffer positions.
12664
12665 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12666
12667 * image.c (gif_load): Don't assume that each subimage has the same
12668 dimensions as the base image. Handle disposal method that is
12669 "undefined" by the gif spec (Bug#9335).
12670
12671 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12672
12673 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12674 (Fcondition_case): Document `debug' symbol in error handler.
12675
12676 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12677
12678 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12679 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12680 from an Org mode buffer to a Speedbar frame.
12681
12682 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12683 a composition, take its buffer position from IT->cmp_it.charpos.
12684 Fixes cursor positioning at the beginning of a line that begins
12685 with a composed character.
12686
12687 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12688
12689 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12690 character bidirectional type, use STRONG_L instead. Fixes crashes
12691 in a buffer produced by `describe-categories'.
12692
12693 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12694 members before the level stack, so they would be saved and
12695 restored when copying iterator state. Fixes incorrect reordering
12696 around TABs covered by display properties.
12697
12698 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12699
12700 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12701
12702 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12703
12704 * eval.c (internal_condition_case, internal_condition_case_1)
12705 (internal_condition_case_2, internal_condition_case_n):
12706 Remove unnecessary aborts (Bug#9081).
12707
12708 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12709
12710 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12711 has no `load' handler, try opening the file locally. (Bug#9311)
12712
12713 2011-08-16 Ken Brown <kbrown@cornell.edu>
12714
12715 * gmalloc.c: Expand comment.
12716
12717 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12718
12719 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12720 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12721
12722 2011-08-16 Ken Brown <kbrown@cornell.edu>
12723
12724 Fix memory allocation problems in Cygwin build (Bug#9273).
12725
12726 * unexcw.c ( __malloc_initialized): Declare external variable.
12727 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12728
12729 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12730 New variables.
12731 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12732 dumped emacs.
12733 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12734 in the static heap.
12735 [CYGWIN] (special_realloc): New function.
12736 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12737 requests to realloc storage in the static heap.
12738
12739 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12740
12741 * bidi.c (bidi_initialize): Remove unused local.
12742
12743 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12744
12745 * bidimirror.h:
12746 * biditype.h: Remove file.
12747 * makefile.w32-in ($(BLD)/bidi.$(O)):
12748 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12749
12750 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12751
12752 * chartab.c: Improve commentary for the uniprop_table API.
12753
12754 * bidi.c (bidi_paragraph_init): Support zero value of
12755 bidi_ignore_explicit_marks_for_paragraph_level.
12756 (bidi_initialize): Use uniprop_table instead of including
12757 biditype.h and bidimirror.h.
12758
12759 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12760 coordinates of the iterator when restoring from ppos_it.
12761 (Bug#9296)
12762
12763 2011-08-14 Kenichi Handa <handa@m17n.org>
12764
12765 * process.c (create_process): Call setup_process_coding_systems
12766 after the pid of the process is set to -1 (Bug#8162).
12767
12768 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12769
12770 * xdisp.c (move_it_in_display_line_to): Don't invoke
12771 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12772 ppos_it. Fixes vertical cursor motion when line beginning is
12773 covered by an image. (Bug#9296)
12774
12775 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12776
12777 * nsterm.h (ns_run_ascript): Declare.
12778 (NSAPP_DATA2_RUNASSCRIPT): Define.
12779
12780 * nsfns.m (as_script, as_result, as_status): New static variables.
12781 (ns_run_ascript): New function.
12782 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12783 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12784 the event loop. Get status from as_status (Bug#7276).
12785
12786 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12787 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12788 the event loop (Bug#7276).
12789
12790 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12791
12792 * gnutls.c (QCgnutls_bootprop_priority)
12793 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12794 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12795 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12796 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12797 (QCgnutls_bootprop_verify_hostname_error)
12798 (QCgnutls_bootprop_callbacks_verify): Rename from
12799 Qgnutls_bootprop_..., all uses changed.
12800
12801 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12802 uses changed.
12803
12804 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12805
12806 * xfaces.c (Qframe_set_background_mode): Now static.
12807 * dispextern.h (Qframe_set_background_mode): Remove decl.
12808
12809 * process.c (Fnetwork_interface_info): Declare local only if needed.
12810
12811 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12812
12813 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12814 (Fnetwork_interface_list): Allocate in increments of bytes instead
12815 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12816 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12817 sockaddr.
12818 (struct ifflag_def): notrailers is smart on OSX.
12819 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12820 Get hardware address with getifaddrs if available.
12821
12822 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12823
12824 * xdisp.c (iterate_out_of_display_property): xassert that
12825 IT->position is set to within IT->object's boundaries. Break from
12826 the loop as soon as EOB is reached; avoids infloops in redisplay
12827 when IT->position is set up wrongly due to some bug.
12828 Set IT->current to match the bidi iterator unconditionally.
12829 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12830 entry. Force push_it to save on the stack the current
12831 buffer/string position, to be restored by pop_it. Fix flags in
12832 the iterator structure wrt the object coming from a display
12833 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12834 properties. (Bug#9284)
12835
12836 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12837
12838 * fontset.c (fontset_get_font_group): Add proper type checks.
12839 (Bug#9172)
12840
12841 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12842
12843 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12844 and LC_VERSION_MIN_MACOSX.
12845 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12846 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12847
12848 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12849
12850 * xdisp.c (forward_to_next_line_start): Allow to use the
12851 no-display-properties-and-no-overlays under bidi display.
12852 Set disp_pos in the bidi iterator to avoid searches for display
12853 properties and overlays.
12854
12855 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12856
12857 * editfns.c (Fset_time_zone_rule): Document relationship with the
12858 setenv function.
12859
12860 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12861 the font entity extracted from the cache (Bug#8109).
12862
12863 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12864
12865 * composite.c (autocmp_chars): Don't reset point. That is done by
12866 restore_point_unwind (Bug#5984).
12867
12868 2011-08-07 Juri Linkov <juri@jurta.org>
12869
12870 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12871 to show the arg `TIME' instead of `TIMEVAL'.
12872
12873 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12874
12875 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12876 display property strides EOL and includes a newline, as in
12877 longlines-mode. (Bug#9254)
12878 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12879 word-wrap under bidirectional display. (Bug#9224)
12880
12881 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12882 is non-zero, even if the data buffer is NULL. Fixes a crash in
12883 vertical-motion with longlines-mode. (Bug#9254)
12884
12885 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12886
12887 * bidi.c <bidi_cache_total_alloc>: Now static.
12888 (bidi_initialize): Initialize bidi_cache_total_alloc.
12889
12890 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12891 cache. (Bug#9221)
12892
12893 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12894 amount allocated this far in `bidi_cache_total_alloc'.
12895 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12896 non-zero, only free the data buffer without restoring the cache
12897 contents. All callers changed.
12898
12899 * dispextern.h (bidi_unshelve_cache): Update prototype.
12900
12901 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12902 (move_it_in_display_line, move_it_to)
12903 (move_it_vertically_backward, move_it_by_lines): Replace the call
12904 to xfree to an equivalent call to bidi_unshelve_cache.
12905 (move_it_in_display_line_to): Fix logic of returning
12906 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12907
12908 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12909
12910 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12911 came from a string character with a `cursor' property. (Bug#9229)
12912
12913 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12914
12915 * Makefile.in (LIB_PTHREAD): New variable.
12916 (LIBES): Add LIB_PTHREAD (Bug#9216).
12917
12918 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12919 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12920
12921 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12922
12923 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12924
12925 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12926
12927 * xterm.c (x_find_topmost_parent): New function.
12928 (x_set_frame_alpha): Find topmost parent window with
12929 x_find_topmost_parent and set the property there also (bug#9181).
12930 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12931
12932 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12933
12934 * callproc.c (Fcall_process): Avoid vfork clobbering
12935 the local vars buffer, coding_systems, current_dir.
12936
12937 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12938
12939 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12940
12941 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12942
12943 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12944 so that it is not optimized away.
12945
12946 * xdisp.c (compute_display_string_pos): Remove unused local.
12947
12948 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12949
12950 Fix slow cursor motion and scrolling in large buffers with
12951 selective display, like Org Mode buffers. (Bug#9218)
12952
12953 * dispextern.h (struct bidi_it): New member disp_prop_p.
12954
12955 * xdisp.c: Remove one-slot cache of display string positions.
12956 (compute_display_string_pos): Accept an additional argument
12957 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12958 for a display string or property. If found, set DISP_PROP_P
12959 non-zero.
12960
12961 * bidi.c (bidi_fetch_char): Accept an additional argument
12962 DISP_PROP_P, and pass it to compute_display_string_pos.
12963 Only handle text covered by a display string if DISP_PROP_P is returned
12964 non-zero. All callers of bidi_fetch_char changed.
12965
12966 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12967
12968 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12969
12970 2010-12-03 Don March <don@ohspite.net>
12971
12972 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12973 last character M-[char] is translated to ESC [char] (bug#7541).
12974
12975 2011-08-02 Kenichi Handa <handa@m17n.org>
12976
12977 * lisp.h (uniprop_table): Extern it.
12978
12979 * chartab.c (uniprop_table): Make it non-static.
12980
12981 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12982
12983 * xdisp.c (forward_to_next_line_start): Accept additional argument
12984 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12985 on the newline.
12986 (reseat_at_next_visible_line_start): Use the bidi iterator state
12987 returned by forward_to_next_line_start to restore the state of
12988 it->bidi_it after backing up to previous newline. (Bug#9212)
12989
12990 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12991
12992 * regex.c (re_comp): Protoize.
12993 (re_exec): Fix return type.
12994 (regexec): Fix type of `ret'. (Bug#9203)
12995
12996 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12997
12998 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12999 This is needed if max-image-size is a floating-point number.
13000
13001 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13002
13003 * print.c (print_object): Print empty symbol as ##.
13004
13005 * lread.c (read1): Read ## as empty symbol.
13006
13007 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13008
13009 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13010 setting frame foreground color (Bug#9175).
13011 (x_set_background_color): Likewise.
13012
13013 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13014 contents (Bug#9176).
13015 (EmacsTooltip -init): Remove bezels and add shadows to
13016 tooltip windows.
13017
13018 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13019 or scroll bar (Bug#8470).
13020
13021 * nsfont.m (nsfont_open): Remove assignment to voffset and
13022 unnecessary vars hshink, expand, hd, full_height, min_height.
13023 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13024
13025 * nsterm.h (nsfont_info): Remove voffset field.
13026
13027 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13028
13029 Implement strike-through and overline on NextStep (Bug#8863).
13030
13031 * nsfont.m (nsfont_open): Use underline position provided by font,
13032 instead of hard-coded value of 2.
13033 (nsfont_draw): Call ns_draw_text_decoration instead.
13034
13035 * nsterm.h: Add declaration for ns_draw_text_decoration.
13036
13037 * nsterm.m (ns_draw_text_decoration): New function for drawing
13038 underline, overline, and strike-through.
13039 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13040 ns_draw_text_decoration. Change treatment of cursor drawing to
13041 accommodate underlining, etc.
13042
13043 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13044
13045 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13046 default.
13047
13048 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13049
13050 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13051 Without this fix, if a signal arrives just after memory fills up,
13052 'malloc' might be invoked reentrantly.
13053
13054 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13055 In other words, assume that every image size is allowed, on non-X
13056 hosts. This assumption is probably wrong, but it lets Emacs compile.
13057
13058 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13059
13060 * regex.c (re_iswctype): Convert return values to boolean.
13061
13062 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13063
13064 * xdisp.c (compute_display_string_pos): Don't use cached display
13065 string position if the buffer had its restriction changed.
13066 (Bug#9184)
13067
13068 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13069
13070 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13071
13072 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13073
13074 Integer signedness and overflow and related fixes. (Bug#9079)
13075
13076 * bidi.c: Integer size and overflow fixes.
13077 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13078 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13079 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13080 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13081 (bidi_find_other_level_edge):
13082 Use ptrdiff_t instead of EMACS_INT where either will do.
13083 This works better on 32-bit hosts configured --with-wide-int.
13084 (bidi_cache_ensure_space): Check for size-calculation overflow.
13085 Use % rather than repeated addition, for better worst-case speed.
13086 Don't set bidi_cache_size until after xrealloc returns, because it
13087 might not return.
13088 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13089 (bidi_cache_ensure_space): Also check that the bidi cache size
13090 does not exceed that of the largest Lisp string or buffer. See Eli
13091 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13092
13093 * alloc.c (__malloc_size_t): Remove.
13094 All uses replaced by size_t. See Andreas Schwab's note
13095 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13096
13097 * image.c: Improve checking for integer overflow.
13098 (check_image_size): Assume that f is nonnull, since
13099 it is always nonnull in practice. This is one less thing to
13100 worry about when checking for integer overflow later.
13101 (x_check_image_size): New function, which checks for integer
13102 overflow issues inside X.
13103 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13104 This removes the need for a memory_full check.
13105 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13106 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13107 (xbm_read_bitmap_data): Change locals back to 'int', since
13108 their values must fit in 'int'.
13109 (xpm_load_image, png_load, tiff_load):
13110 Invoke x_create_x_image_and_pixmap earlier,
13111 to avoid much needless work if the image is too large.
13112 (tiff_load): Treat overly large images as if
13113 x_create_x_image_and_pixmap failed, not as malloc failures.
13114 (gs_load): Use x_check_image_size.
13115
13116 * gtkutil.c: Omit integer casts.
13117 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13118 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13119
13120 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13121
13122 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13123 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13124 would wrongly return t on a 64-bit host.
13125
13126 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13127 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13128 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13129 and therefore cause GCC to emit a bogus diagnostic in some cases.
13130
13131 * image.c: Integer signedness and overflow and related fixes.
13132 This is not an exhaustive set of fixes, but it's time to
13133 record what I've got.
13134 (lookup_pixel_color, check_image_size): Remove redundant decls.
13135 (check_image_size): Don't assume that arbitrary EMACS_INT values
13136 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13137 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13138 (tiff_load, imagemagick_load_image):
13139 Check for overflow in size calculations.
13140 (x_create_x_image_and_pixmap): Remove unnecessary test for
13141 xmalloc returning NULL; that can't happen.
13142 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13143 (xpm_color_bucket): Use better integer hashing function.
13144 (xpm_cache_color): Don't possibly over-allocate memory.
13145 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13146 (gif_memory_source):
13147 Use ptrdiff_t, not int or size_t, to record sizes.
13148 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13149 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13150 either works, as we prefer signed integers.
13151 (tiff_read_from_memory, tiff_write_from_memory):
13152 Return tsize_t, not size_t, since that's what the TIFF API wants.
13153 (tiff_read_from_memory): Don't fail simply because the read would
13154 go past EOF; instead, return a short read.
13155 (tiff_load): Omit no-longer-needed casts.
13156 (Fimagemagick_types): Don't assume size fits into 'int'.
13157
13158 Improve hashing quality when configured --with-wide-int.
13159 * fns.c (hash_string): New function, taken from sxhash_string.
13160 Do not discard information about ASCII character case; this
13161 discarding is no longer needed.
13162 (sxhash-string): Use it. Change sig to match it. Caller changed.
13163 * lisp.h: Declare it.
13164 * lread.c (hash_string): Remove, since we now use fns.c's version.
13165 The fns.c version returns a wider integer if --with-wide-int is
13166 specified, so this should help the quality of the hashing a bit.
13167
13168 * emacs.c: Integer overflow minor fix.
13169 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13170 Define only if GNU_LINUX.
13171 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13172
13173 * dispnew.c: Integer signedness and overflow fixes.
13174 Remove unnecessary forward decls, that were a maintenance hassle.
13175 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13176 All uses changed.
13177 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13178 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13179 (prepare_desired_row, line_draw_cost):
13180 Use int, not unsigned, where either works.
13181 (save_current_matrix, restore_current_matrix):
13182 Use ptrdiff_t, not size_t, where either works.
13183 (init_display): Check for overflow more accurately, and without
13184 relying on undefined behavior.
13185
13186 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13187 Remove, replacing with the new symbols in lisp.h. All uses changed.
13188 * fileio.c (make_temp_name):
13189 * filelock.c (lock_file_1, lock_file):
13190 * xdisp.c (message_dolog):
13191 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13192 Use pMd etc. instead.
13193 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13194 replacing the pWIDE etc. symbols removed from editfns.c.
13195
13196 * keyboard.h (num_input_events): Now uintmax_t.
13197 This is (very slightly) less likely to mess up due to wraparound.
13198 All uses changed.
13199
13200 * buffer.c: Integer signedness fixes.
13201 (alloc_buffer_text, enlarge_buffer_text):
13202 Use ptrdiff_t rather than size_t when either will do, as we prefer
13203 signed integers.
13204
13205 * alloc.c: Integer signedness and overflow fixes.
13206 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13207 (__malloc_size_t): Default to size_t, not to int.
13208 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13209 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13210 Prefer ptrdiff_t to size_t when either would do, as we prefer
13211 signed integers.
13212 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13213 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13214 Now const. Initialize with values that are in range even if char
13215 is signed.
13216 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13217 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13218 These functions do the right thing with sizes > 2**32.
13219 (check_depth): Now ptrdiff_t, not int.
13220 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13221 Adjust to new way of storing sizes. Check for size overflow bugs
13222 in rest of code.
13223 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13224 slightly wrong anyway, as it missed one instance of
13225 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13226 (refill_memory_reserve): Omit needless cast to size_t.
13227 (mark_object_loop_halt): Mark as externally visible.
13228
13229 * xselect.c: Integer signedness and overflow fixes.
13230 (Fx_register_dnd_atom, x_handle_dnd_message):
13231 Use ptrdiff_t, not size_t, since we prefer signed.
13232 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13233 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13234 x_dnd_atoms_size and x_dnd_atoms_length.
13235
13236 * doprnt.c: Prefer signed to unsigned when either works.
13237 * eval.c (verror):
13238 * doprnt.c (doprnt):
13239 * lisp.h (doprnt):
13240 * xdisp.c (vmessage):
13241 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13242 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13243 prefer signed arithmetic to avoid comparison confusion.
13244 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13245 but is a bit tricky.
13246
13247 Assume freestanding C89 headers, string.h, stdlib.h.
13248 * data.c, doprnt.c, floatfns.c, print.c:
13249 Include float.h unconditionally.
13250 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13251 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13252 * regex.c: Likewise for stddef.h, string.h.
13253 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13254 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13255 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13256 (STDC_HEADERS): Remove obsolete defines.
13257 * sysdep.c: Include limits.h unconditionally.
13258
13259 Assume support for memcmp, memcpy, memmove, memset.
13260 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13261 * regex.c (memcmp, memcpy):
13262 Remove; we assume C89 now.
13263
13264 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13265 (__malloc_safe_bcopy): Remove; no longer needed.
13266
13267 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13268 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13269 well either way, and we prefer signed to unsigned.
13270
13271 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13272
13273 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13274 closes the connection while we're reading (bug#9182).
13275
13276 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13277
13278 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13279 are specified (Bug#9168).
13280
13281 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13282
13283 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13284 Found by GCC static checking and --with-wide-int on a 32-bit host.
13285
13286 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13287
13288 * xdisp.c (compute_display_string_pos): Fix logic of caching
13289 previous display string position. Initialize cached_prev_pos to
13290 -1. Fixes slow-down at the beginning of a buffer.
13291
13292 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13293
13294 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13295 for attrs[LFACE_FONTSET_INDEX].
13296
13297 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13298
13299 * xml.c (parse_region): Remove unused local
13300 that was recently introduced.
13301
13302 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13303
13304 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13305 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13306
13307 * xdisp.c (move_it_in_display_line_to): Record the best matching
13308 position for TO_CHARPOS while scanning the line, and restore it on
13309 exit if none of the characters scanned was an exact match.
13310 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13311 when exact match is impossible due to invisible text, and the
13312 lines are truncated.
13313
13314 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13315
13316 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13317 for OSX >= 10.7.
13318
13319 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13320
13321 Fix a significant slow-down of cursor motion with C-n, C-p,
13322 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13323 auto-repeat under bidi redisplay in fontified buffers.
13324 * xdisp.c (compute_stop_pos_backwards): New function.
13325 (next_element_from_buffer): Call compute_stop_pos_backwards to
13326 find a suitable prev_stop when we find ourselves before
13327 base_level_stop.
13328 (reseat): Don't look for prev_stop, as that could mean a very long
13329 run.
13330 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13331 <cached_disp_overlay_modiff>: Cache for last found display string
13332 position.
13333 (compute_display_string_pos): Return the cached position if asked
13334 about the same buffer in the same area of character positions, and
13335 the buffer wasn't changed since the time the display string
13336 position was cached.
13337
13338 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13339
13340 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13341 is an integer, which is important for empty lines. (Bug#9149)
13342
13343 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13344
13345 * frame.c (Fmodify_frame_parameters): In tty case, update the
13346 default face if necessary (Bug#4238).
13347
13348 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13349
13350 * editfns.c (Fstring_to_char): No need to explain what a character
13351 is in the docstring (Bug#6576).
13352
13353 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13354
13355 * xml.c (parse_region): Make sure we always return a tree.
13356
13357 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13358
13359 * xml.c (parse_region): If a document contains only comments,
13360 return that, too.
13361
13362 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13363
13364 * xml.c (make_dom): Return comments, too.
13365
13366 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13367
13368 Port to OpenBSD.
13369 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13370 and the surrounding thread.
13371 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13372 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13373 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13374 timer goes off.
13375 * s/openbsd.h (BROKEN_SIGIO): Define.
13376 * unexelf.c (unexec) [__OpenBSD__]:
13377 Don't update the .mdebug section of the Alpha COFF symbol table.
13378
13379 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13380
13381 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13382 (bug#8460).
13383
13384 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13385
13386 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13387 This fixes some race conditions on the permissions of any newly
13388 created file.
13389
13390 * alloc.c (valid_pointer_p): Use pipe, not open.
13391 This fixes some permissions issues when debugging.
13392
13393 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13394 If fchown fails to set both uid and gid, try to set just gid,
13395 as that is sometimes allowed. Adjust the file's mode to eliminate
13396 setuid or setgid bits that are inappropriate if fchown fails.
13397
13398 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13399
13400 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13401 to compare Lisp_Objects.
13402 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13403 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13404 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13405
13406 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13407
13408 * lread.c (read_integer): Unread even EOF character.
13409 (read1): Likewise. Properly record start position of symbol.
13410
13411 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13412 symbol character follows.
13413
13414 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13415
13416 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13417 This works around a problem with the previous change to Fcopy_file.
13418 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13419 and without this change, GCC might complain about discarding
13420 fchown's return value.
13421
13422 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13423
13424 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13425
13426 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13427
13428 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13429
13430 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13431
13432 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13433 it's used from the C level.
13434
13435 * process.c: Use the same condition for POLL_FOR_INPUT in both
13436 keyboard.c and process.c (bug#1858).
13437
13438 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13439
13440 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13441 (Fgnutls_boot): Use it.
13442
13443 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13444
13445 * doc.c (Fsubstitute_command_keys): Revert last change.
13446
13447 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13448
13449 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13450 quotes the next character, and doesn't affect other longer
13451 sequences (bug#8935).
13452
13453 * lread.c (syms_of_lread): Clarify that is isn't only
13454 `eval-buffer' and `eval-defun' that's affected by
13455 `lexical-binding' (bug#8460).
13456
13457 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13458
13459 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13460 bidi redisplay when a line includes both an image and is truncated.
13461
13462 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13463
13464 Fix minor problems found by static checking.
13465 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13466 (elsz): Now a signed constant, not a size_t var. We prefer signed
13467 types to unsigned, to avoid integer comparison confusion. Without
13468 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13469 "cannot optimize loop, the loop counter may overflow", a symptom
13470 of the confusion.
13471 * indent.c (Fvertical_motion): Mark locals as initialized.
13472 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13473
13474 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13475
13476 * search.c (Fre_search_backward): Mention `case-fold-search' in
13477 all the re_search_* functions (bug#8138).
13478
13479 * keyboard.c (Fopen_dribble_file): Document when the file is
13480 closed (bug#8056).
13481
13482 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13483
13484 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13485 bidi_cache_idx.
13486
13487 Support bidi reordering of display and overlay strings.
13488 * xdisp.c (compute_display_string_pos)
13489 (compute_display_string_end): Accept additional argument STRING.
13490 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13491 (reseat_to_string): Initialize bidi_it->string.s and
13492 bidi_it->string.schars.
13493 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13494 NULL (avoids a crash in bidi_paragraph_init).
13495 Initialize itb.string.lstring.
13496 (init_iterator): Call bidi_init_it only of a valid
13497 buffer position was specified. Initialize paragraph_embedding to
13498 L2R.
13499 (reseat_to_string): Initialize the bidi iterator.
13500 (display_string): If we need to ignore text properties of
13501 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13502 original value of -1 will not work with bidi.)
13503 (compute_display_string_pos): First arg is now struct
13504 `text_pos *'; all callers changed. Support display properties on
13505 Lisp strings.
13506 (compute_display_string_end): Support display properties on Lisp
13507 strings.
13508 (init_iterator, reseat_1, reseat_to_string): Initialize the
13509 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13510 when iterating on a string not from display properties).
13511 (compute_display_string_pos, compute_display_string_end):
13512 Fix calculation of the object to scan. Fixes an error when using
13513 arrow keys.
13514 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13515 base_level_stop; instead, set base_level_stop to BEGV.
13516 Fixes crashes in vertical-motion.
13517 (next_element_from_buffer): Improve commentary for when
13518 the iterator is before prev_stop.
13519 (init_iterator): Initialize bidi_p from the default value of
13520 bidi-display-reordering, not from buffer-local value. Use the
13521 buffer-local value only if initializing for buffer iteration.
13522 (handle_invisible_prop): Support invisible properties on strings
13523 that are being bidi-reordered.
13524 (set_iterator_to_next): Support bidi reordering of C strings and
13525 Lisp strings.
13526 (next_element_from_string): Support bidi reordering of Lisp
13527 strings.
13528 (handle_stop_backwards): Support Lisp strings as well.
13529 (display_string): Support display of R2L glyph rows.
13530 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13531 (init_iterator): Don't initialize it->bidi_p for strings
13532 here.
13533 (reseat_to_string): Initialize it->bidi_p for strings here.
13534 (next_element_from_string, next_element_from_c_string)
13535 (next_element_from_buffer): Add xassert's for correspondence
13536 between IT's object being iterated and it->bidi_it.string
13537 structure.
13538 (face_before_or_after_it_pos): Support bidi iteration.
13539 (next_element_from_c_string): Handle the case of the first string
13540 character that is not the first one in the visual order.
13541 (get_visually_first_element): New function, refactored from common
13542 parts of next_element_from_buffer, next_element_from_string, and
13543 next_element_from_c_string.
13544 (tool_bar_lines_needed, redisplay_tool_bar)
13545 (display_menu_bar): Force left-to-right direction. Add a FIXME
13546 comment for making that be controlled by a user option.
13547 (push_it, pop_it): Save and restore the state of the
13548 bidi iterator. Save and restore the bidi_p flag.
13549 (pop_it): Iterate out of display property for string iteration as
13550 well.
13551 (iterate_out_of_display_property): Support iteration over strings.
13552 (handle_single_display_spec): Set up it->bidi_it for iteration
13553 over a display string, and call bidi_init_it.
13554 (handle_single_display_spec, next_overlay_string)
13555 (get_overlay_strings_1, push_display_prop): Set up the bidi
13556 iterator for displaying display or overlay strings.
13557 (forward_to_next_line_start): Don't use the shortcut if
13558 bidi-iterating.
13559 (back_to_previous_visible_line_start): If handle_display_prop
13560 pushed the iterator stack, restore the internal state of the bidi
13561 iterator by calling bidi_pop_it same number of times.
13562 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13563 and we are bidi-iterating, don't decrement the iterator position;
13564 instead, set the first_elt flag in the bidi iterator, to produce
13565 the same effect.
13566 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13567 (push_display_prop): xassert that we are iterating a buffer.
13568 (push_it, pop_it): Save and restore paragraph_embedding member.
13569 (handle_single_display_spec, next_overlay_string)
13570 (get_overlay_strings_1, reseat_1, reseat_to_string)
13571 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13572 correctly. Don't assume unibyte strings are not bidi-reordered.
13573 (compute_display_string_pos)
13574 (compute_display_string_end): Fix handling the case of C string.
13575 (push_it, pop_it): Save and restore from_disp_prop_p.
13576 (handle_single_display_spec, push_display_prop): Set the
13577 from_disp_prop_p flag.
13578 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13579 (pop_it): Call iterate_out_of_display_property only if we are
13580 popping after iteration over a string that came from a display
13581 property. Fix a typo in popping stretch info. Add an assertion
13582 for verifying that the iterator position is in sync with the bidi
13583 iterator.
13584 (handle_single_display_spec, get_overlay_strings_1)
13585 (push_display_prop): Fix initialization of paragraph direction for
13586 string when that of the parent object is not yet determined.
13587 (reseat_1): Call bidi_init_it to resync the bidi
13588 iterator with IT's position. (Bug#7616)
13589 (find_row_edges): If ROW->start.pos gives position
13590 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13591 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13592 Reset the from_disp_prop_p flag.
13593 (SAVE_IT, RESTORE_IT): New macros.
13594 (pos_visible_p, face_before_or_after_it_pos)
13595 (back_to_previous_visible_line_start)
13596 (move_it_in_display_line_to, move_it_in_display_line)
13597 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13598 (try_scrolling, redisplay_window, display_line): Use them when
13599 saving a temporary copy of the iterator and restoring it back.
13600 (back_to_previous_visible_line_start, reseat_1)
13601 (init_iterator): Empty the bidi cache "stack".
13602 (move_it_in_display_line_to): If iterator ended up at
13603 EOL, but we never saw any buffer positions smaller than
13604 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13605 motion in bidi-reordered lines.
13606 (move_it_in_display_line_to): Record prev_method and prev_pos
13607 immediately before the call to set_iterator_to_next. Fixes cursor
13608 motion in bidi-reordered lines with stretch glyphs and strings
13609 displayed in margins. (Bug#8133) (Bug#8867)
13610 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13611 TO_CHARPOS.
13612 (pos_visible_p): Support positions in bidi-reordered lines.
13613 Save and restore bidi cache.
13614
13615 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13616 (bidi_paragraph_info): Delete unused struct.
13617 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13618 (bidi_cache_start): New variable.
13619 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13620 to zero.
13621 (bidi_cache_fetch_state, bidi_cache_search)
13622 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13623 (bidi_cache_find, bidi_peek_at_next_level)
13624 (bidi_level_of_next_char, bidi_find_other_level_edge)
13625 (bidi_move_to_visually_next): Compare cache index with
13626 bidi_cache_start rather than with zero.
13627 (bidi_fetch_char): Accept new argument STRING; all callers
13628 changed. Support iteration over a string. Support strings with
13629 display properties. Support unibyte strings. Fix the type of
13630 `len' according to what STRING_CHAR_AND_LENGTH expects.
13631 (bidi_paragraph_init, bidi_resolve_explicit_1)
13632 (bidi_resolve_explicit, bidi_resolve_weak)
13633 (bidi_level_of_next_char, bidi_move_to_visually_next):
13634 Support iteration over a string.
13635 (bidi_set_sor_type, bidi_resolve_explicit_1)
13636 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13637 can now be zero (for strings); special values 0 and -1 were
13638 changed to -1 and -2, respectively.
13639 (bidi_char_at_pos): New function.
13640 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13641 Call it instead of FETCH_MULTIBYTE_CHAR.
13642 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13643 initialized to valid values.
13644 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13645 values.
13646 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13647 the test for valid cached positions. Fix the logic for looking up
13648 the sentinel state in the cache. GCPRO the Lisp string we are
13649 iterating.
13650 (bidi_push_it, bidi_pop_it): New functions.
13651 (bidi_initialize): Initialize the bidi cache start stack pointer.
13652 (bidi_cache_ensure_space): New function, refactored from part of
13653 bidi_cache_iterator_state. Don't assume the required size is just
13654 one BIDI_CACHE_CHUNK away.
13655 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13656 (bidi_count_bytes, bidi_char_at_pos): New functions.
13657 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13658 always valid if bidi_cache_idx is valid.
13659 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13660 is valid if it's going to be used.
13661 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13662 (bidi_cache_fetch_state, bidi_cache_search)
13663 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13664 (bidi_cache_iterator_state, bidi_cache_find)
13665 (bidi_find_other_level_edge, bidi_cache_start_stack):
13666 All variables related to cache indices are now EMACS_INT.
13667
13668 * dispextern.h (struct bidi_string_data): New structure.
13669 (struct bidi_it): New member `string'. Make flag members be 1-bit
13670 fields, and put them last in the struct.
13671 (compute_display_string_pos, compute_display_string_end):
13672 Update prototypes.
13673 (bidi_push_it, bidi_pop_it): Add prototypes.
13674 (struct iterator_stack_entry): New members bidi_p,
13675 paragraph_embedding, and from_disp_prop_p.
13676 (struct it): Member bidi_p is now a bit field 1 bit wide.
13677 (bidi_shelve_cache, bidi_unshelve_cache):
13678 Declare prototypes.
13679
13680 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13681 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13682 and vector-like objects.
13683
13684 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13685 cache around display iteration.
13686
13687 * window.c (Fwindow_end, window_scroll_pixel_based)
13688 (displayed_window_lines, Frecenter): Save and restore the bidi
13689 cache around display iteration.
13690
13691 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13692
13693 * editfns.c (Fdelete_region): Clarify the use of the named
13694 parameters (bug#6788).
13695
13696 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13697
13698 * indent.c (Fvertical_motion): Set and restore w->pointm when
13699 saving and restoring the window's buffer (Bug#9006).
13700
13701 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13702
13703 * editfns.c (Fstring_to_char): Clarify just what is returned
13704 (bug#6576). Text by Eli Zaretskii.
13705
13706 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13707
13708 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13709
13710 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13711
13712 * buffer.c (mmap_find): Fix a typo.
13713
13714 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13715
13716 Fix execution of x selection hooks.
13717 * xselect.c (Qx_lost_selection_functions)
13718 (Qx_sent_selection_functions): New vars.
13719 (syms_of_xselect): DEFSYM them.
13720 (x_handle_selection_request): Pass Qx_sent_selection_functions
13721 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13722 (x_handle_selection_clear,x_clear_frame_selections):
13723 Pass Qx_lost_selection_functions rather than
13724 Vx_lost_selection_functions to Frun_hook_with_args.
13725
13726 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13727
13728 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13729 The old code sometimes used this field without initializing it.
13730
13731 * alloc.c (gc_sweep): Don't read past end of array.
13732 In theory, the old code could also have corrupted Emacs internals,
13733 though it'd be very unlikely.
13734
13735 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13736
13737 * character.c (Fcharacterp): Don't advertise optional ignored
13738 argument. (Bug#4026)
13739
13740 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13741
13742 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13743 key" (bug#4257).
13744
13745 * window.c (Fset_window_start): Doc fix (bug#4199).
13746 (Fset_window_hscroll): Ditto.
13747
13748 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13749
13750 Fix minor new problems caught by GCC 4.6.1.
13751 * term.c (init_tty): Remove unused local.
13752 * xsettings.c (store_monospaced_changed): Define this function only
13753 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13754 not used otherwise.
13755
13756 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13757
13758 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13759
13760 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13761
13762 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13763 are the mini-buffer and the echo area (bug#3320).
13764
13765 * term.c (init_tty): Remove support for supdup, c10 and perq
13766 terminals, which are no longer supported (bug#1482).
13767
13768 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13769
13770 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13771
13772 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13773
13774 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13775 for non-popups (Bug#3642).
13776
13777 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13778
13779 * alloc.c (reset_malloc_hooks): Protoize.
13780 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13781 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13782 * cm.c (losecursor): Likewise.
13783 * data.c (fmod): Likewise.
13784 * dispnew.c (swap_glyphs_in_rows): Likewise.
13785 * emacs.c (memory_warning_signal): Likewise.
13786 * floatfns.c (float_error): Likewise.
13787 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13788 (otf_open, font_otf_capability, generate_otf_features)
13789 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13790 Likewise.
13791 * image.c (pbm_read_file): Likewise.
13792 * indent.c (string_display_width): Likewise.
13793 * intervals.c (check_for_interval, search_for_interval)
13794 (inc_interval_count, count_intervals, root_interval)
13795 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13796 * lread.c (defalias): Likewise.
13797 * ralloc.c (r_alloc_check): Likewise.
13798 * regex.c (set_image_of_range_1, set_image_of_range)
13799 (regex_grow_registers): Likewise.
13800 * sysdep.c (strerror): Likewise.
13801 * termcap.c (valid_filename_p, tprint, main): Likewise.
13802 * tparam.c (main): Likewise.
13803 * unexhp9k800.c (run_time_remap, save_data_space)
13804 (update_file_ptrs, read_header, write_header, calculate_checksum)
13805 (copy_file, copy_rest, display_header): Likewise.
13806 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13807 Likewise.
13808 * xdisp.c (check_it): Likewise.
13809 * xfaces.c (register_color, unregister_color, unregister_colors):
13810 Likewise.
13811 * xfns.c (print_fontset_result): Likewise.
13812 * xrdb.c (member, fatal, main): Likewise.
13813
13814 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13815
13816 Fix minor problems found by static checking (Bug#9031).
13817 * chartab.c (char_table_set_range, map_sub_char_table):
13818 Remove unused locals.
13819 (uniprop_table): Now static.
13820 * composite.c (_work_char): Remove unused static var.
13821
13822 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13823
13824 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13825
13826 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13827
13828 * gtkutil.c (qttip_cb): Remove code without function.
13829
13830 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13831
13832 * w32.c (pthread_sigmask): New stub.
13833
13834 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13835
13836 Use pthread_sigmask, not sigprocmask (Bug#9010).
13837 sigprocmask is portable only for single-threaded applications, and
13838 Emacs can be multi-threaded when it uses GTK.
13839 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13840 (LIBES): Use it.
13841 * callproc.c (Fcall_process):
13842 * process.c (create_process):
13843 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13844 Use pthread_sigmask, not sigprocmask.
13845
13846 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13847
13848 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13849 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13850 wrong (Bug#8591).
13851
13852 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13853
13854 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13855 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13856 (xg_hide_tooltip): Fix comment.
13857
13858 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13859 in registerServicesMenuSendTypes.
13860 (validRequestorForSendType): Don't check ns_return_types.
13861
13862 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13863 ns_return_type.
13864
13865 2011-07-08 Jason Rumney <jasonr@gnu.org>
13866
13867 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13868 SH_SHOW for hidden windows (Bug#5482).
13869
13870 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13871 frame struct members of non-existent frames (Bug#6284).
13872
13873 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13874
13875 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13876 variable firstTime not needed on OSX >= 10.6.
13877 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13878 >= 10.5. Use setKnobProportion, setDoubleValue.
13879
13880 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13881 (MAC_OS_X_VERSION_10_5): Define if not defined.
13882 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13883 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13884 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13885
13886 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13887 cString and lossyCString on OSX >= 10.4.
13888
13889 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13890 sizeToFit on OSX >= 10.2.
13891
13892 * nsimage.m (allocInitFromFile): Don't use deprecated method
13893 bestRepresentationForDevice on OSX >= 10.6.
13894
13895 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13896 to avoid warning.
13897
13898 * emacs.c: Declare unexec_init_emacs_zone.
13899
13900 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13901
13902 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13903
13904 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13905 on svcsMenu (Bug#8842).
13906
13907 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13908 ns_return_types.
13909 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13910
13911 * nsterm.m (QUTF8_STRING): Declare.
13912 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13913 (validRequestorForSendType): Return type is (id).
13914 Change indexOfObjectIdenticalTo to indexOfObject.
13915 Check if we have local selection before returning self (Bug#8842).
13916 (writeSelectionToPasteboard): Put local selection into paste board
13917 if we have a local selection (Bug#8842).
13918 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13919
13920 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13921 (ns_get_local_selection): Declare.
13922
13923 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13924
13925 * keymap.c (describe_map_tree): Don't insert a double newline at
13926 the end of the buffer (bug#1169) and return whether we inserted
13927 something.
13928
13929 * callint.c (Fcall_interactively): Change "reading args" to
13930 "providing args" to try to clarify what it does (bug#1010).
13931
13932 2011-07-07 Kenichi Handa <handa@m17n.org>
13933
13934 * composite.c (composition_compute_stop_pos): Ignore a static
13935 composition starting before CHARPOS (Bug#8915).
13936
13937 * xdisp.c (handle_composition_prop): Likewise.
13938
13939 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13940
13941 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13942 (Bug#9015)
13943
13944 2011-07-07 Kenichi Handa <handa@m17n.org>
13945
13946 * character.h (unicode_category_t): New enum type.
13947
13948 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13949 (Qchar_code_property_table): New variable.
13950 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13951 (UNIPROP_COMPRESSED_FORM_P): New macros.
13952 (char_table_ascii): Uncompress the compressed values.
13953 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13954 Uncompress the compressed values.
13955 (sub_char_table_ref_and_range): Likewise.
13956 (char_table_ref_and_range): Uncompress the compressed values.
13957 (sub_char_table_set): New arg is_uniprop. Callers changed.
13958 Uncompress the compressed values.
13959 (sub_char_table_set_range): Args changed. Callers changed.
13960 (char_table_set_range): Adjuted for the above change.
13961 (map_sub_char_table): Delete args default_val and parent. Add arg
13962 top. Give decoded values to a Lisp function.
13963 (map_char_table): Adjust for the above change. Give decoded
13964 values to a Lisp function. Gcpro more variables.
13965 (uniprop_table_uncompress)
13966 (uniprop_decode_value_run_length): New functions.
13967 (uniprop_decoder, uniprop_decoder_count): New variables.
13968 (uniprop_get_decoder, uniprop_encode_value_character)
13969 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13970 New functions.
13971 (uniprop_encoder, uniprop_encoder_count): New variables.
13972 (uniprop_get_encoder, uniprop_table)
13973 (Funicode_property_table_internal, Fget_unicode_property_internal)
13974 (Fput_unicode_property_internal): New functions.
13975 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13976 Sunicode_property_table_internal, Sget_unicode_property_internal,
13977 and Sput_unicode_property_internal. Defvar_lisp
13978 char-code-property-alist.
13979
13980 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13981 Vunicode_category_table.
13982
13983 * font.c (font_range): Adjust for the change of
13984 Vunicode_category_table.
13985
13986 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13987
13988 * m/iris4d.h: Remove file, move contents ...
13989 * s/irix6-5.h: ... here.
13990
13991 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13992
13993 Remove unportable assumption about struct layout (Bug#8884).
13994 * alloc.c (mark_buffer):
13995 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13996 (clone_per_buffer_values): Don't assume that
13997 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13998 This isn't true in general, and it's particularly not true
13999 if Emacs is configured with --with-wide-int.
14000 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14001 New macros, used in the buffer.c change.
14002
14003 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14004
14005 * xsettings.c: Use both GConf and GSettings if both are available.
14006 (store_config_changed_event): Add comment.
14007 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14008 (store_tool_bar_style_changed): New functions.
14009 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
14010 (struct xsettings): Move font inside HAVE_XFT.
14011 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
14012 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
14013 Move inside HAVE_XFT.
14014 (something_changed_gsettingsCB): Rename from something_changedCB.
14015 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14016 also.
14017 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
14018 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
14019 (something_changed_gconfCB): Rename from something_changedCB.
14020 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14021 (parse_settings): Move check for font inside HAVE_XFT.
14022 (read_settings, apply_xft_settings): Add comment.
14023 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14024 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14025 call store_font_name_changed.
14026 (xft_settings_event): Add comment.
14027 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14028 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14029 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14030 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14031 (xsettings_initialize): Call init_gsettings last.
14032 (xsettings_get_system_font, xsettings_get_system_normal_font):
14033 Add comment.
14034
14035 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14036
14037 Random fixes. E.g., (random) never returned negative values.
14038 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14039 subseconds part to the entropy, as that's a bit more random.
14040 Prefer signed to unsigned, since the signedness doesn't matter and
14041 in general we prefer signed. When given a limit, use a
14042 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14043 latter isn't right if USE_2_TAGS_FOR_INTS.
14044 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14045 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14046
14047 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14048
14049 * textprop.c (text_property_stickiness):
14050 Obey Vtext_property_default_nonsticky.
14051 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14052 * w32fns.c (syms_of_w32fns):
14053 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14054
14055 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14056
14057 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14058 This is more efficient than Ffile_directory_p and avoids a minor race.
14059
14060 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14061
14062 * buffer.c (Foverlay_put): Say what the return value is
14063 (bug#7835).
14064
14065 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14066 is a directory before asking whether to use the file name
14067 (bug#7564).
14068 (barf_or_query_if_file_exists): Make the "File is a directory"
14069 error be more correct.
14070
14071 * fns.c (Frequire): Remove the mention of the .gz files, since
14072 that's installation-specific, but keep the mention of
14073 `get-load-suffixes'.
14074
14075 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14076
14077 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14078 Report string overflow if the output is too long.
14079
14080 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14081
14082 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14083 (syms_of_gnutls): Remove duplicate DEFSYM for
14084 Qgnutls_bootprop_verify_hostname_error, an error for
14085 Qgnutls_bootprop_verify_error (which is no longer used).
14086
14087 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14088 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14089 Also (re)move comments that are misplaced or no longer relevant.
14090
14091 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14092
14093 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14094
14095 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14096
14097 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14098 and background color parameters if they have been changed.
14099
14100 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14101
14102 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14103
14104 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14105
14106 * xsettings.c (SYSTEM_FONT): Define only when used.
14107 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14108
14109 * keymap.c (access_keymap_1): Now static.
14110
14111 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14112
14113 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14114 leave any prefix arg for the up event (Bug#1586).
14115
14116 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14117
14118 * lread.c (syms_of_lread): Mention single symbols defined by
14119 `defvar' or `defconst' (bug#7154).
14120
14121 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14122 (Frequire): Mention get-load-suffixes.
14123
14124 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14125
14126 * window.h (window): Remove clone_number slot.
14127 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14128 Remove.
14129 (make_parent_window, make_window, saved_window)
14130 (Fset_window_configuration, save_window_save): Don't deal with
14131 clone numbers.
14132 * buffer.c (Qclone_number): Remove declaration.
14133 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14134
14135 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14136
14137 Add multiple inheritance to keymaps.
14138 * keymap.c (Fmake_composed_keymap): New function.
14139 (Fset_keymap_parent): Simplify.
14140 (fix_submap_inheritance): Remove.
14141 (access_keymap_1): New function extracted from access_keymap to handle
14142 embedded parents and handle lists of maps.
14143 (access_keymap): Use it.
14144 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14145 (Fcopy_keymap): Handle embedded parents.
14146 (Fcommand_remapping, define_as_prefix): Simplify.
14147 (Fkey_binding): Simplify.
14148 (syms_of_keymap): Move minibuffer-local-completion-map,
14149 minibuffer-local-filename-completion-map,
14150 minibuffer-local-must-match-map, and
14151 minibuffer-local-filename-must-match-map to Elisp.
14152 (syms_of_keymap): Defsubr make-composed-keymap.
14153 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14154 (parse_menu_item): Trivial simplification.
14155
14156 2011-07-01 Glenn Morris <rgm@gnu.org>
14157
14158 * Makefile.in (SETTINGS_LIBS): Fix typo.
14159
14160 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14161
14162 * coding.c (Fencode_coding_string): Record the last coding system
14163 used, as the function doc string says (bug#8738).
14164
14165 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14166
14167 * xsettings.c (store_monospaced_changed): Take new font as arg and
14168 check for change against current_mono_font.
14169 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14170 (emacs_settings_constructor, emacs_settings_get_property)
14171 (emacs_settings_set_property, emacs_settings_class_init)
14172 (emacs_settings_init, gsettings_obj): Remove.
14173 (something_changedCB): New function for HAVE_GSETTINGS.
14174 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14175 with value as argument.
14176 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14177 g_settings_new (Bug#8967). Do not create gsettings_obj.
14178 Remove calls to g_settings_bind. Connect something_changedCB to
14179 "changed".
14180
14181 * xgselect.c: Add defined (HAVE_GSETTINGS).
14182 (xgselect_initialize): Ditto.
14183
14184 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14185 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14186 xg_select.
14187
14188 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14189
14190 * eval.c (struct backtrace): Simplify and port the data structure.
14191 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14192 signed bit field, as this assumption is not portable and it makes
14193 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14194 "char debug_on_exit : 1" as this is not portable either; instead,
14195 use the portable "unsigned int debug_on_exit : 1". Remove unused
14196 member evalargs. Remove obsolete comments about cc bombing out.
14197
14198 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14199
14200 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14201 Let HAVE_GSETTINGS override HAVE_GCONF.
14202 (store_monospaced_changed): New function.
14203 (EMACS_SETTINGS): A new type derived from GObject to handle
14204 GSettings notifications.
14205 (emacs_settings_constructor, emacs_settings_get_property)
14206 (emacs_settings_set_property, emacs_settings_class_init):
14207 New functions.
14208 (gsettings_client, gsettings_obj): New variables.
14209 (GSETTINGS_SCHEMA): New define.
14210 (something_changedCB): Call store_monospaced_changed.
14211 (init_gsettings): New function.
14212 (xsettings_initialize): Call init_gsettings.
14213 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14214 to NULL.
14215
14216 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14217 GCONF_CFLAGS/LIBS.
14218
14219 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14220
14221 * window.c (resize_root_window, grow_mini_window)
14222 (shrink_mini_window): Rename Qresize_root_window to
14223 Qwindow_resize_root_window and Qresize_root_window_vertically to
14224 Qwindow_resize_root_window_vertically.
14225
14226 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14227
14228 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14229
14230 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14231
14232 * makefile.w32-in: Redesign dependencies so they reflect more
14233 clearly which files are directly included by each source file,
14234 and not through other includes.
14235
14236 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14237
14238 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14239 (sort_overlays, overlay_strings): When an overlay's clone number
14240 matches the window's clone number process the overlay even if
14241 the overlay's window property doesn't match the current window.
14242
14243 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14244 (Fwindow_hchild): Rename to Fwindow_left_child.
14245 (Fwindow_next): Rename to Fwindow_next_sibling.
14246 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14247 (resize_window_check): Rename to window_resize_check.
14248 (resize_window_apply): Rename to window_resize_apply.
14249 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14250 (Fdelete_other_windows_internal, resize_frame_windows)
14251 (Fsplit_window_internal, Fdelete_window_internal)
14252 (grow_mini_window, shrink_mini_window)
14253 (Fresize_mini_window_internal): Fix callers accordingly.
14254
14255 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14256
14257 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14258 (emacs_fixed_set_min_size): Remove.
14259 (emacs_fixed_new): Take frame as argument.
14260
14261 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14262 (_EmacsFixedPrivate): Remove minwidth/height.
14263 Add struct frame *f.
14264 (emacs_fixed_init): Initialize priv->f.
14265 (get_parent_class, emacs_fixed_set_min_size): Remove.
14266 (emacs_fixed_new): Set priv->f to argument.
14267 (emacs_fixed_get_preferred_width)
14268 (emacs_fixed_get_preferred_height): Use min_width/height from
14269 frames size_hint to set minimum and natural (Bug#8919).
14270 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14271 and use min_width/height from frames size_hint to set
14272 min_width/height (Bug#8919).
14273
14274 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14275 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14276 Fix indentation.
14277
14278 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14279
14280 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14281 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14282 called at ZV.
14283
14284 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14285
14286 * process.c (wait_reading_process_output): Bypass select if
14287 waiting for a cell while ignoring keyboard input, and input is
14288 pending. Suggested by Jan Djärv (Bug#8869).
14289
14290 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14291
14292 Use gnulib's dup2 module instead of rolling our own.
14293 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14294
14295 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14296
14297 * dispnew.c (scrolling_window): Before scrolling, turn off a
14298 mouse-highlight in the window being scrolled.
14299
14300 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14301
14302 Move DEFSYM to lisp.h and use everywhere.
14303
14304 * character.h (DEFSYM): Move declaration...
14305 * lisp.h (DEFSYM): ...here.
14306
14307 * gnutls.c:
14308 * minibuf.c:
14309 * w32menu.c:
14310 * w32proc.c:
14311 * w32select.c: Don't include character.h.
14312
14313 * alloc.c (syms_of_alloc):
14314 * buffer.c (syms_of_buffer):
14315 * bytecode.c (syms_of_bytecode):
14316 * callint.c (syms_of_callint):
14317 * casefiddle.c (syms_of_casefiddle):
14318 * casetab.c (init_casetab_once):
14319 * category.c (init_category_once, syms_of_category):
14320 * ccl.c (syms_of_ccl):
14321 * cmds.c (syms_of_cmds):
14322 * composite.c (syms_of_composite):
14323 * dbusbind.c (syms_of_dbusbind):
14324 * dired.c (syms_of_dired):
14325 * dispnew.c (syms_of_display):
14326 * doc.c (syms_of_doc):
14327 * editfns.c (syms_of_editfns):
14328 * emacs.c (syms_of_emacs):
14329 * eval.c (syms_of_eval):
14330 * fileio.c (syms_of_fileio):
14331 * fns.c (syms_of_fns):
14332 * frame.c (syms_of_frame):
14333 * fringe.c (syms_of_fringe):
14334 * insdel.c (syms_of_insdel):
14335 * keymap.c (syms_of_keymap):
14336 * lread.c (init_obarray, syms_of_lread):
14337 * macros.c (syms_of_macros):
14338 * msdos.c (syms_of_msdos):
14339 * print.c (syms_of_print):
14340 * process.c (syms_of_process):
14341 * search.c (syms_of_search):
14342 * sound.c (syms_of_sound):
14343 * syntax.c (init_syntax_once, syms_of_syntax):
14344 * terminal.c (syms_of_terminal):
14345 * textprop.c (syms_of_textprop):
14346 * undo.c (syms_of_undo):
14347 * w32.c (globals_of_w32):
14348 * window.c (syms_of_window):
14349 * xdisp.c (syms_of_xdisp):
14350 * xfaces.c (syms_of_xfaces):
14351 * xfns.c (syms_of_xfns):
14352 * xmenu.c (syms_of_xmenu):
14353 * xsettings.c (syms_of_xsettings):
14354 * xterm.c (syms_of_xterm): Use DEFSYM.
14355
14356 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14357
14358 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14359
14360 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14361
14362 Integer and buffer overflow fixes (Bug#8873).
14363
14364 * print.c (printchar, strout): Check for string overflow.
14365 (PRINTPREPARE, printchar, strout):
14366 Don't set size unless allocation succeeds.
14367
14368 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14369 for sizes. Check for string overflow more accurately.
14370 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14371
14372 * macros.c: Integer and buffer overflow fixes.
14373 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14374 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14375 Use ptrdiff_t, not int, for sizes.
14376 Don't increment bufsize until after realloc succeeds.
14377 Check for size-calculation overflow.
14378 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14379
14380 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14381
14382 * lread.c: Integer overflow fixes.
14383 (read_integer): Radix is now EMACS_INT, not int,
14384 to improve quality of diagnostics for out-of-range radices.
14385 Calculate buffer size correctly for out-of-range radices.
14386 (read1): Check for integer overflow in radices, and in
14387 read-circle numbers.
14388 (read_escape): Avoid int overflow.
14389 (Fload, openp, read_buffer_size, read1)
14390 (substitute_object_recurse, read_vector, read_list, map_obarray):
14391 Use ptrdiff_t, not int, for sizes.
14392 (read1): Use EMACS_INT, not int, for sizes.
14393 Check for size overflow.
14394
14395 * image.c (cache_image): Check for size arithmetic overflow.
14396
14397 * lread.c: Integer overflow issues.
14398 (saved_doc_string_size, saved_doc_string_length)
14399 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14400 Now ptrdiff_t, not int.
14401 (read1): Don't assume doc string length fits in int. Check for
14402 out-of-range doc string lengths.
14403 (read_list): Don't assume file position fits in int.
14404 (read_escape): Check for hex character overflow.
14405
14406 2011-06-22 Leo Liu <sdl.web@gmail.com>
14407
14408 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14409 Move to minibuffer.el.
14410
14411 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14412
14413 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14414 The following patches are for when GLYPH_DEBUG && !XASSERT.
14415 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14416 * dispnew.c (flush_stdout):
14417 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14418 Mark as externally visible.
14419 * dispnew.c (check_window_matrix_pointers): Now static.
14420 * dispnew.c (window_to_frame_vpos):
14421 * xfns.c (unwind_create_frame):
14422 * xterm.c (x_check_font): Remove unused local.
14423 * scroll.c (CHECK_BOUNDS):
14424 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14425 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14426 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14427 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14428 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14429 Now static.
14430 (debug_method_add): Use va_list and vsprintf rather than relying
14431 on undefined behavior with wrong number of arguments.
14432 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14433 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14434 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14435 since we're not interested in debugging glyphs with old libraries.
14436 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14437 GCC 4.6.0's static checking.
14438
14439 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14440
14441 Integer overflow and signedness fixes (Bug#8873).
14442 A few related buffer overrun fixes, too.
14443
14444 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14445
14446 * dispextern.h (struct face.stipple):
14447 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14448 (x_bitmap_mask, x_allocate_bitmap_record)
14449 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14450 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14451 (x_create_bitmap_from_xpm_data):
14452 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14453 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14454 (.bitmaps_last):
14455 * xfaces.c (load_pixmap):
14456 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14457 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14458 (.bitmaps_last, struct x_output.icon_bitmap):
14459 Use ptrdiff_t, not int, for bitmap indexes.
14460 (x_allocate_bitmap_record): Check for size overflow.
14461 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14462
14463 Use ptrdiff_t, not int, for overlay counts.
14464 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14465 * editfns.c (overlays_around, get_pos_property):
14466 * textprop.c (get_char_property_and_overlay):
14467 * xdisp.c (next_overlay_change, note_mouse_highlight):
14468 * xfaces.c (face_at_buffer_position):
14469 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14470 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14471 (Fnext_overlay_change, Fprevious_overlay_change)
14472 (mouse_face_overlay_overlaps, Foverlays_in):
14473 Use ptrdiff_t, not int, for sizes.
14474 (overlays_at, overlays_in): Check for size-calculation overflow.
14475
14476 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14477
14478 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14479 (x_session_initialize): Do not assume string length fits in int.
14480
14481 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14482 This is unlikely, but can occur if DPI is outlandish.
14483
14484 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14485 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14486
14487 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14488 * xrdb.c (magic_file_p, search_magic_path):
14489 Omit last arg SUFFIX; it was always 0. All callers changed.
14490 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14491
14492 * xfont.c (xfont_match): Avoid need for strlen.
14493
14494 * xfns.c: Don't assume strlen fits in int.
14495 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14496
14497 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14498 not unsigned long, as we prefer signed integers. All callers changed.
14499 Detect integer overflow in repeat count.
14500 (message_dolog): Don't assume print length fits in 39 bytes.
14501 (display_mode_element): Don't assume strlen fits in int.
14502
14503 * termcap.c: Don't assume sizes fit in int and never overflow.
14504 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14505 (gobble_line): Check for size-calculation overflow.
14506
14507 * minibuf.c (Fread_buffer):
14508 * lread.c (intern, intern_c_string):
14509 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14510 Don't assume string length fits in int.
14511
14512 * keyboard.c (parse_tool_bar_item):
14513 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14514
14515 * font.c: Don't assume string length fits in int.
14516 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14517 Use ptrdiff_t, not int.
14518 (font_intern_prop): Don't assume string length fits in int.
14519 Don't assume integer property fits in fixnum.
14520 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14521
14522 * filelock.c: Fix some buffer overrun and integer overflow issues.
14523 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14524 Reformulate so as not to need the command string.
14525 Invoke gzip -cd rather than gunzip, as it's more portable.
14526 (lock_info_type, lock_file_1, lock_file):
14527 Don't assume pid_t and time_t fit in unsigned long.
14528 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14529 (current_lock_owner): Prefer signed type for sizes.
14530 Use memcpy, not strncpy, where memcpy is what is really wanted.
14531 Don't assume (via atoi) that time_t and pid_t fit in int.
14532 Check for time_t and/or pid_t out of range, e.g., via a network share.
14533 Don't alloca where an auto var works fine.
14534
14535 * fileio.c: Fix some integer overflow issues.
14536 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14537 Don't assume string length fits in int.
14538 (directory_file_name): Don't assume string length fits in long.
14539 (make_temp_name): Don't assume pid fits in int, or that its print
14540 length is less than 20.
14541
14542 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14543
14544 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14545
14546 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14547
14548 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14549 We prefer signed integers, even for size calculations.
14550
14551 * emacs.c: Don't assume string length fits in 'int'.
14552 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14553 (main): Don't invoke strlen when not needed.
14554
14555 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14556 (XD_DEBUG_MESSAGE): Don't waste a byte.
14557
14558 * callproc.c (getenv_internal_1, getenv_internal)
14559 (Fgetenv_internal):
14560 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14561
14562 * lread.c (invalid_syntax): Omit length argument.
14563 All uses changed. This doesn't fix a bug, but it simplifies the
14564 code away from its former Hollerith-constant appearance, and it's
14565 one less 'int' to worry about when looking at integer-overflow issues.
14566 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14567
14568 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14569 This didn't break anything, but it didn't help either.
14570 It's confusing to put a bogus integer in a place where the actual
14571 value does not matter.
14572 (LIST_END_P): Remove unused macro and its bogus comment.
14573 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14574
14575 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14576 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14577 implementation.
14578 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14579 We prefer signed types, and the value cannot exceed the EMACS_INT
14580 range anyway (because otherwise the length would not be representable).
14581 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14582 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14583 This avoids a GCC warning when WIDE_EMACS_INT.
14584
14585 * indent.c (sane_tab_width): New function.
14586 (current_column, scan_for_column, Findent_to, position_indentation)
14587 (compute_motion): Use it. This is just for clarity.
14588 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14589
14590 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14591
14592 * lisp.h (lint_assume): New macro.
14593 * composite.c (composition_gstring_put_cache):
14594 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14595
14596 * editfns.c, insdel.c:
14597 Omit unnecessary forward decls, to simplify future changes.
14598
14599 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14600
14601 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14602
14603 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14604 Use much-faster test for byte-length change.
14605 Don't assume string byte-length fits in 'int'.
14606 Check that character arg fits in 'int'.
14607 (mapcar1): Declare byte as byte, for clarity.
14608
14609 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14610
14611 * fns.c (concat): Catch string overflow earlier.
14612 Do not rely on integer wraparound.
14613
14614 * dispextern.h (struct it.overlay_strings_charpos)
14615 (struct it.selective): Now EMACS_INT, not int.
14616 * xdisp.c (forward_to_next_line_start)
14617 (back_to_previous_visible_line_start)
14618 (reseat_at_next_visible_line_start, next_element_from_buffer):
14619 Don't arbitrarily truncate the value of 'selective' to int.
14620
14621 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14622
14623 * composite.c: Don't truncate sizes to 'int'.
14624 (composition_gstring_p, composition_reseat_it)
14625 (composition_adjust_point): Use EMACS_INT, not int.
14626 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14627 not EMACS_UINT, for indexes.
14628
14629 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14630
14631 * buffer.c: Include <verify.h>.
14632 (struct sortvec.priority, struct sortstr.priority):
14633 Now EMACS_INT, not int.
14634 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14635 (struct sortstr.size, record_overlay_string)
14636 (struct sortstrlist.size, struct sortlist.used):
14637 Don't truncate size to int.
14638 (record_overlay_string): Check for size-calculation overflow.
14639 (init_buffer_once): Check at compile-time, not run-time.
14640
14641 2011-06-22 Jim Meyering <meyering@redhat.com>
14642
14643 Don't leak an XBM-image-sized buffer
14644 * image.c (xbm_load): Free the image buffer after using it.
14645
14646 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14647
14648 Port to Sun C.
14649 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14650 that Sun C diagnosed.
14651 * fns.c (secure_hash): Fix pointer signedness issue.
14652 * intervals.c (static_offset_intervals): New function.
14653 (offset_intervals): Use it.
14654
14655 2011-06-21 Leo Liu <sdl.web@gmail.com>
14656
14657 * deps.mk (fns.o):
14658 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14659 sha512.h.
14660
14661 * fns.c (secure_hash): Rename from crypto_hash_function and change
14662 the first arg to accept symbols.
14663 (Fsecure_hash): New primitive.
14664 (syms_of_fns): New symbols.
14665
14666 2011-06-20 Deniz Dogan <deniz@dogan.se>
14667
14668 * process.c (Fset_process_buffer): Clarify return value in
14669 docstring.
14670
14671 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14672
14673 * dispnew.c (add_window_display_history): Use BVAR.
14674
14675 * xdisp.c (debug_method_add): Use BVAR.
14676 (check_window_end, dump_glyph_matrix, dump_glyph)
14677 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14678
14679 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14680 Likewise.
14681
14682 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14683 check till after the cache is created in init_frame_faces.
14684
14685 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14686
14687 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14688
14689 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14690
14691 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14692 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14693 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14694
14695 Improve buffer-overflow checking (Bug#8873).
14696 * fileio.c (Finsert_file_contents):
14697 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14698 Remove the old (too-loose) buffer overflow checks.
14699 They weren't needed, since make_gap checks for buffer overflow.
14700 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14701 The old code merely checked for Emacs fixnum overflow, and relied
14702 on undefined (wraparound) behavior. The new code avoids undefined
14703 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14704
14705 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14706 Tune. Don't use wider integers than needed. Don't use alloca.
14707 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14708
14709 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14710
14711 * insdel.c, lisp.h (buffer_overflow): New function.
14712 (insert_from_buffer_1, replace_range, replace_range_2):
14713 * insdel.c (make_gap_larger):
14714 * editfns.c (Finsert_char):
14715 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14716
14717 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14718
14719 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14720
14721 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14722
14723 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14724 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14725
14726 * fileio.c: Don't assume EMACS_INT fits in off_t.
14727 (emacs_lseek): New static function.
14728 (Finsert_file_contents, Fwrite_region): Use it.
14729 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14730
14731 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14732
14733 * fns.c: Don't overflow int when computing a list length.
14734 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14735 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14736 truncation on 64-bit hosts. Check for QUIT every
14737 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14738 faster and is responsive enough.
14739 (Flength): Report an error instead of overflowing an integer.
14740 (Fsafe_length): Return a float if the value is not representable
14741 as a fixnum. This shouldn't happen except in contrived situations.
14742 (Fnthcdr, Fsort): Don't assume list length fits in int.
14743 (Fcopy_sequence): Don't assume vector length fits in int.
14744
14745 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14746 (header_size, word_size): New constants.
14747 (allocate_vectorlike): Don't check size overflow here.
14748 (allocate_vector): Check it here instead, since this is the only
14749 caller of allocate_vectorlike that could cause overflow.
14750 Check that the new vector's length is representable as a fixnum.
14751
14752 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14753 The previous code was bogus. For example, next_almost_prime (32)
14754 returned 39, which is undesirable as it is a multiple of 3; and
14755 next_almost_prime (24) returned 25, which is a multiple of 5 so
14756 why was the code bothering to check for multiples of 7?
14757
14758 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14759
14760 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14761
14762 Variadic C functions now count arguments with ptrdiff_t.
14763 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14764 Back then I didn't know that the Emacs coding style prefers signed int.
14765 Also, in the meantime I found a few more instances where arguments
14766 were being counted with int, which may truncate counts on 64-bit
14767 machines, or EMACS_INT, which may be unnecessarily wide.
14768 * lisp.h (struct Lisp_Subr.function.aMANY)
14769 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14770 Arg counts are now ptrdiff_t, not size_t.
14771 All variadic functions and their callers changed accordingly.
14772 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14773 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14774 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14775 * callint.c (Fcall_interactively): Check arg count for overflow,
14776 to avoid potential buffer overrun. Use signed char, not 'int',
14777 for 'varies' array, so that we needn't bother to check its size
14778 calculation for overflow.
14779 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14780 * eval.c (apply_lambda):
14781 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14782 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14783 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14784
14785 * callint.c (Fcall_interactively): Don't use index var as event count.
14786
14787 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14788 * mem-limits.h (SIZE): Remove; no longer used.
14789
14790 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14791
14792 Remove unnecessary casts.
14793 * xterm.c (x_term_init):
14794 * xfns.c (x_set_border_pixel):
14795 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14796 These aren't needed now that we assume ANSI C.
14797
14798 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14799 It's more likely to cause problems (due to unsigned overflow)
14800 than to cure them.
14801
14802 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14803
14804 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14805
14806 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14807
14808 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14809
14810 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14811
14812 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14813
14814 GLYPH_CODE_FACE returns EMACS_INT, not int.
14815 * dispextern.h (merge_faces):
14816 * xfaces.c (merge_faces):
14817 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14818 Don't assume EMACS_INT fits in int.
14819
14820 * character.h (CHAR_VALID_P): Remove unused parameter.
14821 * fontset.c, lisp.h, xdisp.c: All uses changed.
14822
14823 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14824
14825 * fns.c (concat): Minor tuning based on overflow analysis.
14826 This doesn't fix any bugs. Use int to hold character, instead
14827 of constantly refetching from Emacs object. Use XFASTINT, not
14828 XINT, for value known to be a character. Don't bother comparing
14829 a single byte to 0400, as it's always less.
14830
14831 * floatfns.c (Fexpt):
14832 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14833
14834 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14835 for characters.
14836
14837 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14838
14839 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14840 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14841 incorrectly succeed when S was a string, because 4294967386 was
14842 truncated before it was used.
14843
14844 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14845 Otherwise, an out-of-range integer could cause undefined behavior
14846 on a 64-bit host.
14847
14848 * composite.c: Use int, not EMACS_INT, for characters.
14849 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14850 EMACS_INT, for values that are known to be in character range.
14851 This doesn't fix any bugs but is the usual style inside Emacs and
14852 may generate better code on 32-bit machines.
14853
14854 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14855 This is for reasons similar to the recent CHAR_STRING fix.
14856 * charset.c (Fencode_char): Check that character arg is actually
14857 a character. Pass an int to ENCODE_CHAR.
14858 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14859 wider than 'int', as a compile-time check to prevent future regressions
14860 in this area.
14861
14862 * character.c (char_string): Remove unnecessary casts.
14863
14864 Make sure a 64-bit char is never passed to CHAR_STRING.
14865 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14866 by silently ignoring the top 32 bits, allowing some values
14867 that were far too large to be valid characters.
14868 * character.h: Include <verify.h>.
14869 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14870 arguments are no wider than unsigned, as a compile-time check
14871 to prevent future regressions in this area.
14872 * data.c (Faset):
14873 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14874 (Fsubst_char_in_region):
14875 * fns.c (concat):
14876 * xdisp.c (decode_mode_spec_coding):
14877 Adjust to CHAR_STRING's new requirement.
14878 * editfns.c (Finsert_char, Fsubst_char_in_region):
14879 * fns.c (concat): Check that character args are actually
14880 characters. Without this test, these functions did the wrong
14881 thing with wildly out-of-range values on 64-bit hosts.
14882
14883 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14884 These casts should not be needed on 32-bit hosts, either.
14885 * keyboard.c (read_char):
14886 * lread.c (Fload): Remove casts to unsigned.
14887
14888 * lisp.h (UNSIGNED_CMP): New macro.
14889 This fixes comparison bugs on 64-bit hosts.
14890 (ASCII_CHAR_P): Use it.
14891 * casefiddle.c (casify_object):
14892 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14893 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14894 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14895 * dispextern.h (FACE_FROM_ID):
14896 * keyboard.c (read_char): Use UNSIGNED_CMP.
14897
14898 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14899 not to EMACS_INT, to avoid GCC warning.
14900
14901 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14902
14903 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14904 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14905 isn't needed on 32-bit machines.
14906
14907 * buffer.c (Fgenerate_new_buffer_name):
14908 Use EMACS_INT for count, not int.
14909 (advance_to_char_boundary): Return EMACS_INT, not int.
14910
14911 * data.c (Qcompiled_function): Now static.
14912
14913 * window.c (window_body_lines): Now static.
14914
14915 * image.c (gif_load): Rename local to avoid shadowing.
14916
14917 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14918 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14919 * alloc.c (make_save_value): Integer argument is now of type
14920 ptrdiff_t, not int.
14921 (mark_object): Use ptrdiff_t, not int.
14922 * lisp.h (pD): New macro.
14923 * print.c (print_object): Use it.
14924
14925 * alloc.c: Use EMACS_INT, not int, to count objects.
14926 (total_conses, total_markers, total_symbols, total_vector_size)
14927 (total_free_conses, total_free_markers, total_free_symbols)
14928 (total_free_floats, total_floats, total_free_intervals)
14929 (total_intervals, total_strings, total_free_strings):
14930 Now EMACS_INT, not int. All uses changed.
14931 (Fgarbage_collect): Compute overall total using a double, so that
14932 integer overflow is less likely to be a problem. Check for overflow
14933 when converting back to an integer.
14934 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14935 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14936 These were 'int' variables that could overflow on 64-bit hosts;
14937 they were never used, so remove them instead of repairing them.
14938 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14939 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14940 Previously, this ceilinged at INT_MAX, but that doesn't work on
14941 64-bit machines.
14942 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14943
14944 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14945 (allocate_vectorlike): Check for ptrdiff_t overflow.
14946 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14947 when a (possibly-narrower) signed value would do just as well.
14948 We prefer using signed arithmetic, to avoid comparison confusion.
14949
14950 * alloc.c: Catch some string size overflows that we were missing.
14951 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14952 for convenience in STRING_BYTES_MAX.
14953 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14954 The definition here is exact; the one in lisp.h was approximate.
14955 (allocate_string_data): Check for string overflow. This catches
14956 some instances we weren't catching before. Also, it catches
14957 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14958 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14959 and ptrdiff_t and EMACS_INT are both 64 bits.
14960
14961 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14962 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14963 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14964
14965 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14966
14967 * alloc.c (Fmake_string): Check for out-of-range init.
14968
14969 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14970
14971 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14972
14973 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14974
14975 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14976 xg_get_default_scrollbar_width.
14977
14978 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14979 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14980 (style_changed_cb): Call update_theme_scrollbar_width and call
14981 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14982 all frames (Bug#8505).
14983 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14984 Call gtk_window_set_resizable if HAVE_GTK3.
14985 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14986 and height if HAVE_GTK3 (Bug#8505).
14987 (scroll_bar_width_for_theme): New variable.
14988 (update_theme_scrollbar_width): New function.
14989 (xg_get_default_scrollbar_width): Move code to
14990 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14991 (xg_initialize): Call update_theme_scrollbar_width.
14992
14993 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14994
14995 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14996
14997 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14998
14999 * frame.c (make_frame): Call other_buffer_safely instead of
15000 other_buffer.
15001
15002 * window.c (temp_output_buffer_show): Call display_buffer with
15003 second argument Vtemp_buffer_show_specifiers and reset latter
15004 immediately after the call.
15005 (Vtemp_buffer_show_specifiers): New variable.
15006 (auto_window_vscroll_p, next_screen_context_lines)
15007 (Vscroll_preserve_screen_position): Remove leading asterisks from
15008 doc-strings.
15009
15010 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
15011
15012 Fix minor problems found by GCC 4.6.0 static checking.
15013 * buffer.c (Qclone_number): Remove for now, as it's unused.
15014 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15015 (record_buffer): Remove unused local.
15016 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15017 (set_frame_buffer_list): Remove; unused.
15018 * frame.h (other_visible_frames): Remove decl.
15019 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15020 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15021 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15022 if HAVE_GPM.
15023 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15024 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15025 Define only if HAVE_GPM.
15026 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15027 (update_hints_inhibit): Remove; never set. All uses removed.
15028 * widgetprv.h (emacsFrameClassRec): Remove decl.
15029 * window.c (delete_deletable_window): Now returns void, since it
15030 wasn't returning anything.
15031 (compare_window_configurations): Remove unused locals.
15032 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15033 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15034 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15035 the same widths as pointers. This follows up on the 2011-05-06 patch.
15036 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15037 * xterm.h: Likewise.
15038 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15039
15040 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15041
15042 * makefile.w32-in: Update dependencies.
15043 (LISP_H): Add lib/intprops.h.
15044
15045 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15046
15047 * image.c (gif_load): Add animation frame delay to the metadata.
15048 (syms_of_image): Use DEFSYM. New symbol `delay'.
15049
15050 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15051
15052 * window.c (delete_deletable_window): Re-add.
15053 (Fset_window_configuration): Rewrite to handle dead buffers and
15054 consequently deletable windows.
15055 (window_tree, Fwindow_tree): Remove. Supply functionality in
15056 window.el.
15057 (compare_window_configurations): Simplify code.
15058
15059 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15060
15061 * image.c (imagemagick_load_image): Fix type mismatch.
15062 (Fimagemagick_types): Likewise.
15063
15064 * window.h (replace_buffer_in_windows): Declare.
15065
15066 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15067
15068 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15069 Qclone_number. Remove external declaration of Qdelete_window.
15070 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15071 code.
15072 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15073 Run Qbuffer_list_update_hook if allowed.
15074 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15075 buffer list implementation.
15076 (other_buffer_safely): New function.
15077 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15078 calls to replace_buffer_in_windows and
15079 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15080 if allowed.
15081 (record_buffer): Inhibit quitting and rewrite using quittable
15082 functions. Run Qbuffer_list_update_hook if allowed.
15083 (Frecord_buffer, Funrecord_buffer): New functions.
15084 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15085 Move switch-to-buffer to window.el.
15086 (bury-buffer): Move to window.el.
15087 (Vbuffer_list_update_hook): New variable.
15088
15089 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15090 section.
15091
15092 * window.h (resize_frame_windows): Move up in code.
15093 (Fwindow_frame): Remove EXFUN.
15094 (replace_buffer_in_all_windows): Remove prototype.
15095 (replace_buffer_in_windows_safely): Add prototype.
15096
15097 * window.c: Declare Qdelete_window static again. Move down
15098 declaration of select_count.
15099 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15100 (Fother_window): Move to window.el.
15101 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15102 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15103 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15104 window.el.
15105 (replace_buffer_in_windows): Implement by calling
15106 Qreplace_buffer_in_windows.
15107 (replace_buffer_in_all_windows): Remove with some functionality
15108 moved into replace_buffer_in_windows_safely.
15109 (replace_buffer_in_windows_safely): New function.
15110 (select_window_norecord, select_frame_norecord): Move in front
15111 of run_window_configuration_change_hook. Remove now obsolete
15112 declarations.
15113 (Fset_window_buffer): Rewrite doc-string.
15114 Call Qrecord_window_buffer.
15115 (keys_of_window): Move binding for other-window to window.el.
15116
15117 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15118
15119 * dispextern.h (struct image): Replace data member, whose int_val
15120 and ptr_val fields were not used by anything, with a single
15121 lisp_val object.
15122
15123 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15124 (gif_clear_image, gif_load, imagemagick_load_image)
15125 (gs_clear_image, gs_load): Callers changed.
15126
15127 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15128
15129 * buffer.h: Include <time.h>, for time_t.
15130 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15131
15132 Fix minor problems found by static checking.
15133
15134 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15135
15136 Make identifiers static if they are not used in other modules.
15137 * data.c (Qcompiled_function, Qframe, Qvector):
15138 * image.c (QimageMagick, Qsvg):
15139 * minibuf.c (Qmetadata):
15140 * window.c (resize_window_check, resize_root_window): Now static.
15141 * window.h (resize_window_check, resize_root_window): Remove decls.
15142
15143 * window.c (window_deletion_count, delete_deletable_window):
15144 Remove; unused.
15145 (window_body_lines): Now static.
15146 (Fdelete_other_windows_internal): Mark vars as initialized.
15147 Make sure 'resize_failed' is initialized.
15148 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15149 (resize_window_apply): Remove unused local.
15150 * window.h (delete_deletable_window): Remove decl.
15151
15152 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15153 (imagemagick_load_image): Fix pointer signedness problem by changing
15154 last arg from unsigned char * to char *. All uses changed.
15155 Also, fix a local for similar reasons.
15156 Remove unused locals. Remove locals to avoid shadowing.
15157 (fn_rsvg_handle_free): Remove; unused.
15158 (svg_load, svg_load_image): Fix pointer signedness problem.
15159 (imagemagick_load_image): Don't use garbage pointer image_wand.
15160
15161 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15162
15163 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15164
15165 * image.c (gif_load): Fix omitted cast error introduced by
15166 2011-06-06 change.
15167
15168 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15169
15170 * window.h (resize_proportionally, orig_total_lines)
15171 (orig_top_line): Remove from window structure.
15172 (set_window_height, set_window_width, change_window_heights)
15173 (Fdelete_window): Remove prototypes.
15174 (resize_frame_windows): Remove duplicate declaration.
15175
15176 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15177
15178 * window.h (resize_frame_windows, resize_window_check)
15179 (delete_deletable_window, resize_root_window)
15180 (resize_frame_windows): Declare prototypes.
15181
15182 * window.c (resize_window_apply): Make definition be "static" to
15183 match the prototype.
15184
15185 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15186
15187 * window.c: Remove declarations of Qwindow_size_fixed,
15188 window_min_size_1, window_min_size_2, window_min_size,
15189 size_window, window_fixed_size_p, enlarge_window, delete_window.
15190 Remove static from declaration of Qdelete_window, it's
15191 temporarily needed by Fbury_buffer.
15192 (replace_window): Don't assign orig_top_line and
15193 orig_total_lines.
15194 (Fdelete_window, delete_window): Remove. Window deletion is
15195 handled by window.el.
15196 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15197 Replace Fdelete_window calls with calls to Qdelete_window.
15198 (Fdelete_other_windows): Remove. Deleting other windows is
15199 handled by window.el.
15200 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15201 handled in window.el.
15202 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15203 Window minimum sizes are handled in window.el.
15204 (shrink_windows, size_window, set_window_height)
15205 (set_window_width, change_window_heights, window_height)
15206 (window_width, CURBEG, CURSIZE, enlarge_window)
15207 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15208 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15209 handled in window.el.
15210 (make_dummy_parent): Rename to make_parent_window and give it a
15211 second argument horflag.
15212 (make_window): Don't set resize_proportionally any more.
15213 (Fsplit_window): Remove. Windows are split in window.el.
15214 (save_restore_action, save_restore_orig_size)
15215 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15216 Resize mini windows in window.el.
15217 (grow_mini_window, shrink_mini_window): Implement by calling
15218 Qresize_root_window_vertically, resize_window_check and
15219 resize_window_apply.
15220 (saved_window, Fset_window_configuration, save_window_save):
15221 Do not handle orig_top_line, orig_total_lines, and
15222 resize_proportionally.
15223 (window_min_height, window_min_width): Move to window.el.
15224 (keys_of_window): Move bindings for delete-other-windows,
15225 split-window, delete-window and enlarge-window to window.el.
15226
15227 * buffer.c: Temporarily extern Qdelete_window.
15228 (Fbury_buffer): Temporarily call Qdelete_window instead of
15229 Fdelete_window (Fbury_buffer will move to window.el soon).
15230
15231 * frame.c (set_menu_bar_lines_1): Remove code handling
15232 orig_top_line and orig_total_lines.
15233
15234 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15235 set_window_height but set heights directly.
15236 (change_frame_size_1): Use resize_frame_windows.
15237
15238 * xdisp.c (init_xdisp): Don't use set_window_height but set
15239 heights directly.
15240
15241 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15242 Use resize_frame_windows instead of change_window_heights and run
15243 run_window_configuration_change_hook.
15244
15245 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15246 instead of change_window_heights and run
15247 run_window_configuration_change_hook.
15248
15249 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15250
15251 * window.c (replace_window): Rename second argument REPLACEMENT to
15252 NEW. New third argument SETFLAG. Rewrite.
15253 (delete_window, make_dummy_parent): Call replace_window with
15254 third argument 1.
15255 (window_list_1): Move down in code.
15256 (run_window_configuration_change_hook): Move set_buffer part
15257 before select_frame_norecord part in order to unwind correctly.
15258 Rename count1 to count.
15259 (recombine_windows, delete_deletable_window, resize_root_window)
15260 (Fdelete_other_windows_internal)
15261 (Frun_window_configuration_change_hook, make_parent_window)
15262 (resize_window_check, resize_window_apply, Fresize_window_apply)
15263 (resize_frame_windows, Fsplit_window_internal)
15264 (Fdelete_window_internal, Fresize_mini_window_internal):
15265 New functions.
15266 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15267
15268 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15269
15270 * window.h (window): Add some new members to window structure -
15271 normal_lines, normal_cols, new_total, new_normal, clone_number,
15272 splits, nest, prev_buffers, next_buffers.
15273 (WINDOW_TOTAL_SIZE): Move here from window.c.
15274 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15275
15276 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15277 Remove.
15278 (make_dummy_parent): Set new members of windows structure.
15279 (make_window): Move down in code. Handle new members of window
15280 structure.
15281 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15282 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15283 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15284 (Fset_window_prev_buffers, Fwindow_next_buffers)
15285 (Fset_window_next_buffers, Fset_window_clone_number):
15286 New functions.
15287 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15288 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15289 Doc-string fixes.
15290 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15291 Argument WINDOW can be now internal window too.
15292 (Fwindow_use_time): Move up in code.
15293 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15294 Rewrite doc-string.
15295 (Fset_window_configuration, saved_window)
15296 (Fcurrent_window_configuration, save_window_save): Handle new
15297 members of window structure.
15298 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15299 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15300 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15301 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15302 Qget_mru_window, Qresize_root_window,
15303 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15304 Qauto_buffer_name; staticpro them.
15305
15306 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15307
15308 * window.c (Fwindow_total_size, Fwindow_left_column)
15309 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15310 (Fwindow_list_1): New functions.
15311 (window_box_text_cols): Replace with window_body_cols.
15312 (Fwindow_width, Fscroll_left, Fscroll_right):
15313 Use window_body_cols instead of window_box_text_cols.
15314 (delete_window, Fset_window_configuration):
15315 Call delete_all_subwindows with window as argument.
15316 (delete_all_subwindows): Take a window as argument and not a
15317 structure. Rewrite.
15318 (window_loop): Remove handling of GET_LRU_WINDOW and
15319 GET_LARGEST_WINDOW.
15320 (Fget_lru_window, Fget_largest_window): Move to window.el.
15321
15322 * window.h: Extern window_body_cols instead of
15323 window_box_text_cols. delete_all_subwindows now takes a
15324 Lisp_Object as argument.
15325
15326 * indent.c (compute_motion, Fcompute_motion):
15327 Use window_body_cols instead of window_box_text_cols.
15328
15329 * frame.c (delete_frame): Call delete_all_subwindows with root
15330 window as argument.
15331
15332 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15333
15334 * fns.c (Fputhash): Document return value.
15335
15336 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15337
15338 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15339
15340 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15341
15342 Cons<->int and similar integer overflow fixes (Bug#8794).
15343
15344 Check for overflow when converting integer to cons and back.
15345 * charset.c (Fdefine_charset_internal, Fdecode_char):
15346 Use cons_to_unsigned to catch overflow.
15347 (Fencode_char): Use INTEGER_TO_CONS.
15348 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15349 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15350 * data.c (long_to_cons, cons_to_long): Remove.
15351 (cons_to_unsigned, cons_to_signed): New functions.
15352 These signal an error for invalid or out-of-range values.
15353 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15354 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15355 * font.c (Ffont_variation_glyphs):
15356 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15357 * lisp.h: Include <intprops.h>.
15358 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15359 (cons_to_signed, cons_to_unsigned): New decls.
15360 (long_to_cons, cons_to_long): Remove decls.
15361 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15362 (Fprimitive_undo): Use CONS_TO_INTEGER.
15363 * xfns.c (Fx_window_property): Likewise.
15364 * xselect.c: Include <limits.h>.
15365 (x_own_selection, selection_data_to_lisp_data):
15366 Use INTEGER_TO_CONS.
15367 (x_handle_selection_request, x_handle_selection_clear)
15368 (x_get_foreign_selection, Fx_disown_selection_internal)
15369 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15370 (lisp_data_to_selection_data): Use cons_to_unsigned.
15371 (x_fill_property_data): Use cons_to_signed.
15372 Report values out of range.
15373
15374 Check for buffer and string overflow more precisely.
15375 * buffer.h (BUF_BYTES_MAX): New macro.
15376 * lisp.h (STRING_BYTES_MAX): New macro.
15377 * alloc.c (Fmake_string):
15378 * character.c (string_escape_byte8):
15379 * coding.c (coding_alloc_by_realloc):
15380 * doprnt.c (doprnt):
15381 * editfns.c (Fformat):
15382 * eval.c (verror):
15383 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15384 since they may not be the same number.
15385 * editfns.c (Finsert_char):
15386 * fileio.c (Finsert_file_contents):
15387 Likewise for BUF_BYTES_MAX.
15388
15389 * image.c: Use ptrdiff_t, not int, for sizes.
15390 (slurp_file): Switch from int to ptrdiff_t.
15391 All uses changed.
15392 (slurp_file): Check that file size fits in both size_t (for
15393 malloc) and ptrdiff_t (for sanity and safety).
15394
15395 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15396 if b->modtime has its maximal value.
15397
15398 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15399
15400 Don't assume time_t can fit into int.
15401 * buffer.h (struct buffer.modtime): Now time_t, not int.
15402 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15403 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15404
15405 Minor fixes for signed vs unsigned integers.
15406 * character.h (MAYBE_UNIFY_CHAR):
15407 * charset.c (maybe_unify_char):
15408 * keyboard.c (read_char, reorder_modifiers):
15409 XINT -> XFASTINT, since the integer must be nonnegative.
15410 * ftfont.c (ftfont_spec_pattern):
15411 * keymap.c (access_keymap, silly_event_symbol_error):
15412 XUINT -> XFASTINT, since the integer must be nonnegative.
15413 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15414 since it makes no difference and we prefer signed.
15415 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15416 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15417 nonnegative.
15418
15419 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15420
15421 * window.h (Fwindow_frame): Declare.
15422
15423 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15424
15425 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15426 (SPARE_MEMORY): Always define.
15427 (LARGE_REQUEST): Remove.
15428 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15429
15430 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15431
15432 * lisp.h: Move EXFUNS for Fframe_root_window,
15433 Fframe_first_window and Fset_frame_selected_window to window.h.
15434
15435 * window.h: Move EXFUNS for Fframe_root_window,
15436 Fframe_first_window and Fset_frame_selected_window here from
15437 lisp.h.
15438
15439 * frame.c (Fwindow_frame, Fframe_first_window)
15440 (Fframe_root_window, Fframe_selected_window)
15441 (Fset_frame_selected_window): Move to window.c.
15442 (Factive_minibuffer_window): Move to minibuf.c.
15443 (Fother_visible_frames_p): New function.
15444
15445 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15446
15447 * window.c (decode_window, decode_any_window): Move up in code.
15448 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15449 (inhibit_frame_unsplittable): Remove unused variable.
15450 (Fwindow_buffer): Move up and rewrite doc-string.
15451 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15452 (Fwindow_prev): New functions.
15453 (Fwindow_frame): Move here from frame.c. Accept any window as
15454 argument.
15455 (Fframe_root_window, Fframe_first_window)
15456 (Fframe_selected_window): Move here from frame.c. Accept frame
15457 or arbitrary window as argument. Update doc-strings.
15458 (Fminibuffer_window): Move up in code.
15459 (Fwindow_minibuffer_p): Move up in code and simplify.
15460 (Fset_frame_selected_window): Move here from frame.c.
15461 Marginal rewrite.
15462 (Fselected_window, select_window, Fselect_window): Move up in
15463 code. Minor doc-string fixes.
15464
15465 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15466
15467 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15468 Do not assume that spare memory exists; that assumption is valid
15469 only if SYSTEM_MALLOC.
15470 (LARGE_REQUEST): New macro, so that the issue of large requests
15471 is separated from the issue of spare memory.
15472
15473 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15474
15475 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15476 format. (Bug#8806)
15477
15478 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15479
15480 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15481 before statements.
15482
15483 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15484
15485 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15486
15487 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15488
15489 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15490 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15491
15492 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15493
15494 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15495
15496 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15497
15498 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15499 (x_clipboard_manager_save): Add return value.
15500 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15501 New error handlers.
15502 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15503 Obey Vx_select_enable_clipboard_manager. Catch errors in
15504 x_clipboard_manager_save (Bug#8779).
15505 (Vx_select_enable_clipboard_manager): New variable.
15506 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15507
15508 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15509
15510 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15511
15512 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15513
15514 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15515 in the current matrix if keep_current_p is non-zero.
15516
15517 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15518
15519 * bidi.c (bidi_level_of_next_char): Fix last change.
15520
15521 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15522
15523 Support bidi reordering of text covered by display properties.
15524
15525 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15526 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15527 (bidi_cache_search, bidi_cache_iterator_state)
15528 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15529 (bidi_level_of_next_char, bidi_move_to_visually_next):
15530 Support character positions inside a run of characters covered by a
15531 display string.
15532 (bidi_paragraph_init, bidi_resolve_explicit_1)
15533 (bidi_level_of_next_char): Call bidi_fetch_char and
15534 bidi_fetch_char_advance instead of FETCH_CHAR and
15535 FETCH_CHAR_ADVANCE.
15536 (bidi_init_it): Initialize new members.
15537 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15538 definitions.
15539 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15540 instead of using explicit *_CHAR codes.
15541 (bidi_resolve_explicit, bidi_resolve_weak):
15542 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15543 bidirectional text is supported only in multibyte buffers.
15544 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15545 it to initialize the frame_window_p member of struct bidi_it.
15546 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15547 (bidi_resolve_explicit, bidi_resolve_weak)
15548 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15549 bidi_it->nchars is non-positive.
15550 (bidi_level_of_next_char): Don't try to lookup the cache for the
15551 next/previous character if nothing is cached there yet, or if we
15552 were just reseat()'ed to a new position.
15553
15554 * xdisp.c (set_cursor_from_row): Set start and stop points
15555 according to the row's direction when priming the loop that looks
15556 for the glyph on which to display cursor.
15557 (single_display_spec_intangible_p): Function deleted.
15558 (display_prop_intangible_p): Reimplement to call
15559 handle_display_spec instead of single_display_spec_intangible_p.
15560 Accept 3 additional arguments needed by handle_display_spec.
15561 This fixes incorrect cursor motion across display property with complex
15562 values: lists, `(when COND...)' forms, etc.
15563 (single_display_spec_string_p): Support property values that are
15564 lists with the argument STRING its top-level element.
15565 (display_prop_string_p): Fix the condition for processing a
15566 property that is a list to be consistent with handle_display_spec.
15567 (handle_display_spec): New function, refactored from the
15568 last portion of handle_display_prop.
15569 (compute_display_string_pos): Accept additional argument
15570 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15571 value of a `display' property is a "replacing spec".
15572 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15573 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15574 the display property, but just return a value indicating whether
15575 the display property will replace the characters it covers.
15576 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15577 frame_window_p members of struct bidi_it.
15578 (compute_display_string_pos, compute_display_string_end):
15579 New functions.
15580 (push_it): Accept second argument POSITION, where pop_it should
15581 jump to continue iteration.
15582 (reseat_1): Initialize bidi_it.disp_pos.
15583
15584 * keyboard.c (adjust_point_for_property): Adjust the call to
15585 display_prop_intangible_p to its new signature.
15586
15587 * dispextern.h (struct bidi_it): New member frame_window_p.
15588 (bidi_init_it): Update prototypes.
15589 (display_prop_intangible_p): Update prototype.
15590 (compute_display_string_pos, compute_display_string_end):
15591 Declare prototypes.
15592 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15593 EMACS_INT.
15594
15595 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15596
15597 Malloc failure behavior now depends on size of allocation.
15598 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15599 * lisp.h: Change signatures accordingly.
15600 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15601 All callers changed. (Bug#8762)
15602
15603 * gnutls.c: Use Emacs's memory allocators.
15604 Without this change, the gnutls library would invoke malloc etc.
15605 directly, which causes problems on non-SYNC_INPUT hosts, and which
15606 runs afoul of improving memory_full behavior. (Bug#8761)
15607 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15608 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15609 xfree instead of the default malloc, realloc, free.
15610 (Fgnutls_boot): No need to check for memory allocation failure,
15611 since xmalloc does that for us.
15612
15613 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15614 * category.c (hash_get_category_set):
15615 * ccl.c (ccl_driver):
15616 * charset.c (Fdefine_charset_internal):
15617 * charset.h (struct charset.hash_index):
15618 * composite.c (get_composition_id, gstring_lookup_cache)
15619 (composition_gstring_put_cache):
15620 * composite.h (struct composition.hash_index):
15621 * dispextern.h (struct image.hash):
15622 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15623 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15624 (hashfn_equal, hashfn_user_defined, make_hash_table)
15625 (maybe_resize_hash_table, hash_lookup, hash_put)
15626 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15627 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15628 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15629 * image.c (make_image, search_image_cache, lookup_image)
15630 (xpm_put_color_table_h):
15631 * lisp.h (struct Lisp_Hash_Table):
15632 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15633 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15634 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15635 * alloc.c (allocate_vectorlike):
15636 Check for overflow in vector size calculations.
15637 * ccl.c (ccl_driver):
15638 Check for overflow when converting EMACS_INT to int.
15639 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15640 need to be updated by these changes.
15641 * fns.c (make_hash_table, maybe_resize_hash_table):
15642 Check for integer overflow with large hash tables.
15643 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15644 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15645 (SXHASH_REDUCE): New macro.
15646 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15647 Use it instead of discarding useful hash info with large hash values.
15648 (sxhash_float): New function.
15649 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15650 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15651 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15652 Rewrite to use FIXNUM_BITS, as this simplifies things.
15653 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15654 Adjust signatures to match updated version of code.
15655 (consing_since_gc): Now EMACS_INT, since a single hash table can
15656 use more than INT_MAX bytes.
15657
15658 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15659
15660 Make it possible to build with GCC-4.6+ -O2 -flto.
15661
15662 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15663
15664 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15665
15666 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15667 Call minibuffer-inactive-mode.
15668
15669 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15670
15671 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15672 Update dependencies.
15673
15674 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15675
15676 * data.c (init_data): Remove code for UTS, this system is not
15677 supported anymore.
15678
15679 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15680
15681 Don't force ./temacs to start in terminal mode.
15682
15683 * frame.c (make_initial_frame): Initialize faces in all cases, not
15684 only when CANNOT_DUMP is defined.
15685 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15686
15687 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15688
15689 * dispnew.c (add_window_display_history): Use const for the string
15690 pointer. Remove declaration, not needed.
15691
15692 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15693
15694 Use 'inline', not 'INLINE'.
15695 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15696 * alloc.c, fontset.c (INLINE): Remove.
15697 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15698 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15699 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15700 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15701 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15702
15703 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15704
15705 Make it possible to run ./temacs.
15706
15707 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15708 syms_of_callproc does the same thing. Remove test for
15709 "initialized", do it in the caller.
15710 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15711
15712 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15713
15714 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15715 (read_minibuf): Use get_minibuffer.
15716 (syms_of_minibuf): Use DEFSYM.
15717 (Qmetadata): New var.
15718 * data.c (Qbuffer): Don't make it static.
15719 (syms_of_data): Use DEFSYM.
15720
15721 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15722
15723 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15724 (CCL_CODE_MIN): New macro.
15725
15726 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15727
15728 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15729
15730 * eval.c (Qdebug): Now static.
15731 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15732 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15733 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15734
15735 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15736
15737 * image.c: Various fixes to ImageMagick code comments.
15738 (Fimagemagick_types): Doc fix.
15739
15740 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15741
15742 Minor fixes prompted by GCC 4.6.0 warnings.
15743
15744 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15745
15746 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15747 (x_clipboard_manager_save_all): Move extern decl to ...
15748 * xterm.h: ... here, so that it can be checked for consistency.
15749
15750 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15751
15752 * xselect.c (x_clipboard_manager_save_frame)
15753 (x_clipboard_manager_save_all): New functions.
15754 (Fx_clipboard_manager_save): Lisp function deleted.
15755
15756 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15757 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15758
15759 * xterm.h: Update prototype.
15760
15761 2011-05-28 William Xu <william.xwl@gmail.com>
15762
15763 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15764 exiting (Bug#8239).
15765
15766 2011-05-28 Jim Meyering <meyering@redhat.com>
15767
15768 Avoid a sign-extension bug in crypto_hash_function.
15769 * fns.c (to_uchar): Define.
15770 (crypto_hash_function): Use it to convert some newly-signed
15771 variables to unsigned, to avoid sign-extension bugs. For example,
15772 without this change, (md5 "truc") would evaluate to
15773 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15774 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15775 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15776
15777 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15778
15779 Integer overflow fixes.
15780
15781 * dbusbind.c: Serial number integer overflow fixes.
15782 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15783 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15784 to hold a serial number that is too large for a fixnum.
15785 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15786 Check for serial numbers out of range. Decode any serial number
15787 that was so large that it became a float. (Bug#8722)
15788
15789 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15790 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15791 Use XFASTINT rather than XUINT when numbers are nonnegative.
15792 (xd_append_arg, Fdbus_method_return_internal):
15793 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15794 arguments, check that Lisp number is nonnegative, rather than
15795 silently wrapping negative numbers around. (Bug#8722)
15796 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15797 (Bug#8722)
15798
15799 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15800
15801 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15802
15803 ccl: Add integer overflow checks.
15804 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15805 (IN_INT_RANGE): New macros.
15806 (ccl_driver): Use them to check for integer overflow when
15807 decoding a CCL program. Many of the new checks are whether XINT (x)
15808 fits in int; it doesn't always, on 64-bit hosts. The new version
15809 doesn't catch all possible integer overflows, but it's an
15810 improvement. (Bug#8719)
15811
15812 * alloc.c (make_event_array): Use XINT, not XUINT.
15813 There's no need for unsigned here.
15814
15815 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15816 This follows up to the 2011-05-06 change that substituted uintptr_t
15817 for EMACS_INT. This case wasn't caught back then.
15818
15819 Rework Fformat to avoid integer overflow issues.
15820 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15821 now (part of C89). Include <verify.h>.
15822 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15823 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15824 (Fformat): Avoid the prepass trying to compute sizes; it was only
15825 approximate and thus did not catch overflow reliably. Instead, walk
15826 through the format just once, formatting and computing sizes as we go,
15827 checking for integer overflow at every step, and allocating a larger
15828 buffer as needed. Keep track separately whether the format is
15829 multibyte. Keep only the most-recently calculated precision, rather
15830 than them all. Record whether each argument has been converted to
15831 string. Use EMACS_INT, not int, for byte and char and arg counts.
15832 Support field widths and precisions larger than INT_MAX. Avoid
15833 sprintf's undefined behavior with conversion specifications such as %#d
15834 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15835 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15836 formatting out-of-range floating point numbers with int
15837 formats. (Bug#8668)
15838
15839 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15840
15841 * data.c: Avoid integer truncation in expressions involving floats.
15842 * data.c: Include <intprops.h>.
15843 (arith_driver): When there's an integer overflow in an expression
15844 involving floating point, convert the integers to floating point
15845 so that the resulting value does not suffer from catastrophic
15846 integer truncation. For example, on a 64-bit host (* 4
15847 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15848 Do not rely on undefined behavior after integer overflow.
15849
15850 merge count_size_as_multibyte, parse_str_to_multibyte
15851 * character.c, character.h (count_size_as_multibyte):
15852 Rename from parse_str_to_multibyte; all uses changed.
15853 Check for integer overflow.
15854 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15855 since it's now a duplicate of the other. This is more of
15856 a character than a buffer op, so better that it's in character.c.
15857 * fns.c, print.c: Adjust to above changes.
15858
15859 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15860
15861 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15862
15863 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15864
15865 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15866 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15867 (x_clipboard_manager_save): Now static.
15868 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15869
15870 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15871 (crypto_hash_function): Now static.
15872 Fix pointer signedness problems. Avoid unnecessary initializations.
15873
15874 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15875
15876 * termhooks.h (Vselection_alist): Make it terminal-local.
15877
15878 * terminal.c (create_terminal): Initialize it.
15879
15880 * xselect.c: Support for clipboard managers.
15881 (Vselection_alist): Move to termhooks.h as terminal-local var.
15882 (LOCAL_SELECTION): New macro.
15883 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15884 (symbol_to_x_atom): Remove gratuitous arg.
15885 (x_handle_selection_request, lisp_data_to_selection_data)
15886 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15887 (x_own_selection, x_get_local_selection, x_convert_selection):
15888 New arg, specifying work frame. Use terminal-local Vselection_alist.
15889 (some_frame_on_display): Delete unused function.
15890 (Fx_own_selection_internal, Fx_get_selection_internal)
15891 (Fx_disown_selection_internal, Fx_selection_owner_p)
15892 (Fx_selection_exists_p): New optional frame arg.
15893 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15894 (x_handle_selection_clear): Don't treat other terminals with the
15895 same keyboard specially. Use the terminal-local Vselection_alist.
15896 (x_clear_frame_selections): Use Frun_hook_with_args.
15897
15898 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15899
15900 * xterm.h: Add support for those atoms.
15901
15902 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15903
15904 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15905 (converted_selections, conversion_fail_tag): New global variables.
15906 (x_selection_request_lisp_error): Free the above.
15907 (x_get_local_selection): Remove unnecessary code.
15908 (x_reply_selection_request): Args changed; handle arbitrary array
15909 of converted selections stored in converted_selections.
15910 Separate the XChangeProperty and SelectionNotify steps.
15911 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15912 (x_convert_selection): New function.
15913 (x_handle_selection_event): Simplify.
15914 (x_get_foreign_selection): Don't ignore incoming requests while
15915 waiting for an answer; this will fail when we implement
15916 SAVE_TARGETS, and seems unnecessary anyway.
15917 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15918 (Vx_sent_selection_functions): Doc fix.
15919
15920 2011-05-26 Leo Liu <sdl.web@gmail.com>
15921
15922 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15923
15924 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15925
15926 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15927
15928 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15929 for fringe update if it has periodic bitmap.
15930 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15931 and fringe_bitmap_periodic_p.
15932
15933 * fringe.c (get_fringe_bitmap_data): New function.
15934 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15935 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15936 row. Mark glyph row for fringe update if periodicity changed.
15937
15938 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15939 for fringe update unless it has periodic bitmap.
15940
15941 2011-05-25 Kenichi Handa <handa@m17n.org>
15942
15943 * xdisp.c (get_next_display_element): Set correct it->face_id for
15944 a static composition.
15945
15946 2011-05-24 Leo Liu <sdl.web@gmail.com>
15947
15948 * deps.mk (fns.o):
15949 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15950
15951 * fns.c (crypto_hash_function, Fsha1): New function.
15952 (Fmd5): Use crypto_hash_function.
15953 (syms_of_fns): Add Ssha1.
15954
15955 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15956
15957 * gnutls.c: Remove unused macros.
15958 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15959 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15960 Remove macros that are defined and never used.
15961 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15962
15963 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15964
15965 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15966 (Fx_get_selection_internal): Minor cleanup.
15967 (Fx_own_selection_internal): Rename arguments for consistency with
15968 select.el.
15969
15970 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15971
15972 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15973
15974 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15975
15976 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15977
15978 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15979
15980 * dispnew.c (scrolling_window): Don't exclude the case that the
15981 last enabled row in the desired matrix touches the bottom boundary.
15982
15983 2011-05-21 Glenn Morris <rgm@gnu.org>
15984
15985 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15986 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15987 and add some more files.
15988
15989 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15990
15991 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15992 report_file_error introduced by the change from 2011-05-07.
15993
15994 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15995
15996 * systime.h (Time): Define only if emacs is defined.
15997 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15998 where the include path doesn't have X11/X.h by default. See
15999 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16000
16001 2011-05-20 Kenichi Handa <handa@m17n.org>
16002
16003 * composite.c (find_automatic_composition): Fix previous change.
16004
16005 2011-05-20 Glenn Morris <rgm@gnu.org>
16006
16007 * lisp.mk: New file, split from Makefile.in.
16008 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16009 (shortlisp): Remove.
16010 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16011
16012 2011-05-19 Glenn Morris <rgm@gnu.org>
16013
16014 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16015 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16016 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16017 (lisp): Set the order to that of loadup.el.
16018 (shortlisp): Make it a copy of $lisp.
16019 (SOME_MACHINE_LISP): Remove.
16020 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16021 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16022
16023 2011-05-18 Kenichi Handa <handa@m17n.org>
16024
16025 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16026 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16027 (find_automatic_composition): Mostly rewrite for efficiency.
16028
16029 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16030
16031 * makefile.w32-in: Update dependencies.
16032
16033 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16034
16035 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16036 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16037
16038 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16039
16040 Fix some integer overflow issues, such as string length overflow.
16041
16042 * insdel.c (count_size_as_multibyte): Check for string overflow.
16043
16044 * character.c (lisp_string_width): Check for string overflow.
16045 Use EMACS_INT, not int, for string indexes and lengths; in
16046 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16047 the resulting string length overflows an EMACS_INT; instead,
16048 report a string overflow if no precision given. When checking for
16049 precision exhaustion, use a check that cannot possibly have
16050 integer overflow. (Bug#8675)
16051 * character.h (lisp_string_width): Adjust to new signature.
16052
16053 * alloc.c (string_overflow): New function.
16054 (Fmake_string): Use it. This doesn't change behavior, but saves
16055 a few bytes and will simplify future changes.
16056 * character.c (string_escape_byte8): Likewise.
16057 * lisp.h (string_overflow): New decl.
16058
16059 Fixups, following up to the user-interface timestamp change.
16060 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16061 for UI timestamps, instead of unsigned long.
16062 * msdos.c (mouse_get_pos): Likewise.
16063 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16064 * w32gui.h (Time): Define by including "systime.h" rather than by
16065 declaring it ourselves. (Bug#8664)
16066
16067 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16068 * image.c (clear_image_cache): Likewise.
16069
16070 * term.c (term_mouse_position): Don't assume time_t wraparound.
16071
16072 Be more systematic about user-interface timestamps.
16073 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16074 and sometimes 'EMACS_UINT', to represent these timestamps.
16075 This change causes it to use 'Time' uniformly, as that's what X uses.
16076 This makes the code easier to follow, and makes it easier to catch
16077 integer overflow bugs such as Bug#8664.
16078 * frame.c (Fmouse_position, Fmouse_pixel_position):
16079 Use Time, not unsigned long, for user-interface timestamps.
16080 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16081 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16082 * keyboard.h (last_event_timestamp): Likewise.
16083 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16084 * menu.h (xmenu_show): Likewise.
16085 * term.c (term_mouse_position): Likewise.
16086 * termhooks.h (struct input_event.timestamp): Likewise.
16087 (struct terminal.mouse_position_hook): Likewise.
16088 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16089 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16090 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16091 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16092 what it was before.
16093 * menu.h, termhooks.h: Include "systime.h", for Time.
16094
16095 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16096 Don't assume that the difference between two unsigned long values
16097 can fit into an integer. At this point, we know button_down_time
16098 <= event->timestamp, so the difference must be nonnegative, so
16099 there's no need to cast the result if double-click-time is
16100 nonnegative, as it should be; check that it's nonnegative, just in
16101 case. This bug is triggered when events are more than 2**31 ms
16102 apart (about 25 days). (Bug#8664)
16103
16104 * xselect.c (last_event_timestamp): Remove duplicate decl.
16105 (x_own_selection): Remove needless cast to unsigned long.
16106
16107 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16108 that always fit in int. Use a sentinel instead of a counter, to
16109 avoid a temp and to allay GCC's concerns about possible int overflow.
16110 * frame.h (struct frame): Use int for menu_bar_items_used
16111 instead of EMACS_INT, since it always fits in int.
16112
16113 * menu.c (grow_menu_items): Check for int overflow.
16114
16115 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16116
16117 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16118 Before, the code was not consistent. These values cannot exceed
16119 2**31 - 1 so there's no need to make them unsigned.
16120 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16121 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16122 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16123 as modifiers.
16124 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16125
16126 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16127 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16128 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16129 presumably because the widths might not match.
16130
16131 * window.c (size_window): Avoid needless test at loop start.
16132
16133 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16134
16135 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16136
16137 2011-05-12 Drew Adams <drew.adams@oracle.com>
16138
16139 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16140
16141 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16142
16143 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16144 `width' to `bar_area_x' and `bar_area_width', respectively.
16145 (x_scroll_run): Take account of fringe background extension.
16146
16147 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16148 Rename local vars `left' and `width' to `bar_area_x' and
16149 `bar_area_width', respectively.
16150 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16151 background extension.
16152
16153 2011-05-10 Jim Meyering <meyering@redhat.com>
16154
16155 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16156
16157 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16158
16159 * image.c (Finit_image_library): Return t for built-in image types,
16160 like pbm and xbm. (Bug#8640)
16161
16162 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16163
16164 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16165
16166 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16167
16168 * w32console.c (Fset_screen_color): Doc fix.
16169 (Fget_screen_color): New function.
16170 (syms_of_ntterm): Defsubr it.
16171
16172 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16173 unlink the temporary file if Fcall_process didn't create it in the
16174 first place.
16175 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16176 child process will be redirected to a file specified with `:file'.
16177 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16178 cue to call_process_cleanup not to close that handle.
16179
16180 2011-05-07 Ben Key <bkey76@gmail.com>
16181
16182 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16183 one of two shell specific rules, either bootstrap-temacs-CMD or
16184 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16185 to the previous implementation of the bootstrap-temacs rule.
16186 The bootstrap-temacs-CMD rule is similar to the previous
16187 implementation of the bootstrap-temacs rule except that it
16188 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16189 variable.
16190
16191 These changes, along with some changes to nt/configure.bat,
16192 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16193 earlier fix to add support for --cflags and --ldflags options
16194 that include quotes so that it works whether make uses cmd or
16195 sh as the shell.
16196
16197 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16198
16199 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16200 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16201 is a constant.
16202 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16203 a string. Handle both cases.
16204 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16205 (Fdbus_register_method): Use Qinvalid_function.
16206
16207 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16208
16209 * makefile.w32-in: Update dependencies.
16210 (LISP_H): Add inttypes.h and stdin.h.
16211 (PROCESS_H): Add unistd.h.
16212
16213 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16214
16215 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16216 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16217
16218 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16219
16220 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16221
16222 * term.c (vfatal): Remove stray call to va_end.
16223 It's not needed and the C Standard doesn't allow it here anyway.
16224
16225 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16226 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16227
16228 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16229 bytes.
16230
16231 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16232
16233 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16234
16235 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16236
16237 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16238
16239 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16240
16241 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16242 * charset.c (Fdefine_charset_internal): Don't initialize
16243 charset.code_space[15]. The value was garbage, on hosts with
16244 32-bit int (Bug#8600).
16245
16246 * lread.c (read_integer): Be more consistent with string-to-number.
16247 Use string_to_number to do the actual conversion; this avoids
16248 rounding errors and fixes some other screwups. Without this fix,
16249 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16250 (digit_to_number): Move earlier, for benefit of read_integer.
16251 Return -1 if the digit is out of range for the base, -2 if it is
16252 not a digit in any supported base. (Bug#8602)
16253
16254 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16255
16256 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16257 to match comment at start of function. This also removes a
16258 GCC warning about overflow in a 32+64-bit port.
16259
16260 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16261
16262 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16263 Reported by Stefan Monnier in
16264 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16265 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16266 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16267
16268 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16269 (EMACS_UINTPTR): Likewise, with uintptr_t.
16270
16271 * lisp.h: Prefer 64-bit EMACS_INT if available.
16272 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16273 on 32-bit hosts that have 64-bit int, so that they can access
16274 large files.
16275 However, temporarily disable this change unless the temporary
16276 symbol WIDE_EMACS_INT is defined.
16277
16278 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16279
16280 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16281 This removes an assumption that EMACS_INT and long are the same
16282 width as pointers. The assumption is true for Emacs porting targets
16283 now, but we want to make other targets possible.
16284 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16285 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16286 In the rest of the code, change types of integers that hold casted
16287 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16288 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16289 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16290 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16291 No need to cast type when ORing.
16292 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16293 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16294 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16295 assume EMACS_INT is the same width as char *.
16296 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16297 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16298 Remove no-longer-needed casts.
16299 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16300 (xg_tool_bar_help_callback, xg_make_tool_item):
16301 Use EMACS_INTPTR to hold an integer
16302 that will be cast to void *; this can avoid a GCC warning
16303 if EMACS_INT is not the same width as void *.
16304 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16305 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16306 (current_message_1, set_message_1):
16307 Use a local to convert to proper width without a cast.
16308 * xmenu.c (dialog_selection_callback): Likewise.
16309
16310 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16311 Also, don't assume VALBITS / RAND_BITS is less than 5,
16312 and don't rely on undefined behavior when shifting a 1 left into
16313 the sign bit.
16314 * lisp.h (get_random): Change signature to match.
16315
16316 * lread.c (hash_string): Use size_t, not int, for hash computation.
16317 Normally we prefer signed values; but hashing is special, because
16318 it's better to use unsigned division on hash table sizes so that
16319 the remainder is nonnegative. Also, size_t is the natural width
16320 for hashing into memory. The previous code used 'int', which doesn't
16321 retain enough info to hash well into very large tables.
16322 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16323
16324 * dbusbind.c: Don't possibly lose pointer info when converting.
16325 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16326 Use XPNTR rather than XHASH, so that the high-order bits of
16327 the pointer aren't lost when converting through void *.
16328
16329 * eval.c (Fautoload): Don't double-shift a pointer.
16330
16331 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16332
16333 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16334
16335 * gnutls.c (DEF_GNUTLS_FN):
16336 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16337
16338 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16339
16340 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16341 marker. (Bug#8610)
16342
16343 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16344
16345 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16346 New version that can reserve upto 2GB of heap space.
16347
16348 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16349
16350 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16351
16352 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16353
16354 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16355 `gnutls_certificate_set_x509_key_file'.
16356
16357 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16358
16359 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16360 Update dependencies.
16361
16362 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16363
16364 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16365 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16366 Remove unused parameter `fildes'.
16367 * process.c (read_process_output, send_process): Don't pass it.
16368
16369 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16370
16371 Fix previous change: the library cache is defined in w32.c.
16372 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16373 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16374
16375 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16376
16377 Implement dynamic loading of GnuTLS on Windows.
16378
16379 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16380 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16381 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16382 Declare.
16383
16384 * gnutls.c (Qgnutls_dll): Define.
16385 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16386 (gnutls_*): Declare function pointers.
16387 (init_gnutls_functions): New function to initialize function pointers.
16388 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16389 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16390 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16391 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16392 (emacs_gnutls_write, emacs_gnutls_read)
16393 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16394 (Fgnutls_available_p): New function.
16395 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16396 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16397 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16398
16399 * image.c: Include w32.h.
16400 (Vimage_type_cache): Delete.
16401 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16402 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16403 (w32_delayed_load): Move to w32.c.
16404
16405 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16406
16407 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16408 (w32_delayed_load): Move from image.c. When loading a library, record
16409 its filename in the :loaded-from property of the library id.
16410 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16411 Initialize and staticpro them.
16412 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16413
16414 * process.c: Include lisp.h before w32.h, not after.
16415 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16416 instead of gnutls_record_check_pending.
16417
16418 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16419
16420 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16421
16422 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16423 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16424 as passed in.
16425
16426 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16427
16428 * xterm.c (x_set_frame_alpha): Do not set property on anything
16429 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16430
16431 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16432
16433 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16434
16435 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16436
16437 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16438 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16439 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16440 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16441 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16442 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16443 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16444 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16445 (Qgnutls_bootprop_callbacks_verify): Make static.
16446
16447 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16448
16449 * callproc.c: Indentation fixup.
16450
16451 * sysdep.c (wait_for_termination_1): Make static.
16452 (wait_for_termination, interruptible_wait_for_termination):
16453 Move after wait_for_termination_1.
16454
16455 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16456
16457 * sysdep.c (interruptible_wait_for_termination): New function
16458 which is like wait_for_termination, but allows keyboard
16459 interruptions.
16460
16461 * callproc.c (Fcall_process): Add (:file "file") as an option for
16462 the STDOUT buffer.
16463 (Fcall_process_region): Ditto.
16464
16465 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16466
16467 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16468 rather than `XVECTOR (FOO)->size'.
16469
16470 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16471 inttypes.h, as a gnulib replacement is used if it not available in
16472 system headers.
16473
16474 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16475
16476 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16477 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16478 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16479
16480 * coding.c (coding_alloc_by_realloc): Error out if destination
16481 will grow beyond MOST_POSITIVE_FIXNUM.
16482 (decode_coding_emacs_mule): Abort if there isn't enough place in
16483 charbuf for the composition carryover bytes. Reserve an extra
16484 space for up to 2 characters produced in a loop.
16485 (decode_coding_iso_2022): Abort if there isn't enough place in
16486 charbuf for the composition carryover bytes.
16487
16488 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16489
16490 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16491 aborting when %lld or %lll format is passed.
16492 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16493 %llo or %llx format is passed. (Bug#8545)
16494
16495 * window.c (window_scroll_line_based): Use a marker instead of
16496 simple variables to record original value of point. (Bug#7952)
16497
16498 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16499 produced by %s or %c overflows available buffer space. (Bug#8545)
16500
16501 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16502
16503 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16504 (SIZE_MAX): Move defn after all includes, as they might #define it.
16505
16506 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16507
16508 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16509
16510 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16511
16512 * keyboard.c (Qdelayed_warnings_hook): Define.
16513 (command_loop_1): Run `delayed-warnings-hook'
16514 if Vdelayed_warnings_list is non-nil.
16515 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16516 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16517
16518 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16519
16520 * doprnt.c (doprnt): Don't return value smaller than the buffer
16521 size if the message was truncated. (Bug#8545).
16522
16523 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16524
16525 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16526 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16527
16528 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16529
16530 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16531
16532 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16533
16534 * makefile.w32-in: Update dependencies.
16535
16536 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16537
16538 Improve `doprnt' and its usage. (Bug#8545)
16539 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16540 `format_end'. Remove support for %l as a conversion specifier.
16541 Don't use xrealloc. Improve diagnostics when the %l size modifier
16542 is used. Update the commentary.
16543
16544 * eval.c (verror): Simplify calculation of size_t.
16545
16546 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16547 messages.
16548
16549 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16550
16551 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16552 change.
16553
16554 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16555
16556 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16557 This makes this file independent of the recent pseudovector change.
16558
16559 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16560
16561 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16562
16563 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16564 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16565 Remove unused local.
16566 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16567
16568 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16569 GCC 4.6.0 optimizes based on type-based alias analysis.
16570 For example, if b is of type struct buffer * and v of type struct
16571 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16572 != &v->size, and therefore "v->size = 1; b->size = 2; return
16573 v->size;" must therefore return 1. This assumption is incorrect
16574 for Emacs, since it type-puns struct Lisp_Vector * with many other
16575 types. To fix this problem, this patch adds a new type struct
16576 vectorlike_header that documents the constraints on layout of vectors
16577 and pseudovectors, and helps optimizing compilers not get fooled
16578 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16579 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16580 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16581 the size member.
16582 (XSETPVECTYPE): Rewrite in terms of new macro.
16583 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16584 This is a bit clearer, and further avoids the possibility of
16585 undesirable aliasing.
16586 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16587 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16588 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16589 since Lisp_Subr is a special case (no "next" field).
16590 (ASIZE): Now uses header.size rather than size.
16591 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16592 to avoid the hassle of writing XVECTOR (foo)->header.size.
16593 (struct vectorlike_header): New type.
16594 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16595 object, to help avoid aliasing.
16596 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16597 (SUBRP): Likewise, since Lisp_Subr is a special case.
16598 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16599 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16600 (struct Lisp_Hash_Table): Combine first two members into a single
16601 struct vectorlike_header member. All uses of "size" and "next" members
16602 changed to be "header.size" and "header.next".
16603 * buffer.h (struct buffer): Likewise.
16604 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16605 * frame.h (struct frame): Likewise.
16606 * process.h (struct Lisp_Process): Likewise.
16607 * termhooks.h (struct terminal): Likewise.
16608 * window.c (struct save_window_data, struct saved_window): Likewise.
16609 * window.h (struct window): Likewise.
16610 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16611 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16612 * buffer.c (init_buffer_once): Likewise.
16613 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16614 special case.
16615 * process.c (Fformat_network_address): Use local var for size,
16616 for brevity.
16617
16618 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16619
16620 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16621 * data.c (atof): Remove decl; no longer used or needed.
16622 (digit_to_number): Move to lread.c.
16623 (Fstring_to_number): Use new string_to_number function, to be
16624 consistent with how the Lisp reader treats infinities and NaNs.
16625 Do not assume that floating-point numbers represent EMACS_INT
16626 without losing information; this is not true on most 64-bit hosts.
16627 Avoid double-rounding errors, by insisting on integers when
16628 parsing non-base-10 numbers, as the documentation specifies.
16629 * lisp.h (string_to_number): New decl, replacing ...
16630 (isfloat_string): Remove.
16631 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16632 (read1): Do not accept +. and -. as integers; this
16633 appears to have been a coding error. Similarly, do not accept
16634 strings like +-1e0 as floating point numbers. Do not report
16635 overflow for integer overflows unless the base is not 10 which
16636 means we have no simple and reliable way to continue.
16637 Break out the floating-point parsing into a new
16638 function string_to_number, so that Fstring_to_number parses
16639 floating point numbers consistently with the Lisp reader.
16640 (digit_to_number): Move here from data.c. Make it static inline.
16641 (E_CHAR, EXP_INT): Remove, replacing with ...
16642 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16643 (string_to_number): New function, replacing isfloat_string.
16644 This function checks for valid syntax and produces the resulting
16645 Lisp float number too. Rework it so that string-to-number
16646 no longer mishandles examples like "1.0e+". Use strtoumax,
16647 so that overflow for non-base-10 numbers is reported only when
16648 there's no portable and simple way to convert to floating point.
16649
16650 * textprop.c (set_text_properties_1): Rewrite for clarity,
16651 and to avoid GCC warning about integer overflow.
16652
16653 * intervals.h (struct interval): Use EMACS_INT for members
16654 where EMACS_UINT might cause problems. See
16655 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16656 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16657 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16658 All uses changed.
16659 (offset_intervals): Tell GCC not to worry about length overflow
16660 when negating a negative length.
16661
16662 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16663 (overrun_check_free): Likewise.
16664
16665 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16666 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16667 word size.
16668
16669 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16670 (gnutls_make_error): Rename local to avoid shadowing.
16671 (gnutls_emacs_global_deinit): ifdef out; not used.
16672 (Fgnutls_boot): Use const for pointer to readonly storage.
16673 Comment out unused local. Fix pointer signedness problems.
16674
16675 * lread.c (openp): Don't stuff size_t into an 'int'.
16676 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16677 about possible signed overflow.
16678
16679 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16680 (GDK_KEY_g): Don't define if already defined.
16681 (xg_prepare_tooltip): Avoid pointer signedness problem.
16682 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16683
16684 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16685 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16686
16687 * xfns.c (Fx_window_property): Simplify a bit,
16688 to make a bit faster and to avoid GCC 4.6.0 warning.
16689 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16690
16691 * fns.c (internal_equal): Don't assume size_t fits in int.
16692
16693 * alloc.c (compact_small_strings): Tighten assertion a little.
16694
16695 Replace pEd with more-general pI, and fix some printf arg casts.
16696 * lisp.h (pI): New macro, generalizing old pEd macro to other
16697 conversion specifiers. For example, use "...%"pI"d..." rather
16698 than "...%"pEd"...".
16699 (pEd): Remove. All uses replaced with similar uses of pI.
16700 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16701 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16702 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16703 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16704 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16705 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16706 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16707 64-bit hosts.
16708 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16709 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16710 * print.c (safe_debug_print, print_object): Likewise.
16711 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16712 to int.
16713 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16714 avoiding the 0 flag, which is not portable.
16715 * process.c (Fmake_network_process): Use pI to avoid cast.
16716 * region-cache.c (pp_cache): Likewise.
16717 * xdisp.c (decode_mode_spec): Likewise.
16718 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16719 behavior on 64-bit hosts with printf arg.
16720 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16721 (x_stop_queuing_selection_requests): Likewise.
16722 (x_get_window_property): Don't truncate byte count to an 'int'
16723 when tracing.
16724
16725 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16726 here, since it parses constructs like leading '-' and spaces,
16727 which are not wanted; and it overflows with large numbers.
16728 Instead, simply match F[0-9]+, which is what is wanted anyway.
16729
16730 * alloc.c: Remove unportable assumptions about struct layout.
16731 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16732 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16733 (allocate_vectorlike, make_pure_vector): Use the new macros,
16734 plus offsetof, to remove unportable assumptions about struct layout.
16735 These assumptions hold on all porting targets that I know of, but
16736 they are not guaranteed, they're easy to remove, and removing them
16737 makes further changes easier.
16738
16739 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16740 This doesn't fix a bug but makes the code clearer.
16741 (string_overrun_cookie): Now const. Use initializers that
16742 don't formally overflow signed char, to avoid warnings.
16743 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16744 can cause Emacs to crash when string overrun checking is enabled.
16745 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16746 multiple of sizeof (EMACS_INT); it need not be, if
16747 alignof(EMACS_INT) < sizeof (EMACS_INT).
16748 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16749
16750 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16751
16752 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16753
16754 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16755
16756 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16757 supposed to be handshaking. (Bug#8556)
16758 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16759
16760 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16761
16762 * lisp.h (Qdebug): List symbol.
16763 * eval.c (Qdebug): Restore global linkage.
16764 * keyboard.c (debug-on-event): New variable.
16765 (handle_user_signal): Break into debugger when debug-on-event
16766 matches the current signal symbol.
16767
16768 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16769
16770 * alloc.c (check_sblock, check_string_bytes)
16771 (check_string_free_list): Convert to standard C.
16772
16773 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16774
16775 * w32.c (emacs_gnutls_push): Fix typo.
16776
16777 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16778
16779 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16780 "cast to pointer from integer of different size".
16781
16782 Improve doprnt and its use in verror. (Bug#8545)
16783 * doprnt.c (doprnt): Document the set of format control sequences
16784 supported by the function. Use SAFE_ALLOCA instead of always
16785 using `alloca'.
16786
16787 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16788 is one byte too soon. Don't use xrealloc; instead xfree and
16789 xmalloc anew.
16790
16791 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16792
16793 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16794 callbacks stage.
16795
16796 * gnutls.c: Renamed global_initialized to
16797 gnutls_global_initialized. Added internals for the
16798 :verify-hostname-error, :verify-error, and :verify-flags
16799 parameters of `gnutls-boot' and documented those parameters in the
16800 docstring. Start callback support.
16801 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16802 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16803 on error. Return error code.
16804 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16805 (emacs_gnutls_read): Likewise.
16806 (Fgnutls_boot): Return handshake error code.
16807 (emacs_gnutls_handle_error): New function.
16808 (wsaerror_to_errno): Likewise.
16809
16810 * w32.h (emacs_gnutls_pull): Add prototype.
16811 (emacs_gnutls_push): Likewise.
16812
16813 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16814 (emacs_gnutls_push): Likewise.
16815
16816 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16817
16818 * process.c (wait_reading_process_output): Check if GnuTLS
16819 buffered some data internally if no FDs are set for TLS
16820 connections.
16821
16822 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16823 (LIBS): Link to USER_LIBS.
16824 ($(BLD)/gnutls.$(0)): New target.
16825
16826 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16827
16828 * xdisp.c (handle_single_display_spec): Rename the
16829 display_replaced_before_p argument into display_replaced_p, to
16830 make it consistent with the commentary. Fix typos in the
16831 commentary.
16832
16833 * textprop.c (syms_of_textprop): Remove dead code.
16834 (copy_text_properties): Delete obsolete commentary about an
16835 interface that was deleted long ago. Fix typos in the description
16836 of arguments.
16837
16838 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16839 to changes in oldXMenu/XMenu.h from 2011-04-16.
16840 <menu_help_message, prev_menu_help_message>: Constify.
16841 (IT_menu_make_room): menu->help_text is now `const char **';
16842 adjust.
16843
16844 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16845 to changes in oldXMenu/XMenu.h from 2011-04-16.
16846 (struct XMenu): Declare `help_text' `const char **'.
16847
16848 * xfaces.c <Qunspecified>: Make extern again.
16849
16850 * syntax.c: Include sys/types.h before including regex.h, as
16851 required by POSIX.
16852
16853 * doc.c (get_doc_string): Improve the format passed to `error'.
16854
16855 * doprnt.c (doprnt): Improve commentary.
16856
16857 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16858
16859 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16860 them with etags.
16861
16862 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16863 changes in globals.h immediately force recompilation.
16864 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16865 $(CURDIR)/s/ms-w32.h.
16866 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16867
16868 * character.c (Fchar_direction): Function deleted.
16869 (syms_of_character): Don't defsubr it.
16870 <char-direction-table>: Deleted.
16871
16872 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16873
16874 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16875 * doprnt.c: Include limits.h.
16876 (SIZE_MAX): New macro.
16877 (doprnt): Return a size_t value. 2nd arg is now size_t.
16878 Many local variables are now size_t instead of int or unsigned.
16879 Improve overflow protection. Support `l' modifier for integer
16880 conversions. Support %l conversion. Don't assume an EMACS_INT
16881 argument for integer conversions and for %c.
16882
16883 * lisp.h (doprnt): Restore prototype.
16884
16885 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16886 $(SRC)/character.h.
16887
16888 * Makefile.in (base_obj): Add back doprnt.o.
16889
16890 * deps.mk (doprnt.o): Add back prerequisites.
16891 (callint.o): Depend on character.h.
16892
16893 * eval.c (internal_lisp_condition_case): Include the handler
16894 representation in the error message.
16895 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16896 when breaking from the loop.
16897
16898 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16899
16900 * callint.c (Fcall_interactively): When displaying error message
16901 about invalid control letter, pass the character's codepoint, not
16902 a pointer to its multibyte form. Improve display of the character
16903 in octal and display also its hex code.
16904
16905 * character.c (char_string): Use %x to display the (unsigned)
16906 codepoint of an invalid character, to avoid displaying a bogus
16907 negative value.
16908
16909 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16910 `error', not SYMBOL_NAME itself.
16911
16912 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16913 character arguments to `error'.
16914
16915 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16916 to `error' in error message about FINAL_CHAR argument. Make sure
16917 FINAL_CHAR is a character, and use %c when it is passed as
16918 argument to `error'.
16919
16920 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16921
16922 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16923
16924 * w32.c: Include <time.h>.
16925 (sys_localtime): New function.
16926
16927 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16928
16929 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16930
16931 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16932
16933 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16934
16935 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16936 zombies (Bug#8467).
16937
16938 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16939
16940 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16941 gl_state.e_property when gl_state.object is Qt.
16942
16943 * insdel.c (make_gap_larger): Remove limitation of buffer size
16944 to <= INT_MAX.
16945
16946 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16947
16948 * xdisp.c (lookup_glyphless_char_display)
16949 (produce_glyphless_glyph): Handle cons cell entry in
16950 glyphless-char-display.
16951 (Vglyphless_char_display): Document it.
16952
16953 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16954 glyphless-char-display.
16955
16956 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16957
16958 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16959
16960 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16961
16962 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16963 definition for no-X builds.
16964
16965 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16966
16967 Static checks with GCC 4.6.0 and non-default toolkits.
16968
16969 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16970
16971 * process.c (keyboard_bit_set): Define only if SIGIO.
16972 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16973 (send_process): Repair possible setjmp clobbering.
16974
16975 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16976
16977 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16978
16979 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16980
16981 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16982 Define only if needed.
16983
16984 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16985 by pacifying GCC about it. Maybe it's time to retire it?
16986 * xfaces.c (USG, __TIMEVAL__): Likewise.
16987
16988 * dispextern.h (struct redisplay_interface): Rename param
16989 to avoid shadowing.
16990 * termhooks.h (struct terminal): Likewise.
16991 * xterm.c (xembed_send_message): Likewise.
16992
16993 * insdel.c (make_gap_smaller): Define only if
16994 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16995
16996 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16997 it.
16998
16999 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17000 so that we aren't warned about unused symbols.
17001
17002 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17003
17004 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
17005
17006 * xfns.c (x_real_positions): Mark locals as initialized.
17007
17008 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17009
17010 * xterm.c: Fix problems found by static analysis with other toolkits.
17011 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
17012 (x_dispatch_event): Declare static if USE_GTK, and
17013 define if USE_GTK || USE_X_TOOLKIT.
17014 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
17015 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
17016 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17017 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
17018
17019 * xmenu.c (menu_help_callback): Pointer type fixes.
17020 Use const pointers when pointing at readonly data. Avoid pointer
17021 signedness clashes.
17022 (FALSE): Remove unused macro.
17023 (update_frame_menubar): Remove unused decl.
17024
17025 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17026
17027 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17028 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17029 (single_menu_item): Rename local to avoid shadowing.
17030
17031 * keyboard.c (make_lispy_event): Remove unused local var.
17032
17033 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17034 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17035
17036 * bitmaps: Change bitmaps from unsigned char back to the X11
17037 compatible char. Avoid the old compiler warnings about
17038 out-of-range initializers by using, for example, '\xab' rather
17039 than 0xab.
17040
17041 * xgselect.c (xgselect_initialize): Check vs interface
17042 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17043
17044 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17045
17046 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17047 to read-only memory.
17048
17049 * fns.c (vector): Remove; this old hack is no longer needed.
17050
17051 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17052 Remove unused var.
17053 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17054
17055 * xrdb.c (x_load_resources): Omit unused local.
17056
17057 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17058 (x_window): Rename locals to avoid shadowing.
17059 (USG): Use the kludged USG macro, to pacify gcc.
17060
17061 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17062 (x_term_init): Remove local to avoid shadowing.
17063
17064 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17065
17066 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17067 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17068
17069 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17070
17071 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17072
17073 Fix regex.c, syntax.c and friends for buffers > 2GB.
17074 * syntax.h (struct gl_state_s): Declare character position members
17075 EMACS_INT.
17076
17077 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17078
17079 * textprop.c (verify_interval_modification, interval_of):
17080 Declare arguments EMACS_INT.
17081
17082 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17083 EMACS_INT.
17084
17085 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17086
17087 * indent.c (Fvertical_motion): Local variable it_start is now
17088 EMACS_INT.
17089
17090 * regex.c (re_match, re_match_2, re_match_2_internal)
17091 (bcmp_translate, regcomp, regexec, print_double_string)
17092 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17093 (re_compile_pattern, re_exec): Declare arguments and local
17094 variables `size_t' and `ssize_t' and return values `regoff_t', as
17095 appropriate.
17096 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17097 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17098 <compile_stack_type>: `size' and `avail' are now `size_t'.
17099
17100 * regex.h <regoff_t>: Use ssize_t, not int.
17101 (re_search, re_search_2, re_match, re_match_2): Arguments that
17102 specify buffer/string position and length are now ssize_t and
17103 size_t. Return type is regoff_t.
17104
17105 2011-04-16 Ben Key <bkey76@gmail.com>
17106
17107 * nsfont.m: Fixed bugs in ns_get_family and
17108 ns_descriptor_to_entity that were caused by using free to
17109 deallocate memory blocks that were allocated by xmalloc (via
17110 xstrdup). This caused Emacs to crash when compiled with
17111 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17112 --enable-checking=xmallocoverrun). xfree is now used to
17113 deallocate these memory blocks.
17114
17115 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17116
17117 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17118
17119 emacs_write: Accept and return EMACS_INT for sizes.
17120 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17121 et seq.
17122 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17123 Accept and return EMACS_INT.
17124 (emacs_gnutls_write): Return the number of bytes written on
17125 partial writes.
17126 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17127 (emacs_read, emacs_write): Remove check for negative size, as the
17128 Emacs source code has been audited now.
17129 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17130 (emacs_read, emacs_write): Use it.
17131 * process.c (send_process): Adjust to the new signatures of
17132 emacs_write and emacs_gnutls_write. Do not attempt to store
17133 a byte offset into an 'int'; it might overflow.
17134 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17135
17136 * sound.c: Don't assume sizes fit in 'int'.
17137 (struct sound_device.period_size, alsa_period_size):
17138 Return EMACS_INT, not int.
17139 (struct sound_device.write, vox_write, alsa_write):
17140 Accept EMACS_INT, not int.
17141 (wav_play, au_play): Use EMACS_INT to store sizes and to
17142 record read return values.
17143
17144 2011-04-15 Ben Key <bkey76@gmail.com>
17145
17146 * keyboard.c (Qundefined): Don't declare static since it is used
17147 in nsfns.m.
17148 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17149 static since they are used in nsfont.m.
17150
17151 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17152
17153 * process.c (Qprocessp): Don't declare static.
17154 * lisp.h (Qprocessp): Declare again.
17155
17156 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17157
17158 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17159
17160 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17161
17162 Improve C-level modularity by making more things 'static'.
17163
17164 Don't publish debugger-only interfaces to other modules.
17165 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17166 (verify_bytepos, count_markers): Move decls to the only modules
17167 that need them.
17168 * region-cache.h (pp_cache): Likewise.
17169 * window.h (check_all_windows): Likewise.
17170 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17171
17172 * sysdep.c (croak): Now static, if
17173 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17174 * syssignal.h (croak): Declare only if not static.
17175
17176 * alloc.c (refill_memory_reserve): Now static if
17177 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17178 * lisp.h (refill_memory_reserve): Declare only if not static.
17179
17180 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17181 Define only if USE_LUCID.
17182
17183 * xrdb.c (x_customization_string, x_rm_string): Now static.
17184
17185 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17186 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17187
17188 * xdisp.c (draw_row_with_mouse_face): Now static.
17189 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17190
17191 * window.h (check_all_windows): Mark externally visible.
17192
17193 * window.c (window_deletion_count): Now static.
17194
17195 * undo.c: Make symbols static if they're not exported.
17196 (last_undo_buffer, last_boundary_position, pending_boundary):
17197 Now static.
17198
17199 * textprop.c (interval_insert_behind_hooks): Now static.
17200 (interval_insert_in_front_hooks): Likewise.
17201
17202 * term.c: Make symbols static if they're not exported.
17203 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17204 (max_frame_lines, tty_set_terminal_modes):
17205 (tty_reset_terminal_modes, tty_turn_off_highlight):
17206 (get_tty_terminal): Now static.
17207 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17208 * termhooks.h (term_mouse_moveto): Do not declare if
17209 HAVE_WINDOW_SYSTEM.
17210 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17211 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17212
17213 * sysdep.c: Make symbols static if they're not exported.
17214 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17215 Now static.
17216 (sigprocmask_set, full_mask): Remove; unused.
17217 (wait_debugging): Mark as visible.
17218 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17219 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17220
17221 * syntax.c (syntax_temp): Define only if !__GNUC__.
17222
17223 * sound.c (current_sound_device, current_sound): Now static.
17224
17225 * search.c (searchbufs, searchbuf_head): Now static.
17226
17227 * scroll.c (scroll_cost): Remove; unused.
17228 * dispextern.h (scroll_cost): Remove decl.
17229
17230 * region-cache.h (pp_cache): Mark as externally visible.
17231
17232 * process.c: Make symbols static if they're not exported.
17233 (process_tick, update_tick, create_process, chan_process):
17234 (Vprocess_alist, proc_buffered_char, datagram_access):
17235 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17236 (deactivate_process): Mark defn as static, as well as decl.
17237 * lisp.h (create_process): Remove decl.
17238 * process.h (chan_process, Vprocess_alist): Remove decls.
17239
17240 * print.c: Make symbols static if they're not exported.
17241 (print_depth, new_backquote_output, being_printed, print_buffer):
17242 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17243 (print_interval, print_number_index, initial_stderr_stream):
17244 Now static.
17245 * lisp.h (Fprinc): Remove decl.
17246 (debug_output_compilation_hack): Mark as externally visible.
17247
17248 * sysdep.c (croak): Move decl from here to syssignal.h.
17249 * syssignal.h (croak): Put it here, so the API can be checked when
17250 'croak' is called from dissociate_if_controlling_tty.
17251
17252 * minibuf.c: Make symbols static if they're not exported.
17253 (minibuf_save_list, choose_minibuf_frame): Now static.
17254 * lisp.h (choose_minibuf_frame): Remove decl.
17255
17256 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17257
17258 * lread.c: Make symbols static if they're not exported.
17259 (read_objects, initial_obarray, oblookup_last_bucket_number):
17260 Now static.
17261 (make_symbol): Remove; unused.
17262 * lisp.h (initial_obarray, make_symbol): Remove decls.
17263
17264 * keyboard.c: Make symbols static if they're not exported.
17265 (single_kboard, recent_keys_index, total_keys, recent_keys):
17266 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17267 (this_single_command_key_start, echoing, last_auto_save):
17268 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17269 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17270 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17271 (Vlispy_mouse_stem, double_click_count):
17272 Now static.
17273 (force_auto_save_soon): Define only if SIGDANGER.
17274 (ignore_mouse_drag_p): Now static if
17275 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17276 (print_help): Remove; unused.
17277 (stop_character, last_timer_event): Mark as externally visible.
17278 * keyboard.h (ignore_mouse_drag_p): Declare only if
17279 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17280 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17281 * lisp.h (echoing): Remove decl.
17282 (force_auto_save_soon): Declare only if SIGDANGER.
17283 * xdisp.c (redisplay_window): Simplify code, to make it more
17284 obvious that ignore_mouse_drag_p is not accessed if !defined
17285 USE_GTK && !defined HAVE_NS.
17286
17287 * intervals.c: Make symbols static if they're not exported.
17288 (merge_properties_sticky, merge_interval_right, delete_interval):
17289 Now static.
17290 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17291
17292 * insdel.c: Make symbols static if they're not exported.
17293 However, leave prepare_to_modify_buffer alone. It's never
17294 called from outside this function, but that appears to be a bug.
17295 (combine_after_change_list, combine_after_change_buffer):
17296 (adjust_after_replace, signal_before_change): Now static.
17297 (adjust_after_replace_noundo): Remove; unused.
17298 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17299 (signal_before_change): Remove decls.
17300
17301 * indent.c (val_compute_motion, val_vmotion): Now static.
17302
17303 * image.c: Make symbols static if they're not exported.
17304 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17305 if USE_GTK.
17306 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17307 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17308
17309 * fringe.c (standard_bitmaps): Now static.
17310 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17311
17312 * frame.c: Make symbols static if they're not exported.
17313 (x_report_frame_params, make_terminal_frame): Now static.
17314 (get_frame_param): Now static, unless HAVE_NS.
17315 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17316 (x_get_resource_string): Remove; not used.
17317 * frame.h (make_terminal_frame, x_report_frame_params):
17318 (x_get_resource_string); Remove decls.
17319 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17320 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17321
17322 * font.c, fontset.c: Make symbols static if they're not exported.
17323 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17324 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17325 * font.c (font_close_object): Now static.
17326 * font.h (font_close_object): Remove.
17327 * fontset.c (FONTSET_OBJLIST): Remove.
17328 (free_realized_fontset) #if-0 the body, which does nothing.
17329 (face_suitable_for_char_p): #if-0, as it's never called.
17330 * fontset.h (face_suitable_for_char_p): Remove decl.
17331 * xfaces.c (face_at_string_position):
17332 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17333 since 0 is always ASCII.
17334
17335 * fns.c (weak_hash_tables): Now static.
17336
17337 * fileio.c: Make symbols static if they're not exported.
17338 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17339 (Vwrite_region_annotation_buffers): Now static.
17340
17341 * eval.c: Make symbols static if they're not exported.
17342 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17343 * lisp.h (backtrace_list): Remove decl.
17344
17345 * emacs.c: Make symbols static if they're not exported.
17346 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17347 (fatal_error_code, fatal_error_signal_hook, standard_args):
17348 Now static.
17349 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17350 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17351 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17352 * lisp.h (fatal_error_signal_hook): Remove decl.
17353 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17354
17355 * editfns.c: Move a (normally-unused) function to its only use.
17356 * editfns.c, lisp.h (get_operating_system_release): Remove.
17357 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17358 worth the hassle of breaking this out.
17359
17360 * xterm.c: Make symbols static if they're not exported.
17361 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17362 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17363 (x_destroy_window, x_delete_display):
17364 Now static.
17365 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17366 (x_mouse_leave): Remove; unused.
17367 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17368 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17369 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17370 Remove decls.
17371 (x_mouse_leave): Declare only if WINDOWSNT.
17372 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17373 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17374 USE_X_TOOLKIT.
17375
17376 * ftxfont.c: Make symbols static if they're not exported.
17377 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17378 HAVE_FREETYPE.
17379 * font.h (ftxfont_driver): Likewise.
17380
17381 * xfns.c: Make symbols static if they're not exported.
17382 (x_last_font_name, x_display_info_for_name):
17383 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17384 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17385 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17386 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17387 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17388 (last_show_tip_args): Now static.
17389 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17390 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17391 (x_screen_planes): Remove; unused.
17392 * dispextern.h (x_screen_planes): Remove decl.
17393
17394 * dispnew.c: Make symbols static if they're not exported.
17395 * dispextern.h (redraw_garbaged_frames, scrolling):
17396 (increment_row_positions): Remove.
17397 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17398 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17399 Now static.
17400 (redraw_garbaged_frames): Remove; unused.
17401
17402 * xfaces.c: Make symbols static if they're not exported.
17403 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17404 Remove decls.
17405 * xterm.h (defined_color): Remove decls.
17406 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17407 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17408 (menu_face_changed_default, defined_color, free_realized_face):
17409 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17410 (ascii_face_of_lisp_face): Remove; unused.
17411
17412 * xdisp.c: Make symbols static if they're not exported.
17413 * dispextern.h (scratch_glyph_row, window_box_edges):
17414 (glyph_to_pixel_coords, set_cursor_from_row):
17415 (get_next_display_element, set_iterator_to_next):
17416 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17417 (show_mouse_face): Remove decls
17418 * frame.h (message_buf_print): Likewise.
17419 * lisp.h (pop_message, set_message, check_point_in_composition):
17420 Likewise.
17421 * xterm.h (set_vertical_scroll_bar): Likewise.
17422 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17423 (message_buf_print, scratch_glyph_row, displayed_buffer):
17424 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17425 (get_next_display_element, show_mouse_face, window_box_edges):
17426 (frame_to_window_pixel_xy, check_point_in_composition):
17427 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17428 (glyph_to_pixel_coords): Remove; unused.
17429
17430 * dired.c (file_name_completion): Now static.
17431
17432 * dbusbind.c (xd_in_read_queued_messages): Now static.
17433
17434 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17435 * data.c (circular_list_error): Remove.
17436
17437 * commands.h (last_point_position, last_point_position_buffer):
17438 (last_point_position_window): Remove decls.
17439 * keyboard.c: Make these variables static.
17440
17441 * coding.h (coding, code_convert_region, encode_coding_gap):
17442 Remove decls.
17443 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17444 (iso_code_class, detect_coding, code_convert_region): Now static.
17445 (encode_coding_gap): Remove; unused.
17446
17447 * chartab.c (chartab_chars, chartab_bits): Now static.
17448
17449 * charset.h (charset_iso_8859_1): Remove decl.
17450 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17451 Now static.
17452
17453 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17454 * ccl.c (Vccl_program_table): Now static.
17455 (check_ccl_update): Remove; unused.
17456
17457 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17458 * category.h: ... from here.
17459 * category.c (check_category_table, set_category_set): Now static.
17460
17461 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17462 * lisp.h: Remove these decls.
17463
17464 * buffer.c (buffer_count): Remove unused var.
17465
17466 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17467 so that it's not optimized away.
17468 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17469 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17470 exported only to the debugger.
17471
17472 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17473 * atimer.h (run_all_atimers): Remove; not exported.
17474
17475 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17476 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17477 was inaccessible from Lisp.
17478 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17479 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17480
17481 alloc.c: Import and export fewer symbols, and remove unused items.
17482 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17483 is defined.
17484 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17485 it's not optimized away by whole-program optimization.
17486 (message_enable_multibyte, free_misc): Remove.
17487 (catchlist, handlerlist, mark_backtrace):
17488 Declare only if BYTE_MARK_STACK.
17489 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17490 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17491 (message_enable_multibyte): Remove decl.
17492 (free_misc, interval_free_list, float_block, float_block_index):
17493 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17494 (cons_free_list, last_marked_index):
17495 Now static.
17496 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17497 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17498 (mark_backtrace): Define only if BYTE_MARK_STACK.
17499 * xdisp.c (message_enable_multibyte): Now static.
17500
17501 Declare Lisp_Object Q* variables to be 'static' if not exported.
17502 This makes it easier for human readers (and static analyzers)
17503 to see whether these variables are used from other modules.
17504 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17505 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17506 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17507 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17508 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17509 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17510 * xmenu.c, xselect.c:
17511 Declare Q* vars static if they are not used in other modules.
17512 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17513 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17514 Remove decls of unexported vars.
17515 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17516
17517 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17518
17519 Make Emacs functions such as Fatom 'static' by default.
17520 This makes it easier for human readers (and static analyzers)
17521 to see whether these functions can be called from other modules.
17522 DEFUN now defines a static function. To make the function external
17523 so that it can be used in other C modules, use the new macro DEFUE.
17524 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17525 (Finit_image_library):
17526 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17527 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17528 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17529 Remove decls, since these functions are now static.
17530 (Funintern, Fget_internal_run_time): New decls, since these functions
17531 were already external.
17532
17533 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17534 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17535 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17536 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17537 * keyboard.c, keymap.c, lread.c:
17538 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17539 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17540 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17541 Mark functions with DEFUE instead of DEFUN,
17542 if they are used in other modules.
17543 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17544 decls for now-static functions.
17545 * buffer.h (Fdelete_overlay): Remove decl.
17546 * callproc.c (Fgetenv_internal): Mark as internal.
17547 * composite.c (Fremove_list_of_text_properties): Remove decl.
17548 (Fcomposition_get_gstring): New forward static decl.
17549 * composite.h (Fcomposite_get_gstring): Remove decl.
17550 * dired.c (Ffile_attributes): New forward static decl.
17551 * doc.c (Fdocumntation_property): New forward static decl.
17552 * eval.c (Ffetch_bytecode): New forward static decl.
17553 (Funintern): Remove extern decl; now in .h file where it belongs.
17554 * fileio.c (Fmake_symbolic_link): New forward static decl.
17555 * image.c (Finit_image_library): New forward static decl.
17556 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17557 * intervals.h (Fprevious_property_change):
17558 (Fremove_list_of_text_properties): Remove decls.
17559 * keyboard.c (Fthis_command_keys): Remove decl.
17560 (Fcommand_execute): New forward static decl.
17561 * keymap.c (Flookup_key): New forward static decl.
17562 (Fcopy_keymap): Now static.
17563 * keymap.h (Flookup_key): Remove decl.
17564 * process.c (Fget_process): New forward static decl.
17565 (Fprocess_datagram_address): Mark as internal.
17566 * syntax.c (Fsyntax_table_p): New forward static decl.
17567 (skip_chars): Remove duplicate decl.
17568 * textprop.c (Fprevious_property_change): New forward static decl.
17569 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17570 Now internal.
17571 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17572 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17573
17574 * editfns.c (Fformat): Remove unreachable code.
17575
17576 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17577
17578 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17579 change. (Bug#8496)
17580
17581 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17582
17583 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17584 when at ZV. (Bug#8487)
17585
17586 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17587
17588 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17589 (Bug#8437)
17590 * keyboard.c (parse_tool_bar_item): Likewise.
17591 * sound.c (sound_cleanup, alsa_close): Likewise.
17592 * termcap.c (tgetent): Likewise.
17593 * xfns.c (x_default_font_parameter): Likewise.
17594 * xsettings.c (read_and_apply_settings): Likewise.
17595
17596 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17597 (overrun_check_free): Protoize.
17598
17599 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17600
17601 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17602 since callers should never pass a negative size.
17603 Change the signature to match that of plain 'read' and 'write'; see
17604 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17605 * lisp.h: Update prototypes of emacs_write and emacs_read.
17606
17607 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17608
17609 * xdisp.c (redisplay_window): Don't try to determine the character
17610 position of the scroll margin if the window start point w->startp
17611 is outside the buffer's accessible region. (Bug#8468)
17612
17613 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17614
17615 Fix write-region and its subroutines for buffers > 2GB.
17616 * fileio.c (a_write, e_write): Modify declaration of arguments and
17617 local variables to support buffers larger than 2GB.
17618 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17619
17620 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17621 argument, local variables, and return value.
17622
17623 * lisp.h: Update prototypes of emacs_write and emacs_read.
17624
17625 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17626
17627 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17628
17629 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17630
17631 Fix more problems found by GCC 4.6.0's static checks.
17632
17633 * xdisp.c (vmessage): Use a better test for character truncation.
17634
17635 * charset.c (load_charset_map): <, not <=, for optimization,
17636 and to avoid potential problems with integer overflow.
17637 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17638 * casetab.c (set_identity, shuffle): Likewise.
17639 * editfns.c (Fformat): Likewise.
17640 * syntax.c (skip_chars): Likewise.
17641
17642 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17643 This also lets GCC 4.6.0 generate slightly better loop code.
17644
17645 * callint.c (Fcall_interactively): <, not <=, for optimization.
17646 (Fcall_interactively): Count the number of arguments produced,
17647 not the number of arguments given. This is simpler and lets GCC
17648 4.6.0 generate slightly better code.
17649
17650 * ftfont.c: Distingish more carefully between FcChar8 and char.
17651 The previous code passed unsigned char * to a functions like
17652 strlen and xstrcasecmp that expect char *, which does not
17653 conform to the C standard.
17654 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17655 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17656 char * when the C standard requires it.
17657
17658 * keyboard.c (read_char): Remove unused var.
17659
17660 * eval.c: Port to Windows vsnprintf (Bug#8435).
17661 Include <limits.h>.
17662 (SIZE_MAX): Define if the headers do not.
17663 (verror): Do not give up if vsnprintf returns a negative count.
17664 Instead, grow the buffer. This ports to Windows vsnprintf, which
17665 does not conform to C99. Problem reported by Eli Zaretskii.
17666 Also, simplify the allocation scheme, by avoiding the need for
17667 calling realloc, and removing the ALLOCATED variable.
17668
17669 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17670
17671 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17672 But keep the doprint source code for now, as we might revamp it
17673 and use it again (Bug#8435).
17674 * lisp.h (doprnt): Remove.
17675 * Makefile.in (base_obj): Remove doprnt.o.
17676 * deps.mk (doprnt.o): Remove.
17677
17678 error: Print 32- and 64-bit integers portably (Bug#8435).
17679 Without this change, on typical 64-bit hosts error ("...%d...", N)
17680 was used to print both 32- and 64-bit integers N, which relied on
17681 undefined behavior.
17682 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17683 * lisp.h (error, verror): Mark as printf-like functions.
17684 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17685 Report overflow in size calculations when allocating printf buffer.
17686 Do not truncate output string at its first null byte.
17687 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17688 Truncate the output at a character boundary, since vsnprintf does not
17689 do that.
17690 * charset.c (check_iso_charset_parameter): Convert internal
17691 character to string before calling 'error', since %c now has the
17692 printf meaning.
17693 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17694 overflow when computing char to be passed to 'error'. Do not
17695 pass Lisp_Object to 'error'; pass the integer instead.
17696 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17697 formatted with plain %d.
17698
17699 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17700
17701 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17702
17703 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17704
17705 * xterm.c (x_catch_errors): Remove duplicate declaration.
17706
17707 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17708
17709 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17710
17711 2011-04-10 Jim Meyering <meyering@redhat.com>
17712
17713 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17714 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17715 return ssize_t not "int", and use size_t as the buffer length.
17716 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17717 * gnutls.h: Update declarations.
17718 * process.c (read_process_output): Use ssize_t, to match.
17719 (send_process): Likewise.
17720
17721 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17722
17723 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17724
17725 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17726
17727 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17728 Use unsigned char, to match FcChar8 type definition.
17729
17730 * xterm.c (handle_one_xevent):
17731 * xmenu.c (create_and_show_popup_menu):
17732 * xselect.c (x_decline_selection_request)
17733 (x_reply_selection_request): Avoid type-punned deref of X events.
17734
17735 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17736
17737 Fix some uses of `int' instead of EMACS_INT.
17738 * search.c (string_match_1, fast_string_match)
17739 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17740 (scan_buffer, find_next_newline_no_quit)
17741 (find_before_next_newline, search_command, Freplace_match)
17742 (Fmatch_data): Make some `int' variables be EMACS_INT.
17743
17744 * xdisp.c (display_count_lines): 3rd argument and return value now
17745 EMACS_INT. All callers changed.
17746 (pint2hrstr): Last argument is now EMACS_INT.
17747
17748 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17749 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17750 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17751 (decode_coding_utf_16, decode_coding_emacs_mule)
17752 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17753 (decode_coding_ccl, decode_coding_charset)
17754 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17755 (decode_coding_iso_2022, decode_coding_emacs_mule)
17756 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17757 <char_offset, last_offset>: Declare EMACS_INT.
17758 (encode_coding_utf_8, encode_coding_utf_16)
17759 (encode_coding_emacs_mule, encode_invocation_designation)
17760 (encode_designation_at_bol, encode_coding_iso_2022)
17761 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17762 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17763 Declare EMACS_INT.
17764 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17765 (encode_invocation_designation): Last argument P_NCHARS is now
17766 EMACS_INT.
17767 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17768 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17769
17770 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17771 All users changed.
17772
17773 * ccl.c (Fccl_execute_on_string): Declare some variables
17774 EMACS_INT.
17775
17776 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17777
17778 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17779
17780 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17781
17782 * process.c (Fformat_network_address): Doc fix.
17783
17784 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17785
17786 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17787
17788 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17789
17790 * keyboard.c (read_char): Call Lisp function help-form-show,
17791 instead of using internal_with_output_to_temp_buffer.
17792 (Qhelp_form_show): New var.
17793 (syms_of_keyboard): Use DEFSYM macro.
17794
17795 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17796
17797 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17798
17799 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17800
17801 * process.c (Flist_processes): Remove to Lisp.
17802 (list_processes_1): Delete.
17803
17804 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17805
17806 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17807
17808 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17809
17810 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17811
17812 Fix more problems found by GCC 4.6.0's static checks.
17813
17814 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17815
17816 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17817
17818 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17819
17820 * xdisp.c (vmessage): Mark as a printf-like function.
17821
17822 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17823
17824 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17825
17826 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17827 printf-like functions.
17828 (tiff_load): Add casts to remove these marks before passing them
17829 to system-supplied API.
17830
17831 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17832
17833 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17834 This avoids several warnings with gcc -Wstrict-overflow.
17835 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17836 directly, rather than having caller test rule sign. This avoids
17837 some unnecessary tests.
17838 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17839 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17840 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17841
17842 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17843 (xfont_open): Avoid unnecessary tests.
17844
17845 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17846
17847 * composite.h, composite.c (composition_gstring_put_cache):
17848 Use EMACS_INT, not int, for length.
17849
17850 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17851 breaking out part of COMPOSITION_DECODE_RULE.
17852 (COMPOSITION_DECODE_RULE): Use it.
17853 * composite.c (get_composition_id): Remove unused local vars,
17854 by using the new macro.
17855
17856 * textprop.c (set_text_properties_1): Change while to do-while,
17857 since the condition is always true at first.
17858
17859 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17860 (interval_deletion_adjustment): Return unsigned value.
17861 All uses changed.
17862
17863 * process.c (list_processes_1, create_pty, read_process_output):
17864 (exec_sentinel): Remove vars that were set but not used.
17865 (create_pty): Remove unnecessary "volatile"s.
17866 (Fnetwork_interface_info): Avoid possibility of int overflow.
17867 (read_process_output): Do adaptive read buffering even if carryover.
17868 (read_process_output): Simplify nbytes computation if buffered.
17869
17870 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17871
17872 * syntax.c (scan_words): Remove var that was set but not used.
17873 (update_syntax_table): Use unsigned instead of int.
17874
17875 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17876 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17877 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17878
17879 * print.c (print_error_message): Avoid int overflow.
17880
17881 * font.c (font_list_entities): Redo for clarity,
17882 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17883
17884 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17885 (font_score): Avoid potential overflow in diff calculation.
17886
17887 * fns.c (substring_both): Remove var that is set but not used.
17888 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17889
17890 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17891
17892 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17893 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17894 can always succeed if overflow has undefined behavior.
17895
17896 * search.c (boyer_moore, wordify): Remove vars set but not used.
17897 (wordify): Omit three unnecessary tests.
17898
17899 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17900 All callers changed. This avoids the need for an unused var.
17901
17902 * casefiddle.c (casify_region): Remove var that is set but not used.
17903
17904 * dired.c (file_name_completion): Remove var that is set but not used.
17905
17906 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17907
17908 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17909 (Finsert_file_contents): Remove unnecessary code checking fd.
17910
17911 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17912 Check for integer overflow on size calculations.
17913
17914 * buffer.c (Fprevious_overlay_change): Remove var that is set
17915 but not used.
17916
17917 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17918 Remove vars that are set but not used.
17919 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17920 (timer_check_2): Mark vars as initialized.
17921
17922 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17923
17924 * image.c (lookup_image): Remove var that is set but not used.
17925 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17926
17927 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17928 that are set but not used.
17929
17930 * xfns.c (make_invisible_cursor): Don't return garbage
17931 if XCreateBitmapFromData fails (Bug#8410).
17932
17933 * xselect.c (x_get_local_selection, x_handle_property_notify):
17934 Remove vars that are set but not used.
17935
17936 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17937 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17938
17939 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17940 Remove var that is set but not used.
17941 (scroll_bar_windows_size): Now size_t, not int.
17942 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17943 Check for overflow.
17944
17945 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17946 (map_tty_color) [!defined MSDOS]: Likewise.
17947
17948 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17949
17950 * coding.c: Remove vars that are set but not used.
17951 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17952 All callers changed.
17953 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17954 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17955 (decode_coding_charset): Remove vars that are set but not used.
17956
17957 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17958 that is set but not used.
17959
17960 * print.c (print_object): Remove var that is set but not used.
17961
17962 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17963 The gnulib version avoids calling malloc in the usual case,
17964 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17965 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17966 * filelock.c (current_lock_owner): Likewise.
17967 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17968 * sysdep.c: Include allocator.h, careadlinkat.h.
17969 (emacs_no_realloc_allocator): New static constant.
17970 (emacs_readlink): New function.
17971 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17972 ../lib/careadlinkat.h.
17973
17974 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17975
17976 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17977 first non-nil return value).
17978
17979 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17980
17981 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17982 if not defined (Bug#8403).
17983
17984 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17985
17986 * xdisp.c (display_count_lines): Remove parameter `start',
17987 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17988 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17989 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17990 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17991 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17992 and thereabouts. All callers changed.
17993 (get_per_char_metric): Remove parameter `f', unused since
17994 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17995
17996 2011-04-02 Jim Meyering <meyering@redhat.com>
17997
17998 do not dereference NULL upon failed strdup
17999 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18000 (ns_get_family): Likewise.
18001
18002 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
18003
18004 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18005
18006 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18007
18008 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18009 later (Bug#8403).
18010
18011 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18012
18013 Add lexical binding.
18014
18015 * window.c (Ftemp_output_buffer_show): New fun.
18016 (Fsave_window_excursion):
18017 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18018
18019 * lread.c (lisp_file_lexically_bound_p): New function.
18020 (Fload): Bind Qlexical_binding.
18021 (readevalloop): Remove `evalfun' arg.
18022 Bind Qinternal_interpreter_environment.
18023 (Feval_buffer): Bind Qlexical_binding.
18024 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18025 Mark as dynamic.
18026 (syms_of_lread): Declare `lexical-binding'.
18027
18028 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18029
18030 * keyboard.c (eval_dyn): New fun.
18031 (menu_item_eval_property): Use it.
18032
18033 * image.c (parse_image_spec): Use Ffunctionp.
18034
18035 * fns.c (concat, mapcar1): Accept byte-code-functions.
18036
18037 * eval.c (Fsetq): Handle lexical vars.
18038 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18039 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18040 (FletX, Flet): Obey lexical binding.
18041 (Fcommandp): Handle closures.
18042 (Feval): New `lexical' arg.
18043 (eval_sub): New function extracted from Feval. Use it almost
18044 everywhere where Feval was used. Look up vars in lexical env.
18045 Handle closures.
18046 (Ffunctionp): Move from subr.el.
18047 (Ffuncall): Handle closures.
18048 (apply_lambda): Remove `eval_flags'.
18049 (funcall_lambda): Handle closures and new byte-code-functions.
18050 (Fspecial_variable_p): New function.
18051 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18052 but without exporting it to Lisp.
18053
18054 * doc.c (Fdocumentation, store_function_docstring):
18055 * data.c (Finteractive_form): Handle closures.
18056
18057 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18058 interactive spec.
18059
18060 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18061 New byte-codes.
18062 (exec_byte_code): New function extracted from Fbyte_code to handle new
18063 calling convention for byte-code-functions. Add new byte-codes.
18064
18065 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18066
18067 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18068
18069 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18070
18071 * xdisp.c (redisplay_internal): Fix prototype.
18072
18073 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18074
18075 * xdisp.c (SCROLL_LIMIT): New macro.
18076 (try_scrolling): Use it when setting scroll_limit.
18077 Limit scrolling to 100 screen lines.
18078 (redisplay_window): Even when falling back on "recentering",
18079 position point in the window according to scroll-conservatively,
18080 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18081
18082 (try_scrolling): When point is above the window, allow searching
18083 as far as scroll_max, or one screenful, to compute vertical
18084 distance from PT to the scroll margin position. This prevents
18085 try_scrolling from unnecessarily failing when
18086 scroll-conservatively is set to a value slightly larger than the
18087 window height. Clean up the case of PT below the margin at bottom
18088 of window: scroll_max can no longer be INT_MAX. When aggressive
18089 scrolling is in use, don't let point enter the opposite scroll
18090 margin as result of the scroll.
18091 (syms_of_xdisp) <scroll-conservatively>: Document the
18092 threshold of 100 lines for never-recentering scrolling.
18093
18094 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18095
18096 * dispextern.h (move_it_by_lines):
18097 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18098 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18099 (message_log_check_duplicate): Remove parameters `prev_bol' and
18100 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18101 (redisplay_internal): Remove parameter `preserve_echo_area',
18102 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18103
18104 * indent.c (Fvertical_motion):
18105 * window.c (window_scroll_pixel_based, Frecenter):
18106 Don't pass `need_y_p' to `move_it_by_lines'.
18107
18108 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18109
18110 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18111 steal a few bits to be more compact.
18112 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18113 Remove unneeded casts.
18114
18115 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18116
18117 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18118
18119 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18120 binding" message (bug#7967).
18121
18122 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18123
18124 Fix more problems found by GCC 4.6.0's static checks.
18125
18126 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18127 Remove unused local var.
18128
18129 * editfns.c (Fmessage_box): Remove unused local var.
18130
18131 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18132 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18133 Omit unused local vars.
18134 * window.c (shrink_windows): Omit unused local var.
18135 * menu.c (digest_single_submenu): Omit unused local var.
18136 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18137 Omit unused local var.
18138
18139 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18140 Don't assume string length fits in int.
18141 (keyremap_step, read_key_sequence): Use size_t for sizes.
18142 (read_key_sequence): Don't check last_real_key_start redundantly.
18143
18144 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18145 instead of alloca (Bug#8344).
18146
18147 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18148 (Fbacktrace_frame): Don't assume nframes fits in int.
18149
18150 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18151
18152 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18153 concerns.
18154
18155 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18156
18157 * cm.c (calccost): Turn while-do into do-while, for clarity.
18158
18159 * keyboard.c (syms_of_keyboard): Use the same style as later
18160 in this function when indexing through an array. This also
18161 works around GCC bug 48267.
18162
18163 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18164
18165 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18166
18167 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18168 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18169
18170 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18171 This avoids undefined behavior on integer overflow, and is a bit
18172 more convenient anyway since it is compared to a size_t variable.
18173
18174 Variadic C functions now count arguments with size_t, not int.
18175 This avoids an unnecessary limitation on 64-bit machines, which
18176 caused (substring ...) to crash on large vectors (Bug#8344).
18177 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18178 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18179 All variadic functions and their callers changed accordingly.
18180 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18181 * data.c (arith_driver, float_arith_driver): Likewise.
18182 * editfns.c (general_insert_function): Likewise.
18183 * eval.c (struct backtrace.nargs, interactive_p)
18184 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18185 (funcall_lambda, mark_backtrace): Likewise.
18186 * fns.c (concat): Likewise.
18187 * frame.c (x_set_frame_parameters): Likewise.
18188 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18189 0 if not found, not -1. All callers changed.
18190
18191 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18192 (stack_copy_size): Now size_t, not int.
18193 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18194
18195 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18196
18197 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18198 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18199 All callers changed.
18200
18201 * lisp.h (multibyte_char_to_unibyte):
18202 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18203 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18204 * character.h (CHAR_TO_BYTE8):
18205 * cmds.c (internal_self_insert):
18206 * editfns.c (general_insert_function):
18207 * keymap.c (push_key_description):
18208 * search.c (Freplace_match):
18209 * xdisp.c (message_dolog, set_message_1): All callers changed.
18210
18211 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18212
18213 * keyboard.c (safe_run_hook_funcall): New function.
18214 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18215 don't set the hook to nil, but remove the offending function instead.
18216 (Qcommand_hook_internal): Remove, unused.
18217 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18218 Vcommand_hook_internal.
18219
18220 * eval.c (enum run_hooks_condition): Remove.
18221 (funcall_nil, funcall_not): New functions.
18222 (run_hook_with_args): Call each function through a `funcall' argument.
18223 Remove `cond' argument, now redundant.
18224 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18225 (Frun_hook_with_args_until_failure): Adjust accordingly.
18226 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18227
18228 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18229
18230 * dispextern.h (string_buffer_position): Remove declaration.
18231
18232 * print.c (strout): Remove parameter `multibyte', unused since
18233 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18234
18235 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18236 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18237 All callers changed.
18238
18239 * w32.c (_wsa_errlist): Use braces for struct initializers.
18240
18241 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18242 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18243 All callers changed.
18244 (string_buffer_position): Likewise. Also, make static (it's never
18245 used outside xdisp.c).
18246 (cursor_row_p): Remove parameter `w', unused since
18247 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18248 (decode_mode_spec): Remove parameter `precision', introduced during
18249 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18250 All callers changed.
18251
18252 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18253
18254 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18255
18256 2011-03-27 Anders Lindgren <andlind@gmail.com>
18257
18258 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18259 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18260 (ns_update_auto_hide_menu_bar): New functions.
18261 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18262 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18263 ns_constrain_all_frames.
18264 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18265 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18266
18267 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18268
18269 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18270
18271 2011-03-27 Glenn Morris <rgm@gnu.org>
18272
18273 * syssignal.h: Replace RETSIGTYPE with void.
18274 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18275 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18276 Replace SIGTYPE with void everywhere.
18277 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18278 * s/template.h (SIGTYPE): Remove commented out definition.
18279
18280 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18281
18282 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18283 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18284
18285 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18286
18287 * w32.c (read_unc_volume): Use parameter `henum', instead of
18288 global variable `wget_enum_handle'.
18289
18290 * keymap.c (describe_vector): Remove parameters `indices' and
18291 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18292 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18293
18294 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18295
18296 * keyboard.c (timer_check): Remove parameter `do_it_now',
18297 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18298 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18299 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18300
18301 * keyboard.c (read_char):
18302 * w32menu.c (w32_menu_display_help):
18303 * xmenu.c (show_help_event, menu_help_callback):
18304 Adjust calls to `show_help_echo'.
18305
18306 * gtkutil.c (xg_maybe_add_timer):
18307 * keyboard.c (readable_events):
18308 * process.c (wait_reading_process_output):
18309 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18310
18311 * insdel.c (adjust_markers_gap_motion):
18312 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18313 (gap_left, gap_right): Don't call it.
18314
18315 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18316
18317 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18318 incurred during fontification.
18319
18320 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18321
18322 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18323 (DEFVAR_PER_BUFFER): Don't pass it.
18324
18325 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18326 (scrolling_window): Don't pass it.
18327
18328 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18329
18330 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18331
18332 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18333 and `suffix'.
18334 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18335 of variables specific to SELinux and computation of `encoded_absname'.
18336
18337 * image.c (XPutPixel): Remove unused variable `height'.
18338
18339 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18340
18341 * unexw32.c (get_section_info): Remove unused variable `section'.
18342
18343 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18344 (system_process_attributes): Remove unused variable `sess'.
18345 (sys_read): Remove unused variable `err'.
18346
18347 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18348 (w32_wnd_proc): Remove unused variable `isdead'.
18349 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18350 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18351 (x_create_tip_frame): Remove unused variable `tem'.
18352
18353 * w32inevt.c (w32_console_read_socket):
18354 Remove unused variable `no_events'.
18355
18356 * w32term.c (x_draw_composite_glyph_string_foreground):
18357 Remove unused variable `width'.
18358
18359 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18360
18361 * w32term.c (x_set_glyph_string_clipping):
18362 Don't pass uninitialized region to CombineRgn.
18363
18364 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18365
18366 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18367 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18368 (Fx_close_connection): Remove unused variable `i'.
18369
18370 * w32font.c (w32font_draw): Return number of glyphs.
18371 (w32font_open_internal): Remove unused variable `i'.
18372 (w32font_driver): Add missing initializer.
18373
18374 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18375 (fill_in_menu): Remove unused variable `items_added'.
18376
18377 * w32term.c (last_mouse_press_frame): Remove static global variable.
18378 (w32_clip_to_row): Remove unused variable `f'.
18379 (x_delete_terminal): Remove unused variable `i'.
18380
18381 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18382 (NOTHING): Remove unused static global variable.
18383 (uniscribe_check_otf): Remove unused variable `table'.
18384 (uniscribe_font_driver): Add missing initializers.
18385
18386 2011-03-23 Julien Danjou <julien@danjou.info>
18387
18388 * term.c (Fsuspend_tty, Fresume_tty):
18389 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18390 * window.c (temp_output_buffer_show):
18391 * insdel.c (signal_before_change):
18392 * frame.c (Fhandle_switch_frame):
18393 * fileio.c (Fdo_auto_save):
18394 * emacs.c (Fkill_emacs):
18395 * editfns.c (save_excursion_restore):
18396 * cmds.c (internal_self_insert):
18397 * callint.c (Fcall_interactively):
18398 * buffer.c (Fkill_all_local_variables):
18399 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18400 Use Frun_hooks.
18401 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18402 unconditionally since it does the check itself.
18403
18404 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18405
18406 Fix more problems found by GCC 4.5.2's static checks.
18407
18408 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18409 the first time through the loop, since we know p0 < p1 then.
18410 This also avoids a gcc -Wstrict-overflow warning.
18411
18412 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18413 leading to a memory leak, possible in functions like
18414 load_charset_map_from_file that can allocate an unbounded number
18415 of objects (Bug#8318).
18416
18417 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18418 that could (at least in theory) be that large.
18419
18420 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18421 This is less likely to overflow, and avoids undefined behavior if
18422 overflow does occur. All callers changed. Use strtoul to scan
18423 for the unsigned long integer.
18424 (pint2hrstr): Simplify and tune code slightly.
18425 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18426
18427 * scroll.c (do_scrolling): Work around GCC bug 48228.
18428 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18429
18430 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18431 This also avoids a warning with gcc -Wstrict-overflow.
18432 (validate_x_resource_name): Simplify count usage.
18433 This also avoids a warning with gcc -Wstrict-overflow.
18434
18435 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18436 fail (Bug#8306).
18437
18438 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18439
18440 * process.c (Fmake_network_process): Use socklen_t, not int,
18441 where POSIX says socklen_t is required in portable programs.
18442 This fixes a porting bug on hosts like 64-bit HP-UX, where
18443 socklen_t is wider than int (Bug#8277).
18444 (Fmake_network_process, server_accept_connection):
18445 (wait_reading_process_output, read_process_output):
18446 Likewise.
18447
18448 * process.c: Rename or move locals to avoid shadowing.
18449 (list_processes_1, Fmake_network_process):
18450 (read_process_output_error_handler, exec_sentinel_error_handler):
18451 Rename or move locals.
18452 (Fmake_network_process): Define label "retry_connect" only if needed.
18453 (Fnetwork_interface_info): Fix pointer signedness.
18454 (process_send_signal): Add cast to avoid pointer signedness problem.
18455 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18456 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18457
18458 Make tparam.h and terminfo.c consistent.
18459 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18460 Include tparam.h instead, since it declares them.
18461 * cm.h (PC): Remove extern decl; tparam.h now does this.
18462 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18463 * terminfo.c: Include tparam.h, to check interfaces.
18464 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18465 (tparam): Adjust signature to match interface in tparam.h;
18466 this removes some undefined behavior. Check that outstring and len
18467 are zero, which they always are with Emacs.
18468 * tparam.h (PC, BC, UP): New extern decls.
18469
18470 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18471 (xftfont_open): Rename locals to avoid shadowing.
18472
18473 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18474 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18475 (OTF_TAG_SYM): Omit macro if not needed.
18476 (ftfont_list): Remove unused local.
18477 (get_adstyle_property, ftfont_pattern_entity):
18478 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18479 Rename locals to avoid shadowing.
18480
18481 * xfont.c (xfont_list_family): Mark var as initialized.
18482
18483 * xml.c (make_dom): Now static.
18484
18485 * composite.c (composition_compute_stop_pos): Rename local to
18486 avoid shadowing.
18487 (composition_reseat_it): Remove unused locals.
18488 (find_automatic_composition, composition_adjust_point): Likewise.
18489 (composition_update_it): Mark var as initialized.
18490 (find_automatic_composition): Mark vars as initialized,
18491 with a FIXME (Bug#8290).
18492
18493 character.h: Rename locals to avoid shadowing.
18494 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18495 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18496 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18497 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18498 to avoid shadowing.
18499
18500 * textprop.c (property_change_between_p): Remove; unused.
18501
18502 * intervals.c (interval_start_pos): Now static.
18503
18504 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18505
18506 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18507 Rename locals to avoid shadowing.
18508
18509 * sound.c (wav_play, au_play, Fplay_sound_internal):
18510 Fix pointer signedness.
18511 (alsa_choose_format): Remove unused local var.
18512 (wav_play): Initialize a variable to 0, to prevent undefined
18513 behavior (Bug#8278).
18514
18515 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18516
18517 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18518
18519 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18520 clobbering (Bug#8298).
18521 * sysdep.c (sys_subshell): Likewise.
18522 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18523
18524 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18525 This should get cleaned up, so that child_setup has the
18526 same signature on all platforms.
18527
18528 * callproc.c (call_process_cleanup): Now static.
18529 (relocate_fd): Rename locals to avoid shadowing.
18530
18531 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18532
18533 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18534 not to be necessary, and produces flickering.
18535
18536 2011-03-20 Glenn Morris <rgm@gnu.org>
18537
18538 * config.in: Remove file.
18539
18540 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18541
18542 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18543 are now in src/globals.h.
18544 (syms_of_minibuf): Remove spurious & from previous change.
18545
18546 2011-03-20 Leo Liu <sdl.web@gmail.com>
18547
18548 * minibuf.c (completing-read-function): New variable.
18549 (completing-read-default): Rename from completing-read.
18550 (completing-read): Call completing-read-function.
18551
18552 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18553
18554 * xfaces.c (Fx_load_color_file):
18555 Read color file from absolute filename (bug#8250).
18556
18557 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18558
18559 * makefile.w32-in: Update dependencies.
18560
18561 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18562
18563 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18564
18565 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18566
18567 Fix more problems found by GCC 4.5.2's static checks.
18568
18569 * process.c (make_serial_process_unwind, send_process_trap):
18570 (sigchld_handler): Now static.
18571
18572 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18573 That way, the code declares only the vars that it needs.
18574 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18575 * s/cygwin.h (PTY_ITERATION): Likewise.
18576 * s/darwin.h (PTY_ITERATION): Likewise.
18577 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18578
18579 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18580 * process.c (allocate_pty): Don't declare stb unless it's needed.
18581
18582 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18583 (CONSTANTLIM): Remove; unused.
18584 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18585 Define only if needed.
18586
18587 * unexelf.c (unexec): Name an expression,
18588 to avoid gcc -Wbad-function-cast warning.
18589 Use a different way to cause a compilation error if anyone uses
18590 n rather than nn, a way that does not involve shadowing.
18591 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18592
18593 * deps.mk (unexalpha.o): Remove; unused.
18594
18595 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18596 * unexec.h: New file.
18597 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18598 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18599 Depend on unexec.h.
18600 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18601 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18602 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18603 Change as necessary to match prototype in unexec.h.
18604
18605 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18606 shadowing.
18607 (back_comment, skip_chars): Mark vars as initialized.
18608
18609 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18610 Rename locals to avoid shadowing.
18611
18612 * lread.c (read1): Rewrite so as not to use empty "else".
18613 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18614
18615 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18616
18617 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18618 warning when compiling print.c.
18619
18620 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18621 instead of using an uninitialized var.
18622 (font_sort_entities): Mark var as initialized.
18623
18624 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18625
18626 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18627 pointers to constants.
18628 (font_parse_fcname): Remove unused vars.
18629 (font_delete_unmatched): Now static.
18630 (font_get_spec): Remove; unused.
18631 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18632 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18633 Rename or move locals to avoid shadowing.
18634
18635 * fns.c (require_nesting_list, require_unwind): Now static.
18636 (Ffillarray): Rename locals to avoid shadowing.
18637
18638 * floatfns.c (domain_error2): Define only if needed.
18639 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18640
18641 * alloc.c (mark_backtrace): Move decl from here ...
18642 * lisp.h: ... to here, so that it can be checked.
18643
18644 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18645 (Fdefvar): Rewrite so as not to use empty "else".
18646 (lisp_indirect_variable): Name an expression,
18647 to avoid gcc -Wbad-function-cast warning.
18648 (Fdefvar): Rename locals to avoid shadowing.
18649
18650 * callint.c (quotify_arg, quotify_args): Now static.
18651 (Fcall_interactively): Rename locals to avoid shadowing.
18652 Use const pointer when appropriate.
18653
18654 * lisp.h (get_system_name, get_operating_system_release):
18655 Move decls here, to check interfaces.
18656 * process.c (get_operating_system_release): Move decl to lisp.h.
18657 * xrdb.c (get_system_name): Likewise.
18658 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18659 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18660 some of which prompt warnings from gcc -Wbad-function-cast.
18661 (Fformat_time_string, Fencode_time, Finsert_char):
18662 (Ftranslate_region_internal, Fformat):
18663 Rename or remove local vars to avoid shadowing.
18664 (Ftranslate_region_internal): Mark var as initialized.
18665
18666 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18667 avoid shadowing.
18668
18669 * lisp.h (eassert): Check that the argument compiles, even if
18670 ENABLE_CHECKING is not defined.
18671
18672 * data.c (Findirect_variable): Name an expression, to avoid
18673 gcc -Wbad-function-cast warning.
18674 (default_value, arithcompare, arith_driver, arith_error): Now static.
18675 (store_symval_forwarding): Rename local to avoid shadowing.
18676 (Fmake_variable_buffer_local, Fmake_local_variable):
18677 Mark variables as initialized.
18678 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18679
18680 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18681 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18682 Rename locals to avoid shadowing.
18683 (mark_stack): Move local variables into the #ifdef region where
18684 they're used.
18685 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18686 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18687 needed otherwise.
18688 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18689 (GC_STRING_CHARS): Remove; not used.
18690 (Fmemory_limit): Cast sbrk's returned value to char *.
18691
18692 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18693 avoids undefined behavior in theory.
18694
18695 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18696
18697 Use functions, not macros, for up- and down-casing (Bug#8254).
18698 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18699 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18700 to use the following functions instead of these macros.
18701 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18702 EMACS_INT, since callers assume the returned value fits in int.
18703 (upcase1): Likewise, for UPCASE_TABLE.
18704 (uppercasep, lowercasep, upcase): New static inline functions.
18705 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18706 the race-condition problem in the old DOWNCASE.
18707
18708 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18709 Rename locals to avoid shadowing.
18710 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18711 (regex_compile, re_search_2, re_match_2_internal):
18712 Remove unused local vars.
18713 (FREE_VAR): Rewrite so as not to use empty "else",
18714 which gcc can warn about.
18715 (regex_compile, re_match_2_internal): Mark locals as initialized.
18716 (RETALLOC_IF): Define only if needed.
18717 (WORDCHAR_P): Likewise. This one is never needed, but is used
18718 only in a comment talking about a compiler bug, so put inside
18719 the #if 0 of that comment.
18720 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18721 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18722 Remove; unused.
18723
18724 * search.c (boyer_moore): Rename locals to avoid shadowing.
18725 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18726 (PREV_CHAR_BOUNDARY): Likewise.
18727
18728 * search.c (simple_search): Remove unused var.
18729
18730 * dired.c (compile_pattern): Move decl from here ...
18731 * lisp.h: ... to here, so that it can be checked.
18732 (struct re_registers): New forward decl.
18733
18734 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18735
18736 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18737 All uses changed.
18738 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18739 Rename locals to avoid shadowing.
18740 (Fvertical_motion): Mark locals as initialized.
18741
18742 * casefiddle.c (casify_object, casify_region): Now static.
18743 (casify_region): Mark local as initialized.
18744
18745 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18746
18747 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18748 New macros, so that the caller can use some names other than
18749 gcpro1, gcpro2, etc.
18750 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18751 of the new macros.
18752 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18753 argument, for consistency with GCPRO2_VAR, etc: it is now the
18754 prefix of the variable, not the variable itself. All uses
18755 changed.
18756 * dired.c (directory_files_internal, file_name_completion):
18757 Rename locals to avoid shadowing.
18758
18759 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18760 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18761 dired.c's scmp function, had undefined behavior.
18762 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18763 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18764 * buffer.h: ... to here, because these macros use current_buffer,
18765 and the new implementation with inline functions needs to have
18766 current_buffer in scope now, rather than later when the macros
18767 are used.
18768 (downcase, upcase1): New static inline functions.
18769 (DOWNCASE, UPCASE1): Reimplement using these functions.
18770 This avoids undefined behavior in expressions like
18771 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18772 from race conditions in accessing the global variables
18773 case_temp1 and case_temp2.
18774 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18775 * lisp.h (case_temp1, case_temp2): Remove their decls.
18776 * character.h (ASCII_CHAR_P): Move from here ...
18777 * lisp.h: ... to here, so that the inline functions mentioned
18778 above can use them.
18779
18780 * dired.c (directory_files_internal_unwind): Now static.
18781
18782 * fileio.c (file_name_as_directory, directory_file_name):
18783 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18784 Now static.
18785 (file_name_as_directory): Use const pointers when appropriate.
18786 (Fexpand_file_name): Likewise. In particular, newdir might
18787 point at constant storage, so make it a const pointer.
18788 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18789 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18790 signedness issues.
18791 (Fset_file_times, Finsert_file_contents, auto_save_error):
18792 Rename locals to avoid shadowing.
18793
18794 * minibuf.c (choose_minibuf_frame_1): Now static.
18795 (Ftry_completion, Fall_completions): Rename or remove locals
18796 to avoid shadowing.
18797
18798 * marker.c (bytepos_to_charpos): Remove; unused.
18799
18800 * lisp.h (verify_bytepos, count_markers): New decls,
18801 so that gcc does not warn that these functions aren't declared.
18802
18803 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18804 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18805 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18806 (copy_text): Remove unused local var.
18807
18808 * filelock.c (within_one_second): Now static.
18809 (lock_file_1): Rename local to avoid shadowing.
18810
18811 * buffer.c (fix_overlays_before): Mark locals as initialized.
18812 (fix_start_end_in_overlays): Likewise. This function should be
18813 simplified by using pointers-to-pointers, but that's a different
18814 matter.
18815 (switch_to_buffer_1): Now static.
18816 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18817 (report_overlay_modification): Rename locals to avoid shadowing.
18818
18819 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18820 Fix pointer signedness issue.
18821 (sys_subshell): Mark local as volatile if checking for lint,
18822 to suppress a gcc -Wclobbered warning that does not seem to be right.
18823 (MAXPATHLEN): Define only if needed.
18824
18825 * process.c (serial_open, serial_configure): Move decls from here ...
18826 * systty.h: ... to here, so that they can be checked.
18827
18828 * fns.c (get_random, seed_random): Move extern decls from here ...
18829 * lisp.h: ... to here, so that they can be checked.
18830
18831 * sysdep.c (reset_io): Now static.
18832 (wait_for_termination_signal): Remove; unused.
18833
18834 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18835 (copy_keymap_item, append_key, push_text_char_description):
18836 Now static.
18837 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18838 (DENSE_TABLE_SIZE): Remove; unused.
18839 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18840 (describe_map_tree):
18841 Rename locals to avoid shadowing.
18842
18843 * keyboard.c: Declare functions static if they are not used elsewhere.
18844 (echo_char, echo_dash, cmd_error, top_level_2):
18845 (poll_for_input, handle_async_input): Now static.
18846 (read_char, kbd_buffer_get_event, make_lispy_position):
18847 (make_lispy_event, make_lispy_movement, apply_modifiers):
18848 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18849 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18850 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18851 (read_key_sequence, read_char): Mark locals as initialized.
18852 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18853
18854 * keyboard.h (make_ctrl_char): New decl.
18855 (mark_kboards): Move decl here ...
18856 * alloc.c (mark_kboards): ... from here.
18857
18858 * lisp.h (force_auto_save_soon): New decl.
18859
18860 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18861 (DEFINE_DUMMY_FUNCTION): New macro.
18862 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18863 Use it.
18864 (main): Add casts to avoid warnings
18865 if GCC considers string literals to be constants.
18866
18867 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18868
18869 * dbusbind.c: Pointer signedness fixes.
18870 (xd_signature, xd_append_arg, xd_initialize):
18871 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18872 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18873 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18874 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18875
18876 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18877 if GCC considers string literals to be constants.
18878 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18879
18880 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18881
18882 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18883 (print_preprocess, print_object): New macro to fix last change.
18884
18885 * print.c (print_preprocess): Don't forget font objects.
18886
18887 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18888
18889 * emacs.c (USAGE3): Doc fixes.
18890
18891 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18892
18893 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18894 structure.
18895
18896 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18897
18898 * lisp.h (VWindow_system, Qfile_name_history):
18899 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18900 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18901 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18902
18903 * w32select.c: Don't #include "keyboard.h".
18904 (run_protected): Add extern declaration for waiting_for_input.
18905
18906 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18907 * w32console.c (detect_input_pending, read_input_pending)
18908 (encode_terminal_code):
18909 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18910 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18911 (w32_system_caret_y, Qfile_name_history):
18912 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18913 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18914 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18915 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18916 * w32proc.c (Qlocal, report_file_error):
18917 * w32term.c (Vwindow_system, updating_frame):
18918 * w32uniscribe.c (initialized, uniscribe_font_driver):
18919 Remove unneeded extern declarations.
18920
18921 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18922
18923 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18924
18925 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18926
18927 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18928 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18929 These macros can no longer be used for assignment.
18930
18931 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18932 Assign struct members directly, instead of using BUF_BEGV etc.
18933 (record_buffer_markers, fetch_buffer_markers): New functions for
18934 recording and fetching special buffer markers.
18935 (set_buffer_internal_1, set_buffer_temp): Use them.
18936
18937 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18938
18939 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18940
18941 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18942 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18943
18944 * xdisp.c (hscroll_window_tree):
18945 (reconsider_clip_changes): Use PT instead of BUF_PT.
18946
18947 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18948
18949 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18950 $(EMACS_ROOT)/lib/intprops.h.
18951
18952 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18953
18954 Fix more problems found by GCC 4.5.2's static checks.
18955
18956 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18957 to unsigned char * to avoid compiler diagnostic.
18958 (xg_free_frame_widgets): Make it clear that a local variable is
18959 needed only if USE_GTK_TOOLTIP.
18960 (gdk_window_get_screen): Make it clear that this macro is needed
18961 only if USE_GTK_TOOLTIP.
18962 (int_gtk_range_get_value): New function, which avoids a diagnostic
18963 from gcc -Wbad-function-cast.
18964 (xg_set_toolkit_scroll_bar_thumb): Use it.
18965 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18966 diagnostic from gcc -Wbad-function-cast.
18967 (get_utf8_string, xg_get_file_with_chooser):
18968 Rename locals to avoid shadowing.
18969 (create_dialog): Move locals to avoid shadowing.
18970
18971 * xgselect.c (xg_select): Remove unused var.
18972
18973 * image.c (four_corners_best): Mark locals as initialized.
18974 (gif_load): Initialize transparent_p to zero (Bug#8238).
18975 Mark another local as initialized.
18976 (my_png_error, my_error_exit): Mark with NO_RETURN.
18977
18978 * image.c (clear_image_cache): Now static.
18979 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18980 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18981 (x_edge_detection): Remove unnecessary cast that
18982 gcc -Wbad-function-cast diagnoses.
18983 (gif_load): Fix pointer signedness.
18984 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18985 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18986
18987 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18988
18989 Improve quality of tests for time stamp overflow.
18990 For example, without this patch (encode-time 0 0 0 1 1
18991 1152921504606846976) returns the obviously-bogus value (-948597
18992 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18993 reports time overflow. See
18994 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18995 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18996 * editfns.c: Include limits.h and intprops.h.
18997 (TIME_T_MIN, TIME_T_MAX): New macros.
18998 (time_overflow): Move earlier, to before first use.
18999 (hi_time, lo_time): New functions, for an accurate test for
19000 out-of-range times.
19001 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19002 (Fget_internal_run_time): Don't assume time_t fits in int.
19003 (make_time): Use list2 instead of Fcons twice.
19004 (Fdecode_time): More accurate test for out-of-range times.
19005 (check_tm_member): New function.
19006 (Fencode_time): Use it, to test for out-of-range times.
19007 (lisp_time_argument): Don't rely on undefined left-shift and
19008 right-shift behavior when checking for time stamp overflow.
19009
19010 * editfns.c (time_overflow): New function, refactoring common code.
19011 (Fformat_time_string, Fdecode_time, Fencode_time):
19012 (Fcurrent_time_string): Use it.
19013
19014 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19015 * dired.c (make_time): Move to ...
19016 * editfns.c (make_time): ... here.
19017 * systime.h: Note the move.
19018
19019 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19020
19021 * fringe.c (update_window_fringes): Remove unused variables.
19022
19023 * unexmacosx.c (copy_data_segment): Also copy __got section.
19024 (Bug#8223)
19025
19026 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19027
19028 * termcap.c [MSDOS]: Include "msdos.h".
19029 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19030 Constify `char *' arguments and their references according to
19031 prototypes in tparam.h.
19032
19033 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19034
19035 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19036 Adapt all references accordingly.
19037
19038 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19039
19040 2011-03-11 Tom Tromey <tromey@redhat.com>
19041
19042 * buffer.c (syms_of_buffer): Remove obsolete comment.
19043
19044 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19045
19046 * termhooks.h (encode_terminal_code): Declare prototype.
19047
19048 * msdos.c (encode_terminal_code): Don't declare prototype.
19049
19050 * term.c (encode_terminal_code): Now external again, used by
19051 w32console.c and msdos.c.
19052
19053 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19054 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19055
19056 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19057
19058 Fix some minor problems found by GCC 4.5.2's static checks.
19059
19060 * fringe.c (update_window_fringes): Mark locals as initialized
19061 (Bug#8227).
19062 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19063
19064 * alloc.c (mark_fringe_data): Move decl from here ...
19065 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19066 to check its interface.
19067 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19068
19069 * fontset.c (free_realized_fontset): Now static.
19070 (Fset_fontset_font): Rename local to avoid shadowing.
19071 (fontset_font): Mark local as initialized.
19072 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19073
19074 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19075
19076 * xselect.c (x_disown_buffer_selections): Remove; not used.
19077 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19078 (x_own_selection, Fx_disown_selection_internal): Rename locals
19079 to avoid shadowing.
19080 (x_handle_dnd_message): Remove local to avoid shadowing.
19081
19082 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19083 so that the caller can use some name other than gcpro1.
19084 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19085 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19086 (Fx_backspace_delete_keys_p):
19087 Use them to avoid shadowing, and rename vars to avoid shadowing.
19088 (x_decode_color, x_set_name, x_window): Now static.
19089 (Fx_create_frame): Add braces to silence GCC warning.
19090 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19091 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19092 Remove unused locals.
19093 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19094 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19095 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19096 macros.
19097
19098 * xterm.h (x_mouse_leave): New decl.
19099
19100 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19101 Remove unused functions.
19102 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19103 (x_calc_absolute_position): Now static.
19104 (XTread_socket): Don't define label "out" unless it's used.
19105 Don't declare local "event" unless it's used.
19106 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19107 unless they are used.
19108 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19109 (x_fatal_error_signal): Remove; not used.
19110 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19111 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19112 (x_error_catcher, x_connection_closed, x_error_handler):
19113 (x_error_quitter, xembed_send_message, x_iconify_frame):
19114 (my_log_handler): Rename locals to avoid shadowing.
19115 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19116 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19117
19118 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19119 Rename or move locals to avoid shadowing.
19120 (tty_defined_color, merge_face_heights): Now static.
19121 (free_realized_faces_for_fontset): Remove; not used.
19122 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19123 does not deduce is never used uninitialized.
19124 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19125 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19126
19127 * terminal.c (store_terminal_param): Now static.
19128
19129 * xmenu.c (menu_highlight_callback): Now static.
19130 (set_frame_menubar): Remove unused local.
19131 (xmenu_show): Rename parameter to avoid shadowing.
19132 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19133 since they might point to immutable storage.
19134 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19135 since it's unused otherwise.
19136
19137 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19138 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19139 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19140 avoids a gcc -Wuninitialized diagnostic.
19141 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19142 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19143 does not deduce are never used uninitialized.
19144
19145 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19146
19147 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19148 * window.c (window_loop, size_window):
19149 (run_window_configuration_change_hook, enlarge_window): Likewise.
19150
19151 * window.c (display_buffer): Now static.
19152 (size_window): Mark variables that gcc -Wuninitialized
19153 does not deduce are never used uninitialized.
19154 * window.h (check_all_windows): New decl, to forestall
19155 gcc -Wmissing-prototypes diagnostic.
19156 * dispextern.h (bidi_dump_cached_states): Likewise.
19157
19158 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19159 shadowing.
19160 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19161 Include <limits.h>.
19162 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19163 and to avoid gcc -Wuninitialized warning.
19164 (load_charset_map): Mark variables that gcc -Wuninitialized
19165 does not deduce are never used uninitialized.
19166 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19167
19168 * coding.c (coding_set_source, coding_set_destination):
19169 Use "else { /* comment */ }" rather than "else /* comment */;"
19170 for clarity, and to avoid gcc -Wempty-body warning.
19171 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19172 a block, when the outer 'i' will do.
19173 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19174 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19175 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19176 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19177 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19178 Rename locals to avoid shadowing.
19179 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19180 * coding.c (emacs_mule_char, encode_invocation_designation):
19181 Now static, since they're not used elsewhere.
19182 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19183 (decode_coding_object, encode_coding_object, detect_coding_system):
19184 (decode_coding_emacs_mule): Mark variables that gcc
19185 -Wuninitialized does not deduce are never used uninitialized.
19186 (detect_coding_iso_2022): Initialize a local variable that might
19187 be used uninitialized. Leave a FIXME because it's not clear that
19188 this initialization is needed. (Bug#8211)
19189 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19190 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19191 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19192 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19193 Remove unused macros.
19194
19195 * category.c (hash_get_category_set): Remove unused local var.
19196 (copy_category_table): Now static, since it's not used elsewhere.
19197 * character.c (string_count_byte8): Likewise.
19198
19199 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19200 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19201
19202 * chartab.c (copy_sub_char_table): Now static, since it's not used
19203 elsewhere.
19204 (sub_char_table_ref_and_range, char_table_ref_and_range):
19205 Rename locals to avoid shadowing.
19206 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19207
19208 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19209 (BIDI_BOB): Remove unused macro.
19210
19211 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19212 deduce are never used uninitialized.
19213 * term.c (encode_terminal_code): Likewise.
19214
19215 * term.c (encode_terminal_code): Now static. Remove unused local.
19216
19217 * tparam.h: New file.
19218 * term.c, tparam.h: Include it.
19219 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19220 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19221 Move these decls to tparam.h, and make them agree with what
19222 is actually in tparam.c. The previous trick of using incompatible
19223 decls in different modules does not conform to the C standard.
19224 All callers of tparam changed to use tparam's actual API.
19225 * tparam.c (tparam1, tparam, tgoto):
19226 Use const pointers where appropriate.
19227
19228 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19229 * cm.h (struct cm): Likewise.
19230 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19231 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19232 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19233 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19234 (turn_on_face, init_tty): Likewise.
19235 * termchar.h (struct tty_display_info): Likewise.
19236
19237 * term.c (term_mouse_position): Rename local to avoid shadowing.
19238
19239 * alloc.c (mark_ttys): Move decl from here ...
19240 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19241
19242 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19243
19244 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19245
19246 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19247
19248 * search.c (compile_pattern_1): Remove argument regp, unused since
19249 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19250 (compile_pattern): Don't pass it.
19251
19252 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19253
19254 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19255 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19256 for ! HAVE_GTK3.
19257 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19258
19259 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19260
19261 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19262 gdk_window_get_screen, gdk_window_get_geometry,
19263 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19264 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19265 (xg_get_pixbuf_from_pixmap): New function.
19266 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19267 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19268 Call xg_get_pixbuf_from_pixmap instead of
19269 gdk_pixbuf_get_from_drawable.
19270 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19271 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19272 (xg_check_special_colors): Use GtkStyleContext and its functions
19273 for HAVE_GTK3.
19274 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19275 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19276 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19277 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19278 Call gtk_widget_get_preferred_size.
19279 (xg_frame_resized): gdk_window_get_geometry only takes 5
19280 parameters.
19281 (xg_win_to_widget, xg_event_is_for_menubar):
19282 Call gdk_x11_window_lookup_for_display.
19283 (xg_set_widget_bg): New function.
19284 (delete_cb): New function.
19285 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19286 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19287 (xg_set_background_color): Call xg_set_widget_bg.
19288 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19289 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19290 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19291 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19292 if ! HAVE_GTK3.
19293 (update_frame_tool_bar): Call gtk_widget_hide.
19294 (xg_initialize): Use GDK_KEY_g.
19295
19296 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19297 if ! HAVE_GTK3
19298 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19299
19300 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19301 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19302 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19303
19304 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19305
19306 * w32xfns.c (select_palette): Check success of RealizePalette against
19307 GDI_ERROR, not zero.
19308
19309 See ChangeLog.11 for earlier changes.
19310
19311 ;; Local Variables:
19312 ;; coding: utf-8
19313 ;; End:
19314
19315 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19316
19317 This file is part of GNU Emacs.
19318
19319 GNU Emacs is free software: you can redistribute it and/or modify
19320 it under the terms of the GNU General Public License as published by
19321 the Free Software Foundation, either version 3 of the License, or
19322 (at your option) any later version.
19323
19324 GNU Emacs is distributed in the hope that it will be useful,
19325 but WITHOUT ANY WARRANTY; without even the implied warranty of
19326 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19327 GNU General Public License for more details.
19328
19329 You should have received a copy of the GNU General Public License
19330 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.