Fix bug#12731 in mouse-drag-line.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
69deda53
PE
12012-10-25 Paul Eggert <eggert@cs.ucla.edu>
2
3 Don't assume process IDs fit in int.
4 * emacs.c (shut_down_emacs) [!DOS_NT]:
5 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
6 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
7 Use pid_t, not int, to store process IDs, as 'int'
8 is not wide enough on a few platforms (e.g., AIX and IRIX).
9
7e70a152
KH
102012-10-23 Kenichi Handa <handa@gnu.org>
11
12 The following change is to make face-font-rescale-alist work
13 correctly for non-ASCII fonts.
14
15 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
16 (font_open_for_lface): Handle Vface_font_rescale_alist.
17
49238e7f
CY
182012-10-23 Chong Yidong <cyd@gnu.org>
19
20 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
21
5ec86886
JD
222012-10-21 Jan Djärv <jan.h.d@swipnet.se>
23
ef446959
JD
24 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
25 for screen font.
26 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
27
5ec86886
JD
28 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
29 event (Bug#12681).
30
ee7a418d
GM
312012-10-21 Glenn Morris <rgm@gnu.org>
32
33 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
34
4973679b
PE
352012-10-20 Paul Eggert <eggert@cs.ucla.edu>
36
37 Port to OpenBSD 5.1.
38 * frame.c (Fmouse_position, Fmouse_pixel_position):
39 * xdisp.c (produce_stretch_glyph):
40 Declare local vars only when they're needed.
41 This is clearer and avoids a warning on OpenBSD about unused vars.
42 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
43 This is safer, and avoids OpenBSD warnings about unused vars.
44 * keyboard.c (record_menu_key): Remove unnecessary decl.
45 (poll_timer): Define only if POLL_FOR_INPUT is defined.
46 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
47 as our definition clashes with OpenBSD's.
48 * xfaces.c (load_face_colors, check_lface_attrs)
49 (get_lface_attributes_no_remap, get_lface_attributes)
50 (lface_fully_specified_p, x_supports_face_attributes_p)
51 (tty_supports_face_attributes_p, face_fontset, realize_face)
52 (realize_x_face, realize_tty_face):
53 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
54 merely Lisp_Object *. This is more informative and avoids
55 a warning on OpenBSD about accessing beyond an object's size.
56
c664f463
CY
572012-10-20 Chong Yidong <cyd@gnu.org>
58
59 * lread.c (Fload): Doc fix (Bug#12592).
60
6ec83f92 612012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
62
63 * font.c (Ffont_at): Fix previous change.
64
d2824928
EZ
652012-10-19 Eli Zaretskii <eliz@gnu.org>
66
c052c554
EZ
67 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000. See
68 http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
69 for the reasons.
70
d2824928
EZ
71 * alloc.c (NSTATICS): Decrease to 0x800.
72
f60d391f
SM
732012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
74
75 * fns.c (Fnreverse): Include the problem element when signalling an
76 error (bug#12677).
77
1a9327d5
JD
782012-10-18 Jan Djärv <jan.h.d@swipnet.se>
79
80 * nsterm.m (ns_select): Check writefds before call to
81 FD_ISSET (Bug#12668).
82
14145a1e
DC
832012-10-18 Daniel Colascione <dancol@dancol.org>
84
85 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
86 (staticpro): If we run out of staticpro slots, die with an
87 informative error instead of just calling emacs_abort.
88
1f76f6f5
MR
892012-10-18 Martin Rudalics <rudalics@gmx.at>
90
91 Fix two flaws reported by Dmitry Antipov.
92 * window.c (Ftemp_output_buffer_show): Remove.
93 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
94 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
95
fcf14875
EZ
962012-10-17 Eli Zaretskii <eliz@gnu.org>
97
1f76f6f5
MR
98 * makefile.w32-in ($(BLD)/w32.$(O)):
99 ($(BLD)/vm-limit.$(O)):
100 ($(BLD)/term.$(O)):
101 ($(BLD)/unexw32.$(O)):
102 ($(BLD)/fileio.$(O)):
a68089e4
EZ
103 ($(BLD)/dispnew.$(O)): Update dependencies.
104
105 * w32term.h (w32_initialize_display_info, initialize_w32_display):
106 Add prototypes.
107
108 * w32proc.c: Include ctype.h.
109
110 * w32.h (init_environment, check_windows_init_file)
111 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
112 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
113 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
114 (sys_link): Add prototypes.
115
116 * w32.c: Include w32select.h.
117 (sys_access, e_malloc, sys_select): Add prototypes.
118 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
119
120 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
121
122 * unexw32.c: Include lisp.h and w32.h.
123
124 * term.c [WINDOWSNT]: Include w32term.h.
125
126 * process.c [WINDOWSNT]: Add prototype of sys_select.
127
128 * fileio.c [WINDOWSNT]: Include w32.h.
129
130 * dispnew.c [WINDOWSNT]: Include w32.h.
131
fcf14875
EZ
132 * cygw32.c (Fcygwin_convert_path_to_windows)
133 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
134 Lisp_Object values. (Bug#12661)
135
136 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
137 to Lisp_Object. (Bug#12661)
138
fe0b1ec4
KH
1392012-10-17 Kenichi Handa <handa@gnu.org>
140
141 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
142 invalidate.
143
d556ebf9
DA
1442012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
145
146 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 147 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 148
f0863a54
DA
1492012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
150
151 Do not verify indirection counters of killed buffers (Bug#12579).
152 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
153 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
154
12fbe755
DA
1552012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
156
157 * alloc.c (Fmake_byte_code): Fix typo in comment.
158 * print.c (print_interval): Define as static to match prototype.
159 * indent.c (disptab_matches_widthtab, recompute_width_table):
160 Convert to eassert.
161
61655b89
DA
1622012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
163
164 * editfns.c (get_system_name): Remove.
165 * lisp.h (get_system_name): Remove prototype.
166 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
167 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
168
9520f2f2
DC
1692012-10-15 Daniel Colascione <dancol@dancol.org>
170
171 * dbusbind.c: Add comment explaining reason for previous change.
172
dca778d5
MR
1732012-10-15 Martin Rudalics <rudalics@gmx.at>
174
175 * window.c (Fwindow_end): Rewrite check whether cached position
176 can be used (Bug#12600).
177 (resize_frame_windows, grow_mini_window, shrink_mini_window):
178 Set windows_or_buffers_changed.
179
3e0341b0
DC
1802012-10-15 Daniel Colascione <dancol@dancol.org>
181
182 * dbusbind.c: Fix cygw32 build break when compiling with dbus
183 enabled by undefining the symbol "interface", which the platform
184 headers define to something incompatible.
185
33d4113c
DC
1862012-10-14 Daniel Colascione <dancol@dancol.org>
187
188 * image.c (init_tiff_functions, init_imagemagick_functions)
189 (init_svg_functions): Fix cygw32 build break by using these
190 functions only when WINDOWSNT _and_ HAVE_NTGUI.
191
a36fb15e
JD
1922012-10-14 Jan Djärv <jan.h.d@swipnet.se>
193
194 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
195
537f336d
JD
1962012-10-13 Jan Djärv <jan.h.d@swipnet.se>
197
198 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
199
0ba06a77
KH
2002012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
201
202 * coding.c (detect_coding): Set coding->id before calling
203 this->detector.
204
ce2fe65a
AS
2052012-10-13 Andreas Schwab <schwab@linux-m68k.org>
206
207 * fileio.c: Formatting fixes.
208
d6453ce4
PE
2092012-10-13 Paul Eggert <eggert@cs.ucla.edu>
210
211 Fix some stat-related races.
212 * fileio.c (Fwrite_region): Avoid race condition if a file is
213 removed or renamed by some other process immediately after Emacs
214 writes it but before Emacs stats it. Do not assume that stat (or
215 fstat) succeeds.
216 * image.c (slurp_file): Resolve the file name with fopen + fstat
217 rather than stat + fopen.
218 (pbm_read_file) [0]: Remove unused code with stat race.
219 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
220 Remove ineffective code with stat race.
221
06485aa8
SM
2222012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
223
224 * doc.c (get_doc_string): Don't signal an error if the file is missing.
225
167e3640
JD
2262012-10-12 Jan Djärv <jan.h.d@swipnet.se>
227
228 * nsterm.m (hold_event_q): New static variable.
229 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
230 ! q_event_ptr.
231 (hold_event): New function.
232 (ns_read_socket): If hold_event_q have events, store them and
233 return (Bug#12384).
234 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
235 is zero (Bug#12384).
236
c40239df
JB
2372012-10-12 Juanma Barranquero <lekktu@gmail.com>
238
239 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
240
bb385a92
EZ
2412012-10-12 Eli Zaretskii <eliz@gnu.org>
242
2a9f1099
EZ
243 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
244
bb385a92
EZ
245 * fileio.c (check_existing): New function.
246 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
247 instead of calling 'stat', when what's needed is to check whether
248 a file exists. This avoids expensive system calls on MS-Windows.
249 (Bug#12587)
250
8599b23a 251 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
252
253 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
254 determine whether a file exists and is not a directory.
255
256 * lisp.h (check_existing): Add prototype.
257
2b9c2e68
JD
2582012-10-12 Jan Djärv <jan.h.d@swipnet.se>
259
260 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
261
81749a23
GM
2622012-10-12 Glenn Morris <rgm@gnu.org>
263
264 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
265
5253a5fd
SM
2662012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
267
389a94a5
SM
268 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
269
5253a5fd
SM
270 * eval.c (Fautoload): Remember previous autoload status in load-history.
271
7cded46f
PE
2722012-10-11 Paul Eggert <eggert@cs.ucla.edu>
273
274 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
275 * lread.c (load_each_byte, new_backquote_flag, readchar)
276 (read_filtered_event, lisp_file_lexically_bound_p)
277 (safe_to_load_version, Fload, complete_filename_p, openp)
278 (build_load_history, readevalloop, read_escape, read1)
279 (string_to_number, read_vector, read_list):
280 * macros.c (Fstart_kbd_macro):
281 * marker.c (CONSIDER):
282 * menu.c (parse_single_submenu, digest_single_submenu)
283 (find_and_return_menu_selection, Fx_popup_menu):
284 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
285 (Ftry_completion):
286 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
287 (ns_menu_show):
288 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
289 (xmenu_show, xdialog_show):
290 Use bool for booleans.
291 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
292 as it's not a predicate. All uses changed. Omit unnecessary
293 buffer termination.
294
549c3414
DA
2952012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
296
297 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
298 (save_excursion_restore): Do not restore mark if it was not saved.
299
e85aafe7
PE
3002012-10-11 Paul Eggert <eggert@cs.ucla.edu>
301
fd2f90cf
PE
302 * marker.c (cached_modiff): EMACS_INT, not int.
303
c1af190b
PE
304 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
305 instead of having a wrong decl.
e85aafe7
PE
306 * nsmenu.m (waiting_for_input): Remove wrong decl.
307
e738ca56
PE
3082012-10-10 Paul Eggert <eggert@cs.ucla.edu>
309
9fa1de30
PE
310 keyboard.c, keymap.c: Use bool for booleans.
311 * dispnew.c (sit_for): Distinguish between 3-way display_option
312 and boolean do_display.
313 * keyboard.c (single_kboard, this_command_key_count_reset)
314 (waiting_for_input, echoing, immediate_quit, input_pending)
315 (interrupt_input, interrupts_deferred, pop_kboard)
316 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
317 (command_loop_1, adjust_point_for_property)
318 (safe_run_hooks_error, input_polling_used, read_char):
319 (help_char_p, readable_events, kbd_buffer_events_waiting)
320 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
321 (lucid_event_type_list_p, get_input_pending):
322 (gobble_input, menu_separator_name_p, menu_bar_item)
323 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
324 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
325 (keyremap_step, test_undefined, read_key_sequence)
326 (detect_input_pending, detect_input_pending_ignore_squeezables)
327 (detect_input_pending_run_timers, requeued_events_pending_p)
328 (quit_throw_to_read_char, Fset_input_interrupt_mode):
329 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
330 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
331 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
332 (accessible_keymaps_1, Fkey_description, push_key_description):
333 (shadow_lookup, struct where_is_internal_data)
334 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
335 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
336 (describe_map, describe_vector):
337 * menu.c (single_menu_item):
338 * nsmenu.m (ns_update_menubar):
339 * process.c (wait_reading_process_output):
340 * search.c (scan_buffer, scan_newline):
341 Use bool for boolean.
342 * keyboard.c (timers_run, swallow_events)
343 (detect_input_pending_run_timers):
344 * process.c (wait_reading_process_output):
345 Use unsigned for counter where wraparound-on-overflow is desired,
346 since unsigned is guaranteed to have that behavior and signed is not.
347 (read_char): Use ptrdiff_t for string length.
348 (get_input_pending): Remove first argument, since it was always
349 the same pointer-to-int (now pointer-to-boolean) &input_pending,
350 and behave as if it had that value. Return new value of
351 input_pending. All callers changed.
352 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
353 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
354 a string length.
355 * keymap.c (push_key_description): Omit last arg, which was always 1.
356 All callers changed.
357
e738ca56
PE
358 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
359
29f21cdf
JB
3602012-10-10 Juanma Barranquero <lekktu@gmail.com>
361
362 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
363 ($(BLD)/term.$(O)): Update dependencies.
364
6aea7528
DA
3652012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
366
367 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
368 * lisp.h (enum pvec_type): Adjust comments and omit explicit
369 initializer for PVEC_NORMAL_VECTOR.
370
5f3f57be
PE
3712012-10-10 Paul Eggert <eggert@cs.ucla.edu>
372
373 Clean out old termopts cruft.
374 * termopts.h (flow_control, meta_key): Remove unused decls.
375 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
376 Don't include termopts.h.
377
3e98c68e
DA
3782012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
379
380 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
381
77e344e5
PE
3822012-10-10 Paul Eggert <eggert@cs.ucla.edu>
383
384 * commands.h (immediate_quit): Remove duplicate decl.
385
5683d7cd
JD
3862012-10-09 Jan Djärv <jan.h.d@swipnet.se>
387
388 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
389 caching.
390 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 391 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 392
cf5fc6db
EZ
3932012-10-09 Eli Zaretskii <eliz@gnu.org>
394
b15736e6
EZ
395 * w32fns.c (w32_last_error): Change the return value to DWORD, to
396 match what GetLastError returns. Explain why the function is
397 needed.
398
cf5fc6db
EZ
399 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
400 'is_tooltip_frame', to avoid confusion with its global namesake.
401
f99714ce
DC
4022012-10-08 Daniel Colascione <dancol@dancol.org>
403
404 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
405 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
406 build that caused Emacs to display the hourglass cursor forever.
f99714ce 407
fd59cb29
GM
408 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
409 which is broken under remote desktop, calculate the number of
410 colors available for a display based on the display's number of
411 planes and number of bits per pixel per plane. (bug#10397).
412
62c480c9 4132012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 414
62c480c9
JD
415 * nsfont.m (Vfonts_in_cache): New variable.
416 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
417 are used. Add cached fonts to Vfonts_in_cache.
418 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
419
607446ba
JB
4202012-10-08 Juanma Barranquero <lekktu@gmail.com>
421
fd5125ad
JB
422 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
423 in nt/config.nt.
46979e0b
JB
424 (FONT_H): Define after FRAME_H.
425 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
426 Update dependencies.
fd5125ad 427
607446ba
JB
428 * w32term.c: Remove leftover declaration of keyboard_codepage.
429
b6f4e300
EZ
4302012-10-08 Eli Zaretskii <eliz@gnu.org>
431
c54ebba4
EZ
432 * makefile.w32-in (FONT_H): Add $(FRAME_H).
433 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
434 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
435 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
436 ($(BLD)/unexw32.$(O)):
437 ($(BLD)/w32.$(O)):
438 ($(BLD)/w32console.$(O)):
439 ($(BLD)/w32fns.$(O)):
440 ($(BLD)/w32heap.$(O)):
441 ($(BLD)/w32menu.$(O)):
15c720a3 442 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 443
b6f4e300
EZ
444 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
445 'const char *'.
446 (x_to_w32_color): Don't modify the argument, modify a copy instead.
447
501199a3
DC
4482012-10-08 Daniel Colascione <dancol@dancol.org>
449
450 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
451 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
452 accidental message numbering hole. Change other messages to
453 match.
454
455 * w32select.h (HAVE_W32SELECT): Remove.
456
457 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 458 w32common.h instead of w32heap.h.
501199a3
DC
459
460 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
461 (get_allocation_unit, get_processor_type, get_w32_major_version)
462 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
463 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
464 (OS_NT, os_subtype, cache_system_info): Move declarations to
465 w32common.
466
467 * w32heap.c: Include w32common.h.
468 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
469 (w32_minor_version, w32_build_number, w32_subtype):
470 Remove duplicate definitions.
501199a3
DC
471
472 * w32fns.c: Include w32common.h; include w32heap.h only in
473 WINDOWSNT.
474
475 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
476 Use `report_file_error' instead of `error' in order to better
477 inform users of what went wrong. Increase NTGUI_UNICODE file
478 dialog box file name length to 32k, the maximum allowed by the NT
479 kernel.
480
481 * w32common.h: New file.
482 (ROUND_UP, ROUND_DOWN, get_page_size)
483 (get_allocation_unit, get_processor_type, get_w32_major_version)
484 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
485 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
486 (OS_NT, os_subtype, cache_system_info): Move here.
487
488 * unexw32.c, unexcw.c: Include w32common.h.
489
490 * emacs.c (main): Use (defined (WINDOWSNT) || defined
491 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
492 to call syms_of_w32select.
493
494 * cygw32.h: Remove obsolete EXFUN declarations.
495
496 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
497
498 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
499 of w32inevt.o from SOME_MACHINE_OBJECTS.
500
93aa5c81
DC
5012012-10-08 Daniel Colascione <dancol@dancol.org>
502
503 * image.c: Permanent fix for JPEG compilation issue --- limit
504 jpeglib `boolean' redefinition to Cygwin builds.
505
d424f3d8
EZ
5062012-10-08 Eli Zaretskii <eliz@gnu.org>
507
8ee4c6ce
EZ
508 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
509
d424f3d8
EZ
510 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
511 Cygwin.
512
e08348a0
DC
5132012-10-08 Daniel Colascione <dancol@dancol.org>
514
515 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
516 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
517 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
518 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
519 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
520 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
521 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
522 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
523 now a supported configuration.
524
525 * Makefile.in: consolidate image variables into LIBIMAGE; add
526 W32_OBJ and W32_LIBS. Compile new files.
527
528 * conf_post.h:
529 (_DebPrint) declare tracing facility for W32 debugging. We need
530 to unify tracing later.
531
532 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
533 unconditional use of W32 Unicode functions. Cygwin runs only on
534 100% Unicode operating systems.
535
536 * cygw32.c: New file. Define Cygwin-specific facilities.
537 (Fcygwin_convert_path_to_windows)
538 (Fcygwin_convert_path_from_windows): New user functions for
539 accessing Cygwin path-munging routines.
540
541 * cygw32.h: New file.
542 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
543 UTF-16LE strings temporarily inside non-Lisp-visible string
544 objects.
545
546 (w32_strerror): Just what it says on the tin.
547
548 * emacs.c: Make the NS fork-then-exec code for daemon-launching
549 also run for Cygwin; both systems have the same problem with using
550 GUI facilities in a forked child. Also call syms_of_cygw32,
551 syms_of_w32select in correct places.
552
553 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
554 needs fork-then-exec for daemon launching.
555
556 * font.h: Include frame.h.
557
558 * image.c: Use the image library cache machinery only when we're
559 compiling for native WINDOWSNT; Cygwin can use shared libraries
560 like any other Unixlike system.
561
562 * keyboard.c: Clarify a comment regarding the input loop.
563
564 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
565 functions directly instead of trying to detect at runtime that our
566 host operating system supports them. We make this change for two
567 reasons: Cygwin lacks support for the multibyte character
568 conversion functions used by the legacy menu code, and Cygwin
569 never needs to rely on non-Unicode APIs.
570
571 * unexw32.c (hinst): Declare extern.
572
573 * w32.c: Change header order;
574 (w32_strerror): Move to w32fns.c because we need it for
575 non-WINDOWSNT builds.
576
577 * w32.h: Add #error macro to make sure we don't include w32.h for
578 Cygwin builds. Remove w32select declarations.
579
580 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 581 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
582
583 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
584 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
585 POSIXy alternative.
586 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
587 (w32_major_version, w32_minor_version, w32_build_number)
588 (os_subtype, sound_type): Define here
589 (w32_defined_color): Make color parameter const for consistency
590 with other _defined_color functions.
591 (w32_createwindow): Unconditionally call w32_init_class instead of
592 doing so only when hprevinst is non-NULL. Plumbing hprevinst
593 through the code is complex and unnecessary because class
594 registration is practically free.
595 (w32_name_of_message): New EMACSDEBUG-only function.
596 (Fset_message_beep): Move here
597 (Fx_open_connection): Require that the display name for Windows be
598 "w32" for consistency, emacsclient disambiguation, and maybe, one
599 day, multi-window-system support.
600 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
601 Cygwin files for W32 GUI facilities, since these clearly don't
602 expect Cygwin names.
603 (_DebPrint): Define.
604 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
605 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
606 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
607 (w32_last_error): Remove.
608
609 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
610
611 * w32heap.c (syspage_mask): Declare here.
612 (cache_system_info): Remove.
613
614 * w32inevt.c (faked_key): Define globally, not statically.
615 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
616 (w32_console_toggle_lock_key): Move to w32fns.c.
617
618 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
619
620 * w32proc.c (_DebPrint): Move to w32fns.c.
621 * w32select.c: Include string.h, stdio.h for Cygwin.
622 * w32select.h: New File.
623
624 * w32term.c: Include io.h for non-CYGWIN builds; needed for
625 get_osfhandle.
626 (w32_message_fd): New variable. Under Cygwin, holds the file
627 descriptor the system used to tell us about pending thread
628 messages.
629
630 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
631 that prevented compilation under non-WINDOWSNT systems.
632
633 (w32_initialize): Open /dev/windows and assign it to
634 w32_message_fd. Provide w32 feature.
635
636 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
637 (WM_EMACS_INPUT_READY): add.
638 (prepend_msg, w32_message_fd): Declare globally.
639
640 * w32xfns.c:
641 (keyboard_handle): Use only when WINDOWSNT.
642 (notify_msg_ready): New function. Posts a message to the main
643 thread's message queue under CYGWIN, which wakes up the main
644 thread from select(2) by making the /dev/windows file descriptor
645 ready. Under WINDOWSNT, it sets an event the same way the old
646 code did.
647
648 (post, prepend_msg): Actually call notify_msg_ready instead of
649 setting the input event directly.
650
98daa893
EZ
6512012-10-07 Eli Zaretskii <eliz@gnu.org>
652
653 * ralloc.c (relinquish): If a heap is ready to be relinquished,
654 but it still has blocs in it, don't return it to the system,
655 instead of aborting. (Bug#12402)
656
3bc0a2f7
JD
6572012-10-07 Jan Djärv <jan.h.d@swipnet.se>
658
8ad5b73b 659 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 660
335f5ae4
JD
661 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
662 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
663 (syms_of_nsterm): Remove comment about Panther and above for
664 ns-antialias-text.
335f5ae4
JD
665 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
666 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
667 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
668
669 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
670 MAC_OS_X_VERSION_10_4.
671
8ad5b73b
JD
672 * nsmenu.m (fillWithWidgetValue:): Remove code for <
673 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
674
675 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
676
677 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
678 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
679
3bc0a2f7
JD
680 * nsterm.m (ns_in_resize): Remove (Bug#12479).
681 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
682 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
683 Remove ns_in_resize check.
3bc0a2f7
JD
684 (ns_clear_frame_area): Remove resize handle code.
685
686 * nsfns.m (ns_in_resize): Remove.
1f9f395d 687 (x_set_icon_name, ns_set_name, ns_set_name_as_filename): Remove
8ad5b73b 688 ns_in_resize check.
3bc0a2f7 689
c622b48f
PE
6902012-10-07 Paul Eggert <eggert@cs.ucla.edu>
691
692 Improve sys_siglist detection.
693 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
694 defined as a macro, as is done in Solaris.
695 (sys_siglist_entries): New macro.
696 (save_strsignal): Use it.
697 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
698 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
699
04fafa46
JD
7002012-10-06 Jan Djärv <jan.h.d@swipnet.se>
701
702 * nsfns.m (Fx_create_frame): Call x_default_parameter with
703 fullscreen/Fullscreen.
704
705 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
706 tobar_height is new.
707
708 * nsterm.m (x_make_frame_visible): Check for fullscreen.
709 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
710 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
711 (windowDidResize:): Check for correct window if old style fullscreen.
712 Capitalize word in comment. Remove incorrect comment.
713 (initFrameFromEmacs:): tbar_height renamed tibar_height.
714 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
715 error in drawing background.
1f9f395d 716 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
717 Set toolbar values to zero, save old height in tobar_height.
718 Restore tool bar height when leaving fullscreen.
719 (canBecomeMainWindow): New function.
720
c6e21c03
PE
7212012-10-06 Paul Eggert <eggert@cs.ucla.edu>
722
723 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
724
0d9f584b
EZ
7252012-10-05 Eli Zaretskii <eliz@gnu.org>
726
a65fbb5f
EZ
727 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
728
0d9f584b 729 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
730 that time stamps of directories could also be changed.
731 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
732 FILE_WRITE_ATTRIBUTES access rights.
733
734 * fileio.c (Fset_file_times): Special-case ignoring errors for
735 directories only on MSDOS, not on MS-Windows.
736
e8757f09 7372012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
738
739 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
740
7604f298
EZ
7412012-10-04 Eli Zaretskii <eliz@gnu.org>
742
743 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
744 see whether CreateFile failed.
745
88d69b7d
PE
7462012-10-04 Paul Eggert <eggert@cs.ucla.edu>
747
748 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
749 to avoid similar races.
750 * keyboard.c (pending_signals): Now bool, not int.
751
7509f454
PE
752 Port timers to OpenBSD, plus check for timer failures.
753 OpenBSD problem reported by Han Boetes.
754 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
755 and/or setitimer.
756 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
757 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
758 like OpenBSD, which has timer_settime but does not declare it.
759 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
760 whether to use itimerspec-related primitives. All uses of
761 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
762
a3c5c0c5
PE
7632012-10-02 Paul Eggert <eggert@cs.ucla.edu>
764
765 * profiler.c (handle_profiler_signal): Fix a malloc race
766 that caused Emacs to hang on Fedora 17 when profiling Lisp.
767
914e743b
JD
7682012-10-02 Jan Djärv <jan.h.d@swipnet.se>
769
770 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
771
d8ab37a8
EZ
7722012-10-02 Eli Zaretskii <eliz@gnu.org>
773
774 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
775 consistent with the change in return value of 'safe_strsignal'.
776
b3ecad33
PE
7772012-10-02 Paul Eggert <eggert@cs.ucla.edu>
778
0a99eee1
PE
779 Prefer plain 'static' to 'static inline' (Bug#12541).
780 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
781 (bidi_set_sor_type, bidi_push_embedding_level)
782 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
783 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
784 (bidi_cache_search, bidi_cache_ensure_space)
785 (bidi_cache_iterator_state, bidi_cache_find)
786 (bidi_peek_at_next_level, bidi_set_paragraph_end)
787 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
788 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
789 Now 'static', not 'static inline'.
790
b3ecad33
PE
791 Count overruns when profiling; change units to ns.
792 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
793 Give extra weight to samples after overruns, to attempt to count
794 the time more accurately.
795 (setup_cpu_timer): Change sampling interval units from ms to ns, since
796 the underlying primitives nominally do ns.
797 (Fprofiler_cpu_start): Document the change. Mention that
798 the sampling intervals are only approximate.
799
090cf9db
SM
8002012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
801
802 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
803
804 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
805 case for the special 0 coding-system.
806
807 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
808 (Fmake_overlay): Remove redundant tests.
64edc777 809 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 810
81550bf4
JB
8112012-10-02 Juanma Barranquero <lekktu@gmail.com>
812
813 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
814 Update dependencies.
815
aa1ba90e
PE
8162012-10-01 Paul Eggert <eggert@cs.ucla.edu>
817
818 Fix a malloc race condition involving strsignal.
819 A signal can arrive in the middle of a malloc, and Emacs's signal
820 handler can invoke strsignal, which can invoke malloc, which is
821 not portable. This race condition bug makes Emacs hang on GNU/Linux.
822 Fix it by altering the signal handler so that it does not invoke
823 strsignal.
824 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
825 * process.c (status_message): Use const pointer, in case strsignal
826 is #defined to safe_strsignal.
827 * sysdep.c (sys_siglist, init_signals): Always define and
828 initialize a substitute sys_siglist if the system does not define
829 one, even if HAVE_STRSIGNAL.
830 (safe_strsignal): Rename from strsignal. Always define,
831 using sys_siglist. Return a const pointer.
832 * syssignal.h (safe_strsignal): New decl.
833 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
834
ace917bd
EZ
8352012-10-01 Eli Zaretskii <eliz@gnu.org>
836
837 * w32proc.c (timer_loop): Fix code that waits for timer
838 expiration, to avoid high CPU usage.
839
9eb71b9c
SM
8402012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
841
842 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
843 (sweep_weak_table): Remove redundant prototypes.
844
b3317662
FP
8452012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
846
847 * emacs.c: Move the inclusion of TERM_HEADER after including
848 windows.h on WINDOWSNT. This avoids compilation problems with
849 MSVC.
850
f0e5f225
EZ
8512012-10-01 Eli Zaretskii <eliz@gnu.org>
852
2d7d1608
EZ
853 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
854 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
855 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
856 as the previous version used 'void *'.
857
858 * ralloc.c (ROUNDUP): Fix last change.
859 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
860 'size_t'.
861
f0e5f225
EZ
862 * w32proc.c <disable_itimers>: New static flag.
863 (init_timers): Initialize it to zero, after creating the critical
864 sections used by the timer threads.
865 (term_timers): Set to 1 before deleting the critical sections.
866 (getitimer, setitimer): If disable_itimers is non-zero, return an
867 error indication without doing anything. Reported by Fabrice
868 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
869 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
870 return results.
871 [!HAVE_SETITIMER]: Behave as the previous version that didn't
872 support timers.
f0e5f225
EZ
873
874 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
875 term_ntproc after all the other bookkeeping, to get timers working
876 as long as possible.
877
82ef37c1
PE
8782012-10-01 Paul Eggert <eggert@cs.ucla.edu>
879
b3a4c387
PE
880 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
881 Suggested by Juri Linkov in
882 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
883
b0ab8123
PE
884 Prefer plain 'static' to 'static inline' (Bug#12541).
885 With static functions, modern compilers inline pretty well by
886 themselves; advice from programmers often hurts as much as it helps.
887 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
888 this change shrinks the text size of the Emacs executable by 1.1%
889 without affecting CPU significantly in my benchmark.
890 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
891 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
892 (mark_maybe_object, mark_maybe_pointer, bounded_number):
893 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
894 (bset_auto_fill_function, bset_auto_save_file_format)
895 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
896 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
897 (bset_cache_long_line_scans, bset_case_fold_search)
898 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
899 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
900 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
901 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
902 (bset_header_line_format, bset_indicate_buffer_boundaries)
903 (bset_indicate_empty_lines, bset_invisibility_spec)
904 (bset_left_fringe_width, bset_major_mode, bset_mark)
905 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
906 (bset_name, bset_overwrite_mode, bset_pt_marker)
907 (bset_right_fringe_width, bset_save_length)
908 (bset_scroll_bar_width, bset_scroll_down_aggressively)
909 (bset_scroll_up_aggressively, bset_selective_display)
910 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
911 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
912 (set_buffer_overlays_after):
913 * category.c (bset_category_table):
914 * charset.c (read_hex):
915 * coding.c (produce_composition, produce_charset)
916 (handle_composition_annotation, handle_charset_annotation)
917 (char_encodable_p):
918 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
919 (assign_row, set_frame_matrix_frame, make_current)
920 (add_row_entry):
921 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
922 * fns.c (maybe_resize_hash_table):
923 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
924 * gmalloc.c (register_heapinfo):
925 * image.c (lookup_image_type):
926 * intervals.c (set_interval_object, set_interval_left)
927 (set_interval_right, copy_interval_parent, rotate_right)
928 (rotate_left, balance_possible_root_interval):
929 * keyboard.c (kset_echo_string, kset_kbd_queue)
930 (kset_keyboard_translate_table, kset_last_prefix_arg)
931 (kset_last_repeatable_command, kset_local_function_key_map)
932 (kset_overriding_terminal_local_map, kset_real_last_command)
933 (kset_system_key_syms, clear_event, set_prop):
934 * lread.c (digit_to_number):
935 * marker.c (attach_marker, live_buffer, set_marker_internal):
936 * nsterm.m (ns_compute_glyph_string_overhangs):
937 * process.c (pset_buffer, pset_command)
938 (pset_decode_coding_system, pset_decoding_buf)
939 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
940 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
941 (pset_status, pset_tty_name, pset_type, pset_write_queue):
942 * syntax.c (bset_syntax_table, dec_bytepos):
943 * terminal.c (tset_param_alist):
944 * textprop.c (interval_has_some_properties)
945 (interval_has_some_properties_list):
946 * window.c (wset_combination_limit, wset_dedicated)
947 (wset_display_table, wset_hchild, wset_left_fringe_width)
948 (wset_left_margin_cols, wset_new_normal, wset_new_total)
949 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
950 (wset_right_fringe_width, wset_right_margin_cols)
951 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
952 (wset_vertical_scroll_bar_type, wset_window_parameters):
953 * xdisp.c (wset_base_line_number, wset_base_line_pos)
954 (wset_column_number_displayed, wset_region_showing)
955 (window_box_edges, run_window_scroll_functions)
956 (append_glyph_string_lists, prepend_glyph_string_lists)
957 (append_glyph_string, set_glyph_string_background_width)
958 (append_glyph, append_composite_glyph)
959 (take_vertical_position_into_account):
960 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
961 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
962 (lface_hash, lface_same_font_attributes_p, lookup_face):
963 * xml.c (libxml2_loaded_p):
964 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
965 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
966 Now 'static', not 'static inline'.
967
05584c31
PE
968 * bidi.c: Tune.
969 (bidi_copy_it): Do the whole copy with a single memcpy.
970 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
971
86ec63ba
PE
972 Revert the FOLLOW-SYMLINKS change for file-attributes.
973 Doing it right would require several changes to Tramp, and there's
974 not enough time to get that tested before the freeze today.
975 * dired.c (directory_files_internal, Ffile_attributes):
976 Undo last change.
977
82ef37c1
PE
978 * frame.c (x_report_frame_params): Port better to wider ints.
979 Do not assume that EMACS_UINT is the same width as uprintmax_t,
980 or that pointers can be printed in 15 decimal digits.
981 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
982
62aba0d4
FP
9832012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
984
985 Support x64 build on MS-Windows.
986 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
987 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
988 compatibility with x64.
5e4daaf3 989 (x_get_focus_frame): Add prototype.
62aba0d4
FP
990
991 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
992 defining an XRectangle structure.
993
994 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
995 arithmetics for compatibility with x64.
996
997 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
998 compatibility with x64.
999
1000 * w32heap.h: Adjust prototypes and declarations.
1001
1002 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1003 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1004 DWORD, long, and unsigned long, for compatibility with x64.
1005 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1006 (sbrk): Argument is now of type ptrdiff_t.
1007
1008 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1009 less than 0x0500.
1010 (w32_msg_pump): Use WPARAM type for 'result'.
1011
1012 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1013 architecture.
1014 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1015 compatibility with x64.
1016
1017 * vm-limit.c (lim_data): Now size_t.
1018 (check_memory_limits): Adjust prototypes of real_morecore and
1019 __morecore to receive argument of type ptrdiff_t. Use size_t for
1020 five_percent and data_size.
1021
1022 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1023 variables, for compatibility with x64.
1024 (rva_to_section, offset_to_section, relocate_offset)
1025 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1026 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1027 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1028 for compatibility with x64.
1029
1030 * sysdep.c (STDERR_FILENO): Define if not already defined.
1031
1032 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1033 (__morecore): Argument type is now ptrdiff_t.
1034 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1035 (relinquish): Use ptrdiff_t type for 'excess'.
1036 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1037
1038 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1039 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1040 instead of a literal number.
1041
1042 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1043 (min): Define only if not already defined.
1044
1045 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1046 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1047 hosts.
1048
1049 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1050 'bitmaps' is a pointer.
1051
1052 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1053
1054 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1055
e7a2937b
PE
10562012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1057
1058 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1059 * dired.c (directory_files_internal, Ffile_attributes):
1060 New arg follow_symlinks. All uses changed.
1061
b43d62ae
SM
10622012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1063
1064 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1065
c06c382a
EZ
10662012-09-30 Eli Zaretskii <eliz@gnu.org>
1067
1068 Support atimers and CPU profiler via profile.c on MS-Windows.
1069 * w32proc.c (sig_mask, crit_sig): New static variables.
1070 (sys_signal): Support SIGALRM and SIGPROF.
1071 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 1072 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
1073 sigfillset, and sigprocmask are no longer no-ops.
1074 (sigismember): New function.
1075 (struct itimer_data): New definition.
1076 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1077 (crit_prof): New static variables.
1078 (MAX_SINGLE_SLEEP): New definition.
1079 (timer_loop, stop_timer_thread, term_timers, init_timers)
1080 (start_timer_thread, getitimer, setitimer): New functions.
1081 (alarm): No longer a no-op, calls setitimer.
1082
1083 * w32.c (term_ntproc): Call term_timers.
1084 (init_ntproc): Make sure all signals are unblocked at startup, to
1085 erase any traces of dumping. Call init_timers.
1086
1087 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1088 Windows-specific code to display the hourglass mouse pointer is no
1089 longer used.
1090 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1091 to hourglass timer expiration.
1092 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1093 Remove, no longer used.
b43d62ae
SM
1094 (w32_note_current_window, show_hourglass, hide_hourglass):
1095 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
1096 window systems.
1097 (syms_of_w32fns): Don't initialize hourglass_timer.
1098
1099 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1100 WINDOWSNT as well.
1101 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1102
1103 * w32.h (init_timers, term_timers): Add prototypes.
1104
95402d5f
KH
11052012-09-30 Kenichi Handa <handa@gnu.org>
1106
1107 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1108 to the buffer relocation which may be caused by ccl_driver.
1109
dd946752
JD
11102012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1111
d7e642cc
JD
1112 * xfns.c (Fx_file_dialog): Update comment.
1113
1114 * w32fns.c (Fx_file_dialog): Update comment.
1115
1116 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1117 Initialize panel name field if OSX >= 10.6.
1118
1119 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1120
dd946752
JD
1121 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1122
1123 * nsterm.m (NEW_STYLE_FS): New define.
1124 (ns_fullscreen_hook, windowWillEnterFullScreen)
1125 (windowDidEnterFullScreen, windowWillExitFullScreen)
1126 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1127 (setFSValue): New functions.
1128 (EmacsFSWindow): New implementation.
1129 (canBecomeKeyWindow): New function for EmacsFSWindow.
1130 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1131 (dealloc): Release nonfs_window if in fullscreen.
1132 (updateFrameSize:): Call windowDidMove to update top/left.
1133 (windowWillResize:toSize:): Check if frame is still maximized.
1134 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1135 next_maximized, maximized_width, maximized_height and nonfs_window.
1136 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1137 tbar_height.
1138 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 1139 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
1140
1141 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1142 (EmacsView): Add variables for fullscreen.
1143 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1144 (EmacsFSWindow): New interface for fullscreen.
1145
427730eb
JB
11462012-09-30 Juanma Barranquero <lekktu@gmail.com>
1147
1148 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1149
48de8b12
CY
11502012-09-30 Chong Yidong <cyd@gnu.org>
1151
1152 * fns.c (Frandom): Doc fix.
1153
5938d519
MR
11542012-09-30 Martin Rudalics <rudalics@gmx.at>
1155
1156 * window.c (Vwindow_combination_limit): New default value.
1157 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1158
cb5b0266
PE
11592012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1160
1161 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1162 Suggested by Eli Zaretskii in
1163 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1164
84f72efd
EZ
11652012-09-30 Eli Zaretskii <eliz@gnu.org>
1166
1167 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1168 HAVE_TIMER_SETTIME is defined.
1169
9d4dcdc9
PE
11702012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1171
d89460ed
PE
1172 Profiler improvements: more-accurate timers, overflow checks.
1173 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1174 signal.h, setjmp.h. Include systime.h instead.
1175 (saturated_add): New function.
1176 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1177 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1178 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1179 New static vars.
84f72efd 1180 (enum profiler_cpu_running): New enum.
d89460ed
PE
1181 (profiler_cpu_running): Now of that enum type, not bool.
1182 All uses changed to store the new value.
1183 (handle_profiler_signal): Rename from sigprof_handler_1,
1184 for consistency with other handlers. Do not check whether
1185 cpu_log is a hash-table if garbage collecting, since it
1186 doesn't matter in that case.
1187 (deliver_profiler_signal): Rename from sigprof_handler,
1188 for consistency with other handlers.
1189 (setup_cpu_timer): New function, with much of what used to be in
1190 Fprofiler_cpu_start. Check for out-of-range argument.
1191 Prefer timer_settime if available, and prefer
1192 thread cputime clocks, then process cputime clocks, then
1193 monotonic clocks, to the old realtime clock. Use make_timeval
1194 to round more-correctly when falling back to setitimer.
1195 (Fprofiler_cpu_start): Use it.
1196 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1197 Don't assume that passing NULL as the 2nd argument of setitimer
1198 is the same as passing a pointer to all-zero storage.
1199 Ignore SIGPROF afterwards.
1200 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1201 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1202 non-fatal signal handlers. Ignore SIGPROF on startup.
1203 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1204 in profiler.c, since sysdep.c now uses it.
1205
9d4dcdc9
PE
1206 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1207 Suggested by Eli Zaretskii in
1208 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1209
8e5691a0
JB
12102012-09-29 Juanma Barranquero <lekktu@gmail.com>
1211
1212 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1213
e7c1b6ef
SM
12142012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1215
1216 * lisp.h (struct backtrace): Remove indirection for `function' field.
1217 * xdisp.c (redisplay_internal):
1218 * profiler.c (record_backtrace, sigprof_handler_1):
1219 * alloc.c (Fgarbage_collect):
1220 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1221 (Fbacktrace_frame): Adjust accordingly.
1222
e61d39cd 12232012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
1224
1225 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1226 (Frun_hook_with_args_until_failure): Doc fixes.
1227
404043ea
EZ
12282012-09-28 Eli Zaretskii <eliz@gnu.org>
1229
1230 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1231 Qautomatic_redisplay and change the symbol name. All users changed.
1232
704d3f45
TM
12332012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1234
1235 * profiler.c (sigprof_handler): Fix race condition.
1236
757140ff
GM
12372012-09-28 Glenn Morris <rgm@gnu.org>
1238
1239 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1240
a615a3ae
PE
12412012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1242
1243 Check more robustly for timer_settime.
89d17fd0
PE
1244 * Makefile.in (LIB_TIMER_TIME): New macro.
1245 (LIBES): Add it.
a615a3ae
PE
1246 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1247 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1248 call timer_settime.
1249
3670daf7
TM
12502012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1251
1252 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1253
6a586b7f
JB
12542012-09-26 Juanma Barranquero <lekktu@gmail.com>
1255
1256 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1257
41c8bfcf
PE
12582012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1259
1260 * character.h (MAYBE_UNIFY_CHAR): Remove.
1261 * charset.c, charset.h (maybe_unify_char): Now static.
1262 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1263 Since this stuff is now private to charset.c, there's no need for
1264 a public macro and no need to inline by hand.
1265
3a880af4
SM
12662012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1267 Stefan Monnier <monnier@iro.umontreal.ca>
1268 Juanma Barranquero <lekktu@gmail.com>
611b7507 1269
3a880af4
SM
1270 * profiler.c: New file.
1271 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
1272 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1273 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
1274 * emacs.c (main): Call syms_of_profiler.
1275 * alloc.c (Qautomatic_gc): New constant.
1276 (MALLOC_PROBE): New macro.
1277 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1278 (total_bytes_of_live_objects): New function.
1279 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1280 Call malloc_probe for the memory profiler.
1281 (syms_of_alloc): Define Qautomatic_gc.
1282 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1283 race condition.
1284 (struct backtrace): Move definition...
1285 * lisp.h (struct backtrace): ..here.
1286 (Qautomatic_gc, profiler_memory_running): Declare vars.
1287 (malloc_probe, syms_of_profiler): Declare functions.
1288 * xdisp.c (Qautomatic_redisplay): New constant.
1289 (redisplay_internal): Record itself in backtrace_list.
1290 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 1291
5938d519 12922012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
12932012-09-25 Juanma Barranquero <lekktu@gmail.com>
1294
1295 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1296
e26fd2e4
PE
12972012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1298
1299 Prefer POSIX timers if available.
1300 They avoid a race if the timer is too close to the current time.
1301 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1302 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 1303 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 1304
eedec3ee
EZ
13052012-09-25 Eli Zaretskii <eliz@gnu.org>
1306
1307 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1308 CHAR_STRING_ADVANCE.
1309 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1310 STRING_CHAR_ADVANCE.
1311
aa15c6bb
JB
13122012-09-25 Juanma Barranquero <lekktu@gmail.com>
1313
1314 Move Vlibrary_cache to emacs.c and reset before dumping.
1315
1316 * lisp.h (reset_image_types): Declare.
1317 [WINDOWSNT] (Vlibrary_cache): Declare.
1318
1319 * image.c (reset_image_types): New function.
1320
1321 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1322 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1323 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1324
1325 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1326 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1327
1328 * w32.h (Vlibrary_cache): Do not declare.
1329
54d629be
EZ
13302012-09-25 Eli Zaretskii <eliz@gnu.org>
1331
16b22fef
EZ
1332 * w32proc.c (sys_signal): Handle all signals defined by the
1333 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1334 handlers for signals supported by Windows. Don't override
1335 term_ntproc as the handler for SIGABRT.
1336 (sigaction): Rewrite to call sys_signal instead of duplicating its
1337 code.
1338 (sys_kill): Improve commentary.
1339
1340 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1341 consistency with a signature of a signal handler. All callers
1342 changed.
1343 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1344 install term_ntproc as a signal handler for SIGABRT, as that
1345 should be done by the dumped Emacs.
1346
1347 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1348
1349 * w32select.c (term_w32select): Protect against repeated
1350 invocation by setting clipboard_owner to NULL after calling
1351 DestroyWindow.
1352
1353 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1354 and term_ntproc to their modified signatures.
1355
54d629be
EZ
1356 * character.c (char_string, string_char): Remove calls to
1357 MAYBE_UNIFY_CHAR. See the discussion starting at
1358 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1359 for the details.
1360
59f7af81
CY
13612012-09-25 Chong Yidong <cyd@gnu.org>
1362
1363 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1364
22e8cf4a
SM
13652012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1366
1367 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1368 when encountering an unknown bytecode.
1369
578098f3
PE
13702012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1371
1372 image.c, indent.c: Use bool for booleans.
1373 * dispextern.h (struct image_type): Members valid_p, load, init
1374 now return bool, not int. All uses changed.
1375 * image.c: Omit unnecessary static decls.
1376 (x_create_bitmap_mask, x_build_heuristic_mask):
1377 Return void, not int, since callers don't care about the return value.
1378 (x_create_bitmap_mask, define_image_type, valid_image_p)
1379 (struct image_keyword, parse_image_spec, image_spec_value)
1380 (check_image_size, image_background)
1381 (image_background_transparent, x_clear_image_1)
1382 (postprocess_image, lookup_image, x_check_image_size)
1383 (x_create_x_image_and_pixmap, xbm_image_p)
1384 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1385 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1386 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1387 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1388 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1389 (png_image_p, init_png_functions, png_load_body, png_load)
1390 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1391 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1392 (init_gif_functions, gif_load, imagemagick_image_p)
1393 (imagemagick_load_image, imagemagick_load, svg_image_p)
1394 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1395 (gs_load):
1396 * nsimage.m (ns_load_image):
1397 * nsterm.m (ns_defined_color):
1398 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1399 * xfns.c (x_defined_color):
1400 * xterm.c (x_alloc_lighter_color_for_widget)
1401 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1402 (x_alloc_lighter_color):
1403 * indent.c (disptab_matches_widthtab, current_column)
1404 (scan_for_column, string_display_width, indented_beyond_p)
1405 (compute_motion, vmotion, Fvertical_motion):
1406 Use bool for booleans.
1407
a5f2b6ec
CY
14082012-09-24 Chong Yidong <cyd@gnu.org>
1409
1410 * chartab.c (Fset_char_table_default): Obsolete function removed.
1411
18e27ea8
PE
14122012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1413
afea8a8a
PE
1414 Move pid_t related decls out of lisp.h.
1415 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1416 (interruptible_wait_for_termination):
1417 Move these decls from lisp.h to syswait.h, since they use pid_t.
1418 Needed on FreeBSD; see Herbert J. Skuhra in
1419 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1420 * callproc.c: Include syswait.h.
1421
18e27ea8
PE
1422 gnutls.c, gtkutil.c: Use bool for boolean.
1423 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1424 (emacs_gnutls_handle_error):
1425 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1426 (xg_hide_tooltip, xg_create_frame_widgets)
1427 (create_dialog, xg_uses_old_file_dialog)
1428 (xg_get_file_with_chooser, xg_get_file_with_selection)
1429 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1430 (xg_item_label_same_p, xg_update_menubar)
1431 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1432 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1433 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1434 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1435 (update_frame_tool_bar, free_frame_tool_bar):
1436 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1437 * nsmenu.m (ns_update_menubar):
1438 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1439 * xfns.c (Fx_show_tip) [USE_GTK]:
1440 Use bool for boolean.
1441 * gtkutil.c (xg_update_frame_menubar):
1442 * xmenu.c (update_frame_menubar):
1443 Return void, not int, since caller ignores return value.
1444 * gtkutil.c (xg_change_toolbar_position):
1445 Return void, not 1.
1446
af0e9f75
JB
14472012-09-23 Juanma Barranquero <lekktu@gmail.com>
1448
1449 * makefile.w32-in (BLOCKINPUT_H): Remove.
1450 (SYSSIGNAL_H): New macro.
1451 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1452 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1453 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1454 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1455 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1456 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1457 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1458 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1459 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1460 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1461 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1462 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1463 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1464 ($(BLD)/w32xfns.$(O)): Update dependencies.
1465
5101529e
EZ
14662012-09-23 Eli Zaretskii <eliz@gnu.org>
1467
1468 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1469 fatal_error_backtrace.
1470
1471 * w32proc.c (sys_kill): Undo last change: don't do anything when
1472 invoked to deliver SIGABRT to our own process. This is now
1473 handled by emacs_raise.
1474
2c3ee0ad
JB
14752012-09-23 Juanma Barranquero <lekktu@gmail.com>
1476
1477 * w32term.c (w32_read_socket): Remove leftover reference to
1478 interrupt_input_pending.
1479
62a1d661
PE
14802012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1481
1482 Do not use SA_NODEFER.
1483 Problem reported by Dani Moncayo in
1484 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1485 * alloc.c (die):
1486 * sysdep.c (emacs_abort): Do not reset signal handler.
1487 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1488 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1489 wanted even on POSIXish hosts, and it doesn't work on Windows.
1490
a0942b9a
JD
14912012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1492
1493 * xterm.c (x_term_init): Call fixup_locale before and after calling
1494 gtk_init (Bug#12392).
1495
d07ff9db
CY
14962012-09-23 Chong Yidong <cyd@gnu.org>
1497
1498 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1499 Vdynamic_library_alist.
1500
1501 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1502 (Fgnutls_available_p): Caller changed.
1503
1504 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1505 (Flibxml_parse_xml_region): Likewise.
1506
1507 * dispextern.h (struct image_type): Remove arg from init function.
1508
1509 * image.c (Finit_image_library, lookup_image_type)
1510 (define_image_type): Remove now-unneeded second arg.
1511 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1512 (init_tiff_functions, init_gif_functions, init_svg_functions):
1513 Arglist and w32_delayed_load calling convention changed.
1514 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1515 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1516
4d7e6e51
PE
15172012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1518
1519 Simplify and avoid signal-handling races (Bug#12471).
1520 * alloc.c (die):
1521 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1522 Avoid recursive loop if there's a fatal error in the function itself.
1523 * atimer.c (pending_atimers):
1524 * blockinput.h: Don't include "atimer.h"; no longer needed.
1525 (interrupt_input_pending): Remove. All uses removed.
1526 pending_signals now counts both atimers and ordinary interrupts.
1527 This is less racy than having three separate pending-signal flags.
1528 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1529 (input_blocked_p):
1530 Rename from their upper-case counterparts BLOCK_INPUT,
1531 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1532 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1533 This makes it easier to access volatile variables more accurately.
1534 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1535 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1536 that's more reliable if the code is buggy and sets
1537 interrupt_input_blocked to a negative value. All uses changed.
1538 * atimer.c (deliver_alarm_signal):
1539 Remove. No need to deliver this to the parent; any thread can
1540 handle this signal now. All uses replaced by underlying handler.
1541 * atimer.c (turn_on_atimers):
1542 * dispnew.c (handle_window_change_signal):
1543 * emacs.c (handle_danger_signal):
1544 * keyboard.c (kbd_buffer_get_event):
1545 Don't reestablish signal handler; not needed with sigaction.
1546 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1547 (UNBLOCK_INPUT_TO):
1548 Rework to avoid unnecessary accesses to volatile variables.
1549 (UNBLOCK_INPUT_TO): Now a function.
1550 (totally_unblock_input, unblock_input): New decls.
1551 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1552 (init_data): Remove. Necessary stuff now done in init_signal.
1553 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1554 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1555 (fatal_error_code): Remove; no longer needed.
1556 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1557 it doesn't always backtrace. All uses changed. No need to reset
1558 signal to default, since sigaction and/or die does that for us now.
1559 Use emacs_raise (FOO), not kill (getpid (), FOO).
1560 (main): Check more-accurately whether we're dumping.
1561 Move fatal-error setup to sysdep.c
1562 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1563 * gtkutil.c (xg_get_file_name, xg_get_font):
1564 Remove no-longer-needed signal-mask manipulation.
1565 * keyboard.c, process.c (POLL_FOR_INPUT):
1566 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1567 * keyboard.c (read_avail_input): Remove.
1568 All uses replaced by gobble_input.
1569 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1570 (kbd_buffer_store_event_hold, gobble_input):
1571 (record_asynch_buffer_change) [USABLE_SIGIO]:
1572 (store_user_signal_events):
1573 No need to mess with signal mask.
1574 (gobble_input): If blocking input and there are terminals, simply
1575 set pending_signals to 1 and return. All hooks changed to not
1576 worry about whether input is blocked.
1577 (process_pending_signals): Clear pending_signals before processing
1578 them, in case a signal comes in while we're processing.
1579 By convention callers now test pending_signals before calling us.
1580 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1581 New functions, to support changes to blockinput.h.
1582 (handle_input_available_signal): Now extern.
1583 (reinvoke_input_signal): Remove. All uses replaced by
1584 handle_async_input.
1585 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1586 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1587 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1588 Clear sigmask reliably, even if Fsignal returns, which it can.
1589 Omit unnecessary accesses to volatile var.
1590 (quit_throw_to_read_char): No need to restore sigmask.
1591 * keyboard.c (gobble_input, handle_user_signal):
1592 * process.c (wait_reading_process_output):
1593 Call signal-handling code rather than killing ourselves.
1594 * lisp.h: Include <float.h>, for...
1595 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1596 (pending_signals): Now volatile.
1597 (syms_of_data): Now const if IEEE floating point.
1598 (handle_input_available_signal) [USABLE_SIGIO]:
1599 (terminate_due_to_signal, record_child_status_change): New decls.
1600 * process.c (create_process): Avoid disaster if memory is exhausted
1601 while we're processing a vfork, by tightening the critical section
1602 around the vfork.
1603 (send_process_frame, process_sent_to, handle_pipe_signal)
1604 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1605 ignores SIGPIPE.
1606 (send_process): No need for setjmp/longjmp any more, since the
1607 SIGPIPE stuff is now gone. Instead, report an error if errno
1608 is EPIPE.
1609 (record_child_status_change): Now extern. PID and W are now args.
1610 Return void, not bool. All callers changed.
1611 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1612 Remove. All uses removed. This bug should be fixed now in a
1613 different way.
1614 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1615 and record the child status change directly. This avoids the
1616 need to futz with the signal mask.
1617 (process_fatal_action): Move here from emacs.c.
1618 (emacs_sigaction_flags): New function, containing
1619 much of what used to be in emacs_sigaction_init.
1620 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1621 caught by emacs, to make races less likely.
1622 (deliver_process_signal): Rename from handle_on_main_thread.
1623 All uses changed.
1624 (BACKTRACE_LIMIT_MAX): Now at top level.
1625 (thread_backtrace_buffer, threadback_backtrace_pointers):
1626 New static vars.
1627 (deliver_thread_signal, deliver_fatal_thread_signal):
1628 New functions, for more-accurate delivery of thread-specific signals.
1629 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1630 (deliver_arith_signal): Handle in this thread, not
1631 in the main thread, since it's triggered by this thread.
1632 (maybe_fatal_sig): New function.
1633 (init_signals): New arg DUMPING so that we can be more accurate
1634 about whether we're dumping. Caller changed.
1635 Treat thread-specific signals differently from process-general signals.
1636 Block all signals while handling fatal error; that's safer.
1637 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1638 on IEEE hosts.
1639 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1640 Ignore SIGPIPE unless batch.
1641 (emacs_backtrace): Output backtrace for the appropriate thread,
1642 which is not necessarily the main thread.
1643 * syssignal.h: Include <stdbool.h>.
1644 (emacs_raise): New macro.
1645 * xterm.c (x_connection_signal): Remove; no longer needed
1646 now that we use sigaction.
1647 (x_connection_closed): No need to mess with sigmask now.
1648 (x_initialize): No need to reset SIGPIPE handler here, since
1649 init_signals does this for us now.
1650
8f4635e9
JD
16512012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1652
1653 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1654 background rect may be larger (Bug#12245).
8f4635e9 1655
3296976d
CY
16562012-09-23 Chong Yidong <cyd@gnu.org>
1657
1658 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1659
d41e491e
PE
16602012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1661
1662 * .gdbinit: Just stop at fatal_error_backtrace.
1663 See Stefan Monnier's request in
1664 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1665 Remove no-longer-used query of system type.
1666
c88b867f
CY
16672012-09-22 Chong Yidong <cyd@gnu.org>
1668
1669 * search.c (Freplace_match): Doc fix (Bug#12325).
1670
1671 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1672
1673 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1674 (Fline_end_position): Doc fix.
1675
1676 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1677
bb4d86b4
CY
16782012-09-22 Chong Yidong <cyd@gnu.org>
1679
1680 * dispextern.h (struct image_type): Add new slot, storing a type
1681 initialization function.
1682
1683 * image.c (define_image_type): Call the image initializer function
1684 if it is defined. Arguments and return value changed.
1685 (valid_image_p, make_image): Callers changed.
1686 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1687 (gif_type, imagemagick_type, svg_type, gs_type):
1688 Add initialization functions.
bb4d86b4
CY
1689 (Finit_image_library): Call lookup_image_type.
1690 (CHECK_LIB_AVAILABLE): Macro deleted.
1691 (lookup_image_type): Call define_image_type here, rather than via
1692 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1693 (syms_of_image): Move define_image_type calls for xbm_type and
1694 pbm_type to lookup_image_type.
1695
df9685f3
EZ
16962012-09-22 Eli Zaretskii <eliz@gnu.org>
1697
1698 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1699 'idle_timers' from here ...
1700 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1701 lists, to avoid infloops when the timer does something stupid,
1702 like reinvoke itself with the same or smaller time-out.
1703 (Bug#12447)
1704
8e17c9ba
MR
17052012-09-22 Martin Rudalics <rudalics@gmx.at>
1706
1707 * window.c (Fsplit_window_internal): Handle only Qt value of
1708 Vwindow_combination_limit separately.
1709 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1710 (Vwindow_combination_limit): New default value.
1711 Rewrite doc-string.
8e17c9ba 1712
589bd69b
EZ
17132012-09-22 Eli Zaretskii <eliz@gnu.org>
1714
1715 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1716 the new overlay string. (Bug#10159)
1717
01108e3f
PE
17182012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1719
1720 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1721 or that fprintf is async-signal-safe. POSIX doesn't require
1722 either assumption.
1723
82f8cd94
CY
17242012-09-22 Chong Yidong <cyd@gnu.org>
1725
1726 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1727 (Bug#8207).
1728
3cccbd87
KH
17292012-09-22 Kenichi Handa <handa@gnu.org>
1730
1731 * composite.c (composition_reseat_it): Handle the case that a
1732 grapheme cluster is not covered by a single font (Bug#12352).
1733
09c01941
CY
17342012-09-21 Chong Yidong <cyd@gnu.org>
1735
1736 * image.c (define_image_type): Avoid adding duplicate types to
1737 image_types (Bug#12463). Suggested by Jörg Walter.
1738
acfa068f 17392012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1740
1741 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1742 (print_load_command_name): Add case LC_DATA_IN_CODE.
1743 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1744
acfa068f 17452012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1746
1747 * eval.c (Frun_hook_with_args_until_success)
1748 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1749
acfa068f 17502012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1751
1752 * fileio.c (Ffile_selinux_context): Only call freecon when
1753 lgetfilecon succeeded.
1754 (Fset_file_selinux_context): Likewise. (Bug#12444)
1755
acfa068f 17562012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1757
1758 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1759 reordering, locate the cursor by calling set_cursor_from_row; if
1760 that fails, clear the desired glyph matrix before returning a
1761 failure indication to the caller. Fixes leaving garbled display
1762 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1763 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1764 scrolling through multibyte text.
aa36e4d2 1765
e99f70c8
SM
17662012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1767
1768 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1769 calling mark_vectorlike since that's the one that marks the window.
1770 (mark_discard_killed_buffers): Mark the final cdr.
1771 * window.h (struct window): Move prev/next_buffers to the
1772 non-standard fields.
1773 * window.c (make_window): Initialize prev/next_buffers manually.
1774
f75beb47
PE
17752012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1776
1777 Omit unused arg EXPECTED from socket hooks.
1778 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1779 * nsterm.m (ns_term_init):
1780 * termhooks.h (struct terminal.read_socket_hook):
1781 * w32inevt.c (w32_console_read_socket):
1782 * w32term.c (w32_read_socket):
1783 * xterm.c (XTread_socket):
1784 Omit unused arg EXPECTED. All callers changed.
1785 (store_user_signal_events): Return void, not int, since callers no
1786 longer care about the return value. All uses changed.
1787
b019b76a
JB
17882012-09-20 Juanma Barranquero <lekktu@gmail.com>
1789
1790 * w32gui.h (XParseGeometry): Do not declare.
1791
05642592
PE
17922012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1793
e4bce92a 1794 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 1795 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
1796 <http://bugs.gnu.org/12471#8> (last line).
1797
05642592
PE
1798 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1799 (XParseGeometry): Now static. Substitute extremal values for
1800 values that are out of range.
1801
e543ae91
JD
18022012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1803
1804 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1805
1806 * nsfns.m (XParseGeometry): Remove.
1807 (Fx_create_frame): Call x_set_offset to correctly interpret
1808 top_pos in geometry.
1809
3a880af4 1810 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1811 (Fx_parse_geometry): If there is a space in string, call
1812 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1813
45ba16c7
EZ
18142012-09-17 Eli Zaretskii <eliz@gnu.org>
1815
c8b9f1bc
EZ
1816 * search.c (scan_buffer): Use character positions in calls to
1817 region_cache_forward and region_cache_backward, not byte
1818 positions. (Bug#12196)
1819
b4c932a2
EZ
1820 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1821 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1822
45ba16c7
EZ
1823 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1824 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1825 emacs_blocked_malloc, now deleted.
1826
eeceac93
PE
18272012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1828
1829 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1830 The workaround was for improving performance on Solaris 2.4, but
1831 is getting in the way now. Emacs will still work if someone is
1832 still running Solaris 2.4 in a museum somewhere; Sun dropped
1833 support for Solaris 2.4 in 2003.
1834 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1835 * process.c (create_process) [HAVE_WORKING_VFORK]:
1836 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1837 since Emacs no longer uses vfork on that platform.
1838
78f83752
GM
18392012-09-17 Glenn Morris <rgm@gnu.org>
1840
1841 * emacs.c: Use COPYRIGHT.
1842
634b8cac
PE
18432012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1844
0caaedb1
PE
1845 Remove configure's --without-sync-input option (Bug#12450).
1846 When auditing signal-handling in preparation for cleaning it up,
1847 I found that SYNC_INPUT has race conditions and would be a real
1848 pain to fix. Since it's an undocumented and deprecated
1849 configure-time option, now seems like a good time to remove it.
1850 Also see <http://bugs.gnu.org/11080#16>.
1851 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1852 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1853 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1854 (malloc_hysteresis):
1855 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1856 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1857 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1858 (dont_register_blocks, bytes_used_when_reconsidered)
1859 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1860 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1861 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 1862 Remove. All uses removed.
0caaedb1
PE
1863 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1864 implementation, one that depends on whether the new macro
1865 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1866 is defined.
1867 * atimer.c (run_timers, handle_alarm_signal):
1868 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1869 (handle_async_input, process_pending_signals)
1870 (handle_input_available_signal, init_keyboard):
1871 * nsterm.m (ns_read_socket):
1872 * process.c (wait_reading_process_output):
1873 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1874 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1875 (emacs_write):
1876 * xterm.c (XTread_socket):
1877 Assume SYNC_INPUT.
1878 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1879 * eval.c (handling_signal): Remove. All uses removed.
1880 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1881 All uses replaced with the SYNC_INPUT version.
1882 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1883 Remove decls.
1884 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1885 Now static.
1886
634b8cac
PE
1887 * font.c (Ffont_shape_gstring): Remove unused local.
1888
83da1b55
GM
18892012-09-16 Glenn Morris <rgm@gnu.org>
1890
518650a5
GM
1891 * Makefile.in (clean): No longer run nextstep's clean.
1892
83da1b55
GM
1893 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1894 (ns_frag): Remove.
1895 (ns-app): Move here from ns.mk, and simplify.
1896 (clean): Simplify nextstep entry.
1897 * ns.mk: Remove file.
1898
85a43e2e
KH
18992012-09-17 Kenichi Handa <handa@gnu.org>
1900
1901 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1902 not covert the last few charactes.
1903
ba13e616 19042012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
1905
1906 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1907 here, but just check the validity of glyphs in the glyph-string.
1908
a8c729af
MR
19092012-09-16 Martin Rudalics <rudalics@gmx.at>
1910
3a880af4
SM
1911 * window.c (Fwindow_parameter, Fset_window_parameter):
1912 Accept any window as argument (Bug#12452).
a8c729af 1913
c077c059
JD
19142012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1915
1916 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1917 to ns_term_init to avoid memory leak.
1918
1919 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
1920 explicit retain/release.
1921 (ns_term_init): Only allow one display. Initialize outerpool and
1922 ns_*_types.
1923
39a57ad0
PE
19242012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1925
1926 Port _setjmp fix to POSIXish hosts as well as Microsoft.
1927 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
1928 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
1929 the Microsoft problem in a different way, by altering ../nt/config.nt.
1930
7105c8cb
EZ
19312012-09-15 Eli Zaretskii <eliz@gnu.org>
1932
1933 * w32xfns.c:
1934 * w32uniscribe.c:
1935 * w32term.c:
1936 * w32select.c:
1937 * w32reg.c:
1938 * w32proc.c:
1939 * w32menu.c:
1940 * w32inevt.c:
1941 * w32heap.c:
1942 * w32font.c:
1943 * w32fns.c:
1944 * w32console.c:
1945 * w32.c:
1946 * w16select.c: Remove inclusion of setjmp.h, as it is now included
1947 by lisp.h. This completes removal of setjmp.h inclusion
1948 erroneously announced in the previous commit. (Bug#12446)
1949
1950 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
1951 more accurate.
1952
1953 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
1954 not defined as a macro. The latter happens on MS-Windows.
1955 (Bug#12446)
1956
0328b6de
PE
19572012-09-15 Paul Eggert <eggert@cs.ucla.edu>
1958
1959 Port better to POSIX hosts lacking _setjmp (Bug#12446).
1960 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 1961 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
1962 only reason for the instance was because "lisp.h" was included.
1963 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
1964 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
1965 and _longjmp with the new symbols. Emacs already uses _setjmp if
1966 available, so this change affects only POSIXish hosts that have
1967 sigsetjmp but not _setjmp, such as some versions of Solaris and
1968 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
1969 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
1970 (png_load_body) [HAVE_PNG]:
1971 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
1972 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
1973 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
1974 since PNG requires jmp_buf. This is the only exception to the
1975 general rule that we now use sys_setjmp and sys_longjmp.
1976 This exception is OK since this code does not change the signal
1977 mask or longjmp out of a signal handler.
1978
2af03429
PE
19792012-09-14 Paul Eggert <eggert@cs.ucla.edu>
1980
1981 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1982 Include "syssignal.h", for 'main_thread'.
1983
2f294edf
DA
19842012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
1985
1986 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
1987 * insdel.c (replace_range, replace_range_2):
1988 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
1989 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
1990 Remove redundant check before calling offset_intervals.
1991
6b533e9c
MR
19922012-09-14 Martin Rudalics <rudalics@gmx.at>
1993
1994 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
1995 current buffer (Bug#12387).
1996
2a7931e3
JB
19972012-09-14 Juanma Barranquero <lekktu@gmail.com>
1998
1999 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2000
c18e885b
PE
20012012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2002
2003 Use a more backwards-compatible timer format (Bug#12430).
2004 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2005 vector element, not from the 4th, since PSECS is now at the end.
2006 (Fcurrent_idle_time): Doc fix.
2007
d59a1afb
DA
20082012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2009
2010 Function to mark objects and remove killed buffers at once.
2011 * alloc.c (discard_killed_buffers): Rename to ...
2012 (mark_discard_killed buffers) ... new name. Add marking
2013 of remaining objects. Fix comment. Adjust users.
2014 (mark_object): Do not touch frame buffer lists here.
2015 * frame.c (delete_frame): Reset frame buffer lists here.
2016
5f0cb45a
PE
20172012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2018
8ea47e3a
PE
2019 Better workaround for GNOME bug when --enable-gcc-warnings.
2020 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2021 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2022 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2023
4a4bbad2
PE
2024 Simplify SIGIO usage (Bug#12408).
2025 The code that dealt with SIGIO was crufty and confusing, e.g., it
2026 played tricks like "#undef SIGIO" but these tricks were not used
2027 consistently. Simplify mostly by not #undeffing standard symbols,
2028 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2029 or not as we please) rather than "defined SIGIO" (standard symbol
2030 that we probably shouldn't #undef).
2031 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2032 Modules that need it can include it.
2033 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2034 * dispextern.h (ignore_sigio): New decl.
2035 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2036 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2037 * emacs.c (shut_down_emacs):
2038 * keyboard.c (kbd_buffer_store_event_hold):
2039 Use ignore_sigio rather than invoking 'signal' directly.
2040 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2041 for FIONREAD.
2042 (FIONREAD, SIGIO): Do not #undef.
2043 (tty_read_avail_input): Use #error rather than a syntax error.
2044 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2045 for I_PIPE, used by SETUP_SLAVE_PTY.
2046 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2047 * sysdep.c (croak): Remove; no longer needed. This bit of
2048 temporary code, with Fred N. Fish's comment that it's temporary,
2049 has been in Emacs since at least 1992!
2050 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2051 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2052 * syssignal.h (croak): Remove decl.
2053 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2054 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2055 now that we're termios-only.
2056 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2057 * term.c (dissociate_if_controlling_tty): Use #error rather than
2058 a run-time error.
2059
5f0cb45a
PE
2060 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2061 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2062 to work around GNOME bug 683906.
2063 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2064 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2065 This works around GCC bug 54561.
2066
40bce90b
PE
20672012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2068
2069 More fixes for 'volatile' and setjmp/longjmp.
2070 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2071 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2072 (png_load_body) [HAVE_PNG]:
2073 (jpeg_load_body) [HAVE_JPEG]:
2074 New function, with most of the old parent function's body.
2075 (png_load) [HAVE_PNG]:
2076 (jpeg_load) [HAVE_JPEG]:
2077 Invoke the new function, to avoid longjmp munging our locals.
2078 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2079 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2080 longjmp is passed 2, as the C standard doesn't guarantee this.
2081 Instead, store the failure code into mgr->failure_code.
2082
bfeae2cf
SM
20832012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2084
2085 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2086 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2087 (syms_of_keyboard): Remove support for unread-command-char.
2088
8099e36b
EZ
20892012-09-12 Eli Zaretskii <eliz@gnu.org>
2090
2091 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2092 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2093 violation. (Bug#12426)
2094
92547ff9
PE
20952012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2096
2097 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2098
45b82ad0
SM
20992012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2100
2101 * eval.c: Add `inhibit-debugger'.
2102 (Qinhibit_debugger): New symbol.
2103 (call_debugger): Bind it instead of Qdebug_on_error.
2104 (maybe_call_debugger): Test Vinhibit_debugger.
2105 (syms_of_eval): Define inhibit-debugger.
2106 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2107 (syms_of_xdisp): Remove inhibit-debug-on-message.
2108
5779a1dc
PE
21092012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2110
50f2e553
PE
2111 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2112 If a nonvolatile local variable is written before a _longjmp to
2113 the frame containing the variable, and is read after the _longjmp,
2114 the value read is indeterminate. Some local variables of type
2115 'struct handler' and 'struct catchtag' are used in this way, so
2116 mark each of their slots as volatile if the slot can be set before
2117 _longjmp and read afterwards.
2118 * lisp.h (struct handler): var and chosen_clause are now volatile.
2119 (struct catchtag): val, next, and pdlcount are now volatile.
2120
ae1d87e2
PE
2121 * bidi.c (bidi_push_it, bidi_pop_it):
2122 * fns.c (copy_hash_table):
2123 * image.c (define_image_type):
2124 * keyboard.c (kbd_buffer_store_event_hold):
2125 * process.c (Fprocess_send_eof):
2126 * xfaces.c (x_create_gc) [HAVE_NS]:
2127 * xgselect.c (xg_select):
2128 Prefer assignment to memcpy when either will do.
2129
5779a1dc
PE
2130 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2131 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2132 time an item is removed. No need to mark this function 'inline';
2133 the compiler knows better than we do.
2134
c4c9756b
JD
21352012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2136
2137 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2138 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2139 to change_frame_size (Bug#12388).
2140 (windowDidResize:): Pass YES to updateFrameSize.
2141
2142 * nsterm.h: Add delay parameter to updateFrameSize.
2143
d73e321c
DA
21442012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2145
2146 Discard killed buffers from deleted window and frame objects.
2147 This reduces an amount of references to killed buffers and
2148 helps GC to reclaim them faster.
2149 * alloc.c (discard_killed_buffers): New function.
2150 (mark_object): Use it for deleted windows and frames.
2151 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 2152 or deleted frame, restore its global binding.
d73e321c
DA
2153 * data.c (swap_in_global_binding): Add GC notice.
2154 (swap_in_symval_forwarding): Use convenient set_blv_where.
2155 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2156 * window.h: ... to here.
2157
e578f381
DA
21582012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2159
2160 Convenient macro to check whether the buffer is live.
2161 * buffer.h (BUFFER_LIVE_P): New macro.
2162 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2163 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2164
3057e615
YM
21652012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2166
2167 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2168 composition cases (Bug#12364).
2169
2170 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2171 overhang of succeeding glyphs overlapping box cursor.
2172
2173 * w32term.c (x_draw_glyph_string): Likewise.
2174
6fda35f2
PE
21752012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2176
c990426a
PE
2177 Simplify, document, and port floating-point (Bug#12381).
2178 The porting part of this patch fixes bugs on non-IEEE platforms
2179 with frexp, ldexp, logb.
2180 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2181 Now static.
2182 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2183 support, by removing commented-out code and briefly listing the
2184 C89 functions excluded. The commented-out stuff was confusing
2185 maintenance, e.g., we thought we needed cbrt but it was commented out.
2186 (logb): Remove decl; no longer needed.
2187 (isfinite): New macro, if not already supplied.
2188 (isnan): Don't replace any existing macro.
2189 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2190 are present on all C89 platforms.
2191 (Ffrexp): Do not special-case zero, as frexp does the right thing
2192 for that case.
2193 (Flogb): Do not use logb, as it doesn't have the desired meaning
2194 on hosts that use non-base-2 floating point. Instead, stick with
2195 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2196 frexp, to avoid getting an unspecified result.
2197
6fda35f2
PE
2198 * xdisp.c (Qinhibit_debug_on_message): Now static.
2199
16130a58
JD
22002012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2201
2202 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2203 NSBezierPath (Bug#12131).
2204
d105a573
CY
22052012-09-10 Chong Yidong <cyd@gnu.org>
2206
2207 * fns.c (Fdelq, Fdelete): Doc fix.
2208
ff55dfe8
PE
22092012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2210
2211 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2212 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2213
e7032e7c
SM
22142012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2215
2216 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2217 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2218 Use it.
2219
e9957956
EZ
22202012-09-09 Eli Zaretskii <eliz@gnu.org>
2221
aba05ce9
EZ
2222 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2223 left fringe if the window has a left margin. This avoids leaving
2224 traces of the cursor because its leftmost pixel is not drawn over.
2225
e9957956
EZ
2226 * dispnew.c (update_window_line): When the left margin area of a
2227 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2228 that screen line. (Bug#12277)
2229
f6196b87
PE
22302012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2231
2232 Assume C89 or later for math functions (Bug#12381).
2233 This simplifies the code, and makes it a bit smaller and faster,
2234 and (most important) makes it easier to clean up signal handling
2235 since we can stop worring about floating-point exceptions in
2236 library code. That was a problem before C89, but the problem
2237 went away many years ago on all practical Emacs targets.
2238 * data.c, image.c, lread.c, print.c:
2239 Don't include <math.h>; no longer needed.
2240 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2241 might be autoconfigured, as that never happens.
2242 * data.c (fmod):
2243 * doprnt.c (DBL_MAX_10_EXP):
2244 * print.c (DBL_DIG):
2245 Remove. C89 or later always defines these.
2246 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2247 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2248 (arith_error, domain_error, domain_error2):
2249 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2250 no longer needed -- we simply return what C returns. All uses removed.
2251 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2252 the wrapped code.
2253 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2254 Remove. All uses expanded, as these macros are no longer used
2255 more than once and are now more trouble than they're worth.
2256 (Ftan): Use tan, not sin / cos.
2257 (Flogb): Assume C89 frexp.
2258 (fmod_float): Assume C89 fmod.
2259 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2260 (init_floatfns): Remove. All uses removed.
2261
9d7f1863
JD
22622012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2263
2264 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2265 compositeToPoint for OSX < 10.6 (Bug#12390).
2266
eabf0404
PE
22672012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2268
2269 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2270 This produces more-accurate results.
2271
0b3b1d23
JD
22722012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2273
2274 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2275 changes (Bug#12088).
2276
6dcef6ec
CY
22772012-09-08 Chong Yidong <cyd@gnu.org>
2278
2279 * syntax.c (Fstring_to_syntax): Doc fix.
2280
aa7d57c5
JD
22812012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2282
2283 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2284 in the internal border.
2285 (x_set_window_size): Remove static variables and their usage.
2286 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
2287 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2288 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
2289 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2290 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2291 (ns_fix_rect_ibw): Remove.
2292 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2293 (ns_dumpglyphs_box_or_relief): Ditto.
2294 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2295 adjustment.
2296 (ns_dumpglyphs_image): Ditto.
fc0c31f8 2297 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
2298 border adjustment.
2299 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2300 their usage. Add fringe_extended_p and its use as in other terms.
2301 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2302 scroll bar was removed.
2303 (updateFrameSize): New function.
2304 (windowDidResize): Move code to updateFrameSize and call it.
2305
2306 * nsterm.h (EmacsView): Add updateFrameSize.
2307
1a5432bc
CY
23082012-09-07 Chong Yidong <cyd@gnu.org>
2309
b4f5313e
CY
2310 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2311
1a5432bc
CY
2312 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2313
1a4f1e9b
PE
23142012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2315
2316 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
2317 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2318 Problem introduced when merging patches. Noted by Eli Zaretskii in
2319 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
2320 * floatfns.c: Comment fix.
2321 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2322 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2323 and anyway the declaration is harmless even if SIGDANGER is not defined.
2324 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2325 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2326 source files not surprisingly expected syssignal.h to define, or
2327 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2328 Include <sys/ioctl.h>, for FIONREAD.
2329 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2330 This eliminates a problem whereby other files mysteriously had
2331 to include "syssignal.h" before including "systty.h" if they
2332 wanted to use "#ifdef SIGIO".
2333
bc8000ff
EZ
23342012-09-07 Eli Zaretskii <eliz@gnu.org>
2335
3e6d6928
EZ
2336 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2337
2338 * w32.c (sigemptyset): Empty the set.
2339 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2340
bc8000ff
EZ
2341 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2342
b4fa72f2
DA
23432012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2344
2345 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2346 (mark_object): Likewise for frame objects.
2347
30730c93
PE
23482012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2349
2350 * syssignal.h (handle_on_main_thread): Always declare,
2351 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2352 This ports to platforms without HAVE_PTHREAD.
2353
2fe28299
PE
23542012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2355
2356 Signal-handler cleanup (Bug#12327).
2357 Emacs's signal handlers were written in the old 4.2BSD style with
2358 sigblock and sigmask and so forth, and this led to some
2359 inefficiencies and confusion. Rewrite these to use
2360 pthread_sigmask etc. without copying signal sets around. Also,
2361 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2362 'signal', and instead use functions that do not attempt to take
2363 over the system name space. This patch causes Emacs's text
2364 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2365 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2366 Do not include <signal.h> or "syssignal.h", as these
2367 modules do not use signals.
2368 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2369 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2370 Do not include <signal.h>, as "syssignal.h" does that for us now.
2371 * atimer.c (sigmask_atimers): New function.
2372 (block_atimers, unblock_atimers): New functions,
2373 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2374 All uses replaced.
2375 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2376 no longer needed here.
2377 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 2378 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
2379 * sysdep.c (struct save_signal): New member 'action', replacing
2380 old member 'handler'.
2381 (save_signal_handlers, restore_signal_handlers):
2382 Use sigaction instead of 'signal' to save and restore.
2383 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2384 New function. All users of 'signal' modified to use set_sighandler
2385 if they're writeonly, and to use sys_signal if they're read+write.
2386 (emacs_sigaction_init, forwarded_signal): New functions.
2387 (sys_signal): Remove. All uses replaced by calls to sigaction
2388 and emacs_sigaction_init, or by direct calls to 'signal'.
2389 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2390 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2391 all uses replaced by pthread_sigmask etc. calls.
2392 * syssignal.h: Include <signal.h>.
2393 (emacs_sigaction_init, forwarded_signal): New decls.
2394 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2395 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2396 (sigmask, sys_sigmask): Remove; no longer needed.
2397 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2398 (sigblock, sigunblock, sigfree):
2399 (sigsetmask) [!defined sigsetmask]:
2400 Remove. All uses replaced by pthread_sigmask.
2401 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2402 no longer need to be replaced, and its typical old uses
2403 are now done via emacs_sigaction_init and sigaction.
2404 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2405 (sys_sigdel): Remove; unused.
2406 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2407
0216c128
EZ
24082012-09-06 Eli Zaretskii <eliz@gnu.org>
2409
2410 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2411 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2412
c752cfa9
DA
24132012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2414
2415 Explicitly mark buffer_defaults and buffer_local_symbols.
2416 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2417 mark_local_symbols here.
2418 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2419 since special buffers aren't marked here any more.
2420 (allocate_buffer): Chain new buffer with all_buffers here...
2421 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2422 not here.
2423 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2424 (syms_of_buffer): Remove staticpro of the above.
2425 (init_buffer_once): Set names for buffer_defaults and
2426 buffer_local_symbols.
2427
a864ef14
PE
24282012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2429
2430 Use bool for booleans in font-related modules.
2431 * font.c (font_intern_prop, font_style_to_value)
2432 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2433 (generate_otf_features, font_check_otf_features, font_check_otf)
2434 (font_match_p, font_list_entities, font_at):
2435 * fontset.c (fontset_id_valid_p, reorder_font_vector
2436 (fontset_find_font, Fset_fontset_font)
2437 (face_suitable_for_char_p) [0]:
2438 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2439 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2440 (m17n_flt_initialized, ftfont_shape_by_flt):
2441 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2442 * nsfont.m (nsfont_draw):
2443 * w32font.c (w32font_draw):
2444 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2445 Use bool for booleans.
2446 * font.h: Adjust to above API changes.
2447 (struct font, struct font_driver, struct font_driver_list):
2448 Use bool for booleans.
2449 (struct font): Remove useless member encoding_type.
2450 All users removed.
2451 * fontset.c, xftfont.c: Omit unnecessary static decls.
2452
0699fc18
DA
24532012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2454
2455 * alloc.c (mark_object): Revert window marking code
2456 since it's unsafe for the Fset_window_configuration.
2457
20ef56db
PE
24582012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2459
2fe28299 2460 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2461 Be more systematic about preserving errno whenever a signal
2462 handler returns, even if it's not in the main thread. Do this by
2463 renaming signal handlers to distinguish between signal delivery
2464 and signal handling. All uses changed.
2465 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2466 * data.c (deliver_arith_signal): Rename from arith_error.
2467 * dispnew.c (deliver_window_change_signal): Rename from
2468 window_change_signal.
2469 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2470 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2471 * keyboard.c (deliver_input_available_signal): Rename from
2472 input_available_signal.
2473 (deliver_user_signal): Rename from handle_user_signal.
2474 (deliver_interrupt_signal): Rename from interrupt_signal.
2475 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2476 (deliver_child_signal): Rename from sigchld_handler.
2477 * atimer.c (handle_alarm_signal):
2478 * data.c (handle_arith_signal):
2479 * dispnew.c (handle_window_change_signal):
2480 * emacs.c (handle_fatal_signal, handle_danger_signal):
2481 * keyboard.c (handle_input_available_signal):
2482 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2483 * process.c (handle_pipe_signal, handle_child_signal):
2484 New functions, with the actual signal-handling code taken from the
2485 original respective signal handlers, sans the sporadic attempts to
2486 preserve errno, since that's now done by handle_on_main_thread.
2487 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2488 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2489 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2490 Move to sysdep.c.
2491 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2492 Move initialization of main_thread to sysdep.c's init_signals.
2493 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2494 our usage, and simplifies the mainline code.
2495 (record_child_status_change): New static function, as a helper
2496 for handle_child_signal, and with most of the old child handler's
2497 contents.
2498 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2499 (handle_child_signal): Use the above.
2500 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2501 Moved here from emacs.c.
2502 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2503 code moved here from emacs.c's main function.
2504 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2505 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2506 This lets callers save and restore errno properly.
20ef56db 2507
e3ccf108
DA
25082012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2509
2510 Remove redundant or unused things here and there.
2511 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2512 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2513 * editfns.c (Fcompare_buffer_substrings): Likewise.
2514 * frame.h (struct terminal, struct font_driver_list):
2515 Remove redundant declarations.
2516 * window.h (Qleft, Qright): Likewise.
2517
697e1e39
DA
25182012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 Do not mark objects from deleted buffers, windows and frames.
2521 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2522 (mark_object): Likewise for windows and frames.
2523
c1ca42ca
DA
25242012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2525
2526 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2527 buffer_defaults and buffer_local_symbols as valid objects.
2528 Return special value to denote them.
2529
014d93be
PE
25302012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2531
f75d7a91
PE
2532 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2533 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2534 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2535 (file_name_absolute_p, Fsubstitute_in_file_name):
2536 (check_executable, check_writable, Ffile_accessible_directory_p)
2537 (Fset_file_selinux_context, Fdefault_file_modes)
2538 (Finsert_file_contents, choose_write_coding_system)
2539 (Fwrite_region, build_annotations, a_write, e_write)
2540 (Fdo_auto_save):
2541 * filelock.c (boot_time_initialized, get_boot_time)
2542 (get_boot_time_1, lock_file_1, within_one_second):
2543 * floatfns.c (in_float):
2544 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2545 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2546 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2547 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2548 * window.c (compare_window_configurations):
2549 Use bool for booleans.
2550 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2551 (Fdefault_file_modes): Now mode_t, not int, for modes.
2552 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2553 (internal_delete_file): Now returns void, not a (boolean) int,
2554 since nobody was looking at the return value.
2555 * lisp.h, window.h: Adjust to above API changes.
2556
014d93be
PE
2557 * xdisp.c (set_message): Simplify and reindent last change.
2558
776f29e1
JB
25592012-09-05 Juanma Barranquero <lekktu@gmail.com>
2560
2561 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2562
7f7e0167
LI
25632012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2564
2565 * eval.c (call_debugger): Make the function non-static so that we
2566 can call it from set_message.
2567
2568 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2569 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2570
cf29dd84
PE
25712012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 Give more-useful info on a fatal error (Bug#12328).
2574 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2575 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2576 of doing the work ourselves.
2577 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2578 do most of the work.
2579 (fatal_error_backtrace): New function, taken from the guts
2580 of the old fatal_error_signal, but with a new option to output
2581 a backtrace.
2582 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2583 info about the signal than just its number.
2584 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2585 * sysdep.c: Include <execinfo.h>
2586 (emacs_backtrace): New function, taken partly from the previous
2587 code of the 'die' function.
2588 (emacs_abort): Call fatal_error_backtrace rather than abort.
2589
972debf2
SM
25902012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2591
2592 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2593 eager (load-time) macro-expansion.
2594 * lisp.mk (lisp): Add macroexp.
2595
1088b922
PE
25962012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2597
2598 Simplify redefinition of 'abort' (Bug#12316).
2599 Do not try to redefine the 'abort' function. Instead, redo
2600 the code so that it calls 'emacs_abort' rather than 'abort'.
2601 This removes the need for the NO_ABORT configure-time macro
2602 and makes it easier to change the abort code to do a backtrace.
2603 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2604 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2605 Remove; sysdep.c's emacs_abort now takes its place.
2606 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2607 'abort' changed to use 'emacs_abort'.
2608 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2609 (abort) [!defined abort]: Rename to ...
2610 (emacs_abort): ... new name.
2611 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2612 the place of the old 'abort' in emacs.c.
2613 * w32.c, w32fns.c (abort): Do not #undef.
2614 * w32.c (emacs_abort): Rename from w32_abort.
2615
30934d33
EZ
26162012-09-04 Eli Zaretskii <eliz@gnu.org>
2617
2618 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2619 offsets[j].dv, since the y axis of the screen coordinates points
2620 down, while the y axis of the font definition coordinates points
2621 up. This fixes display of Arabic diacritics such as KASRA and
2622 KASRATAN. (Bug#11860)
2623
af26b72c
PE
26242012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2625
2626 Be more systematic about _setjmp vs setjmp.
2627 * alloc.c (test_setjmp, mark_stack):
2628 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2629 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2630 (png_load, my_error_exit, jpeg_load):
2631 * process.c (send_process_trap, send_process):
2632 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2633 The underscored versions are up to 30x faster on some hosts.
2634 Formerly, the code used setjmp+longjmp sometimes and
2635 _setjmp+_longjmp at other times, with no particular reason to
2636 prefer setjmp+longjmp.
2637
26d4541d
PE
26382012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2639
d42f4f0f 2640 Fix minor problem found by static checking.
26d4541d 2641 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2642
c5e28e39
MR
26432012-09-03 Martin Rudalics <rudalics@gmx.at>
2644
2645 * buffer.c (Fdelete_all_overlays): New function.
2646
3eab3ca9
CY
26472012-09-03 Chong Yidong <cyd@gnu.org>
2648
2649 * gtkutil.c: Add extern decl for Qxft.
2650
c04889f8
PE
26512012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2652
1882aa38
PE
2653 * emacs.c, eval.c: Use bool for boolean.
2654 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2655 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2656 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2657 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2658 (main, decode_env_path, Fdaemon_initialized):
2659 * eval.c (call_debugger, Finteractive_p, interactive_p):
2660 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2661 (maybe_call_debugger, Fbacktrace):
2662 * process.c (read_process_output, exec_sentinel):
2663 Use bool for booleans.
2664 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2665 All callers changed.
2666 * eval.c (interactive_p): Omit always-true boolean argument
2667 EXCLUDE_SUBRS_P. All callers changed.
2668 * dispextern.h, lisp.h: Reflect above API changes.
2669 * firstfile.c (dummy): Use the address of 'main', whose signature
2670 won't change, instead of the address of 'initialize', whose
2671 signature just changed from int to bool.
2672 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2673 * msdos.c (fatal_error_in_progress): ... from here.
2674 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2675 of incrementing it.
2676 (redisplay_internal, unwind_redisplay): Simply clear
2677 REDISPLAYING_P when unwinding, instead of saving its previous,
2678 always-false value and then restoring it.
2679
a411ac43
PE
2680 Clean up some extern decls.
2681 Mostly, this hoists extern decls out of .c files and into .h files.
2682 That way, we're more likely to catch errors if the interfaces change.
2683 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2684 declare xg_mark_data.
2685 * dispextern.h (x_frame_parm_handlers):
2686 * font.h (Qxft):
2687 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2688 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2689 (Qultra_bold, Qoblique, Qitalic):
2690 Move extern decl here from .c file.
2691 * alloc.c (xg_mark_data) [USE_GTK]:
2692 * doc.c (Qclosure):
2693 * eval.c (Qlexical_binding):
2694 * fns.c (time) [!HAVE_UNISTD_H]:
2695 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2696 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2697 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2698 * lread.c (Qinternal_interpreter_environment):
2699 * minibuf.c (Qbuffer):
2700 * process.c (QCfamily, QCfilter):
2701 * widget.c (free_frame_faces):
2702 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2703 * xfont.c (x_clear_errors):
2704 * xterm.c (x_frame_parm_handlers):
2705 Remove now-redundant extern decls.
2706 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2707 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2708 Now static.
2709 * xfaces.c: Remove unnecessary static decls.
2710 * xterm.c (updating_frame): Remove decl of nonexistent object.
2711
c04889f8
PE
2712 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2713 when building globals.h, as the objects that are not built on
2714 this host are not needed to compile C files on this host.
2715
8b339673
JD
27162012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2717
2718 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2719
2720 * frame.h: Add missing prototype for x_wm_set_size_hint.
2721
a08d4ba7
PE
27222012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2723
2724 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2725 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2726 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2727 (Fsubstitute_command_keys):
2728 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2729 (save_excursion_save, save_excursion_restore)
2730 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2731 (format_time_string, general_insert_function)
2732 (make_buffer_string, make_buffer_string_both)
2733 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2734 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2735 (copy_text, insert_1, insert_1_both, insert_from_string)
2736 (insert_from_string_before_markers, insert_from_string_1)
2737 (insert_from_buffer, insert_from_buffer_1, replace_range)
2738 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2739 (del_range_2, modify_region):
2740 * intervals.c (intervals_equal, balance_possible_root_interval)
2741 (adjust_intervals_for_insertion, merge_properties_sticky)
2742 (graft_intervals_into_buffer, lookup_char_property)
2743 (adjust_for_invis_intang, set_point_both)
2744 (get_property_and_range, compare_string_intervals)
2745 (set_intervals_multibyte_1, set_intervals_multibyte):
2746 * keyboard.c (decode_timer):
2747 Use bool for boolean.
2748 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2749 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2750
48c948de
CY
27512012-09-02 Chong Yidong <cyd@gnu.org>
2752
2753 * keymap.c (push_key_description): Print M-TAB as C-M-i
2754 (Bug#11758).
2755
6c49a40b
JB
27562012-09-02 Juanma Barranquero <lekktu@gmail.com>
2757
2758 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2759 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2760 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2761 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2762 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2763 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2764 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2765
4dfbd238
EZ
27662012-09-01 Eli Zaretskii <eliz@gnu.org>
2767
7e510e28
EZ
2768 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2769 more than one grapheme cluster passed to the shaper: compute the
2770 offset adjustment values separately for each cluster. (Bug#11860)
2771
4dfbd238
EZ
2772 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2773 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2774 about implicit conversions from integer to pointer.
2775
86571ae0
DC
27762012-09-01 Daniel Colascione <dancol@dancol.org>
2777
2778 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2779 system used too early.
2780
0e23ef9d
PE
27812012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2782
2783 Better seed support for (random).
2784 * emacs.c (main): Call init_random.
2785 * fns.c (Frandom): Set the seed from a string argument, if given.
2786 Remove long-obsolete Gentzel cruft.
2787 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2788 (init_random): New function.
2789
17a2cbbd
DC
27902012-09-01 Daniel Colascione <dancol@dancol.org>
2791
2792 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2793 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2794 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2795 x_wm_set_size_hint, x_query_colors, x_real_positions,
2796 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2797 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2798 all of which have been moved to common code.
2799
2800 * xfaces.c: Include TERM_HEADER instead of listing all possible
2801 window-system headers.
2802
2803 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2804 to match header.
2805
2806 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2807 directly accessing frame internals.
2808
f18cbb28 2809 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2810 globals_of_w32font.
2811
2812 * process.c: Include TERM_HEADER instead of listing all possible
2813 window-system headers.
2814
3a880af4
SM
2815 * nsterm.h: Remove declarations now in frame.h.
2816 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2817
2818 * menu.c: Include TERM_HEADER instead of listing all possible
2819 window-system headers.
2820
2821 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2822 window system.
2823
2824 * keyboard.c: Include TERM_HEADER instead of listing all possible
2825 window-system headers.
2826
2827 * image.c: Include TERM_HEADER instead of listing all possible
2828 window-system headers. Declare Vlibrary_cache when compiling for
2829 Windows.
2830
2831 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2832 window system declarations.
2833
2834 * frame.h: Move common functions here: set_frame_menubar,
2835 x_set_window_size, x_sync, x_get_focus_frame,
2836 x_set_mouse_position, x_set_mouse_pixel_position,
2837 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2838 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2839 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2840 x_activate_menubar, x_real_positions, x_bitmap_icon,
2841 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2842 and x_query_colors.
2843
2844 * frame.c: Include TERM_HEADER instead of listing all possible
2845 window-system headers.
2846
2847 * font.c: Include TERM_HEADER instead of listing all possible
2848 window-system headers.
2849
2850 * emacs.c: Include TERM_HEADER.
2851
f18cbb28
EZ
2852 * dispnew.c: Include TERM_HEADER instead of listing all possible
2853 window-system headers.
17a2cbbd 2854
f18cbb28 2855 * ccl.h: Include character.h.
17a2cbbd
DC
2856
2857 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2858 the current window system; include in list of objects to link into
2859 Emacs.
2860
c650a5de
DA
28612012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2862
2863 Remove mark_ttys function and fix tty_display_info initialization.
2864 * lisp.h (mark_ttys): Remove prototype.
2865 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2866 to mark_ttys because all possible values of 'top_frame' slot are
2867 the frames which are reachable from Vframe_list.
2868 * term.c (mark_ttys): Remove.
2869 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2870
4e0f6479
DA
28712012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2872
2873 Change struct frame bitfields from unsigned char to unsigned.
2874 * frame.h (struct frame): Change type of 'display_preempted',
2875 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2876 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2877 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2878 bitfields from unsigned char to unsigned.
2879
8b96a52c
DA
28802012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2881
2882 Remove unused member of struct x_output and struct w32_output.
2883 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2884 * w32term.h (struct w32_output): Likewise.
2885
b4444c8a
JD
28862012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2887
2888 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2889 does not become zero (Bug#12234).
2890
b98521db
PE
28912012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2892
2893 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2894 for GCC 4.7.1 x86-64.
2895
31d02438
GM
28962012-08-30 Glenn Morris <rgm@gnu.org>
2897
2898 * lread.c (init_lread): For out-of-tree builds, only add the
2899 source directory's site-lisp dir to the load-path if it exists,
2900 consistent with in-tree builds. (Bug#12302)
2901
7f8941d8
JD
29022012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2903
2904 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 2905 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
2906 (windowShouldClose:): Set window_closed.
2907 (dealloc): New member, free button_values.
fc0c31f8
JB
2908 (process_dialog:): Make member function. Remove window argument,
2909 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
2910 in button_values.
2911 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 2912 with tag. Remove return self, declare return value as void.
7f8941d8
JD
2913 (addString:row:): Remove return self, declare return value as void.
2914 (addSplit): Remove return self, declare return value as void.
2915 (clicked:): Remove return self, declare return value as void.
fc0c31f8 2916 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
2917 (initFromContents:isQuestion:): Adjust call to process_dialog.
2918 Code formatting change.
2919 (timeout_handler:): Set timer_fired to YES.
2920 (runDialogAt:): Set timer_fired to NO.
2921 Handle click on close button as quit.
2922
2923 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
2924 Add window_closed and button_values. Add void as return value for
2925 add(Button|String|Split). addButton takes int instead of Lisp_Object.
2926 Add process_dialog as new member.
2927
eada0861 29282012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 2929
eada0861
GM
2930 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
2931 is not one of the heaps we manage. (Bug#12242)
2932
29332012-08-28 Glenn Morris <rgm@gnu.org>
2934
2935 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
2936
457294dd
MR
29372012-08-28 Martin Rudalics <rudalics@gmx.at>
2938
2939 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
2940 auto-buffer-name window parameter. Install revision of reverted
2941 fix.
457294dd 2942
4f2daf31
DA
29432012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2944
2945 Do not allow to set major mode for a dead buffer.
2946 * buffer.c (Fset_buffer_major_mode): Signal an error
2947 if the buffer is dead.
2948 (Fother_buffer, other_buffer_safely): Remove redundant
2949 nested declaration.
2950
66322887
DA
29512012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2952
2953 Always use set_buffer_if_live to restore original buffer at unwind.
2954 * buffer.h (record_unwind_current_buffer): New function.
2955 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
2956 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
2957 * undo.c, window.c: Adjust users.
2958 * buffer.c (set_buffer_if_live): Fix comment.
2959
a3d794a1
DA
29602012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
2961
2962 Fix usage of set_buffer_internal.
2963 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
2964 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
2965 * coding.c (decode_coding): Omit redundant test.
2966 * fileio.c (decide_coding_unwind): Likewise.
2967 * fns.c (secure_hash): Likewise.
2968 * insdel.c (modify_region): Likewise.
2969 * keyboard.c (command_loop_1): Likewise.
2970 * print.c (PRINTFINISH): Likewise.
2971 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
2972
59ea14cd
PE
29732012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2974
2975 * dispnew.c: Use bool for boolean.
2976 (frame_garbaged, display_completed, delayed_size_change)
2977 (fonts_changed_p, add_window_display_history)
2978 (add_frame_display_history, verify_row_hash)
2979 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
2980 (row_equal_p, realloc_glyph_pool)
2981 (allocate_matrices_for_frame_redisplay)
2982 (showing_window_margins_p)
2983 (adjust_frame_glyphs_for_frame_redisplay)
2984 (build_frame_matrix_from_leaf_window, make_current)
2985 (mirrored_line_dance, mirror_line_dance, update_frame)
2986 (update_window_tree, update_single_window)
2987 (check_current_matrix_flags, update_window, update_text_area)
2988 (update_window_line, set_window_update_flags, scrolling_window)
2989 (update_frame_1, scrolling, buffer_posn_from_coords)
2990 (do_pending_window_change, change_frame_size)
2991 (change_frame_size_1, sit_for):
2992 Use bool for boolean.
2993 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
2994 and remove last int (actually boolean) argument, which was always 0.
2995 All callers changed.
2996 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
2997 * dispextern.h (struct composition_it): Use bool for boolean.
2998 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
2999 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3000 * dired.c (file_name_completion):
3001 Use bool for boolean. (This was missed in an earlier change.)
3002
95072a94
MR
30032012-08-27 Martin Rudalics <rudalics@gmx.at>
3004
3005 * window.c (Fset_window_configuration): Revert first part of
3006 last change.
3007
0f19feff
JD
30082012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3009
3010 * nsterm.h (NSPanel): New class variable dialog_return.
3011
3a880af4
SM
3012 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3013 Initialize dialog_return.
0f19feff
JD
3014 (windowShouldClose:): Use stop instead of stopModalWithCode.
3015 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3016 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3017 event.
3018 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3019 modal loop returns.
3020
f10fe38f
PE
30212012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3022
de1339b0
PE
3023 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3024 * composite.c (find_composition, composition_gstring_p)
3025 (composition_reseat_it, find_automatic_composition):
3026 * data.c (let_shadows_buffer_binding_p)
3027 (let_shadows_global_binding_p, set_internal, make_blv)
3028 (Fmake_variable_buffer_local, Fmake_local_variable)
3029 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3030 (cons_to_signed, arith_driver):
3031 * dbusbind.c (xd_in_read_queued_messages):
3032 * dired.c (directory_files_internal, file_name_completion):
3033 Use bool for booleans.
3034 * dired.c (file_name_completion):
3035 * process.h (fd_callback):
3036 Omit int (actually boolean) argument. It wasn't being used.
3037 All uses changed.
3038 * composite.h, lisp.h: Reflect above API changes.
3039
f10fe38f
PE
3040 * cmds.c, coding.c: Use bool for booleans.
3041 * cmds.c (move_point, Fself_insert_command):
3042 * coding.h (struct composition status, struct coding_system):
3043 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3044 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3045 (emacs_mule_char, decode_coding_emacs_mule)
3046 (encode_coding_emacs_mule, detect_coding_iso_2022)
3047 (decode_coding_iso_2022, encode_invocation_designation)
3048 (encode_designation_at_bol, encode_coding_iso_2022)
3049 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3050 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3051 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3052 (encode_coding_raw_text, detect_coding_charset)
3053 (decode_coding_charset, encode_coding_charset, detect_eol)
3054 (detect_coding, get_translation_table, produce_chars)
3055 (consume_chars, reused_workbuf_in_use)
3056 (make_conversion_work_buffer, code_conversion_save)
3057 (decode_coding_object, encode_coding_object)
3058 (detect_coding_system, char_encodable_p)
3059 (Funencodable_char_position, code_convert_region)
3060 (code_convert_string, code_convert_string_norecord)
3061 (Fset_coding_system_priority):
3062 * fileio.c (Finsert_file_contents):
3063 Use bool for booleans.
3064 * coding.h, lisp.h: Reflect above API changes.
3065 * coding.c: Remove unnecessary static function decls.
3066 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3067 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3068 not a boolean 'int', since callers never look at the return value.
3069 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3070 * coding.h (decoding_buffer_size, encoding_buffer_size)
3071 (emacs_mule_string_char): Remove unused extern decls.
3072 (struct iso_2022_spec, struct coding_system):
3073 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3074 (struct emacs_mule_spec): Remove unused field 'full_support'.
3075 All initializations removed.
3076 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3077
5474c384
DA
30782012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3079
f10fe38f 3080 Fix spare memory change (Bug#12286).
5474c384
DA
3081 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3082 (valid_lisp_object_p): Likewise.
3083
c4b6914d
MR
30842012-08-27 Martin Rudalics <rudalics@gmx.at>
3085
3086 * window.c (Fset_window_configuration): Record any window's old
3087 buffer if it's replaced (see Bug#8789). If the new current
3088 buffer doesn't appear in the selected window, go to its old
3089 point (Bug#12208).
3090
35aaa1ea
DA
30912012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3092
3093 Special MEM_TYPE_SPARE to denote reserved memory.
3094 * alloc.c (enum mem_type): New memory type.
3095 (refill_memory_reserve): Use new type for spare memory.
3096 This prevents live_cons_p and live_string_p from incorrect
3097 detection of uninitialized objects from spare memory as live.
3098
6af64513
PE
30992012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3100
8b2e00a3
PE
3101 Spelling fixes.
3102 * Makefile.in (.PHONY): versioclean -> versionclean.
3103
b52d6985
PE
3104 Remove unused external symbols.
3105 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3106 * window.c (Qwindow_valid_p, decode_valid_window):
3107 Now static, not extern.
3108 * data.c (Qinterval): Remove; unused.
3109 (syms_of_data): Do not define 'interval'.
3110 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3111 * window.h (decode_valid_window):
3112 Remove decls.
3113
d5172d4f
PE
3114 * character.c, charset.c, chartab.c: Use bool for booleans.
3115 * character.c (lisp_string_width, string_count_byte8)
3116 (string_escape_byte8):
3117 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3118 (load_charset_map_from_file, map_charset_chars)
3119 (Fdefine_charset_internal, define_charset_internal)
3120 (Fdeclare_equiv_charset, find_charsets_in_text)
3121 (Ffind_charset_region, char_charset, Fiso_charset):
3122 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3123 (sub_char_table_set, sub_char_table_set_range)
3124 (char_table_set_range, optimize_sub_char_table)
3125 (map_sub_char_table):
3126 Use bool for boolean.
3127 * character.c (str_to_unibyte): Omit last boolean argument; it was
3128 always 0. All callers changed.
3129 * character.h, charset.h: Adjust to match previous changes.
3130 * character.h (char_printable_p): Remove decl of nonexistent function.
3131 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3132 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3133 are all boolean, so make them single-bit bitfields.
3134
6af64513
PE
3135 * lisp.h (ASET): Remove attempt to detect side effects.
3136 It was meant to be temporary and it often doesn't work,
3137 because when IDX has side effects the behavior of IDX==IDX
3138 is undefined. See Stefan Monnier in
3139 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3140
e1f29348
BR
31412012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3142
3143 * lisp.h (functionp): New function (extracted from Ffunctionp).
3144 (FUNCTIONP): Use it.
3145 * eval.c (Ffunctionp): Use it.
3146
17c05d74
PE
31472012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3148
0f46bc75
PE
3149 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3150 as that's faster and simpler than static storage. Don't bother
3151 with the g_main_context_query overhead if g_main_context_pending
3152 says no events are pending.
3153 (gfds, gfds_size): Remove these static vars.
3154 (xgselect_initialize): Remove; no longer needed.
3155 All uses and decls removed.
3156
ee4c0f69
PE
3157 * emacs.c (fatal_error_signal_hook): Remove.
3158 All uses removed. This leftover from old code was always 0.
3159
17c05d74
PE
3160 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3161 * casefiddle.c (casify_object, casify_region):
3162 * casetab.c (set_case_table):
3163 * category.c, category.h (word_boundary_p):
3164 * category.h (CHAR_HAS_CATEGORY):
3165 Use bool for booleans, instead of int.
3166
391ceac5
EZ
31672012-08-25 Eli Zaretskii <eliz@gnu.org>
3168
3169 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3170
2f221583
PE
31712012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3172
f4a681b0
PE
3173 On assertion failure, print backtrace if available.
3174 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3175 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3176 * Makefile.in (LIB_EXECINFO): New macro.
3177 (LIBES): Use it.
3178
2f221583
PE
3179 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3180 * bytecode.c (exec_byte_code):
3181 * callint.c (check_mark, Fcall_interactively):
3182 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3183 (getenv_internal, sync_process_alive, call_process_exited):
3184 * lisp.h (USE_SAFE_ALLOCA):
3185 Use bool for booleans, instead of int.
3186 * lisp.h, process.h: Adjust prototypes to match above changes.
3187 * callint.c (Fcall_interactively): Don't assume the mark's
3188 offset fits in 'int'.
3189
37ef52bb
PE
31902012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3191
3192 * buffer.c, buffer.h: Use bool for boolean.
3193 * buffer.c (reset_buffer_local_variables)
3194 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3195 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3196 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3197 (overlay_touches_p, overlay_strings, Foverlay_put)
3198 (report_overlay_modification, call_overlay_mod_hooks):
3199 (mmap_enlarge, mmap_set_vars):
3200 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3201 Use bool for booleans, instead of int.
3202 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3203 since the 1-or-0 return value is always ignored anyway.
3204 (mmap_initialized_p):
3205 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3206 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3207
2cc21167
PE
32082012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3209
3210 * bidi.c: Use bool for boolean.
3211 This is a bit more readable, and makes the text segment of bidi.o
3212 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3213 Presumably it's faster too.
3214 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3215 Now bool.
3216 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3217 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3218 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3219 (bidi_explicit_dir_char, bidi_level_of_next_char)
3220 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3221 Use bool for booleans, instead of int.
3222 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3223 (bidi_unshelve_cache): Adjust decls to match code.
3224
7db4ddf4
MR
32252012-08-23 Martin Rudalics <rudalics@gmx.at>
3226
3227 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3228 argument.
3229
b1bb8011
PE
32302012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3231
3232 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3233 * atimer.h: Include <stdbool.h>.
3234
ff687885
DN
32352012-08-22 Dan Nicolaescu <dann@gnu.org>
3236
3237 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3238 compile time tests instead of run time tests on systems that do
3239 not use them.
3240 (FRAME_MAC_P): Remove leftover from deleted code.
3241 * frame.c (syms_of_frame): Remove leftover from deleted code.
3242
4ce7a138
JD
32432012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3244
3245 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3246
d733ec6d
PE
32472012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3248
3249 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3250 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 3251 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
3252 (fontset_add): Return void, for FONTSET_ADD.
3253
d0d2d26f
PE
32542012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3255
fce31d69
PE
3256 * alloc.c: Use bool for booleans.
3257 (gc_in_progress, abort_on_gc)
3258 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3259 (dont_register_blocks) [GC_MALLOC_CHECK]:
3260 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3261 (check_string_bytes, make_specified_string, memory_full)
3262 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3263 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3264 (mark_stack, valid_pointer_p, make_pure_string)
3265 (Fgarbage_collect, survives_gc_p, gc_sweep):
3266 Use bool for booleans, instead of int.
3267 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3268 Remove unused local.
3269 * alloc.c (PURE_POINTER_P):
3270 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3271 * editfns.c (Fformat):
3272 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3273 (Fdo_auto_save):
3274 * fns.c (sweep_weak_table):
3275 * lisp.h (suppress_checking, push_message, survives_gc_p)
3276 (make_pure_string, gc_in_progress, abort_on_gc):
3277 * lread.c (readchar, read1):
3278 * print.c (Fprin1_to_string):
3279 * xdisp.c (push_message):
3280 Use bool for booleans affected directly or indirectly by
3281 alloc.c's changes.
3282
d0d2d26f
PE
3283 Make recently-introduced setters macros.
3284 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3285 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3286 (set_fontset_default, set_fontset_fallback): Rename from their
3287 upper-case counterparts, and make them functions rather than macros.
3288 This is more consistent with the other recently-introduced setters.
3289 These don't need to be inline, since they're local.
3290
d18e2bb6
JD
32912012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3292
3293 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3294 the loop (Bug#12247).
3295
1b9d9d16
PE
32962012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3297
3298 * lisp.h (vcopy): Use memcpy rather than our own loop.
3299 This fixes a performance regression introduced by the recent
3300 addition of vcopy. This means 'vcopy' will need to be modified
3301 for a copying collector, but that's OK. Also, tighten the
3302 checking in the assertion.
3303
b2f09701
EZ
33042012-08-21 Eli Zaretskii <eliz@gnu.org>
3305
3306 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3307 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3308 non-base glyph for the width of the base character, according to
e1f29348
BR
3309 what x_draw_composite_glyph_string_foreground expects.
3310 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
3311 expectations, to produce correct width of the composed character.
3312 Reverse the sign of the DU offset produced by ScriptPlace.
3313
9b994fed
PE
33142012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3315
3316 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3317
086ca913
DA
33182012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3319
3320 Avoid direct writes to contents member of struct Lisp_Vector.
3321 * lisp.h (vcopy): New function to copy data into vector.
3322 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3323 * fns.c (Ffillarray): Use ASET.
3324 * keyboard.c (timer_check_2): Use AREF and ASET.
3325 (append_tool_bar_item, Frecent_keys): Use vcopy.
3326 * lread.c (read_vector): Use ASET.
3327 * msdos.c (Frecent_doskeys): Use vcopy.
3328 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3329 (Finternal_merge_in_global_face): Use ASET and vcopy.
3330 * xfont.c (xfont_list_pattern): Likewise.
3331
5481664a
MR
33322012-08-21 Martin Rudalics <rudalics@gmx.at>
3333
3334 * window.c (Fwindow_point): For the selected window always return
3335 the position of its buffer's point.
3336 (Fset_window_point): For the selected window always go in its
3337 buffer to the specified position.
3338
6d470bdd
DA
33392012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3340
3341 Setter macros for fontsets.
3342 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3343 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3344 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3345 Adjust users.
3346
24564fe1
GM
33472012-08-20 Glenn Morris <rgm@gnu.org>
3348
3349 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3350 Don't assume that `ln -f' works.
3351
0a05a035
EZ
33522012-08-20 Eli Zaretskii <eliz@gnu.org>
3353
3354 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3355 and later about non-assignments with no effect. See discussion at
3356 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3357 details.
3358
e46f2325
DA
33592012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3360
3361 Inline setter functions for Lisp_Objects slots of struct specbinding.
3362 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3363 Adjust users.
3364
734fbd86
MR
33652012-08-20 Martin Rudalics <rudalics@gmx.at>
3366
3367 * window.c (select_window): Always make selected window's buffer
3368 current.
3369
f1a95992
DA
33702012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3371
3372 Use AREF and ASET for docstrings of category tables.
3373 * category.h (CATEGORY_DOCSTRING): Use AREF.
3374 (SET_CATEGORY_DOCSTRING): Use ASET.
3375 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3376
e83064be
DA
33772012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3378
3379 Inline setter functions for hash table members.
3380 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3381 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3382 (set_hash_key_and_value, set_hash_index, set_hash_next)
3383 (set_hash_hash): New functions.
3384 * charset.c, fns.c: Adjust users.
3385
4ce60d2e
DA
33862012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3387
3388 Inline getter and setter functions for per-buffer values.
3389 * buffer.h (per_buffer_default, set_per_buffer_default)
3390 (per_buffer_value, set_per_buffer_value): New functions.
3391 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3392 * buffer.c, data.c: Adjust users.
3393
c06c9690
JB
33942012-08-20 Juanma Barranquero <lekktu@gmail.com>
3395
3396 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3397
32bd4250
PE
33982012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3399
bad03192 3400 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3401 as gnulib does this if the system doesn't.
3402 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3403 Remove declaration. MS-Windows declares it on stdlib.h which is
3404 included by conf_post.h.
b69a6d22
PE
3405 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3406 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3407 * vm-limit.c: Include <unistd.h>, for 'environ'.
3408
22d7feb2
PE
3409 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3410 (start_of_data): Remove decl; mem-limits.h provides it.
3411
32bd4250
PE
3412 * xdisp.c (handle_invisible_prop): Make it a bit faster
3413 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3414
450809af
CY
34152012-08-19 Chong Yidong <cyd@gnu.org>
3416
3417 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3418 ends (Bug#3874).
3419
9e677988
AS
34202012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3421
6b1319ce
AS
3422 * .gdbinit: Use call instead of set when calling a function in the
3423 inferior.
3424
9e677988
AS
3425 * data.c (set_internal): Don't use set_blv_found.
3426 (Fkill_local_variable): Likewise.
3427
d7191076
AA
34282012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3429
3430 * nsfont.m (ns_ascii_average_width): Ensure the string
3431 ascii_printable is initialized with a null-terminated character
3432 array. Otherwise, it can contain undesired extra characters.
3433
e757f1c6
PE
34342012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3435
3436 port new setting code to Sun C 5.8 2005/10/13
3437 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3438 Return void, not Lisp_Object. Otherwise, the compiler
3439 complains about (A?B:C) where B is void and C is Lisp_Object
3440 when compiling CHAR_TABLE_SET, due to the recent change to
3441 the API of sub_char_table_set_contents.
3442
a999ce26
CY
34432012-08-18 Chong Yidong <cyd@gnu.org>
3444
3445 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3446 for the string case (Bug#3874).
3447
3f22b86f
PE
34482012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3449
39eb03f1
PE
3450 * buffer.h (BSET): Remove (Bug#12215).
3451 Replace all uses with calls to new setter functions.
3452 (bset_bidi_paragraph_direction, bset_case_canon_table)
3453 (bset_case_eqv_table, bset_directory, bset_display_count)
3454 (bset_display_time, bset_downcase_table)
3455 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3456 (bset_last_selected_window, bset_local_var_alist)
3457 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3458 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3459 (bset_width_table):
3460 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3461 (bset_auto_fill_function, bset_auto_save_file_format)
3462 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3463 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3464 (bset_cache_long_line_scans, bset_case_fold_search)
3465 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3466 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3467 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3468 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3469 (bset_header_line_format, bset_indicate_buffer_boundaries)
3470 (bset_indicate_empty_lines, bset_invisibility_spec)
3471 (bset_left_fringe_width, bset_major_mode, bset_mark)
3472 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3473 (bset_name, bset_overwrite_mode, bset_pt_marker)
3474 (bset_right_fringe_width, bset_save_length)
3475 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3476 (bset_scroll_up_aggressively, bset_selective_display)
3477 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3478 (bset_word_wrap, bset_zv_marker):
3479 * category.c (bset_category_table):
3480 * syntax.c (bset_syntax_table):
3481 New setter functions.
3482
6a09a33b
PE
3483 * process.h (PSET): Remove (Bug#12215).
3484 Replace all uses with calls to new setter functions.
3485 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3486 (PROCESS_INLINE): New macro.
3487 (pset_childp): New setter function.
3488 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3489 * process.c (PROCESS_INLINE):
3490 Define to EXTERN_INLINE, so that the corresponding functions
3491 are compiled into code.
3492 (pset_buffer, pset_command, pset_decode_coding_system)
3493 (pset_decoding_buf, pset_encode_coding_system)
3494 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3495 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3496 (pset_type, pset_write_queue): New setter functions.
3497
e8c17b81
PE
3498 * window.h (WSET): Remove (Bug#12215).
3499 Replace all uses with calls to new setter functions.
3500 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3501 (WINDOW_INLINE): New macro.
3502 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3503 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3504 (wset_total_lines, wset_vertical_scroll_bar)
3505 (wset_window_end_pos, wset_window_end_valid)
3506 (wset_window_end_vpos): New setter functions.
3507 * window.c (WINDOW_INLINE):
3508 Define to EXTERN_INLINE, so that the corresponding functions
3509 are compiled into code.
3510 (wset_combination_limit, wset_dedicated, wset_display_table)
3511 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3512 (wset_new_normal, wset_new_total, wset_next_buffers)
3513 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3514 (wset_prev_buffers, wset_right_fringe_width)
3515 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3516 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3517 (wset_window_parameters):
3518 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3519 (wset_column_number_displayed, wset_region_showing):
3520 New setter functions.
3521
3f22b86f
PE
3522 * termhooks.h (TSET): Remove (Bug#12215).
3523 Replace all uses with calls to new setter functions.
3524 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3525 (TERMHOOKS_INLINE): New macro.
3526 (tset_charset_list, tset_selection_alist): New setter functions.
3527 * terminal.c (TERMHOOKS_INLINE):
3528 Define to EXTERN_INLINE, so that the corresponding functions
3529 are compiled into code.
3530 (tset_param_alist): New setter function.
3531
742af32f
PE
35322012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3533
15dbb4d6
PE
3534 * keyboard.h (KSET): Remove (Bug#12215).
3535 Replace all uses with calls to new setter functions.
3536 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3537 (KEYBOARD_INLINE): New macro.
3538 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3539 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3540 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3541 New setter functions.
3542 * keyboard.c (KEYBOARD_INLINE):
3543 Define to EXTERN_INLINE, so that the corresponding functions
3544 are compiled into code.
3545 (kset_echo_string, kset_kbd_queue)
3546 (kset_keyboard_translate_table, kset_last_prefix_arg)
3547 (kset_last_repeatable_command, kset_local_function_key_map)
3548 (kset_overriding_terminal_local_map, kset_real_last_command)
3549 (kset_system_key_syms): New setter functions.
3550
f00af5b1
PE
3551 * frame.h (FSET): Remove (Bug#12215).
3552 Replace all uses with calls to new setter functions.
3553 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3554 (FRAME_INLINE): New macro.
3555 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3556 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3557 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3558 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3559 (fset_param_alist, fset_root_window, fset_scroll_bars)
3560 (fset_selected_window, fset_title, fset_tool_bar_items)
3561 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3562 * frame.c (FRAME_INLINE):
3563 Define to EXTERN_INLINE, so that the corresponding functions
3564 are compiled into code.
3565 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3566
0c94c8d6
PE
3567 A few more naming-convention fixes for getters and setters.
3568 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3569 and rename from buffer_overlays_set_before.
3570 (set_buffer_overlays_after): Move here from buffer.h, and rename
3571 from buffer_overlays_set_after.
3572 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3573 All uses changed.
3574 (set_buffer_intervals): Rename from buffer_set_intervals.
3575 * intervals.c (set_interval_object): Move here from intervals.h,
3576 and rename from interval_set_object.
3577 (set_interval_left): Move here from intervals.h, and rename from
3578 interval_set_left.
3579 (set_interval_right): Move here from intervals.h, and rename from
3580 interval_set_right.
3581 (copy_interval_parent): Move here from intervals.h, and rename from
3582 interval_copy_parent.
3583 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3584 (set_interval_plist): Rename from interval_set_plist.
3585 Return void, not Lisp_Object, since no caller uses the result.
3586 * lisp.h (string_intervals): Rename from string_get_intervals.
3587 (set_string_intervals): Rename from string_set_intervals.
3588
34dabdb7
PE
3589 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3590 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3591 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3592 All uses changed. See the end of
3593 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3594
742af32f
PE
3595 * lisp.h (CSET): Remove (Bug#12215).
3596 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3597 (set_char_table_purpose): New functions,
3598 replacing CSET. All uses changed. For example, replace
3599 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3600 "set_char_table_parent (char_table, parent);".
742af32f
PE
3601 The old version was confusing because it used the same name
3602 'parent' for two different things.
3603
a04e2c62
DA
36042012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3605
3606 Functions to get and set Lisp_Object fields of buffer-local variables.
3607 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3608 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3609 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3610 * data.c, eval.c, frame.c: Adjust users.
3611
383dcbf9
CY
36122012-08-17 Chong Yidong <cyd@gnu.org>
3613
3614 * xfaces.c (merge_face_vectors): If the target font specfies a
3615 font spec, make the font's attributes take precedence over
3616 directly-specified attributes.
3617 (merge_face_ref): Recognize :font.
3618
44386687
DA
36192012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3620
3621 Do not use memcpy for copying intervals.
3622 * intervals.c (reproduce_interval): New function.
3623 (reproduce_tree, reproduce_tree_obj): Use it.
3624 (reproduce_tree_obj): Remove prototype.
3625
927c7216
PE
36262012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3627
3628 * lisp.h (duration_to_sec_usec): Remove unused decl.
3629
93044f7b
AA
36302012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3631
3632 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3633 to an allocated instance of NSString, not to the class itself.
3634
9851e4a5
JB
36352012-08-17 Juanma Barranquero <lekktu@gmail.com>
3636
3637 * makefile.w32-in (C_CTYPE_H): New macro.
3638 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3639 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3640 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3641
620f13b0
PE
36422012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3643
3644 Use ASCII tests for character types.
3645 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3646 * xfns.c, xterm.c:
3647 Don't include <ctype.h>; was not needed.
3648 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3649 * sysdep.c, xfaces.c:
3650 Include <c-ctype.h> instead of <ctype.h>.
3651 * nsterm.m: Include <c-ctype.h>.
3652 * charset.c (read_hex):
3653 * doc.c (Fsnarf_documentation):
3654 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3655 (DRIVE_LETTER) [DOS_NT]:
3656 (Ffile_name_directory, Fexpand_file_name)
3657 (Fsubstitute_in_file_name):
3658 * font.c (font_parse_xlfd, font_parse_fcname):
3659 * frame.c (x_set_font_backend):
3660 * gtkutil.c (xg_get_font):
3661 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3662 * nsimage.m (hexchar):
3663 * nsterm.m (ns_xlfd_to_fontname):
3664 * sysdep.c (system_process_attributes):
3665 * xfaces.c (hash_string_case_insensitive):
3666 Use C-locale tests instead of locale-specific tests for character
3667 types, since we want the ASCII interpretation here, not the
3668 interpretation suitable for whatever happens to be the current locale.
3669
52162052
MR
36702012-08-16 Martin Rudalics <rudalics@gmx.at>
3671
3672 Consistently check windows for validity/liveness
3673 (Bug#11984, Bug#12025, Bug#12026).
3674 * lisp.h (CHECK_VALID_WINDOW): New macro.
3675 * window.c (decode_window): Rename to decode_live_window.
3676 (decode_valid_window, Fwindow_valid_p): New functions.
3677 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3678 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3679 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3680 (Fwindow_prev_sibling, Fwindow_combination_limit)
3681 (Fset_window_combination_limit, Fwindow_use_time)
3682 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3683 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3684 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3685 (Fwindow_hscroll, Fset_window_hscroll)
3686 (Fwindow_redisplay_end_trigger)
3687 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3688 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3689 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3690 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3691 (Fwindow_end, Fset_window_point, Fset_window_start)
3692 (Fpos_visible_in_window_p, Fwindow_line_height)
3693 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3694 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3695 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3696 (Fset_window_parameter, Fwindow_display_table)
3697 (Fset_window_display_table, Fdelete_other_windows_internal)
3698 (Fset_window_buffer, Fset_window_new_total)
3699 (Fset_window_new_normal, Fdelete_window_internal)
3700 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3701 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3702 (Fwindow_scroll_bars): Check whether argument window is a valid or
3703 live window. Update doc-strings.
3704 (syms_of_window): New symbol Qwindow_valid_p.
3705 * keyboard.c (Fposn_at_x_y): Check whether argument
3706 frame_or_window denotes a valid window.
3707
2751c80f
DA
37082012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3709
3710 Fix previous char table change.
3711 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3712 * chartab.c (optimize_sub_char_table): Likewise.
3713
032a42c8
CY
37142012-08-16 Chong Yidong <cyd@gnu.org>
3715
a2d19368
CY
3716 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3717
032a42c8
CY
3718 * xfont.c (xfont_open):
3719 * xftfont.c (xftfont_open): Set the font's max_width field.
3720
3721 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3722 min_width to space_width and average_width to the average over
3723 printable ASCII characters.
3724 (ns_char_width): Code cleanup.
3725 (ns_ascii_average_width): New utility function.
3726
3727 * font.h (struct font): Update comments.
3728
a098c930
DA
37292012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3730
032a42c8 3731 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3732 * lisp.h (CSET): New macro.
3733 (char_table_set_extras, char_table_set_contents)
3734 (sub_char_table_set_contents): New function.
3735 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3736 * syntax.c: Adjust users.
3737
8be3a09c
SM
37382012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3739
3740 * eval.c (eval_sub): Bind lexical-binding.
3741 * lread.c (Qlexical_binding): Make non-static.
3742
ac4845a6
JD
37432012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3744
ddee6515
JD
3745 * nsmenu.m (popupSession): Remove.
3746 (pop_down_menu): Remove endModalSession.
3747 (timeout_handler:): New method.
3748 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3749 Call runModalForWindow. Check timer_fired when it returns.
3750 If not set, cancel timer and break out of loop.
3751 Otherwise loop again, with a new timeout.
3752
3753 * nsterm.m: Include fcntl.h if present.
3754 (fd_entry, t_readfds, inNsSelect): Remove.
3755 (select_writefds, select_valid, select_timeout, selfds)
3756 (select_mutex, apploopnr): Add.
3757 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3758 Otherwise call kbd_buffer_store_event.
3759 (ns_send_appdefined): Remove release of fd_entry.
3760 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3761 Increment and decrement apploopnr.
3762 (ns_select): If no file descriptors, just do a NSTimer.
3763 Otherwise copy read/write masks and start select thread (fd_handler).
3764 Start main loop and wait for application defined event.
3765 Inform select thread to stop selecting after main loop is exited.
3766 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3767 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3768 (fd_handler:): Loop forever, wait for info from the main thread
3769 to either start or stop selecting. When select returns, send
3770 and appdefined event.
3771 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3772 If not call kbd_buffer_store_event.
3773
3774 * nsterm.h (EmacsApp): fd_handler takes id argument.
3775 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3776
ac4845a6
JD
3777 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3778
eb424fe3
EZ
37792012-08-15 Eli Zaretskii <eliz@gnu.org>
3780
3781 * region-cache.c (move_cache_gap): Update gap_len using the actual
3782 growth of the boundaries array. Do not change cache_len.
3783 (Bug#12196)
3784
4e6a86c6
DA
37852012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3786
3787 Generalize and cleanup font subsystem checks.
3788 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3789 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3790 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3791
5bf192ca
DA
37922012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3793
3794 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3795
f2045622
CY
37962012-08-15 Chong Yidong <cyd@gnu.org>
3797
8be3a09c
SM
3798 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3799 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3800 extract the font descriptor instead of just the font name.
3801 In that case, return a font spec instead of a string.
f2045622
CY
3802 (x_last_font_name): Move to this file from xfns.c.
3803
3804 * xfns.c (Fx_select_font): The return value can also be a font
3805 spec. Move x_last_font_name management to gtkutil.c.
3806
3807 * xfaces.c: Make font weight and style symbols non-static.
3808
7f6feb56
SM
38092012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3810
3811 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3812 (bug#12117).
3813
fecbd8ff
SM
38142012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3815
3816 * alloc.c (Fgarbage_collect): Use plural form consistently.
3817
9b8d5165
EZ
38182012-08-14 Eli Zaretskii <eliz@gnu.org>
3819
3820 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3821 iteration through the command loop. Fixes a problem whereby mouse
3822 movements are ignored until the first mouse click.
3823
f5d9e83a
PE
38242012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3825
3826 Use bool, not int, for Lisp booleans.
3827 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3828 makes Emacs a bit smaller and presumably a bit faster.
3829 * lisp.h: Include <stdbool.h>.
3830 (struct Lisp_Boolfwd, defvar_bool):
3831 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3832 * regex.c [!emacs]: Include <stdbool.h>.
3833 (false, true): Remove; <stdbool.h> does this for us now.
3834
55802e4a
CY
38352012-08-14 Chong Yidong <cyd@gnu.org>
3836
4abcdac8
CY
3837 * character.c (Fcharacterp): Doc fix (Bug#12076).
3838
3839 * data.c (Findirect_variable): Doc fix (Bug#11040).
3840
55802e4a
CY
3841 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3842
3843 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3844 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3845
8e99d072
BR
38462012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3847
3848 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3849 (bug#12022).
3850
08908aca
MR
38512012-08-14 Martin Rudalics <rudalics@gmx.at>
3852
3853 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3854 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3855 * minibuf.c (choose_minibuf_frame, read_minibuf):
3856 * w32fns.c (x_create_tip_frame):
3857 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3858 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3859
56120d6f
PE
38602012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 * intervals.c (offset_intervals): Remove obsolete comment.
3863
67b77c0b
AS
38642012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3865
3866 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3867
f48b82fd
GR
38682012-08-14 Gergely Risko <gergely@risko.hu>
3869
3870 * coding.c (decode_coding): Record buffer modification before
3871 disabling undo_list (Bug#11773).
3872
fd318b54
DA
38732012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3874
3875 Revert and cleanup some recent overlay changes.
3876 * buffer.h (enum overlay_type): Remove.
3877 (buffer_get_overlays, buffer_set_overlays): Likewise.
3878 (buffer_set_overlays_before, buffer_set_overlays_after):
3879 New function. Adjust users.
3880 (unchain_both): Add eassert.
3881
41a62dd9
DA
38822012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3883
3884 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3885
5884c324
PE
38862012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3887
3888 * gtkutil.c (xg_mark_data): Don't assume C99.
3889
ca06f160
JD
38902012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3891
3892 * gtkutil.c (xg_frame_tb_info): New struct.
3893 (TB_INFO_KEY): New define.
3894 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3895 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3896 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3897 if not present.
3898 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 3899 is up to date. Otherwise store new data.
ca06f160
JD
3900 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3901
7864a3f7
DA
39022012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3903
3904 Use KSET for write access to Lisp_Object members of struct kboard.
3905 * keyboard.h (KSET): New macro.
3906 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3907 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3908 * xterm.c: Adjust users.
3909
4c31be61
DA
39102012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3911
3912 Use BSET for write access to Lisp_Object members of struct buffer.
3913 * buffer.h (BSET): New macro.
3914 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3915 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3916 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3917 * window.c, xdisp.c, xfns.c: Adjust users.
3918
14ae4239
BT
39192012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
3920
3921 * lread.c (syms_of_lread): Initialize Vlexical_binding.
3922
32bcadb4
JD
39232012-08-11 Jan Djärv <jan.h.d@swipnet.se>
3924
3d29b2ce 3925 * nsterm.m (not_in_argv): New function.
fc0c31f8 3926 (application:openFile, application:openTempFile:):
3d29b2ce
JD
3927 (application:openFileWithoutUI:, application:openFiles:): Open file
3928 if not_in_argv returns non-zero (bug#12171).
3929
32bcadb4 3930 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
3931 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
3932 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
3933 (xg_get_font_name): Use those functions/macros here.
3934 Reported by Frans Oilinki <moilinki@gmail.com>.
3935
9ff9402d 39362012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
3937
3938 * unexmacosx.c (copy_data_segment): Copy initialized data in
3939 statically linked libraries from input file rather than memory.
3940
db74a5fc
YM
3941 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
3942 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
3943 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
3944
25e65510
GM
39452012-08-10 Glenn Morris <rgm@gnu.org>
3946
3947 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
3948 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
3949
7961135c
DA
39502012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3951
3952 Fix last change to allow compilation with low optimization levels.
3953 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
3954 Reported by Jan Djärv <jan.h.d@swipnet.se>.
3955
42b3a444
DA
39562012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3957
3958 Use common inline syntax in intervals.h.
3959 * intervals.h (INTERVALS_INLINE): New macro.
3960 Change all users from LISP_INLINE.
3961
9fb0c957
DA
39622012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3963
3964 Define Qnone once for all platforms.
3965 * frame.c (Qnone): Define here.
3966 (syms_of_frame): DEFSYM it.
3967 * lisp.h (Qnone): New declaration.
3968 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
3969 * xfns.c: Remove duplication. Adjust users.
3970
65e8ee52
DA
39712012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
3972
3973 Remove unused macros from intervals.h.
3974 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
3975 * intervals.c: Adjust comment.
3976
9b855fd6
EZ
39772012-08-10 Eli Zaretskii <eliz@gnu.org>
3978
3979 * w32fns.c <w32_unicode_gui>: New static variable.
3980 (globals_of_w32fns): Initialize it according to os_subtype.
3981 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
3982 testing os_subtype.
3983
39cb9e56 39842012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
3985 Eli Zaretskii <eliz@gnu.org>
3986
3987 Fix bug #10299 with Unicode characters sent by customized
3988 keyboards created by MSKLC.
3989 * w32fns.c (INIT_WINDOW_CLASS): New macro.
3990 (w32_init_class): Use it to initialize the Emacs class with either
3991 ANSI or Unicode API calls.
3992 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
3993 later.
3994 (w32_wnd_proc): If the character code sent by WM_CHAR or
3995 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
3996 original message. Call DefWindowProcW on NT and later.
3997
9374581a
GM
39982012-08-10 Glenn Morris <rgm@gnu.org>
3999
4b94e8cf
GM
4000 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4001
9374581a
GM
4002 * lisp.h (DIRECTORY_SEP): Let configure set it.
4003
a2752828
DA
40042012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4005
4006 Use TSET for write access to Lisp_Object slots of struct terminal.
4007 * termhooks.h (TSET): New macro.
4008 * coding.c, terminal.c, xselect.c: Adjust users.
4009
cc92c454
SM
40102012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4011
4012 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4013 the failing expression, include them in the error message.
4014 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4015 * lisp.h (internal_condition_case_n): Update declaration.
4016
4cb3e6b3
DA
40172012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4018
4019 Inline functions to examine and change buffer overlays.
4020 * buffer.c (unchain_both): New function.
4021 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4022 (buffer_has_overlays): New function.
4023 (enum overlay_type): New enum.
4024 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4025 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4026
8707c1e5
DA
40272012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4028
4029 Inline functions to examine and change buffer intervals.
4030 * alloc.c (mark_interval_tree): Remove.
4031 (MARK_INTERVAL_TREE): Simplify.
4032 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4033 * intervals.c (buffer_balance_intervals): New function.
4034 (graft_intervals_into_buffer): Adjust indentation.
4035 (set_intervals_multibyte): Simplify.
4036 * buffer.h (BUF_INTERVALS): Remove.
4037 (buffer_get_intervals, buffer_set_intervals): New function.
4038 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4039 * intervals.c, textprop.c: Adjust users.
4040
ad8c997f
DA
40412012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4042
4043 Inline functions to examine and change string intervals.
4044 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4045 (string_get_intervals, string_set_intervals): New function.
4046 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4047 * lread.c, print.c, textprop.c: Adjust users.
4048
32ac3a6b
GM
40492012-08-08 Glenn Morris <rgm@gnu.org>
4050
4051 * lisp.mk (lisp): Remove language/persian.elc.
4052
77c7bcb1
DA
40532012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4054
4055 Cleanup intervals.
4056 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4057 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
4058 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4059 Adjust comment. Move under #if 0.
77c7bcb1
DA
4060 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4061 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4062
9c08a8d4
DA
40632012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4064
4065 Check total length of intervals with eassert.
4066 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4067 * intervals.c: Change all users to eassert.
4068
26d16b35
EZ
40692012-08-07 Eli Zaretskii <eliz@gnu.org>
4070
14ae4239
BT
4071 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4072 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
4073 INTERNAL_FIELD in Lisp_Cons.
4074
c644523b
DA
40752012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4076
4077 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4078 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4079 name since all xname users are fixed long time ago. Do not
4080 use INTERNAL_FIELD.
4081 (set_symbol_name, set_symbol_function, set_symbol_plist):
4082 (set_symbol_next, set_overlay_plist): New function.
4083 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4084 (struct Lisp_Overlay): Likewise.
4085 (CVAR, MVAR, SVAR): Remove.
4086 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4087 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4088 * xterm.c: Adjust users.
4089 * .gdbinit: Change to use name field of struct Lisp_Symbol
4090 where appropriate.
4091
6a3d20cc
DA
40922012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4093
4094 Basic functions to set Lisp_Object and pointer slots of intervals.
4095 * intervals.h (interval_set_parent, interval_set_object):
4096 (interval_set_left, interval_set_right, interval_set_plist):
4097 (interval_copy_parent): New function.
4098 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
4099 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4100 Adjust indentation.
6a3d20cc
DA
4101 (INTERVAL_SIZE): Remove. Adjust users.
4102 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4103
4d2b044c
DA
41042012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4107 * process.h (PGET): Remove.
4108 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4109 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4110
d3d50620
DA
41112012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4112
4113 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4114 * window.h (WGET): Remove.
4115 (struct window): Do not use INTERNAL_FIELD.
4116 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4117 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4118 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4119 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4120 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4121 Adjust users.
4122
d10a51dc
CY
41232012-08-07 Chong Yidong <cyd@gnu.org>
4124
4125 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4126 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4127 (Fdelete_window_internal): Signal an error if the window is not on
4128 a live frame (Bug#12025).
4129
e69b0960
DA
41302012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4131
4132 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4133 * frame.h (FGET): Remove.
4134 (struct frame): Do not use INTERNAL_FIELD.
4135 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4136 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4137 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4138 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4139
25a20a3a
JB
41402012-08-06 Juanma Barranquero <lekktu@gmail.com>
4141
4142 * w32.c: Silence compiler warnings.
4143 (map_w32_filename): Remove unused variable `is_fat'.
4144 (chase_symlinks): Add parentheses around expression.
4145
1c6f11f4
GM
41462012-08-06 Glenn Morris <rgm@gnu.org>
4147
1db4583a
GM
4148 * sysdep.c: Respect BROKEN_GETWD.
4149
1c6f11f4
GM
4150 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4151 Let configure handle it.
4152 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4153
2b90362b
DA
41542012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4155
4156 Use GCALIGNMENT where appropriate.
4157 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4158 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4159 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4160
5f50daf2
EZ
41612012-08-06 Eli Zaretskii <eliz@gnu.org>
4162
14ae4239
BT
4163 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4164 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 4165
cbcc7007
SM
41662012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4167
4168 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4169 that should be sufficient for everyone.
4170
4d365fa4
JD
41712012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4172
4173 * keyboard.c (timer_check_2): Add break so timer_check returns next
4174 timeout.
4175
dd86bd82
DA
41762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4177
4178 Fix Windows build errors introduced after converting to WGET and WSET.
4179 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4180 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4181
054e1668
JD
41822012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4183
4184 * nsterm.m (ns_frame_rehighlight): Use FSET.
4185
4186 * nsmenu.m (ns_update_menubar): Use FSET.
4187
21238f11
DA
41882012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4189
4190 Separate read and write access to Lisp_Object slots of Lisp_Process.
4191 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4192 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4193
077288cf
DA
41942012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4195
4196 Separate read and write access to Lisp_Object slots of struct window.
4197 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4198 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4199 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4200 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4201 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4202 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4203 Adjust users.
4204
71688bd7
DA
42052012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4206
4207 Fix Windows build errors introduced after converting to FGET and FSET.
4208 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4209 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4210 (w32_judge_scroll_bars): Change to use FSET.
4211 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4212
f99bac93
DA
42132012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4214
4215 Fix replacement typo.
4216 * window.c (replace_window): Set root_window instead of
4217 selected_window. This fixes a total window subsystem
4218 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4219
8c2a0f2d
GM
42202012-08-06 Glenn Morris <rgm@gnu.org>
4221
4222 * lisp.mk (lisp): Add language/persian.elc.
4223
edd74c35
DA
42242012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4225
4226 Separate read and write access to Lisp_Object slots of struct frame.
4227 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4228 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4229 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4230 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4231 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4232
8671676c
AS
42332012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4234
4235 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4236
663e2b3f
DA
42372012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4238
4239 Generalize common compile-time constants.
4240 * lisp.h (header_size, bool_header_size, word_size): Now here.
4241 (struct Lisp_Vector): Add comment.
4242 (struct Lisp_Bool_Vector): Move up to define handy constants.
4243 (VECSIZE, PSEUDOVECSIZE): Simplify.
4244 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4245 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4246 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4247 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4248 * xfont.c, xmenu.c: Use word_size where appropriate.
4249
d32e47af
LM
42502012-08-05 Lawrence Mitchell <wence@gmx.li>
4251
4252 * search.c (Freplace_match): Treat \? in the replacement text
4253 literally (Bug#8161).
4254
e5d9c0d1
CY
42552012-08-05 Chong Yidong <cyd@gnu.org>
4256
4257 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4258 * frame.c (Vdelete_frame_functions):
4259 * emacs.c (Vkill_emacs_hook): Doc fix.
4260
8da0576b
EZ
42612012-08-04 Eli Zaretskii <eliz@gnu.org>
4262
4263 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4264 --with-x-toolkit=no builds.
4265 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4266
02676e5d
CY
42672012-08-04 Chong Yidong <cyd@gnu.org>
4268
4269 * syntax.c (Fmodify_syntax_entry): Doc fix.
4270
97147da9
EZ
42712012-08-04 Eli Zaretskii <eliz@gnu.org>
4272
76151e2c
EZ
4273 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4274 * w32.c (init_environment): Change the default values of many
4275 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
4276 them into environment when they were not already defined.
4277 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 4278 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
4279 (check_windows_init_file): Now external, not static.
4280 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
4281 called when Vload_path is already set up.
4282
4283 * w32.h (check_windows_init_file): Add prototype.
4284
4285 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4286 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4287 compatibility with Posix platforms.
4288 (main): Move the call to check_windows_init_file to here from
4289 w32.c.
4290 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4291 any, in the DEFALT argument into the root of the Emacs build or
4292 installation tree, as appropriate.
4293
4294 * callproc.c (init_callproc_1): Call decode_env_path instead of
4295 doing its equivalent by hand.
4296 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4297 the code that sets Vexec_path run on MS-Windows.
4298
4299 * lread.c (init_lread): Add comments to #ifdef's.
4300
97147da9
EZ
4301 * msdos.c (dos_set_window_size, IT_update_begin)
4302 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4303 instead of direct references.
4304
185ee146
PE
43052012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4306
4307 Export DEFAULT_REHASH_* to GDB.
4308 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4309 Now constants, not macros.
4310
8834c57a
PE
43112012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4312
98c6f1e3
PE
4313 Remove unnecessary casts involving pointers.
4314 These casts are no longer needed now that we assume C89 or later,
4315 since they involve casting to or from void *.
4316 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4317 (make_pure_float, make_pure_vector):
4318 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4319 * macros.c (Fstart_kbd_macro):
4320 * menu.c (find_and_return_menu_selection):
4321 * minibuf.c (read_minibuf_noninteractive):
4322 * sysdep.c (closedir):
4323 * xdisp.c (x_produce_glyphs):
4324 * xfaces.c (compare_fonts_by_sort_order):
4325 * xfns.c (x_real_positions, select_visual):
4326 * xselect.c (x_stop_queuing_selection_requests)
4327 (x_get_window_property, x_get_window_property_as_lisp_data):
4328 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4329 Remove unnecessary pointer casts.
4330 * alloc.c (record_xmalloc): New function.
4331 * lisp.h (record_xmalloc): New decl.
4332 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4333 more like a function. This is because the pointer cast is not
4334 needed. All uses changed.
4335 * print.c (print_string, print_error_message): Avoid length recalc.
4336
8834c57a
PE
4337 Improve fix for macroexp crash with debugging (Bug#12118).
4338 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4339 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4340 not supposed to be invoked from the garbage collector.
4341 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4342 (gc_aset): New function, which is like ASET but can be
4343 used in the garbage collector.
4344 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4345 (set_hash_index): Use it instead of ASET.
4346
6dad7178
EZ
43472012-08-03 Eli Zaretskii <eliz@gnu.org>
4348
4349 Support symlinks on latest versions of MS-Windows.
4350 * w32.c: Include winioctl.h and aclapi.h.
4351 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4352 (revert_to_self): Forward declarations of static functions.
4353 <static BOOL g_b_init_get_security_info>:
4354 <g_b_init_create_symbolic_link>: New static flags.
4355 (globals_of_w32): Initialize them to zero.
4356 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4357 (map_w32_filename): Improve commentary. Simplify switch.
4358 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4359 headers (most versions of MinGW w32api don't).
4360 (get_security_info, create_symbolic_link)
4361 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4362 New functions.
4363 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4364 in the argument file name.
4365 (sys_access): Call unc_volume_file_attributes only if
4366 GetFileAttributes fails with network-related error codes.
4367 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4368 have the required privileges.
14ae4239 4369 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
4370 get_file_security_desc.
4371 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
4372 with addition of handling of symlinks and support for 'lstat'.
4373 If possible, get file's attributes and security information by
6dad7178
EZ
4374 handle, not by name. Produce S_IFLNK bit for symlinks, when
4375 called from 'lstat'.
4376 (stat, lstat): New functions, call 'stat_worker'.
4377 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4378 symlinks when the underlying filesystem supports them.
4379
f162bcc3
PE
43802012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4381
79ea6c20
PE
4382 Fix macroexp crash on Windows with debugging (Bug#12118).
4383 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4384 checking subscripts; problem introduced with the recent
4385 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4386 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4387 since it's used in non-static inline functions now.
4388
c0ce93fd
PE
4389 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4390 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 4391
f162bcc3
PE
4392 Use C99-style 'extern inline' if available.
4393 * buffer.h (BUFFER_INLINE):
4394 * category.h (CATEGORY_INLINE):
4395 * character.h (CHARACTER_INLINE):
4396 * charset.h (CHARSET_INLINE):
4397 * composite.h (COMPOSITE_INLINE):
4398 * dispextern.h (DISPEXTERN_INLINE):
4399 * lisp.h (LISP_INLINE):
4400 * systime.h (SYSTIME_INLINE):
4401 New macro, replacing 'static inline' in this header.
4402 * buffer.h, category.h, character.h, charset.h, composite.h:
4403 * dispextern.h, lisp.h, systime.h:
4404 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4405 * alloc.c (LISP_INLINE):
4406 * buffer.c (BUFFER_INLINE):
4407 * category.c (CATEGORY_INLINE):
4408 * character.c (CHARACTER_INLINE):
4409 * charset.c (CHARSET_INLINE):
4410 * composite.c (COMPOSITE_INLINE):
4411 * dispnew.c (DISPEXTERN_INLINE):
4412 * sysdep.c (SYSTIME_INLINE):
4413 Define to EXTERN_INLINE, so that the corresponding functions
4414 are compiled into code.
4415 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4416 (INLINE_HEADER_END): New macros.
4417 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4418 since it's used in non-static inline functions now.
a8333d03 4419 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4420
837b365b
GM
44212012-08-02 Glenn Morris <rgm@gnu.org>
4422
d66b744d
GM
4423 * s/: Remove empty directory.
4424
837b365b
GM
4425 * s/ms-w32.h: Move to ../nt/inc.
4426 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4427 Update for new ms-w32.h location.
4428
13294f95
PE
44292012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4430
4431 Port to Solaris 8.
4432 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4433
90df0db3
GM
44342012-08-02 Glenn Morris <rgm@gnu.org>
4435
4436 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4437 hard-coding the path separator.
4438
4939150c
PE
44392012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4442 This how ASET and AREF are supposed to work, and makes
4443 it easier to think about future improvements. See
4444 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4445 * charset.h (set_charset_attr): New function.
4446 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4447 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4448 (aref_addr): New function. All uses of &AREF(...) changed.
4449 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4450 (set_hash_index): New functions. All lvalue-style uses of
4451 HASH_KEY etc. changed.
4452 * keyboard.c (set_prop): New function. All lvalue-style uses
4453 of PROP changed.
4454
947b2afd
AA
44552012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4456
4457 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4458 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 4459 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
4460 * nsfns.m (ns_set_name_as_filename): Likewise.
4461 * nsmenu.m (ns_update_menubar): Likewise.
4462 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4463
4f5d0325
EZ
44642012-08-01 Eli Zaretskii <eliz@gnu.org>
4465
2008beae
EZ
4466 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4467 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4468 objects.
2008beae 4469
4f5d0325
EZ
4470 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4471
fe3cc771
GM
44722012-08-01 Glenn Morris <rgm@gnu.org>
4473
4474 * s/msdos.h: Remove file.
4475 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4476 * Makefile.in (S_FILE): Remove.
4477 (config_h): Remove S_FILE.
4478
c90acc54
JB
44792012-08-01 Juanma Barranquero <lekktu@gmail.com>
4480
4481 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4482 Remove; moved to nt/config.nt.
4483
d8a05828
DA
44842012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4485
4486 Use INTERNAL_FIELD for conses and overlays.
4487 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4488 Remove obsolete comment.
4489 (MVAR): New macro.
4490 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4491 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4492
8271d590
DA
44932012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4494
4495 Use INTERNAL_FIELD for symbols.
4496 * lisp.h (SVAR): New macro. Adjust users.
4497 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4498 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4499
3193acd2
DA
45002012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4501
4502 Use INTERNAL_FIELD for processes.
4503 * process.h (PVAR): New macro. Adjust style.
4504 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4505 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4506
3a45383a
DA
45072012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 Use INTERNAL_FIELD for windows.
4510 * window.h (WVAR): New macro.
4511 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4512 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4513 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4514 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4515 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4516 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4517
c1dbc63c
PE
45182012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4519
4520 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4521
5c0c0e8a
GM
45222012-08-01 Glenn Morris <rgm@gnu.org>
4523
4524 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4525 Move to configure.ac.
4526
552a99b4
JB
45272012-08-01 Juanma Barranquero <lekktu@gmail.com>
4528
4529 * makefile.w32-in (CONFIG_H): Update dependencies.
4530 (CONF_POST_H): New macro.
4531
4532 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4533
8d8e2dfe
GM
45342012-07-31 Glenn Morris <rgm@gnu.org>
4535
bc96620a
GM
4536 * Makefile.in (S_FILE): No longer set by configure.
4537
476b1b2d
GM
4538 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4539 is available.
4540 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4541
b2c7a106
GM
4542 * process.h (NULL_DEVICE):
4543 * emacs.c (SEPCHAR):
4544 * editfns.c (USER_FULL_NAME): Let configure set them.
4545
d53d062a
GM
4546 * s/README, s/template.h: Remove files.
4547
4515017f
GM
4548 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4549
8d8e2dfe
GM
4550 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4551 Move to configure.ac.
4552
5b20b3cc
EZ
45532012-07-31 Eli Zaretskii <eliz@gnu.org>
4554
1e0afd9a
EZ
4555 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4556 resulting renaming of 'struct frame' members.
4557
5b20b3cc
EZ
4558 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4559
4560 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4561 after introduction of FVAR.
4562
f1310128
JD
45632012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4564
79e721e0
JD
4565 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4566
4567 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4568 instead of compositeToPoint.
4569 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4570
8d7c7eed 4571 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4572
e34f7f79
DA
45732012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4576 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4577 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4578 (BVAR): Change to use INTERNAL_FIELD.
4579 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4580 (KVAR): Change to use INTERNAL_FIELD.
4581 * frame.h (FVAR): New macro.
4582 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4583 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4584 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4585 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4586 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4587
c09bfb2f
DA
45882012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4589
4590 Miscellaneous fixes for non-default X toolkits.
4591 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4592 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4593 Move under #ifdef USE_LUCID.
4594 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4595 definition and usage to avoid warnings.
4596
14c114ae
JD
45972012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4598
4599 * nsterm.m (openFiles): Fix previous checkin.
4600
3bd21e82
PE
46012012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 * indent.c (compute_motion): Remove unused local.
4604
c1529ded
GM
46052012-07-31 Glenn Morris <rgm@gnu.org>
4606
400d5621
GM
4607 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4608
268e2432
GM
4609 * conf_post.h [USG5_4]:
4610 Move remaining contents of s/usg5-4-common.h here.
4611 * s/usg5-4-common.h: Remove file.
4612
7552f3ee
GM
4613 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4614 * s/irix6-5.h: Remove file.
4615
6a381852
GM
4616 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4617 * s/darwin.h: Remove file.
4618
c1529ded
GM
4619 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4620 * s/hpux10-20.h: Remove file, which is now empty.
4621
b429a4ee
GM
46222012-07-30 Glenn Morris <rgm@gnu.org>
4623
4624 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4625 * Makefile.in (config_h): Add conf_post.h.
4626 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4627
adff3182
JD
46282012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4629
4630 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4631 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4632 (openFile, openTempFile, openFileWithoutUI, openFiles):
4633 Open files only if ns_do_open_file.
adff3182 4634
c32af1e4
PE
46352012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4636
7393bcbb
PE
4637 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4638 This no-op macro hasn't been needed for many years.
4639 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4640
c32af1e4
PE
4641 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4642 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4643 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4644 gdb_make_enums_visible.
4645 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4646 (DIRECTORY_SEP): Now a constant, not a macro.
4647
302fc036
EZ
46482012-07-30 Eli Zaretskii <eliz@gnu.org>
4649
4650 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4651 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4652
4653 * w32term.c <w32_keyboard_codepage>: Renamed from
4654 keyboard_codepage and now external. All users changed.
4655
4656 * w32term.h: Add declaration of w32_keyboard_codepage.
4657
4658 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4659 the codepage to translate keys to Unicode. If this argument is
4660 -1, use the value returned by GetConsoleCP. All callers changed.
4661
88fb40b4
PE
46622012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4663
0aee6912
PE
4664 Update .PHONY listings in makefiles.
4665 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4666 bootstrap-clean, distclean, maintainer-clean, versioclean,
4667 extraclean, frc.
4668
88fb40b4
PE
4669 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4670 This is a bit clearer. Fix some commentary typos.
4671
0a763bd1
GM
46722012-07-30 Glenn Morris <rgm@gnu.org>
4673
32bac6d6
GM
4674 * s/netbsd.h: Let configure include signal.h if needed.
4675 Remove file, which is now empty.
4676
b65e7c46
GM
4677 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4678 Let configure set them.
4679 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4680 No more need to undefine.
0a763bd1 4681
169304bd
AS
46822012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4683
4684 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4685 non-single-byte char when adding meta modifier. (Bug#12090)
4686
6cd7a139
DA
46872012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4688
4689 Convert safe_call to use variable number of arguments.
4690 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4691 (safe_call2): Fix comment.
4692 * lisp.h (safe_call): Adjust prototype.
4693 * coding.c (encode_coding_object): Change to use safe_call2.
4694 * xfaces.c (merge_face_heights): Change to use safe_call1.
4695
d34d6ffc
GM
46962012-07-30 Glenn Morris <rgm@gnu.org>
4697
7b8a48e4 4698 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4699 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4700
d34d6ffc
GM
4701 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4702 Remove empty files.
4703
03a660a6
PE
47042012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4705
4706 Export to GDB most of lisp.h's remaining object-like macros.
4707 * lisp.h (min, max): Move earlier, because they're used earlier now.
4708 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4709 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4710 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4711 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4712 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4713 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4714 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4715 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4716 Now constants, for GDB. They need not be macros.
4717 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4718 Now constants, for GDB, as well as macros, for static initializers.
4719 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4720 Move to after the definition of struct Lisp_Char_Table,
4721 since the former now needs that type defined.
4722 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4723 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4724 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4725 New enums, for gdb_make_enums_visible.
4726 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4727 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4728 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4729 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4730 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4731 enum maxargs, enum MAX_ALLOCA.
4732 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4733 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4734 no longer needed, now that they are done in lisp.h.
4735
e499d0ee
DA
47362012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4737
4738 Cleanup string bytes checking.
4739 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4740 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4741 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4742 (check_sblock, compact_small_strings): Simplify.
4743
d5040d2d
PE
47442012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4745
4746 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4747 These macros are confusing and no longer need to be defined, as
4748 the enum values now suffice. All uses replaced with definiens.
4749 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4750
7f259ae6
JB
47512012-07-29 Juanma Barranquero <lekktu@gmail.com>
4752
4753 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4754 ($(BLD)/w32console.$(O)): Update dependencies.
4755
7e63e0c3
DA
47562012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4757
4758 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4759 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4760 time. Adjust users.
4761 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4762
ffd817eb
JD
47632012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4764
4765 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4766 setting sitelisp (Bug#12010).
4767
417a7a0e
EZ
47682012-07-29 Eli Zaretskii <eliz@gnu.org>
4769
14ae4239 4770 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4771
4772 * w32heap.c (cache_system_info):
4773 * w32.c (sys_rename):
4774 * w32proc.c (find_child_console, sys_kill): All users changed.
4775
387d4d92
PE
47762012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4777
4778 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4779
55a6cca6
EZ
47802012-07-29 Eli Zaretskii <eliz@gnu.org>
4781
4782 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4783
dbcf001c
DA
47842012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4785
4786 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4787 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4788 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4789
e2688e4a
DA
47902012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4791
4792 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4793 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4794 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4795 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4796 (replace_range, replace_range_2, del_range_2): Change to eassert.
4797 * marker.c (byte_char_debug_check): Adjust style.
4798
b46a6a83
PE
47992012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4800
4801 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4802 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4803 long-ago-commented-out code that talks about "WIN32".
4804 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4805 All uses changed.
4806
e32a5799
PE
48072012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4810 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4811 Simplify by using alignof.
4812 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4813 * lisp.h: Include <stdalign.h>.
4814 (GCALIGNMENT): New macro and constant.
4815 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4816 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4817 (stdalign): New macro, if not already defined.
4818
df81cd29
EZ
48192012-07-28 Eli Zaretskii <eliz@gnu.org>
4820
01bd1b0d
EZ
4821 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4822 * w32inevt.c: Include w32inevt.h.
4823 (w32_read_console_input): New inline function, calls either
4824 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4825 w32_console_unicode_input.
4826 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4827 (w32_kbd_patch_key, key_event): Use the codepage returned by
4828 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4829 (key_event): use uChar.UnicodeChar only if
4830 w32_console_unicode_input is non-zero.
4831
4832 * w32console.c: Include w32heap.h.
4833 <w32_console_unicode_input>: New global variable.
4834 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4835 family of Windows, zero otherwise.
4836
4837 * w32inevt.h: Declare w32_console_unicode_input.
4838
df81cd29
EZ
4839 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4840 --without-x. (Bug#11742)
4841
c20fdd9e
PE
48422012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4843
4844 Adjust GDB to reflect pvec_type changes (Bug#12036).
4845 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4846 2012-07-04 changes to pseudovector representation.
4847 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4848
32770973 48492012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4850
4851 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4852 bus address.
4853 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4854
3438fe21
EZ
48552012-07-27 Eli Zaretskii <eliz@gnu.org>
4856
bcfbc9de
EZ
4857 * alloc.c (listn): Fix the order the arguments are consed onto the
4858 list.
4859
3438fe21
EZ
4860 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4861 enumeration constants, as PURE and HEAP are too general, and clash
4862 with other headers and sources, such as gmalloc.c and the
4863 MS-Windows system headers. All users changed.
4864
eeaea515
DA
48652012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4866
4867 Revert last save_excursion_save and save_excursion_restore changes.
4868 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4869 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4870
073c88c2
DA
48712012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4872
4873 Fix recently-introduced typos in Windows port.
4874 Reported by Martin Rudalics <rudalics@gmx.at>.
4875 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 4876 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 4877
4706125e
PE
48782012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4879
4880 Improve GDB symbol export (Bug#12036).
4881 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4882 arms of an 'if', not using conditional expressions; otherwise GDB
4883 complains about the types in the unevaluated arm when the argument
4884 is an integer literal.
4885 (xgetint): Simplify expression.
4886 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4887 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4888 Zaretskii in <http://bugs.gnu.org/12036#13>.
4889 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4890 needed now that we have gdb_make_enums_visible.
4891 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4892 (enum enum_USE_LSB_TAG):
4893 New enum types, packaging up enums that need to be exported to GDB.
4894
694b6c97
DA
48952012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4896
4897 Utility function to make a list from specified amount of objects.
4898 * lisp.h (enum constype): New datatype.
4899 (listn): New prototype.
4900 * alloc.c (listn): New function.
4901 (Fmemory_use_count, syms_of_alloc): Use it.
4902 * buffer.c (syms_of_buffer): Likewise.
4903 * callint.c (syms_of_callint): Likewise.
4904 * charset.c (define_charset_internal): Likewise.
4905 * coding.c (syms_of_coding): Likewise.
4906 * keymap.c (syms_of_keymap): Likewise.
4907 * search.c (syms_of_search): Likewise.
4908 * syntax.c (syms_of_syntax): Likewise.
4909 * w32.c (init_environment): Likewise.
4910 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4911 * xdisp.c (syms_of_xdisp): Likewise.
4912 * xfns.c (syms_of_xfns): Likewise.
4913
6195f384
DA
49142012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4915
4916 Fast save_excursion_save and save_excursion_restore.
4917 * lisp.h (struct Lisp_Excursion): New data type.
4918 (PVEC_EXCURSION): New pseudovector type.
4919 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
4920 to deal with it. Adjust comments.
4921 (init_marker, attach_marker): New prototype.
4922 (unchain_marker): Adjust prototype.
4923 * marker.c (attach_marker): Change to global.
4924 (init_marker): New function.
4925 * alloc.c (Fmake_marker, build_marker): Use it.
4926 (build_marker): More easserts.
4927 (mark_object): Handle struct Lisp_Excursion.
4928 * editfns.c (save_excursion_save, save_excursion_restore):
4929 Reimplement to use struct Lisp_Excursion. Add comments.
4930
5eceb8fb
PE
49312012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 Fix export of symbols to GDB (Bug#12036).
4934 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
4935 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
4936 emacs.c, as this is a more-suitable home. Had this been done earlier
4937 the fix for 12036 would have avoided some of the problems noted in
4938 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
4939 would have been more obvious.
562157c8
PE
4940 * emacs.c: Do not include <verify.h>; no longer needed.
4941 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
4942 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
4943 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4944 Remove; now done in lisp.h.
4945 * lisp.h (PUBLISH_TO_GDB): New macro.
4946 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
4947 (DATA_SEG_BITS): Use it.
4948 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
4949 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
4950 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
4951 not be usable in #if. This simplifies things.
4952
d6749401
JB
49532012-07-26 Juanma Barranquero <lekktu@gmail.com>
4954
4955 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
4956
1781b9e9
PE
49572012-07-26 Paul Eggert <eggert@cs.ucla.edu>
4958
d89518db 4959 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
4960 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
4961 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
4962 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
4963 Adjust to changes in lisp.h and emacs.c, by using
4964 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
4965 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
4966 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
4967 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
4968 instead of gdb_valbits.
4969 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
4970 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
4971 instead of gdb_array_mark_flag.
4972 (xboolvector): Get size from $->size, not $->header.size.
4973 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
4974 (xreload, hook-run, hookpost-run): Remove.
4975 * emacs.c: Include <verify.h>.
4976 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
4977 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
4978 Remove.
4979 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
4980 (gdb_USE_LSB_TAG): New enum constants.
4981 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
4982 Also define these as enum constants, so they're visible to GDB.
4983 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
4984 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
4985 as constants, so they're visible to GDB.
4986 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
4987 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
4988 Now enum constants, not macros, so they're visible to GDB.
4989 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
4990 more convenient now. All uses changed.
4991 (VALMASK) [USE_LSB_TAG]: Also define in this case.
4992 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
4993
3628596a
DA
49942012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
4995
4996 Explicitly free restriction data that are not needed anymore.
4997 * editfns.c (save_restriction_restore): Free restriction data.
4998
7abaf5cc
SM
49992012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5000
5001 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5002 add argument, tune behavior, and adjust all callers.
5003
71f88e00
PE
50042012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5005
5006 Use typedef for EMACS_INT, EMACS_UINT.
5007 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5008 than macros. This simplifies debugging in the usual case, since
5009 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5010 and it allows expressions involving EMACS_INT casts.
5011 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5012
57ec3034
JD
50132012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5014
5015 * nsterm.m (ns_read_socket): Return early if there is a modal
5016 window (Bug#12043).
5017
8137e7b3
MR
50182012-07-25 Martin Rudalics <rudalics@gmx.at>
5019
5020 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5021 that FOCUS-FRAME can be omitted.
5022
04e9897c
DA
50232012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5024
5025 Adjust buffer text indirection counters at the end of Fkill_buffer.
5026 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5027 buffer is definitely dead. This should really fix an issue reported
5028 by Christoph Scholtes again. (Bug#12007).
5029 (init_buffer_once): Initialize indirection counters of
5030 buffer_defaults and buffer_local_symbols (for sanity and safety).
5031
8a0484e1
EZ
50322012-07-24 Eli Zaretskii <eliz@gnu.org>
5033
5034 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5035 and continuation glyphs on tooltip frames, leave them at zero.
5036 Avoids continued lines in tooltips. (Bug#11832)
5037
fa691a83
DA
50382012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5039
5040 Simplify copy_overlay.
04e9897c 5041 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
5042 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5043
436bc8e0
EZ
50442012-07-23 Eli Zaretskii <eliz@gnu.org>
5045
5046 * print.c (print_object): Don't crash when a frame's name is nil
5047 or invalid. (Bug#12025)
5048
5049 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5050 it signals an error when a tooltip frame is being created.
5051
d7a7fda3
DA
50522012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5053
5054 Cleanup miscellaneous objects allocation and initialization.
5055 * alloc.c (allocate_misc): Change to static. Add argument to
5056 specify the subtype. Adjust comment and users.
5057 (build_overlay): New function.
5058 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5059 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5060 (allocate_misc): Remove prototype.
5061 (build_overlay): Add prototype.
5062
50632012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
5064
5065 Swap buffer text indirection counters in Fbuffer_swap_text.
5066 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5067 This avoids crash reported by Christoph Scholtes at
5068 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5069
9d7fa573
JD
50702012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5071
5072 * nsmenu.m (Popdown_data): New struct.
5073 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5074 free Popdown_data.
5075 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5076 (initWithContentRect): Make imgView and contentView non-static
5077 and autorelease them. Also autorelease img and matrix (Bug#12005).
5078 (dealloc): Remove (Bug#12005).
5079
0dd6d66d
DA
50802012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5081
5082 Adjust consing_since_gc when objects are explicitly freed.
5083 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5084 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5085 (free_cons, free_misc): Subtract object size from consing_since_gc.
5086
d36d71df
DA
50872012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5088
5089 Simplify and cleanup markers positioning code.
5090 * marker.c (attach_marker): More useful eassert.
5091 (live_buffer, set_marker_internal): New function.
5092 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5093 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5094
fb9ea40f
PE
50952012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5096
5097 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5098 as it's limited by the amount of memory, not by INT_MAX.
5099
2d5c5f7d
EZ
51002012-07-21 Eli Zaretskii <eliz@gnu.org>
5101
07fb592e
EZ
5102 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5103 in special-event-map. See the discussion at
5104 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5105 for the reasons.
5106
37a9eac8 5107 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
5108 info.dwItemData. Fixes crashes on 64-bit Windows.
5109 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 5110
c4328746
JD
51112012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5112
fc0c31f8 5113 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 5114 (conversationIdentifier): Return value is NSInteger.
784051c4 5115 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 5116
6e5d1c12
CY
51172012-07-21 Chong Yidong <cyd@gnu.org>
5118
5119 * window.c (decode_any_window): Signal an error if the window is
5120 on a dead frame (Bug#11984).
5121
9928463d
DA
51222012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5123
5124 Add indirection counting to speed up Fkill_buffer.
5125 * buffer.h (struct buffer): New member.
5126 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5127 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5128 base buffer indirection counter.
5129 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5130 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5131 through buffer list if indirection counter is 0.
5132
f8643a6b
DA
51332012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5134
5135 Extend the value returned by Fgarbage_collect with heap statistics.
5136 * alloc.c (Qheap): New symbol.
5137 (syms_of_alloc): DEFSYM it.
5138 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5139 (Fmemory_free): Remove.
5140 (syms_of_alloc): Don't defsubr it.
5141 * buffer.c (Fcompact_buffer): Remove.
5142 (syms_of_buffer): Don't defsubr it.
5143
dac616ff
DA
51442012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5145
5146 Make maybe_gc inline.
5147 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5148 * lisp.h (consing_since_gc, gc_relative_threshold)
5149 (memory_full_cons_threshold): Revert declaration.
5150 (maybe_gc): Remove prototype, define as inline.
5151 * alloc.c: Remove old commented-out code.
5152 (consing_since_gc, gc_relative_threshold)
5153 (memory_full_cons_threshold): Revert to global.
5154 (maybe_gc): Remove.
5155
d7ea76b4
DA
51562012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5157
5158 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5159 * lisp.h (build_unibyte_string): New function.
5160 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5161 * sysdep.c, w32fns.c, xfns.c: Use it.
5162 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5163 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5164 Adjust users accordingly.
5165 * font.h (font_open_by_name): Adjust prototype.
5166
765e61e3
DA
51672012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5168
5169 Cleanup calls to Fgarbage_collect.
5170 * lisp.h (maybe_gc): New prototype.
5171 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5172 Remove declarations.
5173 * alloc.c (maybe_gc): New function.
5174 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5175 Make them static.
5176 * bytecode.c (MAYBE_GC): Use maybe_gc.
5177 * eval.c (eval_sub, Ffuncall): Likewise.
5178 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5179 to avoid dependency from auto-save feature.
5180
52b852c7
PE
51812012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5182
5183 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5184 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5185 'for_each_per_buffer_object_at'.
5186 All uses changed. It's better to use upper-case for macros that
5187 cannot be implemented as functions, to give the reader a clue
5188 that they're special.
5189
5db81e33
SM
51902012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5191
5192 * alloc.c (Fgarbage_collect): Tweak docstring.
5193
5b835e1d
DA
51942012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5195
5196 Tweak the value returned from Fgarbage_collect again.
5197 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5198 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5199 Adjust documentation.
5200 (total_vector_bytes): Rename to total_vector_slots, adjust
5201 accounting.
5202 (total_free_vector_bytes): Rename to total_free_vector_slots,
5203 adjust accounting.
5204 (Qstring_bytes, Qvector_slots): New symbols.
5205 (syms_of_alloc): DEFSYM them.
5206
9cd47b72
DA
52072012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5208
5209 Buffer compaction primitive which may be used from Lisp.
5210 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5211 (syms_of_buffer): Register Fcompact_buffer.
5212 * alloc.c (Fgarbage_collect): Use compact_buffer.
5213 * buffer.h (compact_buffer): New prototype.
5214 (struct buffer_text): New member.
5215
d17337e5
DA
52162012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5217
5218 New macro to iterate over all buffers, miscellaneous cleanups.
5219 * lisp.h (all_buffers): Remove declaration.
5220 * buffer.h (all_buffers): Add declaration, with comment.
5221 (for_each_buffer): New macro.
5222 * alloc.c (Fgarbage_collect, mark_object): Use it.
5223 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5224 (init_buffer): Likewise.
5225 * data.c (Fset_default): Likewise.
5226 * coding.c (code_conversion_restore): Remove redundant check
5227 for dead buffer.
5228 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5229
60cfd278
AS
52302012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5231
5232 Fix bug that created negative-length intervals.
5233 * intervals.c (merge_interval_right, merge_interval_left):
5234 Do not zero out this interval if it is absorbed by its children,
5235 as this interval's total length doesn't change in that case. See
5236 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5237
d06714cb
PE
52382012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5239
83713154
PE
5240 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5241 when invoking (make-bool-vector N t) and N is a positive
5242 multiple of 8 -- the last 8 bits were mistakenly cleared.
5243
d06714cb
PE
5244 Remove some struct layout assumptions in bool vectors.
5245 * alloc.c (bool_header_size): New constant.
5246 (header_size, word_size): Move earlier, as they're now used earlier.
5247 Use 'word_size' in a few more places, where it's appropriate.
5248 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5249 padding before the data member of a bool vector.
5250 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5251 than doing the check by hand with an abort ().
5252
464d5a5e
SM
52532012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5254
5fbc0409
SM
5255 * eval.c (Fdefvar): Don't check constants since we only set the var if
5256 it's not yet defined anyway (bug#11904).
5257
464d5a5e
SM
5258 * lisp.h (last_undo_boundary): Declare new var.
5259 * keyboard.c (command_loop_1): Set it.
5260 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5261 were auto-added by the command loop (bug#11774).
5262
8dc2e44a
AS
52632012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5264
5265 * w32font.c (Qsymbol): Remove local definition.
5266 (syms_of_w32font): Don't DEFSYM it.
5267
169925ec
DA
52682012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5269
5270 Fix sweep_vectors to handle large bool vectors correctly.
5271 * alloc.c (sweep_vectors): Account total_vector_bytes for
5272 bool vectors larger than VBLOCK_BYTES_MAX.
5273
5fbfb018
CY
52742012-07-18 Chong Yidong <cyd@gnu.org>
5275
5276 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5277 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5278
3ab6e069
DA
52792012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5280
5281 Return more descriptive data from Fgarbage_collect.
5282 Suggested by Stefan Monnier in
5283 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5284 * alloc.c (bounded_number): New function.
5285 (total_buffers, total_vectors): New variable.
5286 (total_string_size): Rename to total_string_bytes, adjust users.
5287 (total_vector_size): Rename to total_vector_bytes, adjust users.
5288 (sweep_vectors): Account total_vectors and total_vector_bytes.
5289 (Fgarbage_collect): New return value. Adjust documentation.
5290 (gc_sweep): Account total_buffers.
5291 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5292 (VECTOR_SIZE): Remove.
5293 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5294 (Qinterval, Qmisc): New symbols.
5295 (syms_of_data): Initialize them.
5296 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5297 (Qcons, Qbuffer): New declarations.
5298
6d02fe5b
PE
52992012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5300
5301 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5302 Round up, not down. Improve doc.
5303
b7ffe040
DA
53042012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5305
5306 Restore old code in allocate_string_data to avoid Faset breakage.
5307 Reported by Julien Danjou <julien@danjou.info> in
5308 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5309 * alloc.c (allocate_string_data): Restore old code with minor
5310 adjustments, fix comment to explain this subtle issue.
5311
4dc7c8d5
SM
53122012-07-17 Eli Zaretskii <eliz@gnu.org>
5313
5314 Remove FILE_SYSTEM_CASE.
5315 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5316
5317 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5318 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5319 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5320 call-process-region passes it through expand-file-name.
5321
5322 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5323
53242012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5325
5326 Fix crash when creating indirect buffer (Bug#11917)
5327 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5328 Don't handle unbound variables specially if non-zero.
5329 (Fbuffer_local_variables): Pass zero.
5330 (clone_per_buffer_values): Pass non-zero.
5331
53322012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5333
5334 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5335 to make the loop interruptible.
5336
53372012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5338
5339 * gnutls.c (emacs_gnutls_handshake): Only retry if
5340 GNUTLS_E_INTERRUPTED.
5341
cce7fefc
DA
53422012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5343
5344 Cleanup and convert miscellaneous checks to eassert.
5345 * alloc.c (mark_interval): Fix comment, partially rephrase
5346 old comment from intervals.h (see below).
5347 * intervals.c (find_interval, adjust_intervals_for_insertion)
5348 (delete_interval, adjust_intervals_for_deletion)
5349 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5350 Convert to eassert.
5351 (adjust_intervals_for_insertion, make_new_interval):
5352 Remove obsolete and unused code.
5353 * intervals.h (struct interval): Remove obsolete comment.
5354 * textprotp.c (erase_properties): Remove unused code.
5355 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5356 (Fremove_list_of_text_properties): Convert to eassert.
5357
9ea10cc3
CY
53582012-07-17 Chong Yidong <cyd@gnu.org>
5359
5360 * editfns.c (Finsert_char): Doc fix.
5361
3900d5de
DA
53622012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5363
5364 Fix previous change to make Fmemory_free always accurate.
5365 * alloc.c (make_interval): Update total_free_intervals.
5366 (make_float): Likewise for total_free_floats.
5367 (free_cons, Fcons): Likewise for total_free_conses.
5368 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5369 Likewise for total_free_vector_bytes.
5370 (Fmake_symbol): Likewise for total_free_symbols.
5371 (bytes_free): Remove.
5372
7098646f
DA
53732012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5374
5375 Simple free memory accounting feature.
5376 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5377 (sweep_vectors): Accumulate size of free vectors.
5378 (Fgarbage_collect): Setup bytes_free.
5379 (Fmemory_free): New function.
5380 (syms_of_alloc): Register it.
5381
22657b40
DA
53822012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5383
5384 Cleanup overlays checking.
5385 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5386 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5387 eassert and OVERLAYP.
5388 (sort_overlays): Change to use OVERLAYP.
5389
ddfc8813
RK
53902012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5391
5392 * editfns.c (Finsert_char): Make it interactive, and make the
5393 second arg optional. Copy interactive spec and docstring from
5394 ucs-insert.
5395
7c26cf3c
PE
53962012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5397
5398 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5399 Unlike the other wrapped functions, fabs has an unspecified
5400 effect on errno.
5401
5d127af9
JD
54022012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5403
5404 * nsterm.m (keyDown): Interpret flags without left/right bits
5405 as the left key (Bug#11670).
5406
6a0dd1d7
DA
54072012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5408
5409 Remove empty and useless init functions.
5410 * lisp.h (init_character_once, init_fns, init_image)
5411 (init_filelock, init_sound): Remove prototype.
5412 * character.c (init_character_once): Remove.
5413 * filelock.c (init_filelock): Likewise.
5414 * fns.c (init_fns): Likewise.
5415 * image.c (init_image): Likewise.
5416 * sound.c (init_sound): Likewise.
5417 * emacs.c (main): Adjust accordingly.
5418
7a6136fd
DA
54192012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5420
5421 * gtkutil.h: Tiny cleanups.
5422 (use_old_gtk_file_dialog): Remove useless declaration.
5423 (xg_uses_old_file_dialog): Add suggested const attribute.
5424
ce811ad9
EZ
54252012-07-15 Eli Zaretskii <eliz@gnu.org>
5426
5427 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5428 (bidi_paragraph_init): Use it to limit search forward for a strong
5429 directional character in abnormally large paragraphs full of
5430 neutral or weak characters. (Bug#11943)
5431
c9adfeaa
SF
54322012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5433
5434 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5435 the toolbar (Bug#9451).
5436 (xg_make_tool_item): Give the widget event box a transparent
5437 background.
5438
fff62aa9
DA
54392012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5440
5441 Cleanup basic allocation variables and functions.
5442 * alloc.c (ignore_warnings, init_intervals, init_float)
5443 (init_cons, init_symbol, init_marker): Remove.
5444 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5445 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5446 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5447 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5448 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5449 (staticidx, init_alloc_once, init_strings, free_ablock):
5450 Remove redundant initialization.
5451 * fns.c (init_weak_hash_tables): Remove.
5452 * lisp.h (init_weak_hash_tables): Remove prototype.
5453
9730daca
DA
54542012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5455
5456 Use zero_vector where appropriate.
5457 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5458 accordingly.
5459 * lisp.h (zero_vector): New declaration.
5460 * font.c (null_vector): Remove.
5461 (syms_of_font): Remove initialization and staticpro.
5462 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5463 * keymap.c (Faccessible_keymaps): Likewise.
5464
2e2d2a13
LL
54652012-07-15 Leo Liu <sdl.web@gmail.com>
5466
5467 * fringe.c: Fix typo in comments.
5468
cd276f6e
LL
54692012-07-14 Leo Liu <sdl.web@gmail.com>
5470
5471 * fringe.c: Add a new bitmap exclamation-mark.
5472
5a1131d9
EZ
54732012-07-14 Eli Zaretskii <eliz@gnu.org>
5474
5475 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5476
5477 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5478 (HAVE_MENUS): Don't define, defined by editing config.in with
5479 msdos/sed2v2.inp.
5480 (GMALLOC_INHIBIT_VALLOC): Don't define.
5481 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5482
22e983b7
JB
54832012-07-14 Juanma Barranquero <lekktu@gmail.com>
5484
5485 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5486
5b3f250f
GM
54872012-07-14 Glenn Morris <rgm@gnu.org>
5488
5489 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5490 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5491 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5492
33d63ff4
GM
54932012-07-13 Glenn Morris <rgm@gnu.org>
5494
5b633342
GM
5495 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5496
33d63ff4
GM
5497 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5498 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5499
b55b9f85
JD
55002012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5501
0dc8cf50
JD
5502 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5503 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5504 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5505 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5506 where appropriate.
5507 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5508 as boolean expression.
5509 (x_set_window_size): Remove unused variable toolbar.
5510 (ns_get_color_default, ns_mod_to_lisp): Remove.
5511 (ns_mouse_position): Remove unused variables xchar and ychar.
5512 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5513 (ns_set_vertical_scroll_bar): Remove unused variable count.
5514 (ns_delete_terminal): Remove unused variable i.
5515 (ns_term_init): Remove unused variables r, g and b.
5516 (mouseDown): Remove unused variable window.
5517 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5518 (initFrameFromEmacs): Remove unused variable vbextra.
5519 (mouseEntered): Remove unused variables p and dpyinfo.
5520 (mouseExited): Remove unused variables p and r.
5521 (ns_define_frame_cursor, ns_clear_frame_area)
5522 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5523 (menuDown): Assign [sender tag] to variable and cast the variable.
5524
5525 * nsterm.h (menuDown): Add id as type to argument sender.
5526 (ns_display_info_for_name): Add Lisp_Object argument.
5527 (ns_term_init): Add Lisp_Object argument.
5528 (ns_map_event_to_object): Add void argument.
5529 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5530 prototype with arguments and only declare if __OBJC__.
5531 (nxatoms_of_nsselect): Add void argument.
5532 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5533 (ns_alloc_autorelease_pool): Add void argument.
5534 (ns_release_autorelease_pool): Add void* argument.
5535 (ns_get_defaults_value): Add const char* argument.
5536
5537 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5538 (initFromContents): Use SSDATA where appropriate.
5539 (ns_update_menubar): Add braces to ambigous if-else.
5540 (initWithTitle): Put () around assignment in if statement.
5541 (ns_menu_show): Remove unused variables window and keymap.
5542 (update_frame_tool_bar): Remove unused variable selected_p.
5543 (initWithContentRect): Remove unused variable this_cmd_name.
5544
5545 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5546 appropriate.
5547 (setXBMColor): Remove unused variable len.
5548 (setPixmapData): Put () around assignment in loop statement.
5549
5550 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5551 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5552 where appropriate.
5553 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5554 around assignment in loop statement.
5555 (nsfont_open): Remove unused variable i.
5556 (nsfont_open): Remove unused variable len.
5557 (nsfont_draw): Remove unused variable cs.
5558
5559 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5560 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5561 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5562 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5563 (Fns_font_name, Fns_perform_service)
5564 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5565 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5566 (ns_set_name): Remove unused variable view.
5567 (x_set_menu_bar_lines): Remove unused variable olines.
5568 (x_set_tool_bar_lines): Remove unused variable root_window.
5569 (Fns_list_colors): Put () around assignment in while statement.
5570 (Fns_perform_service): Remove unused variable len.
5571 (Fns_display_usable_bounds): Remove unused variable top.
5572 (syms_of_nsfns): Remove unused variable i.
5573
b55b9f85
JD
5574 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5575 memcpy (Bug#11907).
5576
ed9265fc 55772012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5578
5579 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5580 and free it with DestroyExceptionInfo (Bug#11558).
5581
ef099b57
JB
55822012-07-13 Juanma Barranquero <lekktu@gmail.com>
5583
5584 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5585 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5586 Set here, not in nt/config.nt.
5587
ea814a5d
EZ
55882012-07-13 Eli Zaretskii <eliz@gnu.org>
5589
5590 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5591 cursor overflow into the last glyph on display line when the right
5592 fringe is off. (Bug#11832)
5593
1a952767
PE
55942012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5595
5596 * xdisp.c (produce_special_glyphs): Now static.
5597 * dispextern.h (produce_special_glyphs): Remove decl.
5598
983188fd
GM
55992012-07-13 Glenn Morris <rgm@gnu.org>
5600
8d7c7eed 5601 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5602 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5603
983188fd
GM
5604 * s/usg5-4-common.h (USG, USG5):
5605 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5606 * s/sol2-6.h (SOLARIS2):
5607 * s/irix6-5.h (IRIX6_5):
5608 * s/hpux10-20.h (USG, USG5, HPUX):
5609 * s/gnu-linux.h (USG, GNU_LINUX):
5610 * s/freebsd.h (BSD_SYSTEM):
5611 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5612 * s/cygwin.h (CYGWIN):
5613 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5614 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5615
d1e68667 56162012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5617
5618 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5619
6de0e799
GM
56202012-07-13 Glenn Morris <rgm@gnu.org>
5621
739ae010
GM
5622 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5623
dbee5793
GM
5624 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5625
6de0e799
GM
5626 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5627 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5628
b82da769
GM
56292012-07-12 Glenn Morris <rgm@gnu.org>
5630
4fae5a7a 5631 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5632
5633 * process.c (init_process_emacs): Rename from init_process.
5634 The old name is also the name of a Mach system call.
5635 * lisp.h, emacs.c: Update for this name change.
5636 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5637 longer needed.
5638
5a979817
EZ
56392012-07-12 Eli Zaretskii <eliz@gnu.org>
5640
5641 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5642 memmove call that removes glyphs covered by the left truncation
5643 glyph. Improve commentary.
5644 (display_line): Fix display of continuation glyphs on GUI frames
5645 when the right fringe is turned off and variable-size fonts are
5646 used in the window. Move the code that appends a stretch glyph to
5647 produce_special_glyphs, so that it could be used for truncation
5648 and continuation glyphs alike.
5649 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5650 glyph of a suitably computed width, to align the special glyphs at
5651 the window margin. Code moved from display_line. (Bug#11832)
5652
3e91a053
GM
56532012-07-12 Glenn Morris <rgm@gnu.org>
5654
ba9e4b84
GM
5655 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5656
5657 * s/gnu-linux.h, s/hpux10-20.h:
5658 Do not unconditionally define HAVE_XRMSETDATABASE.
5659
3e91a053
GM
5660 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5661
b300b1f4
PE
56622012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 Fix typos that broke OS X build.
5665 Reported by Randal L. Schwartz in
5666 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5667 * nsterm.m (ns_timeout): Add missing local decl.
5668 (ns_get_color): snprintf -> sprintf, to fix typo.
5669
6e777848
GM
56702012-07-12 Glenn Morris <rgm@gnu.org>
5671
3f922c37
GM
5672 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5673 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5674 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5675 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5676
0ab7b23a
GM
5677 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5678 Move PTY_OPEN to configure.
5679
6e777848
GM
5680 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5681 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5682 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5683
4a7edc24
DA
56842012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5685
5686 Use empty_unibyte_string where applicable.
5687 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5688 * lread.c (read1): Likewise.
5689 * xsettings.c (syms_of_xsettings): Likewise.
5690
308aab79
GM
56912012-07-12 Glenn Morris <rgm@gnu.org>
5692
42bd1719
GM
5693 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5694 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5695 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5696 * s/hpux10-20.h (RUN_TIME_REMAP):
5697 * s/bsd-common.h (TABDLY): Move to configure.
5698
5699 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5700
5701 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5702
ea0bbd17 5703 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5704 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5705
5706 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5707
308aab79
GM
5708 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5709 * s/template.h: Move NARROWPROTO to configure.
5710
ee1cf5cf
GM
57112012-07-11 Glenn Morris <rgm@gnu.org>
5712
30fe9bf4
GM
5713 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5714 unused since 2011-01-17 change to systty.h.
5715
ee1cf5cf
GM
5716 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5717 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5718 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5719
63e47e07
PE
57202012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5723
c43fb4c3
GM
57242012-07-11 Glenn Morris <rgm@gnu.org>
5725
5726 * s/darwin.h, s/gnu-linux.h, s/template.h:
5727 Move INTERRUPT_INPUT to configure.
5728
e8df9267
DA
57292012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5730
5731 Minor adjustments to interning code.
5732 * lisp.h (intern, intern_c_string): Redefine as static inline
5733 wrappers for intern_1 and intern_c_string_1, respectively.
5734 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5735 * lread.c (intern_1, intern_c_string_1, oblookup):
5736 Simplify Vobarray checking.
e8df9267
DA
5737 * font.c (font_intern_prop): Likewise. Adjust comment.
5738 * w32font.c (intern_font_name): Likewise.
5739
34348bd4
AS
57402012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5741
d96a1e0c
AS
5742 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5743
34348bd4
AS
5744 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5745 of Fcar/Fcdr if possible.
5746 * font.c (check_otf_features): Likewise.
5747 * fontset.c (Fnew_fontset): Likewise.
5748 * gnutls.c (Fgnutls_boot): Likewise.
5749 * minibuf.c (read_minibuf): Likewise.
5750 * msdos.c (IT_set_frame_parameters): Likewise.
5751 * xmenu.c (Fx_popup_dialog): Likewise.
5752 * w32menu.c (Fx_popup_dialog): Likewise.
5753
c8add24e
GM
57542012-07-11 Glenn Morris <rgm@gnu.org>
5755
4b575b3c
GM
5756 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5757 since nothing has defined it on these platforms.
5758
09f4e3b0
GM
5759 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5760 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5761
172bedef
GM
5762 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5763 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5764 Move CLASH_DETECTION to configure.
5765
249685df
GM
5766 * s/gnu.h: Remove file, which is now empty.
5767
c8add24e
GM
5768 * s/gnu.h, s/gnu-linux.h:
5769 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5770
b41253a3
JW
57712012-07-11 John Wiegley <johnw@newartisans.com>
5772
5773 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5774 function attribute, so we only use it if it exists in the
5775 compiler.
5776
d923b542
DA
57772012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5778
5779 Avoid call to strlen in fast_c_string_match_ignore_case.
5780 * search.c (fast_c_string_match_ignore_case): Change to use
5781 length argument. Adjust users accordingly.
5782 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5783
5ebbef1d
PE
57842012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5785
bb352260
PE
5786 Assume mkdir, rmdir.
5787 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5788 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5789
57054ddd
PE
5790 Assume rename.
5791 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5792
b747d3f7
PE
5793 Assume perror.
5794 * s/hpux10-20.h (HAVE_PERROR): Remove.
5795 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5796 Remove dummy definition, as this problem was obsolete long ago.
5797
5ebbef1d
PE
5798 Assume strerror.
5799 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5800
984e7f30
DA
58012012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5802
5803 Avoid calls to strlen in font processing functions.
5804 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5805 (font_open_by_name): Change to use length argument.
5806 Adjust users accordingly.
d923b542
DA
5807 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5808 Adjust prototypes.
5809 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5810 Change to return ptrdiff_t.
984e7f30
DA
5811 (xfont_list_pattern, xfont_match): Use length returned by
5812 xfont_decode_coding_xlfd.
5813 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5814
20e94fdd
GM
58152012-07-11 Glenn Morris <rgm@gnu.org>
5816
9d596af3
GM
5817 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5818 Move DONT_REOPEN_PTY to configure.
5819
20e94fdd
GM
5820 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5821 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5822
e99a530f
PE
58232012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5824
22ffb973
PE
5825 Remove "#define unix" that is no longer needed (Bug#11905).
5826 * s/aix4-2.h (unix): Remove; no longer needed.
5827
e9a9ae03
PE
5828 EMACS_TIME simplification (Bug#11875).
5829 This replaces macros (which typically do not work in GDB)
5830 with functions, typedefs and enums, making the code easier to debug.
5831 The functional style also makes code easier to read and maintain.
5832 * systime.h: Include <sys/time.h> on all hosts, not just if
5833 WINDOWSNT, since 'struct timeval' is needed in general.
5834 (EMACS_TIME): Now a typedef, not a macro.
5835 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5836 not macros.
5837 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5838 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5839 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5840 (EMACS_TIME_LE): Now functions, not macros.
5841 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5842 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5843 which are not functions. All uses rewritten to use:
5844 (make_emacs_time): New function.
5845 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5846 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5847 not functions. All uses rewritten to use the following, respectively:
5848 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5849 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5850 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5851 * fileio.c (Fcopy_file):
5852 * xterm.c (XTflash): Get the current time closer to when it's used.
5853 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5854
ffacb126
PE
5855 * bytecode.c (targets): Suppress -Woverride-init warnings.
5856
e99a530f
PE
5857 Simplify by avoiding confusing use of strncpy etc.
5858 * doc.c (Fsnarf_documentation):
5859 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5860 * frame.c (Fmake_terminal_frame):
5861 * gtkutil.c (get_utf8_string):
5862 * lread.c (openp):
5863 * nsmenu.m (ns_update_menubar):
5864 * regex.c (regerror):
5865 Prefer memcpy to strncpy and strncat when either will do.
5866 * fileio.c (Fsubstitute_in_file_name):
5867 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5868 (menu_separator_name_p):
5869 * nsmenu.m (ns_update_menubar):
5870 Prefer memcmp to strncmp when either will do.
5871 * nsterm.m: Include <ftoastr.h>.
5872 (ns_get_color):
5873 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5874 Prefer snprintf to strncpy.
5875 * nsterm.m (ns_term_init):
5876 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5877 * nsterm.m (ns_term_init):
5878 Avoid the need for strncpy, by using build_string or
5879 make_unibyte_string directly. Use dtoastr, not snprintf.
5880 * process.c (Fmake_network_process): Diagnose service names that
5881 are too long, rather than silently truncating them or creating
5882 non-null-terminated names.
5883 (Fnetwork_interface_info): Likewise, for interface names.
5884 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5885 Prefer sprintf to strncat.
5886 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5887 Prefer vsnprintf to vsprintf + strncpy.
5888
c59592b3
GM
58892012-07-10 Glenn Morris <rgm@gnu.org>
5890
5891 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5892 Clarify fallback case.
5893
7d7bbefd
DA
58942012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5895
5896 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5897 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5898 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 5899 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
5900 where argument type is known to be a Lisp_Cons.
5901
3a4c8000
TT
59022012-07-10 Tom Tromey <tromey@redhat.com>
5903
5904 * bytecode.c (BYTE_CODE_THREADED): New macro.
5905 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5906 (enum byte_code_op): New type.
5907 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5908 (exec_byte_code): Use them. Use token threading when applicable.
5909
2a0213a6
DA
59102012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5911
5912 Optimize pure C strings initialization.
5913 * lisp.h (make_pure_string): Fix prototype.
5914 (build_pure_c_string): New function, defined as static inline. This
5915 provides a better opportunity to optimize away calls to strlen when
5916 the function is called with compile-time constant argument.
5917 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5918 argument, adjust users accordingly. Use build_pure_c_string where
5919 appropriate.
5920 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
5921 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
5922 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
5923
cb1caeaf
DA
59242012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5925
5926 Avoid calls to strlen in miscellaneous functions.
5927 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
5928 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
5929 * lread.c (openp): Likewise.
5930
c293e30c
DA
59312012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5932
5933 Avoid calls to strlen in path processing functions.
5934 * fileio.c (file_name_as_directory): Add comment. Change to add
5935 srclen argument and return the length of result. Adjust users
5936 accordingly.
5937 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
5938 swap 1st and 2nd arguments to obey the common convention.
5939 Adjust users accordingly.
c293e30c
DA
5940 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
5941
9e059e3f
GM
59422012-07-10 Glenn Morris <rgm@gnu.org>
5943
d02eb359
GM
5944 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
5945 Move PENDING_OUTPUT_COUNT definition to configure.
5946
882cf227
GM
5947 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
5948 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
5949 * s/gnu.h (DATA_START): Move definitions to configure.
5950
af6e839f
GM
5951 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
5952 We include usg5-4-common.h, which defines them both.
5953
40289a12
GM
5954 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
5955 O_RDONLY already includes it).
5956
9e059e3f
GM
5957 Stop ns builds setting the EMACSLOADPATH environment variable.
5958 * nsterm.m (ns_load_path): Rename from ns_init_paths.
5959 Now it does not set EMACSLOADPATH, just returns the load-path string.
5960 * nsterm.h: Update accordingly.
5961 * lread.c [HAVE_NS]: Include nsterm.h.
5962 (init_lread) [HAVE_NS]: Use ns_load_path.
5963 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
5964
7c4e8ec0
GM
59652012-07-09 Glenn Morris <rgm@gnu.org>
5966
d4f600ff
GM
5967 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
5968 since the included bsd-common.h does so.
5969
cbb31951
GM
5970 Stop ns builds setting the EMACSPATH environment variable.
5971 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
5972 (ns_init_paths): Do not set EMACSPATH.
5973 * nsterm.h (ns_exec_path): Add it.
5974 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
5975 Use ns_exec_path.
5976
7c4e8ec0
GM
5977 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
5978
26bccfae
PE
59792012-07-09 Paul Eggert <eggert@cs.ucla.edu>
5980
a0bee46f
PE
5981 * process.c (wait_reading_process_output): 'waitchannels' was unset
5982 when read_kbd || !NILP (wait_for_cell); fix this.
5983
5994c183
PE
5984 Add GCC-style 'const' attribute to functions that can use it.
5985 * character.h (char_resolve_modifier_mask):
5986 * keyboard.h (make_ctrl_char):
5987 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
5988 (init_character_once, next_almost_prime, init_fns, init_image)
5989 (flush_pending_output, init_sound):
5990 * mem-limits.h (start_of_data):
5991 * menu.h (finish_menu_items):
5992 Add ATTRIBUTE_CONST.
5993 * emacs.c (DEFINE_DUMMY_FUNCTION):
5994 Declare the dummy function with ATTRIBUTE_CONST.
5995 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
5996 Add decls with ATTRIBUTE_CONST.
5997
26bccfae
PE
5998 Minor improvements to make_formatted_string.
5999 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6000 where int is good enough, as vsprintf returns an int.
6001 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6002
a8290ec3
DA
60032012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6004
6005 Use make_formatted_string to avoid double length calculation.
6006 * lisp.h (make_formatted_string): New prototype.
6007 * alloc.c (make_formatted_string): New function.
6008 * buffer.c (Fgenerate_new_buffer_name): Use it.
6009 * dbus.c (syms_of_dbusbind): Likewise.
6010 * editfns.c (Fcurrent_time_zone): Likewise.
6011 * filelock.c (get_boot_time): Likewise.
6012 * frame.c (make_terminal_frame, set_term_frame_name)
6013 (x_report_frame_params): Likewise.
6014 * image.c (gs_load): Likewise.
6015 * minibuf.c (get_minibuffer): Likewise.
6016 * msdos.c (dos_set_window_size): Likewise.
6017 * process.c (make_process): Likewise.
6018 * xdisp.c (ensure_echo_area_buffers): Likewise.
6019 * xsettings.c (apply_xft_settings): Likewise.
6020
d01ba2f1
GM
60212012-07-09 Glenn Morris <rgm@gnu.org>
6022
6023 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6024 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6025 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6026 * nsterm.h (ns_etc_directory): Add it.
6027 * callproc.c [HAVE_NS]: Include nsterm.h.
6028 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6029
f1f924b6
DA
60302012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6031
6032 Move marker debugging code under MARKER_DEBUG.
6033 * marker.c (MARKER_DEBUG): Move marker debugging code under
6034 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6035 for bootstrap with --enable-checking (~3x slowdown reported
6036 by Juanma Barranquero <lekktu@gmail.com>).
6037 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6038
ab531b66
PE
60392012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6042 See <http://bugs.gnu.org/11825#29>.
6043
c4b3bc8a
EZ
60442012-07-08 Eli Zaretskii <eliz@gnu.org>
6045
6046 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6047 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
6048 (display_line): Add commentary about displaying truncation glyphs
6049 on GUI frames.
6050 (produce_special_glyphs): Move here from term.c.
6051
6052 * term.c (produce_special_glyphs): Move to xdisp.c.
6053
6054 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6055 section.
c4b3bc8a 6056
b676b881
AS
60572012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6058
f17c5273
AS
6059 * xdisp.c (display_line): Avoid warning about implicit declaration
6060 of FRAME_FONT.
6061
298819b9
AS
6062 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6063
b676b881
AS
6064 * lisp.h: Remove empty conditional.
6065
6045c4fd
PE
60662012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6067
b3350bf9
PE
6068 * lread.c (load_path_check): Now static.
6069
6045c4fd
PE
6070 Fix some minor --with-ns problems found by static checking.
6071 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6072 (x_set_font) [!HAVE_X_WINDOWS]:
6073 * image.c (xpm_load_image) [HAVE_NS]:
6074 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6075 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6076 Remove unused local.
6077 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6078 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6079 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6080 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6081 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6082 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6083 Fix pointer signedness problem.
6084 * xfaces.c (FRAME_X_FONT_TABLE):
6085 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6086
929e7845
GM
60872012-07-07 Glenn Morris <rgm@gnu.org>
6088
6089 * lread.c (load_path_check): New function, split from init_lread.
6090 (init_lread): Reorganize. Motivation:
6091 If EMACSLOADPATH is set, check/warn about that rather than the
6092 defaults, which we are not going to use. Hence we can remove
6093 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6094 Don't warn if site-lisp directories are missing.
6095 If not installed, start from a blank load-path, since
6096 PATH_LOADSEARCH refers to the eventual installation directories.
6097
58dd0aa4
EZ
60982012-07-07 Eli Zaretskii <eliz@gnu.org>
6099
6100 Support truncation and continuation glyphs on GUI frames, when
6101 fringes are disabled. (Bug#11832)
6102 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
6103 continuation glyphs even if on GUI frames.
6104 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
6105 or both, are absent.
6106 (start_display, move_it_in_display_line_to): Handle the case of a
6107 GUI frame without a fringe to display continuation or truncation
6108 glyphs.
6109 (insert_left_trunc_glyphs): Support GUI frames: make sure
6110 truncation glyphs overwrite enough glyphs from the current line to
6111 have sufficient space in pixels.
6112 (display_line): Support truncation and continuation glyphs on GUI
6113 frames. If some spare pixels are left on the line after inserting
6114 the truncation glyphs, fill that space with a stretch glyph of a
6115 suitably computed width.
6116
6117 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6118 produce_glyphs, to support GUI sessions.
6119
31571fd7
PE
61202012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6121
5a16b9bc
PE
6122 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6123
f3047c75
PE
6124 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6125
31571fd7
PE
6126 Do not require float-time's arg to fit in time_t (Bug#11825).
6127 This works better on hosts where time_t is unsigned, and where
6128 float-time is applied to the (negative) difference between two times.
6129 * editfns.c (decode_time_components): Last arg is now double *,
6130 not int *, and means to store all the result as a double, without
6131 worrying about whether the seconds part fits in time_t.
6132 All callers changed.
6133 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6134 All callers changed.
6135 (Ffloat_time): Do not fail merely because the specified time falls
6136 outside of time_t range.
6137
4516fbef
GM
61382012-07-07 Glenn Morris <rgm@gnu.org>
6139
6140 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6141 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6142 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6143
07adc2c6
JB
61442012-07-07 Juanma Barranquero <lekktu@gmail.com>
6145
6146 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6147 Update dependencies.
6148
6149 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6150
fd573f31
PE
61512012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6152
fee5959d
PE
6153 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6154 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6155 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6156 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6157 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6158 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6159
fd573f31
PE
6160 * xfont.c (compare_font_names): Redo to omit the need for casts.
6161
ddadbc0e
AS
61622012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6163
fca8d6b6
AS
6164 * xfns.c (Fx_change_window_property): Doc fix.
6165 * w32fns.c (Fx_change_window_property): Doc fix.
6166
ddadbc0e
AS
6167 * w32fns.c (Fx_window_property): Accept the same arguments as the
6168 X Windows version. Doc fix.
6169 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6170
ed9265fc 61712012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
6172 Eli Zaretskii <eliz@gnu.org>
6173
6174 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6175 Windows-specific code from nt/config.nt moved here.
6176 Obsolete settings removed.
6177
216ee680
PE
61782012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6179
6180 * process.c: Avoid unnecessary calls to gettime.
6181 (wait_reading_process_output): Don't get the time of day
6182 when gobbling data immediately and not waiting, as there's no need
6183 for it in that case. This removes a FIXME.
6184
bdd091e4
JD
61852012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6186
6187 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6188 is defined (Bug#11768).
6189
9d44f8ce
DA
61902012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6191
6192 Fix marker debugging code.
6193 * marker.c (byte_char_debug_check): Do not perform the check
6194 if buffer is not multibyte.
090bd7cb
JB
6195 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6196 Call byte_char_debug_check with correct arguments.
9d44f8ce 6197
90fc4786
DA
61982012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6199
6200 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
6201 * marker.c (byte_char_debug_check, count_markers):
6202 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
6203 (byte_debug_flag): Remove.
6204 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6205 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6206
7b7ae965
DA
62072012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6208
4e57b342
DA
6209 Avoid code repetition in marker-related functions.
6210 * marker.c (attach_marker): New function.
6211 (Fset_marker, set_marker_restricted, set_marker_both)
6212 (set_marker_restricted_both): Use it.
6213 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6214 Consistently rename charno to charpos.
6215 (marker_position): Add eassert.
6216 (marker_byte_position): Convert to eassert.
6217
62182012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6219
6220 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 6221 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 6222 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 6223
657924ff
DA
62242012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6225
6226 Introduce fast path for the widely used marker operation.
6227 * alloc.c (build_marker): New function.
6228 * lisp.h (build_marker): New prototype.
6229 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6230 * composite.c (autocmp_chars): Likewise.
6231 * editfns.c (buildmark): Remove.
6232 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6233 (save_restriction_save): Use build_marker.
6234 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6235 * window.c (save_window_save): Likewise.
6236
041a49a6
DA
62372012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6238
6239 Do not use Fdelete_overlay in delete_all_overlays
6240 to avoid redundant calls to unchain_overlay.
6241 * buffer.c (drop_overlay): New function.
6242 (delete_all_overlays, Fdelete_overlay): Use it.
6243 * minibuf.c (get_minibuffer): Fix comment.
6244
7dca65a4
PE
62452012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6246
6247 Port to OpenBSD 5.1 amd64.
6248 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6249 This is needed for OpenBSD, and should be harmless on all BSD systems.
6250 Also, include <sys/sysctl.h>, as it should be available on all
6251 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6252 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6253 use p_pid member, not kp_proc.pid.
6254
8eb876e2
GM
62552012-07-06 Glenn Morris <rgm@gnu.org>
6256
6257 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6258
38182d90
PE
62592012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6260
6261 More xmalloc and related cleanup.
6262 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6263 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6264 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6265 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6266 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6267 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6268 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6269 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6270 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6271 * xterm.c:
6272 Omit needless casts involving void * pointers and allocation.
6273 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6274 as the former is more robust if P's type is changed.
6275 Prefer xzalloc to xmalloc + memset 0.
6276 Simplify malloc-or-realloc to realloc.
6277 Don't worry about xmalloc returning a null pointer.
6278 Prefer xstrdup to xmalloc + strcpy.
6279 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6280 growing it.
6281 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6282 alloca of a constant.
6283
6dd5a677
EZ
62842012-07-05 Eli Zaretskii <eliz@gnu.org>
6285
6286 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6287 hscroll is larger than the line width. Fixes long and futile
6288 looping inside extend_face_to_end_of_line (on a TTY) producing
6289 glyphs that are not needed and thrown away.
6290
6b312f0f
DA
62912012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6292
6293 * marker.c (set_marker_restricted_both): Simplify by using
6294 clip_to_bounds.
6295
f520ef9b
PE
62962012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6297
6298 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6299
383b7c95
JD
63002012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6301
6302 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6303 not defined (Bug#11768).
6304 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6305 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6306 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6307 followed by gtk_box_set_homogeneous (Bug#11768).
6308 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
6309 (update_theme_scrollbar_width, xg_create_scroll_bar):
6310 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
6311 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6312 (is_box_type): New function (Bug#11768).
6313 (xg_tool_item_stale_p): Call is_box_type.
5293d758 6314 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
6315 with default display (Bug#11768).
6316
d6e7bf45
EZ
63172012-07-05 Eli Zaretskii <eliz@gnu.org>
6318
6319 * xdisp.c (window_hscroll_limited): New function.
6320 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6321 coordinates when window's hscroll is set to insanely large
6322 values. (Bug#11857)
6323
431391ec
JB
63242012-07-05 Juanma Barranquero <lekktu@gmail.com>
6325
6326 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6327 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6328
23f86fce
DA
63292012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6330
6331 Cleanup xmalloc.
6332 * lisp.h (xzalloc): New prototype. Omit needless casts.
6333 * alloc.c (xzalloc): New function. Omit needless casts.
6334 * charset.c: Omit needless casts. Convert all calls to
6335 xmalloc with following memset to xzalloc.
6336 * dispnew.c: Likewise.
6337 * fringe.c: Likewise.
6338 * image.c: Likewise.
6339 * sound.c: Likewise.
6340 * term.c: Likewise.
6341 * w32fns.c: Likewise.
6342 * w32font.c: Likewise.
6343 * w32term.c: Likewise.
6344 * xfaces.c: Likewise.
6345 * xfns.c: Likewise.
6346 * xterm.c: Likewise.
6347 * atimer.c: Omit needless casts.
6348 * buffer.c: Likewise.
6349 * callproc.c: Likewise.
6350 * ccl.c: Likewise.
6351 * coding.c: Likewise.
6352 * composite.c: Likewise.
6353 * doc.c: Likewise.
6354 * doprnt.c: Likewise.
6355 * editfns.c: Likewise.
6356 * emacs.c: Likewise.
6357 * eval.c: Likewise.
6358 * filelock.c: Likewise.
6359 * fns.c: Likewise.
6360 * gtkutil.c: Likewise.
6361 * keyboard.c: Likewise.
6362 * lisp.h: Likewise.
6363 * lread.c: Likewise.
6364 * minibuf.c: Likewise.
6365 * msdos.c: Likewise.
6366 * print.c: Likewise.
6367 * process.c: Likewise.
6368 * region-cache.c: Likewise.
6369 * search.c: Likewise.
6370 * sysdep.c: Likewise.
6371 * termcap.c: Likewise.
6372 * terminal.c: Likewise.
6373 * tparam.c: Likewise.
6374 * w16select.c: Likewise.
6375 * w32.c: Likewise.
6376 * w32reg.c: Likewise.
6377 * w32select.c: Likewise.
6378 * w32uniscribe.c: Likewise.
6379 * widget.c: Likewise.
6380 * xdisp.c: Likewise.
6381 * xmenu.c: Likewise.
6382 * xrdb.c: Likewise.
6383 * xselect.c: Likewise.
6384
0497dc44
PE
63852012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6386
6387 * fileio.c (time_error_value): Check the right error number.
6388 Problem reported by Troels Nielsen in
6389 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6390
356e7178
PE
63912012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6392
4e71fd89
PE
6393 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6394 This should be fixed in a better way; see Eli Zaretskii in
6395 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6396 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6397
f0941253
PE
6398 * fileio.c (time_error_value): Rename from special_mtime.
6399 The old name's problems were noted by Eli Zaretskii in
6400 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6401
065c9eb4
PE
6402 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6403 This variable's comment says Emacs needs at least one GDB-visible
6404 symbol of type enum pvec_type, to work around GDB problems.
6405 The symbol's value doesn't matter.
6406
356e7178
PE
6407 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6408 that causes compilation to fail on pre-C99 compilers.
6409
ed9265fc 64102012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6411
6412 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6413 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6414
3884d954
DA
64152012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6416
d209e2fb 6417 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6418 headers for buffer_defaults and buffer_local_symbols.
6419 Reported by Juanma Barranquero <lekktu@gmail.com>.
6420
ee28be33
SM
64212012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6422
6423 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6424 * lisp.h (enum pvec_type): Use fewer bits.
6425 (PSEUDOVECTOR_SIZE_BITS): New constant.
6426 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6427 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6428 change in pvec_type.
6429 (PSEUDOVECTOR_TYPEP): New macro.
6430 (TYPED_PSEUDOVECTORP): Use it.
6431 * fns.c (internal_equal): Adapt code to extract pvectype.
6432 * emacs.c (gdb_pvec_type): Update type.
6433 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6434 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6435 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6436 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6437 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6438 abusing vector->header.next.nbytes.
6439 (live_vector_p): Use PVEC_TYPE.
6440 (mark_object): Adapt code to extract pvectype. Use switch.
6441
c7f2cd7f
PE
64422012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6443
6444 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6445 Tighten new eassert a bit.
6446
8ce70ed2
DA
64472012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6448
6449 Fix compilation with --enable-gcc-warnings and -O1
6450 optimization level.
6451 * doprnt.c (doprnt): Change type of tem to int, initialize
6452 to avoid compiler warning. Add eassert.
6453 * search.c (simple_search): Initialize match_byte to avoid
6454 compiler warning. Add eassert.
6455
dea7f1e5
PE
64562012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6457
24a212eb
PE
6458 Avoid weird behavior with large horizontal scrolls.
6459 Without this change, for example, large hscroll values would
6460 mess up Emacs's display on Fedora 15 x86, presumably due to
6461 overflows in int calculations in the display code.
6462 Also, if buffers had long lines, Emacs would freeze.
6463 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6464 (set_window_hscroll): New function, containing the old guts of
6465 Fset_window_hscroll. Return the clipped value.
6466 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6467 This avoids the need to check against PTRDIFF_MAX.
6468
dea7f1e5
PE
6469 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6470
76046526
DA
64712012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6472
6473 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6474
39adff0d
PE
64752012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6476
63807d47
PE
6477 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6478 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6479 since GCC 4.4.6 issues a bogus warning for them.
6480
39adff0d
PE
6481 Fix bugs in file timestamp newness comparisons.
6482 * fileio.c (Ffile_newer_than_file_p):
6483 * lread.c (Fload): Use full timestamp resolution of files,
6484 not just the 1-second resolution, so that files that are only
6485 slightly newer still count as newer.
6486 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6487 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6488
dbeed9a6
PE
64892012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6490
6491 * fileio.c: Improve handling of file time marker. (Bug#11852)
6492 (special_mtime): New function.
6493 (Finsert_file_contents, Fverify_visited_file_modtime):
6494 Use it to set special mtime values consistently.
6495
636334d6
AS
64962012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6497
6498 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6499 marker for non-existing file. (Bug#11852)
6500
e2017fe2
GM
65012012-07-03 Glenn Morris <rgm@gnu.org>
6502
6503 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6504 and did not make it into globals.h).
6505
404dbd37
TT
65062012-07-03 Tom Tromey <tromey@redhat.com>
6507
6508 * window.c (Fset_window_margins, Fset_window_fringes)
6509 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6510 * textprop.c (Fprevious_property_change): No longer static.
6511 * syntax.c (Fsyntax_table_p): No longer static.
6512 * process.c (Fget_process, Fprocess_datagram_address): No longer
6513 static.
6514 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6515 * keyboard.c (Fcommand_execute): No longer static.
6516 Remove EXFUN.
6517 * insdel.c (Fcombine_after_change_execute): No longer static.
6518 * image.c (Finit_image_library): No longer static.
6519 * fileio.c (Fmake_symbolic_link): No longer static.
6520 * eval.c (Ffetch_bytecode): No longer static.
6521 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6522 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6523 No longer static.
404dbd37
TT
6524 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6525 static.
6526 * dired.c (Ffile_attributes): No longer static.
6527 * composite.c (Fcomposition_get_gstring): No longer static.
6528 * callproc.c (Fgetenv_internal): No longer static.
6529
6530 * ccl.h: Remove EXFUNs.
6531 * buffer.h: Remove EXFUNs.
6532 * dispextern.h: Remove EXFUNs.
6533 * intervals.h: Remove EXFUNs.
6534 * fontset.h: Remove EXFUN.
6535 * font.h: Remove EXFUNs.
6536 * dosfns.c (system_process_attributes): Remove EXFUN.
6537 * keymap.h: Remove EXFUNs.
6538 * lisp.h: Remove EXFUNs.
6539 * w32term.h: Remove EXFUNs.
6540 * window.h: Remove EXFUNs.
6541 * xsettings.h: Remove EXFUN.
6542 * xterm.h: Remove EXFUN.
6543
8e4fd1e1
GM
65442012-07-03 Glenn Morris <rgm@gnu.org>
6545
6546 * lisp.h (Frandom): Make it visible to C.
6547 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6548 buffer for invisible buffers. (Bug#1229)
6549
ca95b3eb
DA
65502012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6551
6552 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6553 values which aren't power of 2.
14ae4239 6554 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 6555 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6556 accordingly.
6557
7555c33f
SM
65582012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6559
6560 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6561
6562 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6563
d12e8f5a
DA
65642012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6565
6566 * alloc.c (allocate_vector_block): Remove redundant
6567 calls to mallopt if DOUG_LEA_MALLOC is defined.
6568 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6569 avoid calls to mallopt if zero_vector is returned.
6570
296094c3
DA
65712012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6572
6573 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6574 is enabled, avoid dereferencing NULL current_sblock if
6575 running undumped.
6576
36429c89
DA
65772012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6578
6579 Cleanup basic buffer management.
6580 * buffer.h (struct buffer): Change layout to use generic vector
6581 marking code. Fix some comments. Change type of 'clip_changed'
6582 to bitfield. Remove unused #ifndef old.
6583 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6584 (GET_OVERLAYS_AT): Fix indentation.
6585 (for_each_per_buffer_object_at): New macro.
6586 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6587 (Fbuffer_local_variables): Use it.
6588 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6589 * alloc.c (allocate_buffer): Adjust to match new layout of
6590 struct buffer. Fix comment.
6591 (mark_overlay): New function.
6592 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6593 Lisp area of struct buffer.
6594 (mark_object): Use it. Adjust marking of misc objects
6595 and related comments.
6596
3b3e4cac
PE
65972012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6598
6599 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6600 wrapper that is not needed because the wrapped code is a no-op (zero
6601 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6602 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6603
cf5c0175
DA
66042012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6605
6606 * alloc.c (mark_buffer): Simplify. Remove prototype.
6607 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6608 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6609 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6610 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6611
ca26824c
GM
66122012-06-30 Glenn Morris <rgm@gnu.org>
6613
2e4c5312
GM
6614 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6615
ca26824c
GM
6616 * epaths.in (PATH_SITELOADSEARCH): New.
6617 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6618 This is rather than relying on --enable-locallisppath elements
6619 having "site-lisp" in their names. (Bug#10208#25, 11658)
6620
0d23c240
EZ
66212012-06-30 Eli Zaretskii <eliz@gnu.org>
6622
c9240d7a
EZ
6623 * w32proc.c (sys_select): Accept and ignore one more argument.
6624
6625 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6626
0d23c240 6627 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6628 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6629
6630 * sysdep.c: Don't include dos.h and dosfns.h.
6631
6632 * process.c (sys_select):
6633 * msdos.c (sys_select): Accept one more argument and ignore it.
6634
6635 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6636 adapt data types and code to that.
6637
6638 * dosfns.c:
6639 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6640 which clashes with the gnulib function of the same name.
6641
af5a5a98
AS
66422012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6643
c5e4379c
AS
6644 * font.c (font_style_to_value, font_style_symbolic)
6645 (font_prop_validate_style): Add type checks for values in
6646 font_style_table.
6647
af5a5a98
AS
6648 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6649 argument.
6650 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6651 uses.
6652
8d38f461
EZ
66532012-06-29 Eli Zaretskii <eliz@gnu.org>
6654
2e5a6631
EZ
6655 * xdisp.c (try_window_id): Undo last change.
6656
8d38f461
EZ
6657 * w32.c (getwd): Adjust commentary about startup_dir.
6658 (init_environment): Always call sys_access, even in non-MSVC
6659 builds. Don't chdir to the directory of the Emacs executable.
6660 This undoes code from 1997 which was justified by the need to
6661 "avoid conflicts when removing and renaming directories". But its
6662 downside was that every relative file name was being interpreted
6663 relative to the directory of the Emacs executable, which can never
6664 be TRT. In particular, it broke sys_access when called with
6665 relative file names.
6666 (sys_access): Map GetLastError to errno.
6667
2af3565e
DA
66682012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6669
6670 * window.h (struct window): Change type of 'fringes_outside_margins'
6671 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6672 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6673 Adjust comment.
6674 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6675 to ptrdiff_t.
6676
c8d3a25c 66772012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6678
c8d3a25c
GM
6679 * gnutls.c (emacs_gnutls_handshake):
6680 Add QUIT to make the loop interruptible.
57570cd3 6681
c8d3a25c 66822012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6683
c8d3a25c
GM
6684 * charset.c (init_charset): Make lack of etc/charsets fatal.
6685
3e984ee8
DA
66862012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6687
6688 * editfns.c (region_limit): Fix type mismatch.
6689
ef884f23
DA
66902012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6691
6692 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6693 undefined. Convert from xassert to eassert.
6694 * nsmenu.m: Convert from xassert to eassert.
6695 * nsterm.m: Likewise.
6696
7d7e0027
SM
66972012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6698
6699 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6700
aa754e6a
PE
67012012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6702
6703 Avoid integer overflow on scroll-left and scroll-right.
6704 * window.c (HSCROLL_MAX): New macro.
6705 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6706 overflow when requested scroll falls outside ptrdiff_t range.
6707
80b00b08
DA
67082012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6709
6710 * window.h (struct window): Change type of 'hscroll',
6711 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6712 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6713 Adjust users accordingly.
6714 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6715 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6716 from EMACS_INT to ptrdiff_t.
6717 (make_window): Omit redundant initialization.
6718
62b2bcf6
JB
67192012-06-28 Juanma Barranquero <lekktu@gmail.com>
6720
6721 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6722
45942c7d
DA
67232012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6724
6725 * window.h (struct window): Change type of 'use_time' and
6726 'sequence_number' from Lisp_Object to int.
6727 * frame.c (make_frame): Adjust users accordingly.
6728 * print.c (print_object): Likewise.
6729 * window.c (select_window, Fwindow_use_time, make_parent_window)
6730 (make_window): Likewise.
6731
e509cfa6
DA
67322012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6733
6734 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6735 enabled with --enable-checking=[all,glyphs] configure option.
6736 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6737 adjust comments accordingly.
6738 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6739 undefined, adjust comments accordingly.
6740 * image.c: Likewise.
6741 * scroll.c: Likewise.
6742 * w32fns.c: Likewise.
6743 * w32term.c: Likewise.
6744 * xdisp.c: Likewise.
6745 * xfaces.c: Likewise.
6746 * xfns.c: Likewise.
6747 * xterm.c: Likewise.
6748
a54e2c05
DA
67492012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6750
6751 Generalize run-time debugging checks.
6752 * dispextern.h (XASSERTS): Remove.
6753 * fontset.c (xassert): Remove.
6754 Convert from xassert to eassert.
6755 * alloc.c: Convert from xassert to eassert.
6756 * bidi.c: Likewise.
6757 * dispnew.c: Likewise.
6758 * fns.c: Likewise.
6759 * fringe.c: Likewise.
6760 * ftfont.c: Likewise.
6761 * gtkutil.c: Likewise.
6762 * image.c: Likewise.
6763 * keyboard.c: Likewise.
6764 * menu.c: Likewise.
6765 * process.c: Likewise.
6766 * scroll.c: Likewise.
6767 * sound.c: Likewise.
6768 * term.c: Likewise.
6769 * w32console.c: Likewise.
6770 * w32fns.c: Likewise.
6771 * w32term.c: Likewise.
6772 * window.c: Likewise.
6773 * xdisp.c: Likewise.
6774 * xfaces.c: Likewise.
6775 * xfns.c: Likewise.
6776 * xselect.c: Likewise.
6777 * xterm.c: Likewise.
6778
1ec4b7b2
SM
67792012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6780
6781 * fns.c (maybe_resize_hash_table): Output message when growing the
6782 purify-hashtable.
6783
2014308a
DA
67842012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6785
6786 * alloc.c (allocate_string_data): Remove dead code.
6787 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6788 avoid GCC warning about unused macro.
6789
246155eb
DA
67902012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6791
6792 * alloc.c (allocate_string): Omit intervals initialization.
6793 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6794 as in make_pure_string and make_pure_c_string.
6795
43184b7b
DA
67962012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6797
d209e2fb 6798 * alloc.c (allocate_string): Fix last change.
43184b7b 6799
3fe6dd74
DA
68002012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6801
d209e2fb 6802 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6803 to memset, add explicit initialization where appropriate.
6804
1ba6038a
GM
68052012-06-27 Glenn Morris <rgm@gnu.org>
6806
6807 * lisp.mk (lisp): Remove paths.elc.
6808
c89926a5
CY
68092012-06-27 Chong Yidong <cyd@gnu.org>
6810
6811 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6812
ed6b3510
JW
68132012-06-26 John Wiegley <johnw@newartisans.com>
6814
1ec4b7b2 6815 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6816 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6817
ed6b3510
JW
6818 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6819 when building with Clang.
6820
8edd4a2b
SM
68212012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6822
6823 * eval.c (Fapply): Allow calling it with a single argument.
6824
f6f62d1b
EZ
68252012-06-26 Eli Zaretskii <eliz@gnu.org>
6826
6827 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6828 _stricmp and _strnicmp.
6829 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6830
62efea5e
DA
68312012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6832
6833 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6834 allocated window.
6835 (allocate_process): Likewise for new process.
8edd4a2b 6836 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6837 (allocate_frame): Likewise.
6838 * frame.c (make_frame): Omit redundant initialization.
6839 * window.c (make_parent_window): Use memset.
6840 (make_window): Omit redundant initialization.
6841 * process.c (make_process): Omit redundant initialization.
6842 * terminal.c (create_terminal): Likewise.
6843
42997f4d
DA
68442012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6845
6846 * term.c (delete_tty): Remove redundant call to memset.
6847
1130ecfc
DA
68482012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6849
6850 * alloc.c: Remove build_string.
6851 * lisp.h: Define build_string as static inline. This provides
6852 a better opportunity to optimize away calls to strlen when the
6853 function is called with compile-time constant argument.
6854 * image.c (imagemagick_error): Convert to build_string.
6855 * w32proc.c (sys_spawnve): Likewise.
6856 * xterm.c (x_term_init): Likewise.
6857
cf38a720
PE
68582012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6859
99027bdd
PE
6860 Use sprintf return value instead of invoking strlen on result.
6861 In the old days this wasn't portable, since some sprintf
6862 implementations returned char *. But they died out years ago and
6863 Emacs already assumes sprintf returns int.
6864 Similarly for float_to_string.
6865 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6866 * ccl.c (ccl_driver):
6867 * character.c (string_escape_byte8):
6868 * data.c (Fnumber_to_string):
6869 * doprnt.c (doprnt):
6870 * print.c (print_object):
6871 * xdisp.c (message_dolog):
6872 * xfns.c (syms_of_xfns):
6873 Use sprintf or float_to_string result to avoid need to call strlen.
6874 * data.c (Fnumber_to_string):
6875 Use make_unibyte_string, since the string must be ASCII.
6876 * lisp.h, print.c (float_to_string): Now returns int length.
6877 * term.c (produce_glyphless_glyph):
6878 Use sprintf result rather than recomputing it.
6879
cf38a720
PE
6880 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6881 * Makefile.in (ALL_CFLAGS):
6882 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6883 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6884
3511c784
DA
68852012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6886
0a08eb21 6887 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
6888 strcasecmp if available.
6889 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6890
fb7da12e
AS
68912012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6892
6893 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6894 Avoid comma operator.
6895 * menu.c (push_submenu_start, push_submenu_end)
6896 (push_left_right_boundary, push_menu_pane): Likewise.
6897 * msdos.c (dos_rawgetc): Likewise.
6898
afa2ffd8
DA
68992012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6900
6901 * xfns.c (xic_create_fontsetname): Remove redundant calls
6902 to memset.
6903
b3b4476b
PE
69042012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6905
4495ff38
PE
6906 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6907 sprintf already null-terminates its output.
6908
b3b4476b
PE
6909 * xfns.c (x_window): Remove redundant cast.
6910
b00876c9
DA
69112012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6912
6913 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6914 `const char *' to `char *' to avoid compiler warning.
6915
d188e26b
PE
69162012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6917
885d1d74
PE
6918 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6919 instead of truncating it to 63 (admittedly a generous limit).
6920
d188e26b
PE
6921 * process.c: Fix spelling and caps in comments.
6922
e2f560b1
DN
69232012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
6924
e86db54b 6925 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
6926 * sysdep.c (setpgrp): Remove definition, not used in this file.
6927
7583a3a1
JB
69282012-06-24 Juanma Barranquero <lekktu@gmail.com>
6929
6930 * makefile.w32-in: Update dependencies.
6931
696056c2
EZ
69322012-06-24 Eli Zaretskii <eliz@gnu.org>
6933
6934 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
6935 (SYSTIME_H): Add nt/inc/sys/time.h.
6936
6937 * systime.h [WINDOWSNT]: Include sys/time.h.
6938
6939 * s/ms-w32.h (struct timespec): Definition moved from
6940 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
6941
845ca893
PE
69422012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6943
6944 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
6945 * buffer.h (buffer_slot_type_mismatch):
6946 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6947 * eval.c (unwind_to_catch):
6948 * image.c (my_png_error, my_error_exit):
6949 * keyboard.c (quit_throw_to_read_char, user_error)
6950 (Fexit_recursive_edit, Fabort_recursive_edit):
6951 * lisp.h (die, args_out_of_range, args_out_of_range_3)
6952 (wrong_type_argument, buffer_overflow, __executable_start)
6953 (memory_full, buffer_memory_full, string_overflow, Fthrow)
6954 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
6955 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
6956 (fatal):
6957 (child_setup) [!DOS_NT]:
6958 * lread.c (end_of_file_error, invalid_syntax):
6959 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
6960 * puresize.h (pure_write_error):
6961 * search.c (matcher_overflow):
6962 * sound.c (sound_perror, alsa_sound_perror):
6963 * sysdep.c, syssignal.h (croak):
6964 * term.c (maybe_fatal, vfatal):
6965 * textprop.c (text_read_only):
6966 * undo.c (user_error):
6967 * unexmacosx.c (unexec_error):
6968 * xterm.c (x_ins_del_lines, x_delete_glyphs):
6969 Use _Noreturn rather than NO_RETURN.
6970 No need for separate decl merely because of _Noreturn.
6971 * sound.c (sound_warning, parse_sound):
6972 Remove unnecessary forward decls.
6973
f1dd8073
PE
69742012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6975
6976 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
6977 * lisp.h (WAIT_READING_MAX): New macro.
6978 * dispnew.c (Fsleep_for, sit_for):
6979 * keyboard.c (kbd_buffer_get_event):
6980 * process.c (Faccept_process_output):
6981 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
6982 This improves on the previous patch, which introduced a bug
6983 when time_t is unsigned and as wide as intmax_t.
6984 See <http://bugs.gnu.org/9000#51>.
6985
b82c1755
EZ
69862012-06-23 Eli Zaretskii <eliz@gnu.org>
6987
6988 * dispnew.c (sit_for, Fsleep_for):
6989 * keyboard.c (kbd_buffer_get_event):
6990 * process.c (Faccept_process_output): Avoid compiler warnings when
6991 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
6992
ca300656
JB
69932012-06-23 Juanma Barranquero <lekktu@gmail.com>
6994
049ec95b
JB
6995 * makefile.w32-in: Update dependencies.
6996
ca300656
JB
6997 * w32.c (ltime): Add return type and declare static.
6998 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6999
db7b8d06
PE
70002012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7001
7002 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7003 Privately reported by Herbert J. Skuhra.
7004 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7005 All uses changed.
7006 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7007 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7008
0bd8297f
EZ
70092012-06-23 Eli Zaretskii <eliz@gnu.org>
7010
96512555
EZ
7011 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7012 last argument of make_unibyte_string.
7013
0bd8297f
EZ
7014 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7015 language ID in the event parameters.
7016
7017 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7018 event.code, not the obscure "character set ID".
7019
63def6b6
CY
70202012-06-23 Chong Yidong <cyd@gnu.org>
7021
7022 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7023
e8a02204
EZ
70242012-06-23 Eli Zaretskii <eliz@gnu.org>
7025
388cdec0
EZ
7026 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7027 * w32.c (fdutimens): New function.
7028
7029 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7030
7031 * s/ms-w32.h (pselect): Redirect to sys_select.
7032
7033 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7034
e8a02204
EZ
7035 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7036 in the logic of incrementing and decrementing the value of
7037 use_relocatable_buffers.
7038
d054f3fb
PE
70392012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7040
7041 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7042 Privately reported by Herbert J. Skuhra.
7043 [__FreeBSD__]: Remove "*/" typo after "#include".
7044 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7045 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7046 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7047 Don't assume EMACS_TIME and struct timeval are the same type.
7048
d35af63c
PE
70492012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7050
7051 Support higher-resolution time stamps (Bug#9000).
7052 The time stamps are only nanosecond-resolution at the C level,
7053 since that's the best that any real-world system supports now.
7054 But they are picosecond-resolution at the Lisp level, as that's
7055 easy, and leaves room for future OS improvements.
7056
7057 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7058 (LIBES): Use it.
7059
7060 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7061 Don't get current time unless it's needed.
7062
7063 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7064 now provides it if it's absent.
7065 (start_atimer): Port to higher-res time stamps.
7066 Check for time stamp overflow. Don't get current time more
7067 often than is needed.
7068
7069 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7070 Include systime.h, not time.h.
7071 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7072
7073 * dired.c: Include stat-time.h.
7074 (Ffile-attributes): File times now have higher resolution.
7075
7076 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7077 (struct image): Timestamp now has higher resolution.
7078
7079 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7080 has at least microseconds now. All uses removed.
7081 (update_frame, update_single_window, update_window, update_frame_1)
7082 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 7083 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
7084
7085 * editfns.c (time_overflow): Now extern.
7086 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7087 (float-time, Fformat_time_string, Fcurrent_time_string)
7088 (Fcurrent_time_zone): Accept and generate higher-resolution
7089 time stamps.
7090 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7091 (decode_time_components, lisp_seconds_argument): New functions.
7092 (make_time): Now static.
7093 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7094 Report an error if the time is invalid, rather than having the caller
7095 do that.
7096
7097 * fileio.c: Include <stat-time.h>
7098 (Fcopy_file): Copy higher-resolution time stamps.
7099 Prefer to set the time stamp via a file descriptor if that works.
7100 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7101 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7102 (Fvisited_file_modtime, Fset_visited_file_modtime):
7103 Support higher-resolution time stamps.
7104
7105 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7106
7107 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7108
7109 * image.c (prepare_image_for_display, clear_image_cache)
7110 (lookup_image): Port to higer-resolution time stamps.
7111
7112 * keyboard.c (start_polling, bind_polling_period):
7113 Check for time stamp overflow.
7114 (read_char, kbd_buffer_get_event, timer_start_idle)
7115 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7116 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7117 Port to higher-resolution time stamps. Do not assume time_t is signed.
7118 (decode_timer): New function. Timers are now vectors of length 9,
7119 not 8, to accommodate the picosecond component.
7120 (timer_check_2): Use it.
7121
7122 * nsterm.m (select_timeout, timeval_subtract): Remove.
7123 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7124 as they're a bit more accurate and handle overflow better.
7125 (ns_select): Change prototype to be compatible with pselect.
7126 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7127 * nsterm.h (ns_select): Adjust prototype.
7128
7129 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7130 us-resolution time stamps.
7131 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7132
7133 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7134
7135 * lisp.h (time_overflow): New decl.
7136 (wait_reading_process_output): First arg is now intmax_t, not int,
7137 to accommodate larger waits.
7138
7139 * process.h (struct Lisp_Process.read_output_delay):
7140 Now counts nanoseconds, not microseconds.
7141 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7142 EMACS_HAS_USECS.
7143 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7144 (wait_reading_process_output):
7145 Port to ns-resolution time stamps.
7146 (Faccept_process_output, wait_reading_process_output):
7147 Check for time stamp overflow. Do not assume time_t is signed.
7148 (select_wrapper): Remove; we now use pselect.
7149 (Fprocess_attributes): Now generates ns-resolution time stamps.
7150
7151 * sysdep.c: Include utimens.h. Don't include utime.h
7152 or worry about struct utimbuf; gnulib does that for us now.
7153 (gettimeofday): Remove; gnulib provides a substitute.
7154 (make_timeval): New function.
7155 (set_file_times): Now sets ns-resolution time stamps.
7156 New arg FD; all uses changed.
7157 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7158 (system_process_attributes):
7159 Now returns ns-resolution time stamp. All uses changed.
7160 Check for time stamp overflow.
7161
7162 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7163 provides a substitute now.
7164
7165 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7166 since it guarantees struct timespec.
7167 (EMACS_TIME): Now struct timespec, so that we can support
7168 ns-resolution time stamps.
7169 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7170 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7171 (EMACS_USECS): Remove.
7172 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7173 so multiply the arg by 1000 before storing it.
7174 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7175 New macros.
7176 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7177 Port to ns-resolution time stamps.
7178 (EMACS_TIME_NEG_P): Remove; replaced by....
7179 (EMACS_TIME_SIGN): New macro.
7180 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7181 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7182 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7183 (make_timeval, make_lisp_time, decode_time_components): New decls.
7184 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7185 that it mishandled time_t overflow. You can't compare by subtracting!
7186 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7187 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7188
7189 * term.c: Include <sys/time.h>.
7190 (timeval_to_Time): New function, for proper overflow wraparound.
7191 (term_mouse_position, term_mouse_click): Use it.
7192
7193 * undo.c (record_first_change): Support higher-resolution time stamps
7194 in the undo buffer.
7195 (Fprimitive_undo): Use them when restoring time stamps.
7196
7197 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7198 (w32_get_internal_run_time):
7199 Port to higher-resolution Emacs time stamps.
7200 (ltime): Now accepts single 64-bit integer, as that's more convenient
7201 for callers.
7202
7203 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7204
7205 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7206 for compatibility with pselect. Support ns-resolution time stamps.
7207
7208 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7209
7210 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7211 Check for time stamp overflow, and support ns-resolution time stamps.
7212
7213 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7214 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7215 (timeval_subtract): Remove; no longer needed.
7216 (XTflash, XTring_bell, x_wait_for_event):
7217 Port to ns-resolution time stamps. Don't assume time_t is signed.
7218
b6a92dfe
CY
72192012-06-22 Chong Yidong <cyd@gnu.org>
7220
7221 * xdisp.c (x_consider_frame_title): Revert last change.
7222
d251c37c
EZ
72232012-06-22 Eli Zaretskii <eliz@gnu.org>
7224
7225 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7226 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7227 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7228 staticidx goes up to 1597 out of 1600 = 0x640.)
7229
f10deafb
PE
72302012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7231
7232 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7233 Otherwise, the umask might be mistakenly 0 while handling input signals.
7234
ec6de1e2
SM
72352012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7236
7237 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7238
28be1ada
DA
72392012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7240
7241 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7242 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7243 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7244 access to `contents' member of Lisp_Vector objects with AREF and ASET
7245 where appropriate.
7246
c6bf3022
CY
72472012-06-19 Chong Yidong <cyd@gnu.org>
7248
7249 * frame.c (delete_frame): When selecting a frame on a different
7250 text terminal, do not alter the terminal's top-frame.
7251
7252 * xdisp.c (format_mode_line_unwind_data): Record the target
7253 frame's selected window and its terminal's top-frame.
7254 (unwind_format_mode_line): Restore them.
7255 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7256 Callers changed.
7257 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7258 since tty frames can be explicitly named.
7259 (prepare_menu_bars): Likewise.
7260
7261 * term.c (Ftty_top_frame): New function.
7262
defd4196
PE
72632012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7264
7265 Port byte-code-meter to modern targets.
7266 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7267 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 7268 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
7269 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7270 (METER_1, METER_2): Simplify.
7271
1053a871
SM
72722012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7273
7274 * data.c (Fdefalias): Return `symbol' (bug#11686).
7275
b7e8d081
MR
72762012-06-18 Martin Rudalics <rudalics@gmx.at>
7277
7278 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
7279 gets killed during executing of this function (Bug#11665).
7280 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
7281 (Vkill_buffer_query_functions): In doc-string say that functions
7282 run by this hook should not change the current buffer.
7283
7ea2b339
PE
72842012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 Fix recently-introduced process.c problems found by static checking.
7287 * process.c (write_queue_push, write_queue_pop, send_process):
7288 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7289 (write_queue_pop): Fix pointer signedness problem.
7290 (send_process): Remove unused local.
7291
96a313a1
CY
72922012-06-17 Chong Yidong <cyd@gnu.org>
7293
7294 * xdisp.c (redisplay_internal): No need to redisplay terminal
7295 frames that are not on top.
7296
20ca2e94
TN
72972012-06-17 Troels Nielsen <bn.troels@gmail.com>
7298
7299 * process.c (make_process): Initialize write_queue.
7300 (write_queue_push, write_queue_pop): New functions.
7301 (send_process): Use them to maintain correct ordering of process
7302 writes (Bug#10815).
7303
9a900ca9
PE
73042012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7305
310fbfa8
PE
7306 * lisp.h (eassert): Assume C89 or later.
7307 This removes the need for CHECK.
7308 (CHECK): Remove. Its comments about always evaluating its
7309 argument were confusing, as 'eassert' typically does not evaluate
7310 its argument.
7311
27bb1ca4
PE
7312 * coding.c (produce_chars): Use ptrdiff_t, not int.
7313
9a900ca9
PE
7314 * xterm.c (x_draw_underwave): Check for integer overflow.
7315 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7316
41b7f8bc 73172012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
7318
7319 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7320 referenced (Bug#11583).
7321
9b0e3eba
AA
73222012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7323
7324 Implement wave-style variant of underlining.
7325 * dispextern.h (face_underline_type): New enum.
7326 (face): Add field for underline type.
7327 * nsterm.m (ns_draw_underwave): New function.
7328 (ns_draw_text_decoration): Use it.
7329 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7330 New functions.
7331 (x_draw_glyph_string): Use them.
7332 * xfaces.c (Qline, Qwave): New Lisp objects.
7333 (check_lface_attrs, merge_face_ref)
1053a871
SM
7334 (Finternal_set_lisp_face_attribute, realize_x_face):
7335 Handle wave-style underline face attributes.
9b0e3eba
AA
7336 * xterm.c (x_draw_underwave): New function.
7337 (x_draw_glyph_string): Use it.
7338
0fb52f11
JB
73392012-06-16 Juanma Barranquero <lekktu@gmail.com>
7340
7341 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7342 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7343 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7344 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7345 ($(BLD)/w32select.$(O)): Update dependencies.
7346
e5560ff7
AS
73472012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7348
7349 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7350 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7351 * character.c (_fetch_multibyte_char_p): Remove.
7352 * alloc.c: Include "character.h" before "buffer.h".
7353 * bidi.c: Likewise.
7354 * buffer.c: Likewise.
7355 * bytecode.c: Likewise.
7356 * callint.c: Likewise.
7357 * callproc.c: Likewise.
7358 * casefiddle.c: Likewise.
7359 * casetab.c: Likewise.
7360 * category.c: Likewise.
7361 * cmds.c: Likewise.
7362 * coding.c: Likewise.
7363 * composite.c: Likewise.
7364 * dired.c: Likewise.
7365 * dispnew.c: Likewise.
7366 * doc.c: Likewise.
7367 * dosfns.c: Likewise.
7368 * editfns.c: Likewise.
7369 * emacs.c: Likewise.
7370 * fileio.c: Likewise.
7371 * filelock.c: Likewise.
7372 * font.c: Likewise.
7373 * fontset.c: Likewise.
7374 * fringe.c: Likewise.
7375 * indent.c: Likewise.
7376 * insdel.c: Likewise.
7377 * intervals.c: Likewise.
7378 * keyboard.c: Likewise.
7379 * keymap.c: Likewise.
7380 * lread.c: Likewise.
7381 * macros.c: Likewise.
7382 * marker.c: Likewise.
7383 * minibuf.c: Likewise.
7384 * nsfns.m: Likewise.
7385 * nsmenu.m: Likewise.
7386 * print.c: Likewise.
7387 * process.c: Likewise.
7388 * regex.c: Likewise.
7389 * region-cache.c: Likewise.
7390 * search.c: Likewise.
7391 * syntax.c: Likewise.
7392 * term.c: Likewise.
7393 * textprop.c: Likewise.
7394 * undo.c: Likewise.
7395 * unexsol.c: Likewise.
7396 * w16select.c: Likewise.
7397 * w32fns.c: Likewise.
7398 * w32menu.c: Likewise.
7399 * window.c: Likewise.
7400 * xdisp.c: Likewise.
7401 * xfns.c: Likewise.
7402 * xmenu.c: Likewise.
7403 * xml.c: Likewise.
7404 * xselect.c: Likewise.
7405
2f07e6af
EZ
74062012-06-16 Eli Zaretskii <eliz@gnu.org>
7407
1053a871
SM
7408 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7409 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7410 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7411 row.
7412 (handle_face_prop): Use chunk-relative overlay string index when
7413 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7414 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7415 the rightmost. (Bug#11720)
2f07e6af 7416
29b83cec
AS
74172012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7418
7419 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7420 (CATEGORY_MEMBER): Enforce 1/0 value.
7421 * category.c (_temp_category_set): Remove.
7422
4c5501e9
EZ
74232012-06-16 Eli Zaretskii <eliz@gnu.org>
7424
7425 * window.c (Fdelete_other_windows_internal)
7426 (Fdelete_window_internal): Don't access frame's mouse highlight
7427 info of the initial frame. (Bug#11677)
7428
2b570124
PE
74292012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7430
e93864f9
PE
7431 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7432 Assume USE_2_TAGS_FOR_INTS.
7433 (xreload): Adjust $tagmask width to match recent lisp.h change.
7434
2b570124
PE
7435 Simplify lisp.h in minor ways that should not affect code.
7436 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7437 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7438 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7439 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7440 (INTTYPEBITS): New macro, for clarity.
7441 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7442 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7443 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7444 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7445 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7446
81755f69
JB
74472012-06-13 Juanma Barranquero <lekktu@gmail.com>
7448
7449 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7450
16192a57
GM
74512012-06-13 Glenn Morris <rgm@gnu.org>
7452
7453 * s/bsd-common.h (BSD4_3):
7454 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7455
646b5f55
AS
74562012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7457
7458 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7459 instead of union.
7460 (XLI, XIL): Define.
1053a871
SM
7461 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7462 Use them.
7463 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7464 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7465 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7466 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7467 * frame.c (delete_frame): Remove outdated comment.
7468 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7469 USE_LISP_UNION_TYPE.
7470 (Fw32_unregister_hot_key): Likewise.
7471 (Fw32_toggle_lock_key): Likewise.
7472 * w32menu.c (add_menu_item): Likewise.
7473 (w32_menu_display_help): Use XIL instead of checking
7474 USE_LISP_UNION_TYPE.
7475 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7476 (init_heap): Likewise.
7477 * w32term.c (w32_read_socket): Update comment.
7478
1d3823c9
GM
74792012-06-13 Glenn Morris <rgm@gnu.org>
7480
c62ff706
GM
7481 * s/usg5-4-common.h, src/s/unixware.h:
7482 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7483
1d3823c9
GM
7484 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7485
bfe3e0a2
PE
74862012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7487
7488 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7489 * alloc.c (make_number) [!defined make_number]:
7490 Remove, as lisp.h always defines this now.
7491 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7492 (roundup_size): Verify that it is a power of 2.
7493 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7494 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7495 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7496 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7497 USE_LSB_TAG now is always defined to be either 0 or 1.
7498 All uses changed.
7499 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7500 code works fine either way, and efficiency is not a concern here,
7501 as the union type is for debugging, not for production.
7502 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7503 Use an inline function on all platforms when using the union type,
7504 since this is simpler and 'static inline' can be used portably
7505 within Emacs now.
7506 (LISP_INITIALLY_ZERO): New macro.
7507 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7508 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7509
45fa9c0f
GM
75102012-06-12 Glenn Morris <rgm@gnu.org>
7511
b4492cba
GM
7512 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7513
7514 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7515
45fa9c0f
GM
7516 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7517 Move BROKEN_SIGIO to configure.
7518
7519 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7520 Move NO_TERMIO to configure.
7521
0e25d334
CY
75222012-06-12 Chong Yidong <cyd@gnu.org>
7523
7524 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7525 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7526 MagickExportImagePixels is undefined.
7527
43682bb6
PE
75282012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * image.c (imagemagick_load_image): Remove unused label.
7531
a9be7d2b
GM
75322012-06-11 Glenn Morris <rgm@gnu.org>
7533
7534 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7535 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7536 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7537 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7538
3017f87f
SM
75392012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7540
7541 * alloc.c (make_byte_code): New function.
7542 (Fmake_byte_code): Use it. Don't purify here.
7543 * lread.c (read1): Use it as well to avoid extra allocation.
7544
1b9b4cf4
CY
75452012-06-11 Chong Yidong <cyd@gnu.org>
7546
7547 * image.c (imagemagick_load_image): Implement transparency.
7548
95988fcf
AS
75492012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7550
7551 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7552 account for preceding backslashes. (Bug#11663)
7553
cd4eb164
CY
75542012-06-09 Chong Yidong <cyd@gnu.org>
7555
7556 * term.c: Support italics in capable terminals (Bug#9652).
7557 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7558 (turn_on_face): Output using TS_enter_italic_mode if available.
7559 Don't handle unused blinking and alt-charset cases.
7560 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7561 and tty_alt_charset_p cases.
7562 (tty_capable_p, init_tty): Support italics.
7563
7564 * termchar.h (struct tty_display_info): Add field for italics.
7565 Remove unused blink field.
7566
7567 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7568 Handle slant.
7569
7570 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7571 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7572 tty_alt_charset_p. Add tty_italic_p.
7573
ff88beb8
MA
75742012-06-09 Michael Albinus <michael.albinus@gmx.de>
7575
7576 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7577 dbus_type_is_basic if available.
7578 (xd_extract_signed, xd_extract_unsigned): Rename from
7579 extract_signed and extract_unsigned, respectively. Adapt callers.
7580
44286096
CY
75812012-06-09 Chong Yidong <cyd@gnu.org>
7582
1682701f
CY
7583 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7584
44286096
CY
7585 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7586 case (Bug#9752).
7587
d86feb17
PE
75882012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7589
7590 * xdisp.c (vmessage): Treat frame message as multibyte.
7591 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7592 would generate the diagnostic "Making \302\247 buffer-local while
7593 let-bound!".
7594
d5c20fe8
EZ
75952012-06-08 Eli Zaretskii <eliz@gnu.org>
7596
7597 * dispnew.c (showing_window_margins_p): Undo last change, which
7598 was done due to an inadvertent commit.
7599 (adjust_frame_glyphs_for_frame_redisplay): Do call
7600 showing_window_margins_p.
7601
513749ee
SM
76022012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7603
7604 * eval.c (Fmake_var_non_special): New primitive.
7605 (syms_of_eval): Defsubr it.
7606 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7607
d4a8f5c1
JB
76082012-06-08 Juanma Barranquero <lekktu@gmail.com>
7609
7610 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7611 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7612
8bbbc977
EZ
76132012-06-08 Eli Zaretskii <eliz@gnu.org>
7614
7615 * alloc.c (allocate_vectorlike): Fix last change.
7616
f3372c87
DA
76172012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7618
7619 Block-based vector allocation of small vectors.
7620 * lisp.h (struct vectorlike_header): New field `nbytes',
7621 adjust comment accordingly.
7622 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7623 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7624 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7625 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7626 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7627 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7628 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7629 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7630 (roundup_size): New constant.
7631 (struct vector_block): New data type.
7632 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7633 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7634 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7635 (sweep_vectors): New functions.
7636 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7637 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7638 or equal to VBLOCK_BYTES_MAX.
7639 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7640 (init_alloc_once): Add call to init_vectors.
7641
4f18a4ed
SM
76422012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7643
7644 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7645
86f158bc
PE
76462012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 * doprnt.c (doprnt): Truncate multibyte char correctly.
7649 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7650 would mishandle a string argument "Xc" if X was a multibyte
7651 character of length 2: it would truncate after X's first byte
7652 rather than including all of X.
7653
c5cfcbe0
CY
76542012-06-06 Chong Yidong <cyd@gnu.org>
7655
7656 * buffer.c (word_wrap): Doc fix.
7657
c05cf390
PE
76582012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7659
7660 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7661
0c3461de
GM
76622012-06-03 Glenn Morris <rgm@gnu.org>
7663
7664 * xdisp.c (tool-bar-style): Doc fix.
7665
c71232db
UM
76662012-06-03 Ulrich Müller <ulm@gentoo.org>
7667
7668 * Makefile.in (PAXCTL): Define.
7669 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7670 binary via PaX flags if the paxctl utility is available.
7671 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7672 Restore PaX flags to their default. (Bug#11398)
7673
383f7350
CY
76742012-06-03 Chong Yidong <cyd@gnu.org>
7675
7676 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7677 buffer (Bug#11226).
7678
5f2c76c6
CY
76792012-06-03 Chong Yidong <cyd@gnu.org>
7680
7681 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7682 (note_mode_line_or_margin_highlight): If there is no help echo,
7683 use mode-line-default-help-echo. Handle the case where the mouse
7684 position is past the end of the mode line string.
7685
7686 * buffer.c (buffer_local_value_1): New function, split from
7687 Fbuffer_local_value; can return Qunbound.
7688 (Fbuffer_local_value): Use it.
7689 (Vmode_line_format): Docstring tweaks.
7690
773d47f6
PE
76912012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7692
7693 * sysdep.c (system_process_attributes): Improve comment.
7694
f2d6a3df
SM
76952012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7696
7697 * keyboard.c: Export real-this-command to Elisp.
7698 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7699 and DEFVAR it. Update all users.
7700
63810350
PE
77012012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7702
7bd5c1f4
PE
7703 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7704
63810350
PE
7705 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7706 Convert pctcpu and pctmem to Lisp float properly.
7707 Let the compiler fold better, as 100.0/0x8000 is exact.
7708
a2821611
AS
77092012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7710
7711 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7712 cons_block.
7713
5fceba1d
PE
77142012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7715
7716 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7717
c98ff5dd
DA
77182012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7719
7720 For a 'struct window', replace some Lisp_Object fields to
7721 bitfields where appropriate, remove unused fields.
7722 * window.h (struct window): Remove unused 'last_mark_x' and
7723 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 7724 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
7725 Change type of 'force_start', 'optional_new_start',
7726 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7727 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7728
ca34e0be
PE
77292012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7730
7731 Pacify gcc -Wdouble-precision when using Xaw.
7732 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7733 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7734 Use 'float' consistently, rather than 'float' in most places
7735 and 'double' in a couple of places.
7736
efc00ab1 77372012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7738
7739 * xdisp.c (handle_stop): Detect whether we have overlay strings
7740 loaded by testing it->current.overlay_string_index to be
7741 non-negative, instead of checking whether n_overlay_strings is
7742 positive. (Bug#11587)
7743
efc00ab1 77442012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7745
7746 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7747
7748 * doc.c (Fsubstitute_command_keys): Doc fix.
7749
efc00ab1 77502012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7751
7752 * search.c (search_buffer): Remove calls to
7753 r_alloc_inhibit_buffer_relocation, as it is now called by
7754 maybe_unify_char, which was the cause of relocation of buffer text
7755 in bug#11519.
7756
efc00ab1 77572012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7758
7759 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7760 for the duration of call to load_charset, to avoid problems with
7761 callers of maybe_unify_char that access buffer text through C
7762 pointers.
7763
7764 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7765 decrement the inhibition flag, instead of just setting or
7766 resetting it.
7767
ba93a187
PE
77682012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7769
7770 Remove obsolete '#define static' cruft.
7771 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7772 This #undef was "temporary" in 2000; it is no longer needed
7773 now that '#define static' has gone away.
7774 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7775 (gray_bitmap_bits): Remove; no longer needed.
7776 All uses replaced with definiens.
7777 * xterm.c: Include "bitmaps/gray.xbm".
7778
9e4bf381
PE
77792012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7780
7781 Clean up __executable_start, monstartup when --enable-profiling.
7782 The following changes affect the code only when profiling.
7783 * dispnew.c (__executable_start): Rename from safe_bcopy.
7784 Define only on platforms that need it.
7785 * emacs.c: Include <sys/gmon.h> when profiling.
7786 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7787 (__executable_start): Remove decl, since lisp.h does it now.
7788 (safe_bcopy): Remove decl; no longer has that name.
7789 (main): Coalesce #if into single bit of code, for simplicity.
7790 Cast pointers to uintptr_t, since standard libraries want integers
7791 and not pointers.
7792 * lisp.h (__executable_start): New decl.
7793
32d72c2f
GM
77942012-05-31 Glenn Morris <rgm@gnu.org>
7795
7796 * image.c (Fimagemagick_types): Doc fix.
7797
baac5bc7
JM
77982012-05-30 Jim Meyering <meyering@redhat.com>
7799
7800 * callproc.c (Fcall_process_region): Include directory component
7801 in mkstemp error message (Bug#11586).
7802
72cb32cf
PE
78032012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 * alloc.c, lisp.h (make_pure_vector): Now static.
7806
61b108cc
SM
78072012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7808
7809 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7810 Move to byte-run.el.
7811 (Fautoload): Do the hash-doc more carefully.
7812 * data.c (Fdefalias): Purify definition, except for keymaps.
7813 (Qdefun): Move from eval.c.
7814 * lisp.h (Qdefun): Remove.
7815 * lread.c (read1): Tiny simplification.
7816
471fe23d
TN
78172012-05-29 Troels Nielsen <bn.troels@gmail.com>
7818
934f3f58 7819 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7820 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7821 Bug#9642, but explicitly check that the buffer the overlay would
7822 be moved to is live and rearrange lines to make sure that errors
7823 will not put the overlay in an inconsistent state.
7824 (Fdelete_overlay): Cosmetics.
7825
85d0efd1
EZ
78262012-05-28 Eli Zaretskii <eliz@gnu.org>
7827
7828 * w32term.c (my_bring_window_to_top): New function.
7829 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7830 could be different from the original one.
7831 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7832 (Bug#11513)
7833
7834 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7835 by calling BringWindowToTop.
7836
7837 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7838 (WM_EMACS_END): Increase by one.
7839
da92a98c
PE
78402012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7841
7842 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7843 This avoids undefined behavior that might cause the eassert
7844 to not catch an out-of-range value.
7845
74d1f848
JB
78462012-05-28 Juanma Barranquero <lekktu@gmail.com>
7847
7848 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7849 Update dependencies.
7850
9e1a06fc
EZ
78512012-05-27 Eli Zaretskii <eliz@gnu.org>
7852
7853 * bidi.c (bidi_mirror_char): Fix last change.
7854
f3dd7312
AS
78552012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7856
7857 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7858 when referring to sectname field in printf format.
7859
81899c91
PE
78602012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7861
57b81a9f
PE
7862 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7863 Only r_alloc_inhibit_buffer_relocation needed to be added;
7864 the others were already declared.
7865
81899c91
PE
7866 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7867 before checking whether it's out of range. Put the check inside
7868 eassert. See
7869 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7870
33017faf 78712012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
7872
7873 * callproc.c (Fcall_process): Restore a line that was accidentally
7874 commented out in the 2011-02-13 change (bug#11547).
7875
33017faf 78762012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
7877
7878 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7879 defined on ralloc.c.
7880
7881 * buffer.c [REL_ALLOC]: Remove prototypes of
7882 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7883 they are now on lisp.h.
7884
7885 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7886
7887 * search.c (search_buffer): Use it to inhibit relocation of buffer
7888 text while re_search_2 is doing its job, because re_search_2 is
7889 passed C pointers to buffer text. (Bug#11519)
7890
23415acf
EZ
7891 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7892 Update value to 24.
7893
44e27368
EZ
7894 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7895 state after an additional call to move_it_in_display_line_to, keep
7896 the values of it->max_ascent and it->max_descent found for the
7897 entire line.
7898 (pos_visible_p): Revert the comparison against bottom_y to what it
7899 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7900 (Bug#11464)
7901
c1892f11
PE
79022012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7903
7904 Fix coding-related core dumps with gcc -ftrapv.
7905 The code was computing A - B, where A and B are pointers, and B is
7906 random garbage. This can lead to core dumps on platforms that
7907 have special pointer registers, and it also leads to core dumps on
7908 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7909 A - B only when B is initialized properly.
7910 * coding.c (coding_set_source, coding_set_destination): Return void.
7911 (coding_change_source, coding_change_destinations): New functions,
7912 with the old behaviors of coding_set_source and coding_set_destination.
7913 All callers that need an offset changed to use these new functions.
7914
eb7afdad
GM
79152012-05-26 Glenn Morris <rgm@gnu.org>
7916
7917 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7918
f12fdf02
EZ
79192012-05-26 Eli Zaretskii <eliz@gnu.org>
7920
53a63be6 7921 Extend mouse support on W32 text-mode console.
61b108cc
SM
7922 * xdisp.c (draw_row_with_mouse_face):
7923 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 7924
eb3f6f01 7925 * w32console.c: Include window.h.
61b108cc
SM
7926 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
7927 New functions.
eb3f6f01
EZ
7928 (initialize_w32_display): Initialize mouse-highlight data.
7929
53a63be6
EZ
7930 * w32inevt.c: Include termchar.h and window.h.
7931 (do_mouse_event): Support mouse-autoselect-window. When the mouse
7932 moves, call note_mouse_highlight. If help_echo changed, call
7933 gen_help_event to produce help-echo message in the echo area.
7934 Call clear_mouse_face if mouse_face_hidden is set in the mouse
7935 highlight info.
7936
4cfd81f6
PE
79372012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7938
7939 * lread.c (read1): Simplify slightly to avoid an overflow warning
7940 with GCC 4.7.0 on x86-64.
7941
4446092a
EZ
79422012-05-26 Eli Zaretskii <eliz@gnu.org>
7943
7944 * bidi.c (bidi_mirror_char): Revert last change: an int is
7945 definitely wide enough here.
7946
42b2a986 79472012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 7948
42b2a986 7949 Fix integer width and related bugs (Bug#9874).
eb106a49 7950 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
7951 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
7952 (string_bytes, check_sblock, allocate_string_data):
7953 (compact_small_strings, Fmake_bool_vector, make_string)
7954 (make_unibyte_string, make_multibyte_string)
7955 (make_string_from_bytes, make_specified_string)
7956 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
7957 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
7958 (mark_vectorlike):
7959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7960 (allocate_pseudovector):
7961 Use int, not EMACS_INT, where int is wide enough.
7962 (inhibit_garbage_collection, Fgarbage_collect):
7963 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7964 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
7965 int might not be wide enough.
7966 (bidi_cache_search, bidi_cache_find, bidi_init_it)
7967 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
7968 (bidi_at_paragraph_end, bidi_find_paragraph_start)
7969 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7970 (bidi_level_of_next_char, bidi_move_to_visually_next):
7971 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7972 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
7973 (Fkill_buffer, Fset_buffer_major_mode)
7974 (advance_to_char_boundary, Fbuffer_swap_text)
7975 (Fset_buffer_multibyte, overlays_at, overlays_in)
7976 (overlay_touches_p, struct sortvec, record_overlay_string)
7977 (overlay_strings, recenter_overlay_lists)
7978 (adjust_overlays_for_insert, adjust_overlays_for_delete)
7979 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
7980 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
7981 (Foverlay_recenter, last_overlay_modification_hooks_used)
7982 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
7983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
7984 (validate_region): Omit unnecessary test for b <= e,
7985 since that's guaranteed by the previous test.
d311d28c
PE
7986 (adjust_overlays_for_delete): Avoid pos + length overflow.
7987 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
7988 (report_overlay_modification):
7989 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7990 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
7991 Omit pointer cast, which isn't needed anyway, and doesn't work
7992 after the EMACS_INT -> ptrdiff_t change.
02481186 7993 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
7994 * buffer.h: Adjust decls to match defn changes elsewhere.
7995 (struct buffer_text, struct buffer):
7996 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7997 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
7998 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
7999 not int, to avoid needless 32-bit limit on 64-bit hosts.
8000 (exec_byte_code): Use tighter memory-full test, one that checks
8001 for alloca overflow. Don't compute the address of the object just
8002 before an array, as that's not portable. Use EMACS_INT, not
8003 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
8004 * callint.c (Fcall_interactively):
8005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8006 * callproc.c (call_process_kill, Fcall_process):
8007 Don't assume pid_t fits into an Emacs fixnum.
8008 (call_process_cleanup, Fcall_process, child_setup):
8009 Don't assume pid_t fits into int.
8010 (call_process_cleanup, Fcall_process, delete_temp_file)
8011 (Fcall_process_region):
8012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8013 (Fcall_process): Simplify handling of volatile integers.
8014 Use int, not EMACS_INT, where int will do.
8015 * casefiddle.c (casify_object, casify_region, operate_on_word)
8016 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8018 (casify_object): Avoid integer overflow when overallocating buffer.
8019 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 8020 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
8021 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8022 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8023 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8024 integers are now checked earlier. All uses replaced with XINT.
8025 (ccl_driver):
8026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8027 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
8028 (ccl_driver, Fregister_code_conversion_map):
8029 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
8030 (resolve_symbol_ccl_program): Check that vector header is in range.
8031 Always copy the vector, so that we can check its contents reliably
8032 now rather than having to recheck each instruction as it's being
8033 executed. Check that vector words fit in 'int'.
8034 (ccl_get_compiled_code, Fregister_ccl_program)
8035 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8036 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8037 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8038 contents are in range.
8039 (Fccl_execute_on_string): Check that status is in range.
8040 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8041 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8042 Accept and return EMACS_INT, not int, because callers can pass values
8043 out of 'int' range.
8044 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8045 (multibyte_chars_in_text, parse_str_as_multibyte)
8046 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8047 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8048 (string_escape_byte8, Fget_byte):
8049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 8050 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
8051 avoid mishandling large integers.
8052 * character.h: Adjust decls to match defn changes elsewhere.
8053 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8054 (Ffind_charset_region):
8055 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8056 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8057 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 8058 Don't assume fixnum fits in int.
d311d28c
PE
8059 (load_charset_map_from_vector, Fmap_charset_chars):
8060 Remove now-unnecessary CHECK_NATNUMs.
8061 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
8062 Don't rely on undefined behavior with signed left shift overflow.
8063 Don't assume unsigned int fits into fixnum, or that fixnum fits
8064 into unsigned int. Don't require max_code to be a valid fixnum;
8065 that's not true for gb10830 4-byte on a 32-bit host. Allow
8066 invalid_code to be a cons, for the same reason. Require code_offset
8067 to be a character. Avoid int overflow if max_char is close
8068 to INT_MAX.
8069 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8070 this is intended anyway and avoids some undefined behavior.
8071 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8072 INDEX_TO_CODE_POINT, as that's what it expects.
8073 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
8074 * charset.h (DECODE_CHAR): Return int, not unsigned;
8075 this is what was intended anyway, and it avoids undefined behavior.
8076 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8077 integer-overflow issues.
8078 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8079 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8080 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
8081 * chartab.c (Fmake_char_table, Fset_char_table_range)
8082 (uniprop_get_decoder, uniprop_get_encoder):
8083 Don't assume fixnum fits in int.
8084 * cmds.c (move_point): New function, that does the gist of
8085 Fforward_char and Fbackward_char, but does so while checking
8086 for integer overflow more accurately.
c96e5d6a 8087 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
8088 (Fforward_line, Fend_of_line, internal_self_insert)
8089 (internal_self_insert):
8090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8091 Fix a FIXME, by checking for integer overflow when calculating
8092 target_clm and actual_clm.
8093 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 8094 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
8095 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8096 (coding_alloc_by_making_gap, alloc_destination)
8097 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8098 (encode_coding_utf_16, detect_coding_emacs_mule)
8099 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8100 (detect_coding_iso_2022, decode_coding_iso_2022)
8101 (encode_invocation_designation, encode_designation_at_bol)
8102 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8103 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8104 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8105 (encode_coding_ccl, encode_coding_raw_text)
8106 (detect_coding_charset, decode_coding_charset)
8107 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8108 (produce_composition, produce_charset, produce_annotation)
8109 (decode_coding, handle_composition_annotation)
8110 (handle_charset_annotation, consume_chars, decode_coding_gap)
8111 (decode_coding_object, encode_coding_object, detect_coding_system)
8112 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8113 (code_convert_region, code_convert_string)
8f50130c
PE
8114 (Fdefine_coding_system_internal)
8115 (coding_set_source, coding_set_destination):
d311d28c
PE
8116 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8117 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8118 (Fdefine_coding_system_internal):
8119 Don't assume fixnums fit in int.
8120 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 8121 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
8122 (Funencodable_char_position, Fcheck_coding_systems_region)
8123 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 8124 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 8125 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 8126 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 8127 Don't access memory outside of the args array.
d311d28c 8128 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
8129 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8130 result of ENCODE_CHAR.
d311d28c
PE
8131 * coding.h: Adjust decls to match defn changes elsewhere.
8132 (struct coding_system):
8133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8134 * composite.c (get_composition_id, find_composition)
8135 (run_composition_function, update_compositions)
8136 (compose_text, composition_gstring_put_cache)
8137 (composition_gstring_p, composition_gstring_width)
8138 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8139 (composition_compute_stop_pos, composition_reseat_it)
8140 (composition_update_it, struct position_record)
8141 (find_automatic_composition, composition_adjust_point)
8142 (Fcomposition_get_gstring, Ffind_composition_internal):
8143 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8144 (update_compositions):
8145 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8146 * composite.h: Adjust decls to match defn changes elsewhere.
8147 (struct composition):
8148 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8149 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8150 Do not attempt to compute the address of the object just before a
8151 buffer; this is not portable.
8152 (Faref, Faset):
8153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8154 (Faset): Use int, not EMACS_INT, where int is wide enough.
8155 (Fstring_to_number): Don't assume fixnums fit in int.
8156 (Frem): Don't assume arg is nonnegative.
8157 * dbusbind.c (xd_append_arg): Check for integers out of range.
8158 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 8159 (extract_signed, extract_unsigned): New functions.
243e0530
PE
8160 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8161 (xd_get_connection_references): Return ptrdiff_t, not int.
8162 All uses changed.
8163 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8164 (xd_read_message_1):
8165 Use int, not unsigned, where the dbus API uses int.
8166 (Fdbus_message_internal): Don't overflow mtype.
8167 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
8168 * dired.c (directory_files_internal, file_name_completion, scmp)
8169 (file_name_completion_stat):
8170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8171 (file_name_completion): Don't overflow matchcount.
8172 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8173 * dispextern.h: Adjust decls to match defn changes elsewhere.
8174 (struct text_pos, struct glyph, struct bidi_saved_info)
8175 (struct bidi_string_data, struct bidi_it, struct composition_it)
8176 (struct it):
8177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8178 (struct display_pos, struct composition_it, struct it):
8179 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8180 * dispnew.c (increment_matrix_positions)
8181 (increment_row_positions, mode_line_string)
8182 (marginal_area_string):
8183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 8184 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
8185 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8186 (duration_to_sec_usec): New function, to check for overflow better.
8187 (Fsleep_for, sit_for): Use it.
8188 * doc.c (get_doc_string, store_function_docstring):
8189 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8190 (get_doc_string, Fsnarf_documentation):
8191 Use int, not EMACS_INT, where int is wide enough.
8192 (get_doc_string):
8193 Use SAFE_ALLOCA, not alloca.
8194 Check for overflow when converting EMACS_INT to off_t.
8195 * doprnt.c (doprnt):
8196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8197 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8198 Don't assume uid_t fits into fixnum.
8199 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8200 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8201 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8202 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8203 (general_insert_function)
8204 (Finsert_char, make_buffer_string, make_buffer_string_both)
8205 (update_buffer_properties, Fbuffer_substring)
8206 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8207 (Fsubst_char_in_region, check_translation)
8208 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8209 (transpose_markers, Ftranspose_regions):
8210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8211 (clip_to_bounds): Move to lisp.h as an inline function).
8212 (Fconstrain_to_field): Don't assume integers are nonnegative.
8213 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8214 (Fsubst_char_in_region, Fsave_restriction):
8215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8216 (Femacs_pid): Don't assume pid_t fits into fixnum.
8217 (lo_time): Use int, not EMACS_INT, when int suffices.
8218 (lisp_time_argument): Check for usec out of range.
8219 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
8220 (Fuser_login_name, Fuser_full_name): Signal an error
8221 if a uid argument is out of range, rather than relying on
8222 undefined behavior.
c8d5c857
PE
8223 (Fformat_time_string): Remove now-unnecessary check.
8224 lisp_time_argument checks for out-of-range usec now.
243e0530 8225 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
8226 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8227 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8228 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8229 (init_cmdargs, Fdump_emacs):
8230 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8231 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8232 the bottom (typically) 32 bits of the fixnum.
8233 * eval.c (specpdl_size, call_debugger):
8234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8235 (when_entered_debugger, Fbacktrace_debug):
8236 Don't assume fixnum can fit in int.
8237 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8238 the object just before a buffer; this is not portable.
8239 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8240 (grow_specpdl, unbind_to):
8241 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8242 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8243 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 8244 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
8245 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8246 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8248 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8249 (a_write, e_write):
8250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8251 (Fcopy_file, non_regular_nbytes, read_non_regular)
8252 (Finsert_file_contents):
8253 Use int, not EMACS_INT, where int is wide enough.
8254 (READ_BUF_SIZE): Verify that it fits in int.
8255 (Finsert_file_contents): Check that counts are in proper range,
8256 rather than assuming fixnums fit into ptrdiff_t etc.
8257 Don't assume fixnums fit into int.
125b3835 8258 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
8259 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8260 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
8261 (string_char_to_byte, string_byte_to_char)
8262 (string_make_multibyte, string_to_multibyte)
8263 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8264 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8265 (substring_both, Fdelete, internal_equal, Ffillarray)
8266 (Fclear_string, mapcar1)
8267 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8268 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8269 (larger_vector, make_hash_table, maybe_resize_hash_table)
8270 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8271 (Fmaphash, secure_hash):
8272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8273 (concat): Check for string index and length overflow.
8274 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8275 (Frequire):
8276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8277 (larger_vector): New API (vec, incr_min, size_max) replaces old
8278 one (vec, new_size, init). This catches size overflow.
8279 INIT was removed because it was always Qnil.
8280 All callers changed.
8281 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8282 the upper bound on a hash table index size.
8283 (make_hash_table, maybe_resize_hash_table): Use it.
8284 (secure_hash): Computer start_byte and end_byte only after
8285 they're known to be in ptrdiff_t range.
8286 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8287 (Ffont_get_glyphs, Ffont_at):
8288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8289 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8290 (Flist_fonts, Fopen_font):
8291 Don't assume fixnum can fit in int.
8292 (check_gstring): Don't assume index can fit in int.
8293 (font_match_p): Check that fixnum is a character, not a nonnegative
8294 fixnum, since the later code needs to stuff it into an int.
8295 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8296 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8297 conversion overflow issues.
8298 (Fopen_font): Check for integer out of range.
8299 (Ffont_get_glyphs): Don't assume index can fit in int.
8300 * font.h: Adjust decls to match defn changes elsewhere.
8301 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8302 integer overflow.
8303 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8304 printmax_t, where ptrdiff_t is wide enough.
8305 (Finternal_char_font):
8306 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8307 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8308 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8309 (Fset_frame_position, x_set_frame_parameters)
8310 (x_set_line_spacing, x_set_border_width)
8311 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8312 Check that fixnums are in proper range for system types.
8313 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8315 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8316 Use SAFE_ALLOCA_LISP, not alloca.
8317 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8318 intptr_t is wide enough.
8319 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8320 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8321 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8322 Check for fixnum out of range.
8323 * ftfont.c (ftfont_list): Don't assume index fits in int.
8324 Check that fixnums are in proper range for system types.
8325 (ftfont_shape_by_flt):
8326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
8327 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8329 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8330 Check that fixnums are in proper range for system types.
8331 * gnutls.h: Adjust decls to match defn changes elsewhere.
8332 * gtkutil.c (xg_dialog_run):
8333 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8334 (update_frame_tool_bar):
8335 Check that fixnums are in proper range for system types.
8336 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 8337 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
8338 * indent.c (last_known_column, last_known_column_point):
8339 (current_column_bol_cache):
8340 (skip_invisible, current_column, check_display_width):
8341 (check_display_width, scan_for_column, current_column_1)
8342 (Findent_to, Fcurrent_indentation, position_indentation)
8343 (indented_beyond_p, Fmove_to_column, compute_motion):
8344 (Fcompute_motion, Fvertical_motion):
8345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8346 (last_known_column_modified): Use EMACS_INT, not int.
8347 (check_display_width):
8348 (Fcompute_motion):
8349 Check that fixnums and floats are in proper range for system types.
8350 (compute_motion): Don't assume index or fixnum fits in int.
8351 (compute_motion, Fcompute_motion):
8352 Use int, not EMACS_INT, when it is wide enough.
8353 (vmotion): Omit local var start_hpos that is always 0; that way
8354 we don't need to worry about overflow in expressions involving it.
8355 * indent.h: Adjust decls to match defn changes elsewhere.
8356 (struct position):
8357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8358 Use int, not EMACS_INT, where int is wide enough.
8359 Remove unused members ovstring_chars_done and tab_offset;
8360 all uses removed.
8361 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8362 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8363 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8364 (make_gap, copy_text, insert, insert_and_inherit)
8365 (insert_before_markers, insert_before_markers_and_inherit)
8366 (insert_1, count_combining_before, count_combining_after)
8367 (insert_1_both, insert_from_string)
8368 (insert_from_string_before_markers, insert_from_string_1)
8369 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8370 (adjust_after_replace, adjust_after_insert, replace_range)
8371 (replace_range_2, del_range, del_range_1, del_range_byte)
8372 (del_range_both, del_range_2, modify_region)
8373 (prepare_to_modify_buffer, signal_before_change)
8374 (signal_after_change, Fcombine_after_change_execute):
8375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8376 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8377 (balance_an_interval, split_interval_right, split_interval_left)
8378 (find_interval, next_interval, update_interval)
8379 (adjust_intervals_for_insertion, delete_node, delete_interval)
8380 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8381 (static_offset_intervals, offset_intervals)
8382 (merge_interval_right, merge_interval_left, make_new_interval)
8383 (graft_intervals_into_buffer, temp_set_point_both)
8384 (temp_set_point, set_point, adjust_for_invis_intang)
8385 (set_point_both, move_if_not_intangible, get_property_and_range)
8386 (get_local_map, copy_intervals, copy_intervals_to_string)
8387 (compare_string_intervals, set_intervals_multibyte_1):
8388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8389 * intervals.h: Adjust decls to match defn changes elsewhere.
8390 (struct interval):
8391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8392 * keyboard.c (this_command_key_count, this_single_command_key_start)
8393 (before_command_key_count, before_command_echo_length, echo_now)
8394 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8395 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8396 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8397 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8398 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8399 (last_non_minibuf_size, last_point_position, echo_truncate)
8400 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8401 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8402 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8403 (stuff_buffered_input):
8404 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8405 (last_auto_save, command_loop_1, read_char):
8406 Use EMACS_INT, not int, to avoid integer overflow.
8407 (record_char): Avoid overflow in total_keys computation.
8408 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8409 * keyboard.h: Adjust decls to match defn changes elsewhere.
8410 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8411 (Fkey_description, Fdescribe_vector, Flookup_key):
8412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8413 (click_position): New function, to check that positions are in range.
8414 (Fcurrent_active_maps):
8415 (describe_command):
8416 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8417 (Faccessible_keymaps, Fkey_description):
8418 (preferred_sequence_p):
8419 Don't assume fixnum can fit into int.
8420 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8421 Check for integer overflow in size calculations.
8422 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8423 avoid mishandling large integers.
8424 * lisp.h: Adjust decls to match defn changes elsewhere.
8425 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8426 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8427 (struct Lisp_Marker):
8428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8429 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8430 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8431 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8432 All callers changed.
8433 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8434 Assume the arg has valid form, since it always does.
8435 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8436 unsigned integer system type.
8437 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8438 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8440 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8441 (duration_to_sec_usec): New decl.
8442 * lread.c (read_from_string_index, read_from_string_index_byte)
8443 (read_from_string_limit, readchar, unreadchar, openp)
8444 (read_internal_start, read1, oblookup):
8445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8446 (Fload, readevalloop, Feval_buffer, Feval_region):
8447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8448 (openp): Check for out-of-range argument to 'access'.
8449 (read1): Use int, not EMACS_INT, where int is wide enough.
8450 Don't assume fixnum fits into int.
6efdadfd 8451 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8452 (read_filtered_event): Use duration_to_sec_usec
8453 to do proper overflow checking on durations.
d311d28c
PE
8454 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8455 in size calculation.
8456 (Fexecute_kbd_macro):
8457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8458 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8459 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8460 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8461 (set_marker_both, set_marker_restricted_both, marker_position)
8462 (marker_byte_position, Fbuffer_has_markers_at):
8463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8464 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8465 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8466 It now merely ensures that the menu is large enough, without
8467 necessarily growing it, as this avoids some integer overflow issues.
8468 All callers changed.
8469 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8470 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8471 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8472 Use SAFE_ALLOCA_LISP, not alloca.
8473 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8474 to EMACS_INT. Check that fixnums are in proper range for system types.
8475 * minibuf.c (minibuf_prompt_width, string_to_object)
8476 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8477 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8479 (get_minibuffer, read_minibuf_unwind):
8480 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8481 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8482 this simplifies overflow checking. All callers changed.
8483 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8484 (Ftest_completion):
8485 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8486 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8487 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8488 Check that fixnums are in proper range for system types.
8489 (Fx_create_frame, Fx_show_tip):
8490 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8491 * nsfont.m (ns_findfonts, nsfont_list_family):
8492 Don't assume fixnum fits in long.
8493 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8494 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8495 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8496 wide enough.
17fdb222 8497 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8499 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8500 (PRINTDECLARE, PRINTPREPARE):
8501 (strout, print_string):
8502 (print, print_preprocess, print_check_string_charset_prop)
8503 (print_object):
8504 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8505 (PRINTDECLARE):
8506 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8507 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8508 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8509 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8510 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8511 (print_error_message): Use SAFE_ALLOCA, not alloca.
8512 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8513 (print_depth, new_backquote_output, print_number_index):
8514 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8515 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8516 (Fset_process_window_size, Fformat_network_address)
8517 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8518 (sigchld_handler):
d311d28c 8519 Check that fixnums are in proper range for system types.
d44287d4 8520 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8521 Check for process-ids out of pid_t range rather than relying on
8522 undefined behavior.
e4d81efc 8523 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8524 (Fformat_network_address, read_process_output, send_process)
8525 (Fprocess_send_region, status_notify):
8526 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8527 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8528 (wait_reading_process_output, read_process_output, exec_sentinel):
8529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8530 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8531 (Faccept_process_output): Use duration_to_sec_usec to do proper
8532 overflow checking on durations.
dde14581
PE
8533 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8534 Don't assume pid_t fits in int.
02481186
PE
8535 * process.h (struct Lisp_Process): Members tick and update_tick
8536 are now of type EMACS_INT, not int.
b62b53e8
PE
8537 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8538 configured --with-wide-int.
d311d28c
PE
8539 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8540 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8541 * search.c (looking_at_1, string_match_1):
8542 (fast_string_match, fast_c_string_match_ignore_case)
8543 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8544 (scan_newline, find_before_next_newline, search_command)
8545 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8546 (set_search_regs, wordify):
8547 (Freplace_match):
8548 (Fmatch_data):
8549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8550 (string_match_1, search_buffer, set_search_regs):
8551 (Fmatch_data):
8552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8553 (wordify): Check for overflow in size calculation.
8554 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8555 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8556 Check that fixnums are in proper range for system types.
8557 * sound.c (struct sound_device)
8558 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8560 (Fplay_sound_internal):
8561 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8562 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8563 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8564 (Fparse_partial_sexp):
8565 Don't assume fixnums can fit in int.
8566 (struct lisp_parse_state, find_start_pos, find_start_value)
8567 (find_start_value_byte, find_start_begv)
8568 (update_syntax_table, char_quoted, dec_bytepos)
8569 (find_defun_start, prev_char_comend_first, back_comment):
8570 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8571 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8573 (Finternal_describe_syntax_value): Check that match_lisp is a
8574 character, not an integer, since the code stuffs it into int.
8575 (scan_words, scan_sexps_forward):
8576 Check that fixnums are in proper range for system types.
8577 (Fforward_word):
8578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8579 (scan_sexps_forward):
8580 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8581 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8582 * syntax.h: Adjust decls to match defn changes elsewhere.
8583 (struct gl_state_s):
8584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8585 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8586 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8587 * sysdep.c (wait_for_termination_1, wait_for_termination)
8588 (interruptible_wait_for_termination, mkdir):
8589 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8590 (emacs_read, emacs_write):
8591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8592 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8593 and double all fit in int.
d311d28c
PE
8594 * term.c (set_tty_color_mode):
8595 Check that fixnums are in proper range for system types.
8596 * termhooks.h (struct input_event):
8597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8598 * textprop.c (validate_interval_range, interval_of)
8599 (Fadd_text_properties, set_text_properties_1)
8600 (Fremove_text_properties, Fremove_list_of_text_properties)
8601 (Ftext_property_any, Ftext_property_not_all)
8602 (copy_text_properties, text_property_list, extend_property_ranges)
8603 (verify_interval_modification):
8604 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8605 (Fnext_single_char_property_change)
8606 (Fprevious_single_char_property_change):
8607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8608 (copy_text_properties):
8609 Check for integer overflow in index calculation.
d311d28c
PE
8610 * undo.c (last_boundary_position, record_point, record_insert)
8611 (record_delete, record_marker_adjustment, record_change)
8612 (record_property_change):
8613 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8614 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8615 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8616 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8617 (Fx_hide_tip, Fx_file_dialog):
8618 * w32menu.c (set_frame_menubar):
8619 Use ptrdiff_t, not int, for consistency with rest of code.
8620 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8621 (select_window, Fdelete_other_windows_internal)
8622 (window_scroll_pixel_based, window_scroll_line_based)
8623 (Frecenter, Fset_window_configuration):
8624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8625 (Fset_window_hscroll, run_window_configuration_change_hook)
8626 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8627 (Fscroll_other_window, Frecenter):
d311d28c
PE
8628 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8629 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8630 Don't assume fixnum fits in int.
8631 (Fset_window_scroll_bars):
8632 Check that fixnums are in proper range for system types.
8633 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8634 (string_pos, c_string_pos, number_of_chars, init_iterator)
8635 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8636 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8637 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8638 (face_before_or_after_it_pos, handle_invisible_prop)
8639 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8640 (display_prop_intangible_p, string_buffer_position_lim)
8641 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8642 (get_overlay_strings_1, get_overlay_strings)
8643 (iterate_out_of_display_property, forward_to_next_line_start)
8644 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8645 (get_next_display_element, set_iterator_to_next)
8646 (get_visually_first_element, compute_stop_pos_backwards)
8647 (handle_stop_backwards, next_element_from_buffer)
8648 (move_it_in_display_line_to, move_it_in_display_line)
8649 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8650 (add_to_log, message_dolog, message_log_check_duplicate)
8651 (message2, message2_nolog, message3, message3_nolog
8652 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8653 (current_message_1, truncate_echo_area, truncate_message_1)
8654 (set_message, set_message_1, store_mode_line_noprop)
8655 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8656 (text_outside_line_unchanged_p, check_point_in_composition)
8657 (reconsider_clip_changes)
8658 (redisplay_internal, set_cursor_from_row, try_scrolling)
8659 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8660 (redisplay_window, find_last_unchanged_at_beg_row)
8661 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8662 (trailing_whitespace_p, find_row_edges, display_line)
8663 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8664 (display_mode_element, store_mode_line_string)
8665 (pint2str, pint2hrstr, decode_mode_spec)
8666 (display_count_lines, display_string, draw_glyphs)
8667 (x_produce_glyphs, x_insert_glyphs)
8668 (rows_from_pos_range, mouse_face_from_buffer_pos)
8669 (fast_find_string_pos, mouse_face_from_string_pos)
8670 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8672 (safe_call, init_from_display_pos, handle_fontified_prop)
8673 (handle_single_display_spec, load_overlay_strings)
8674 (with_echo_area_buffer, setup_echo_area_for_printing)
8675 (display_echo_area, echo_area_display)
8676 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8677 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8678 (redisplay_window, dump_glyph_row, display_mode_line)
8679 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8680 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8681 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8682 (handle_single_display_spec, build_desired_tool_bar_string)
8683 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8684 (get_specified_cursor_type):
8685 Check that fixnums are in proper range for system types.
8686 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8687 (Flookup_image_map):
8688 Don't assume fixnums fit in int.
8689 (compare_overlay_entries):
8690 Avoid mishandling comparisons due to subtraction overflow.
8691 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8692 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8693 (handle_tool_bar_click):
8694 Use int, not unsigned, since we prefer signed and the signedness
8695 doesn't matter here.
8696 (get_next_display_element, next_element_from_display_vector):
8697 Use int, not EMACS_INT, when int is wide enough.
8698 (start_hourglass): Use duration_to_sec_usec to do proper
8699 overflow checking on durations.
8700 * xfaces.c (Fbitmap_spec_p):
8701 Check that fixnums are in proper range for system types.
8702 (compare_fonts_by_sort_order):
8703 Avoid mishandling comparisons due to subtraction overflow.
8704 (Fx_family_fonts, realize_basic_faces):
8705 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8706 (Fx_family_fonts):
8707 Don't assume fixnum fits in int.
8708 Use SAFE_ALLOCA_LISP, not alloca.
8709 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8710 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8711 (face_at_buffer_position, face_for_overlay_string)
8712 (face_at_string_position):
8713 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8714 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8715 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8716 (Fx_show_tip):
8717 Check that fixnums are in proper range for system types.
8718 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8719 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8720 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8721 (Fx_change_window_property): Don't assume fixnums fit in int.
8722 * xfont.c (xfont_chars_supported):
8723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8724 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8725 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8726 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8727 * xml.c (parse_region):
8728 * xrdb.c (magic_file_p):
8729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8730 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8731 (x_get_local_selection, x_reply_selection_request)
8732 (x_handle_selection_request, wait_for_property_change):
8733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8734 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8735 short is wide enough.
8736 (x_send_client_event): Don't assume fixnum fits in int.
8737 * xterm.c (x_x_to_emacs_modifiers):
8738 Don't assume EMACS_INT overflows nicely into int.
8739 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8740 may come from Lisp.
8741 (handle_one_xevent): NATNUMP can eval its arg twice.
8742 (x_connection_closed):
8743 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8744 * xterm.h: Adjust decls to match defn changes elsewhere.
8745 (struct scroll_bar): Use struct vectorlike_header
8746 rather than rolling our own approximation.
8747 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8748
c6574eb5
GM
87492012-05-25 Glenn Morris <rgm@gnu.org>
8750
8751 * lisp.mk (lisp): Update for more files being compiled now.
8752
e8d32c7e
SM
87532012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8754
48def666
SM
8755 * lread.c: Remove `read_pure' which makes no difference.
8756 (read_pure): Remove var.
8757 (unreadpure): Remove function.
8758 (readevalloop): Don't call read_list with -1 flag.
8759 (read1, read_vector): Don't test read_pure any more.
8760 (read_list): Simplify.
8761
e8d32c7e
SM
8762 * fileio.c, character.h: Minor style tweaks.
8763
4b2addb7
DA
87642012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8765
8766 * window.h (clip_changed): Remove useless declaration.
8767
584461b2
JB
87682012-05-22 Juanma Barranquero <lekktu@gmail.com>
8769
8770 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8771 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8772
34374650
PE
87732012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8774
8775 Remove src/m/*.
8776 This directory predates autoconf and is no longer needed nowadays.
8777 Move its few remaining bits of functionality to where they're needed.
8778 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8779 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8780 * m/template.h: Remove.
8781 * Makefile.in (M_FILE): Remove. All uses removed.
8782 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8783 * lisp.h (USE_LSB_TAG):
8784 * mem-limits.h (EXCEEDS_LISP_PTR):
8785 Use VAL_MAX, not VALBITS, in #if.
8786 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8787 (EMACS_UINT): Define unconditionally now.
8788 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8789 (BITS_PER_EMACS_INT): New constants, replacing
8790 what used to be in config.h, but not useful in #if.
8791 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8792 define them any more.
8793 (VAL_MAX): New macro.
8794 (VALMASK): Use it.
8795 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8796 BITS_PER_EMACS_INT, in #if.
8797 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8798 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8799 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8800 * s/ms-w32.h (DATA_START):
8801 Move here from removed file m/intel386.h.
8802 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8803 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8804
261cb4bb
PE
88052012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8806
8807 Assume C89 or later.
8808 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8809 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8810 (xrealloc):
8811 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8812 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8813 * textprop.c, tparam.c (NULL): Remove.
8814 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8815 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8816 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8817 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8818 * xterm.c (input_signal_count): Assume volatile works.
8819
ff23cd9f
KB
88202012-05-21 Ken Brown <kbrown@cornell.edu>
8821
8822 * xgselect.c (xg_select): Fix first argument in call to 'select'
8823 (bug#11508).
8824
1b170bc6
KB
88252012-05-20 Ken Brown <kbrown@cornell.edu>
8826
8827 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8828 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8829
b2f4d39f
KB
88302012-05-19 Ken Brown <kbrown@cornell.edu>
8831
8832 * xfns.c (x_in_use): Remove `static' qualifier.
8833 * xterm.h (x_in_use): Declare.
8834 * xgselect.c: Include xterm.h.
8835 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8836 and `display_arg' (bug#9754).
8837
003fdae2
PE
88382012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8839
9232a6d9
PE
8840 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8841
003fdae2
PE
8842 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8843 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8844
784b56e2
EZ
88452012-05-18 Eli Zaretskii <eliz@gnu.org>
8846
8847 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8848
8849 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8850 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8851
8852 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8853 reference to image_cache->refcount.
8854 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8855
a0a79cde
JL
88562012-05-17 Juri Linkov <juri@jurta.org>
8857
8858 * search.c (Fword_search_regexp, Fword_search_backward)
8859 (Fword_search_forward, Fword_search_backward_lax)
8860 (Fword_search_forward_lax): Move functions to isearch.el
8861 (bug#10145, bug#11381).
8862
b0572523
PE
88632012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8864
8865 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8866
9660f5fc
SM
88672012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8868
8869 * lread.c (init_obarray): Declare Qt and Qnil as special.
8870
4374de83
GM
88712012-05-14 Glenn Morris <rgm@gnu.org>
8872
8873 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 8874 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 8875
dc44c39a
PE
88762012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8877
078c97cb
PE
8878 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8879
dc44c39a
PE
8880 * unexaix.c: Port to more-recent AIX compilers.
8881 (report_error, report_error_1, make_hdr, copy_sym)
8882 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8883 Make arguments const char *, not char *, to avoid violations of C
8884 standard and to fix some AIX warnings reported by Gilles Pion.
8885
e18afed7 88862012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
8887
8888 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8889 already have overlays loaded.
8890 (handle_single_display_spec): Before returning without displaying
8891 fringe bitmap, synchronize the bidi iterator with the main display
8892 iterator, by calling iterate_out_of_display_property.
8893 (iterate_out_of_display_property): Detect buffer iteration by
8894 testing that it->string is a Lisp string.
8895 (get_next_display_element): When the current object is exhausted,
8896 and there's something on it->stack, call set_iterator_to_next to
8897 proceed with what's on the stack, instead of returning zero.
8898 (set_iterator_to_next): If called at the end of a Lisp string,
8899 proceed to consider_string_end without incrementing string
8900 position. Don't increment display vector index past the end of
8901 the display vector. (Bug#11417)
c8fb9dc6
EZ
8902 (pos_visible_p): Don't report a position visible when move_it_to
8903 stopped at the last line of window, which happens to be scanned
8904 backwards by the bidi iteration. (Bug#11464)
ac268e67 8905
e18afed7 89062012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
8907
8908 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8909 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
8910 are on a TTY, and thus unable to display on the fringes.
8911 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
8912 so we need to signal to the caller that this is a "replacing"
8913 display spec. This fixes display when the spec is invalid or we
8914 are on a TTY.
8915
e18afed7 89162012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
8917
8918 * unexaix.c (make_hdr): Fix typo in prototype.
8919 This bug broke the build on AIX. Problem reported by Gilles Pion.
8920
9d0a235a
MA
89212012-05-14 Michael Albinus <michael.albinus@gmx.de>
8922
8923 * keyboard.c (kbd_buffer_get_event): Read special events also in
8924 batch mode. (Bug#11415)
8925
9e6b06ed
GM
89262012-05-12 Glenn Morris <rgm@gnu.org>
8927
8928 * ns.mk: Update for ns_appbindir no longer having trailing "/".
8929
c1a1d7a3
EZ
89302012-05-12 Eli Zaretskii <eliz@gnu.org>
8931
8932 * lisp.mk (lisp): Add newcomment.elc.
8933
3fe7cdc8
GM
89342012-05-12 Glenn Morris <rgm@gnu.org>
8935
8936 * Makefile.in (MKDIR_P): New, set by configure.
8937 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
8938
53f7d2c0
PE
89392012-05-11 Paul Eggert <eggert@cs.ucla.edu>
8940
8941 Remove unused function hourglass_started.
8942 * dispextern.h (hourglass_started):
8943 * w32fns.c (hourglass_started):
8944 * xdisp.c (hourglass_started): Remove.
8945
75aafb17
JB
89462012-05-10 Juanma Barranquero <lekktu@gmail.com>
8947
8948 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
8949 Update dependencies.
8950
12959e8e
PE
89512012-05-10 Paul Eggert <eggert@cs.ucla.edu>
8952
97107e2e
PE
8953 * xgselect.c (xg_select): Put maxfds+1 into a var.
8954 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
8955
12959e8e
PE
8956 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
8957
836d29b3
DA
89582012-05-10 Dave Abrahams <dave@boostpro.com>
8959
8960 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
8961 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
8962
5cb67954
MA
89632012-05-09 Michael Albinus <michael.albinus@gmx.de>
8964
8965 * dbusbind.c (xd_registered_buses): New internal Lisp object.
8966 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
8967 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
8968 Initialize xd_registered_buses.
8969
3478ec45
PE
89702012-05-09 Paul Eggert <eggert@cs.ucla.edu>
8971
b263a6b0
PE
8972 Untag more efficiently if USE_LSB_TAG.
8973 This is based on a proposal by YAMAMOTO Mitsuharu in
8974 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
8975 For an admittedly artificial (nth 8000 longlist) benchmark on
8976 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
8977 Emacs's overall text size by 1%.
8978 * lisp.h (XUNTAG): New macro.
8979 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
8980 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
8981 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
8982 * eval.c (Fautoload):
8983 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
8984 * frame.h (XFRAME): Use XUNTAG.
8985
3478ec45
PE
8986 Port recent dbusbind.c changes to 32-bit --with-wide-int.
8987 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
8988 Remove unportable assumptions about print widths of types like
8989 dbus_uint32_t.
8990 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
8991 intptr_t when converting between pointer and integer, to avoid GCC
8992 warnings about wrong width.
8993
666b903b 89942012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
8995
8996 * w32proc.c (new_child): Force Windows to reserve only 64KB of
8997 stack for each reader_thread, instead of defaulting to 8MB
8998 determined by the linker. This avoids failures in creating
8999 subprocesses on Windows 7, see the discussion in this thread:
9000 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9001
b120cc17
JC
90022012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9003
9004 Fix up display of the *Minibuf-0* buffer in the mini window.
9005 * keyboard.c (read_char): Don't clear the echo area if there's no
9006 message to clear.
9007 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 9008 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 9009
9a4b36f8
MA
90102012-05-07 Michael Albinus <michael.albinus@gmx.de>
9011
9012 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9013 batch mode.
9014
e5f9458f
CY
90152012-05-06 Chong Yidong <cyd@gnu.org>
9016
9017 * lisp.mk (lisp): Update.
9018
eceeb5fc 90192012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
9020
9021 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9022
71873e2b
SM
90232012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9024
9025 * data.c (PUT_ERROR): New macro.
9026 (syms_of_data): Use it. Add new error type `user-error'.
9027 * undo.c (user_error): New function.
9028 (Fprimitive_undo): Use it.
9029 * print.c (print_error_message): Adjust print style for `user-error'.
9030 * keyboard.c (user_error): New function.
9031 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9032
ab0fa4e4
PE
90332012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9034
9035 Do not limit current-time-string to years 1000..9999.
9036 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9037 (Fcurrent_time_string): Support any year that is supported by the
9038 underlying localtime representation. Don't use asctime, as it
9039 has undefined behavior for years outside the range -999..9999.
9040
7ed806a7
PE
90412012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9042
9043 Fix race conditions involving setenv, gmtime, localtime, asctime.
9044 Without this fix, interrupts could mess up code that uses these
9045 nonreentrant functions, since setting TZ invalidates existing
9046 tm_zone or tzname values, and since most of these functions return
9047 pointers to static storage.
9048 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9049 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9050 Grow the critical sections to include not just invoking
9051 localtime/gmtime, but also accessing these functions' results
9052 including their tm_zone values if any, and any related TZ setting.
9053 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
9054 so that the struct tm is saved in the critical section.
9055 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
9056 motivated by the fact that memory allocation needs to be outside
9057 the critical section.
9058
0c16dfed
DA
90592012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9060
9061 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9062 with RESET_INTERVAL.
9063
9064 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9065 Remove duplicated buffer name initialization.
9066
3f83ace8
JM
90672012-05-02 Jim Meyering <jim@meyering.net>
9068
9069 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9070
c7b8541e
JM
9071 * xfns.c (x_window): Use xstrdup (Bug#11375).
9072
90207a15 90732012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
9074
9075 * xdisp.c (pos_visible_p): If already at a newline from the
9076 display string before the 'while' loop, don't walk back the glyphs
9077 from it3.glyph_row. Solves assertion violation when the display
9078 string begins with a newline (egg.el). (Bug#11367)
9079
b593d6a9
AH
90802012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9081
9082 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9083 Move to simple.el.
9084
4737362e
GM
90852012-05-01 Glenn Morris <rgm@gnu.org>
9086
99cf43f9
GM
9087 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9088 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9089 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9090 All were removed before 23.1.
9091
9311dcff
GM
9092 * dispnew.c: Remove HAVE_LIBNCURSES test;
9093 it is always true on relevant platforms.
9094
4d5c6349
GM
9095 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9096 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9097
4737362e
GM
9098 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9099
74dd3a6b
AS
91002012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9101
9102 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9103 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9104 Remove.
9105
13c379ee
PE
91062012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9107
9108 Do not avoid creating empty evaporating overlays (Bug#9642).
9109 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9110 That is, do not delete an evaporating overlay if it becomes
9111 empty after its bounds are adjusted to fit within its buffer.
9112 This fix caused other problems, and I'm reverting it until we get
9113 to the bottom of them.
9114
a8e7d6d7 91152012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
9116
9117 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9118
a8e7d6d7 91192012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
9120
9121 * xdisp.c (pos_visible_p): If the window start position is beyond
9122 ZV, start the display from buffer beginning. Prevents assertion
9123 violation in init_iterator when the minibuffer window is scrolled
9124 via the scroll bar.
9125
9126 * window.c (window_scroll_pixel_based): Likewise.
9127
a8e7d6d7 91282012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
9129
9130 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9131
a8e7d6d7 91322012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
9133
9134 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9135 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9136
a8e7d6d7 91372012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 9138
b593d6a9
AH
9139 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9140 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 9141
1c6900d9
EZ
91422012-04-26 Eli Zaretskii <eliz@gnu.org>
9143
4c3fa1d9
EZ
9144 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9145 display element, check also the underlying string or buffer
9146 character. (Bug#11341)
9147
1c6900d9
EZ
9148 * w32menu.c: Include w32heap.h.
9149 (add_menu_item): If the call to AppendMenuW (via
9150 unicode_append_menu) fails, disable Unicode menus only if we are
9151 running on Windows 9X/Me.
9152
42bf8205
AS
91532012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9154
9155 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9156 (xgetint): Add missing shift for LSB tags.
9157
b1bac16e
MR
91582012-04-24 Martin Rudalics <rudalics@gmx.at>
9159
9160 * keyboard.c (read_char): Don't wipe echo area for select window
9161 events: These might get delayed via `mouse-autoselect-window'
9162 (Bug#11304).
9163
d69621cc
JB
91642012-04-24 Juanma Barranquero <lekktu@gmail.com>
9165
9166 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9167 manipulation of :loaded-from data.
9168
02fd101b
JB
91692012-04-23 Juanma Barranquero <lekktu@gmail.com>
9170
9171 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9172 now a cons (bug#11311).
9173
888bec30
PE
91742012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9175
89a438bd
PE
9176 Do not create empty overlays with the evaporate property (Bug#9642).
9177 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9178 if it becomes empty after its bounds are adjusted to fit within
9179 its buffer. Without this fix, in a nonempty buffer (let ((o
9180 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9181 yields an empty overlay that has the evaporate property, which is
9182 not supposed to happen.
9183
1068fe4d
PE
9184 Fix minor GTK3 problems found by static checking.
9185 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9186 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9187 (struct _EmacsFixedClass, emacs_fixed_get_type):
9188 Move decls here from emacsgtkfixed.h, since they needn't be public.
9189 (emacs_fixed_get_type): Now static.
9190 (emacs_fixed_class_init): Omit unused local.
9191 (emacs_fixed_child_type): Remove; unused.
9192 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9193 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9194 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9195 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9196 (EMACS_FIXED_GET_CLASS): Remove; unused.
9197 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9198
888bec30
PE
9199 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9200 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9201
de85e130
PE
92022012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9203
d0baac98 9204 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 9205 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
9206 (__malloc_size_t, __malloc_ptrdiff_t):
9207 Remove. All uses removed, replaced by the definiens if needed,
9208 since we can assume C89 or better now.
9209 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9210 (protect_malloc_state, align, get_contiguous_space)
9211 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9212 (malloc_atfork_handler_child, malloc_enable_thread)
9213 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9214 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9215 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9216 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9217 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9218 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9219 Define using prototypes, not old style.
9220 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9221 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9222 (align): Don't assume that signed integer overflow wraps around.
9223 Omit unused local var.
9224 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9225 (_free_internal_nolock, memalign, mallochook, reallochook):
9226 Omit no-longer-needed casts.
9227 (valloc): Use getpagesize, not __getpagesize.
9228 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9229 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9230
de85e130
PE
9231 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9232
dcbf5805
MA
92332012-04-22 Michael Albinus <michael.albinus@gmx.de>
9234
9235 Move functions from C to Lisp. Make non-blocking method calls
9236 the default. Implement further D-Bus standard interfaces.
9237
9238 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9239 (QCdbus_request_name_allow_replacement)
9240 (QCdbus_request_name_replace_existing)
9241 (QCdbus_request_name_do_not_queue)
9242 (QCdbus_request_name_reply_primary_owner)
9243 (QCdbus_request_name_reply_in_queue)
9244 (QCdbus_request_name_reply_exists)
9245 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9246 (QCdbus_registered_serial, QCdbus_registered_method)
9247 (QCdbus_registered_signal): New Lisp objects.
9248 (XD_DEBUG_MESSAGE): Use sizeof.
9249 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9250 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9251 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9252 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9253 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9254 (xd_signature, xd_append_arg): Allow float for integer types.
9255 (xd_get_connection_references): New function.
b593d6a9
AH
9256 (xd_get_connection_address): Rename from xd_initialize.
9257 Return cached address.
dcbf5805
MA
9258 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9259 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9260 level.
9261 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 9262 Return number of refcounts.
dcbf5805
MA
9263 (Fdbus_get_unique_name): Make stronger parameter check.
9264 (Fdbus_message_internal): New defun.
9265 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9266 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9267 (Fdbus_send_signal, Fdbus_register_service)
9268 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9269 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9270 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9271 (Vdbus_compiled_version, Vdbus_runtime_version)
9272 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9273 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9274 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
9275 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9276 Adapt docstring.
dcbf5805 9277
52828e02
PE
92782012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9279
da05bc4c
PE
9280 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9281 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9282 Do not assume ptrdiff_t is the same width as 'int'.
9283
52828e02
PE
9284 * alloc.c: Handle unusual debugging option combinations.
9285 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9286 since the two debugging options are incompatible.
9287 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9288 is defined.
9289 (mem_init, mem_insert, mem_insert_fixup):
9290 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9291 (NEED_MEM_INSERT): Remove; no longer needed.
9292
f01769f9
LL
92932012-04-22 Leo Liu <sdl.web@gmail.com>
9294
9295 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9296
5790543d
PE
92972012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9298
9299 * sysdep.c [__FreeBSD__]: Minor cleanups.
9300 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9301 Use Emacs indenting style more consistently. Avoid some casts.
9302 Use 'double' consistently rather than mixing 'float' and 'double'.
9303
b91b7e4d
EW
93042012-04-21 Eduard Wiebe <usenet@pusto.de>
9305
b593d6a9
AH
9306 * sysdep.c (list_system_processes, system_process_attributes):
9307 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 9308
6114eb15
AS
93092012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9310
9311 * lisp.mk (lisp): Update.
9312
2f38dff7
PE
93132012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9316 It is never used otherwise.
9317
4ae29f89
SM
93182012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9319
9320 * print.c (print_preprocess): Only check print_depth if print-circle
9321 is nil.
9322 (print_object): Check for cycles even when print-circle is nil and
9323 print-gensym is t, but only check print_depth if print-circle is nil.
9324
f30d612a
CY
93252012-04-20 Chong Yidong <cyd@gnu.org>
9326
9327 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9328 set the status to "failed" and ensure that sentinel is run.
9329
c07a4c0b 93302012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
9331
9332 * process.c (Fset_process_inherit_coding_system_flag)
9333 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 9334 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 9335
c07a4c0b 93362012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
9337
9338 * xdisp.c (string_buffer_position_lim): Limit starting position to
9339 BEGV.
9340 (set_cursor_from_row): If called for a mode-line or header-line
9341 row, return zero immediately.
9342 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
9343 farther than the first row after the header line, if any.
9344 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
9345 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9346
c07a4c0b 93472012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9348
4ae29f89
SM
9349 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9350 (bug#11238).
ad3a2b41 9351
c07a4c0b 93522012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 93532012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
9354
9355 configure: new option --enable-gcc-warnings (Bug#11207)
9356 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9357 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9358 (ALL_CFLAGS): Use new macros rather than old.
9359 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9360 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9361 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9362 -Wunused-result, -Wunused-variable. This should go away once
9363 the Emacs and Gnulib regex code is merged.
9364 (xmalloc, xrealloc): Now static.
9365
aba027e8
PE
93662012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9367
9368 * dired.c (Fsystem_groups): Remove unused local.
9369
e5a36063
GM
93702012-04-17 Glenn Morris <rgm@gnu.org>
9371
9372 * dired.c (Fsystem_users): Doc fix.
9373
316411f0
DA
93742012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9375
9376 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9377 (syms_of_dired): Add them.
9378
9426aba4
PE
93792012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9380
b62a57be
PE
9381 Fix minor alloc.c problems found by static checking.
9382 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9383 New extern decls, to avoid calling undeclared functions.
9384 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9385 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9386 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9387 (NEED_MEM_INSERT): New macro.
9388 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 9389 Remove one incorrect comment and fix another.
b62a57be 9390
3539f31f
PE
9391 Fix minor ralloc.c problems found by static checking.
9392 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9393 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9394 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9395 (r_alloc_sbrk): Now static.
9396
a041960a
PE
9397 Improve ralloc.c interface checking.
9398 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9399 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9400 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9401 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9402 [REL_ALLOC]: ... to here, to check interface.
9403 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9404 Remove decls. This fixes an "It stinks!".
9405
9426aba4
PE
9406 * alloc.c (which_symbols): Fix alignment issue / type clash.
9407
d55c12ed
AS
94082012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9409
9410 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9411 (struct Lisp_Misc_Any): Likewise.
9412 (struct Lisp_Free): Likewise.
9413 * alloc.c (union aligned_Lisp_Symbol): Define.
9414 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9415 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9416 (union aligned_Lisp_Misc): Define.
9417 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9418 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9419 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9420
b948ce8b
PE
94212012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9422
9423 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9424 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9425 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9426 * s/netbsd.h, s/sol2-6.h:
9427 Remove definition of GC_MARK_STACK, since the default now works.
9428 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9429 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9430 no longer the default.
9431 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9432
35dc09a1 94332012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9434
35dc09a1
GM
9435 * lread.c (lisp_file_lexically_bound_p):
9436 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9437
35dc09a1
GM
94382012-04-14 Eli Zaretskii <eliz@gnu.org>
9439
9440 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9441 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9442
94432012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9444
9445 * nsterm.m (constrainFrameRect): Always constrain when there is only
9446 one screen (Bug#10962).
9447
bcd86815
KB
94482012-04-13 Ken Brown <kbrown@cornell.edu>
9449
9450 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9451
c25df26e
RT
94522012-04-13 Reuben Thomas <rrt@sc3d.org>
9453
9454 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9455
0fc59f1e
DC
94562012-04-11 Daniel Colascione <dancol@dancol.org>
9457
9458 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9459 against is gone. It's better to use vfork now so that when Cygwin
9460 gains a new, working vfork, we use it automatically (bug#10398).
9461
de8c03dc
SM
94622012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9463
9464 * window.c (save_window_save): Obey window-point-insertion-type.
9465
2f097256
GM
94662012-04-11 Glenn Morris <rgm@gnu.org>
9467
9468 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9469
453b951e
SM
94702012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9471
9472 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9473
75f1671a 94742012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9475
9476 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9477 (force_quit_count): New var.
9478 (handle_interrupt): Use it.
9479
2a8ce227
JB
94802012-04-10 Juanma Barranquero <lekktu@gmail.com>
9481
9482 * w32.c (w32_delayed_load): Record the full path of the library
9483 being loaded (bug#10424).
9484
935396c0
GM
94852012-04-09 Glenn Morris <rgm@gnu.org>
9486
05920a43
GM
9487 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9488 not just in the obarray, before snarfing them. (Bug#11036)
9489
935396c0
GM
9490 * Makefile.in ($(leimdir)/leim-list.el):
9491 Pass EMACS rather than BUILT_EMACS.
9492
a18ecafa
TZ
94932012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9494
9495 * process.c (make_process):
9496 * process.h: Add integer `gnutls_handshakes_tried' member to
9497 process struct.
9498
6bbef4e5
JC
9499 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9500 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9501
9502 * gnutls.c (gnutls_log_function2i): Convenience log function.
9503 (emacs_gnutls_read): Use new log functions,
9504 `gnutls_handshakes_tried' process member, and
9505 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9506 attempts per process (connection).
9507
b4d3bc10
CY
95082012-04-09 Chong Yidong <cyd@gnu.org>
9509
9510 * eval.c (Fuser_variable_p, user_variable_p_eh)
9511 (lisp_indirect_variable): Functions deleted.
9512 (Fdefvar): Caller changed.
9513
9514 * callint.c (Finteractive, Fcall_interactively):
9515 * minibuf.c (Fread_variable): Callers changed.
9516
70f4d973
EZ
95172012-04-09 Eli Zaretskii <eliz@gnu.org>
9518
9519 * xdisp.c (set_cursor_from_row): If the display string appears in
9520 the buffer at position that is closer to point than the position
9521 after the display string, display the cursor on the first glyph of
9522 the display string. Fixes cursor display when a 'display' text
9523 property immediately follows invisible text. (Bug#11094)
9524
cb3c2e3e
PE
95252012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9526
9527 composite.c: use 'double' consistently
9528 * composite.c (get_composition_id): Use 'double' consistently
9529 instead of converting 'float' to 'double' and vice versa; this is
9530 easier to understand and avoids a GCC warning.
9531
fd06db5d
GM
95322012-04-09 Glenn Morris <rgm@gnu.org>
9533
50fe702a
GM
9534 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9535 preparation for dumping it with emacs. (Bug#4789)
9536 (leimdir): New variable.
9537 ($(leimdir)/leim-list.el): New rule.
9538 (emacs$(EXEEXT)): Depend on leim-list.el.
9539
fd06db5d
GM
9540 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9541 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9542 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9543
55c131ee
AS
95442012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9545
9546 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9547 proper alignment.
9548
9209588f
JB
95492012-04-07 Juanma Barranquero <lekktu@gmail.com>
9550
9551 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9552 Remove unused local variable.
9553
e3fb2efb
PE
95542012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9555
9556 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9557 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9558 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9559 objects, as mark_maybe_pointer will catch them otherwise.
9560 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9561 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9562
b5385551
PE
95632012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 Fix typo that broke non-Windows builds.
9566 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9567
9078ead6
EZ
95682012-04-07 Eli Zaretskii <eliz@gnu.org>
9569
9570 Support building on MS-Windows with libxml2.
9571
9572 * makefile.w32-in (OBJ2): Add xml.$(O).
9573 (GLOBAL_SOURCES): Add xml.c.
9574 ($(BLD)/xml.$(O)): New dependency list.
9575
9576 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9577 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9578 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9579 [!WINDOWSNT]: New macros.
9580 (init_libxml2_functions, libxml2_loaded_p): New functions.
9581 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9582 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9583 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9584 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9585 linked in).
6bbef4e5
JC
9586 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9587 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9588 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9589
9590 * emacs.c: Don't include libxml/parser.h.
9591 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9592 xmlCleanupParser directly.
9593
9594 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9595
3811fdf3
EZ
95962012-04-07 Eli Zaretskii <eliz@gnu.org>
9597
9598 * indent.c (Fvertical_motion): If there is a display string at
9599 point, use it.vpos to compute how many lines to backtrack after
9600 move_it_to point. (Bug#11133)
9601
2f8e16b2
EZ
96022012-04-06 Eli Zaretskii <eliz@gnu.org>
9603
9604 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9605 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9606 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9607 macros related to unification of CJK characters. For the details,
9608 see the discussion following the message here:
9609 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9610
3d439cd1
CY
96112012-04-04 Chong Yidong <cyd@gnu.org>
9612
9613 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9614
8bc53d00
EZ
96152012-04-01 Eli Zaretskii <eliz@gnu.org>
9616
9617 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9618 instead of alloca. (Bug#11138)
9619
3b0512a3
AS
96202012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9621
9622 * w32menu.c (is_simple_dialog): Properly check lisp types.
9623 (Bug#11141)
9624
8427ddd2
EZ
96252012-03-31 Eli Zaretskii <eliz@gnu.org>
9626
979022ef
EZ
9627 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9628 position we get to after a call to move_it_to fails the
9629 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9630 only if we wind up in a string from display property. (Bug#11063)
9631
a6b1c7cc
EZ
9632 * window.c (Fdelete_other_windows_internal): Invalidate the row
9633 and column information about mouse highlight, so that redisplay
9634 restores it after reallocating the glyph matrices. (Bug#7464)
9635
8427ddd2
EZ
9636 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9637 string comes from a `display' text property, use the buffer
9638 position of that property as if we actually saw that position in
9639 the row's glyphs.
697ba24b
EZ
9640 (move_it_by_lines): Remove the assertion that
9641 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9642 violated when there's a before-string at the beginning of a line.
9643 (Bug#11063)
8427ddd2 9644
65a0a738
EZ
96452012-03-30 Eli Zaretskii <eliz@gnu.org>
9646
9647 * xdisp.c (append_space_for_newline): If the default face was
9648 remapped, use the remapped face for the appended newline.
9649 (extend_face_to_end_of_line): Use the remapped default face for
9650 extending the face to the end of the line.
9651 (display_line): Call extend_face_to_end_of_line when the default
9652 face was remapped. (Bug#11068)
9653
581355cc
EZ
96542012-03-29 Eli Zaretskii <eliz@gnu.org>
9655
9656 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9657
e8fc049f
SM
96582012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9659
9660 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9661
4fb9a543
GM
96622012-03-27 Glenn Morris <rgm@gnu.org>
9663
9664 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9665 Doc fixes.
9666
679910f1
KH
96672012-03-26 Kenichi Handa <handa@m17n.org>
9668
9669 * dispextern.h (struct glyph): Fix previous change. Change the
9670 bit length of glyphless.ch to 25 (Bug#11082).
9671
90d49b7f
CY
96722012-03-26 Chong Yidong <cyd@gnu.org>
9673
9674 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9675 (command_loop_1): Use it; inhibit selection update for
9676 handle-select-window too (Bug#8996).
9677
f514f6f0
FP
96782012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9679
e8fc049f 9680 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9681
bf43fa51
KH
96822012-03-25 Kenichi Handa <handa@m17n.org>
9683
9684 * dispextern.h (struct glyph): Change the bit length of
9685 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9686
8a0c01dd
EZ
96872012-03-24 Eli Zaretskii <eliz@gnu.org>
9688
9689 * s/ms-w32.h (tzname): Include time.h before redirecting to
9690 _tzname. Fixes the MSVC build. (Bug#9960)
9691
7d1c3a76
AS
96922012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9693
8ed79523
AS
9694 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9695 characters.
9696
7d1c3a76
AS
9697 * xterm.c (XTread_socket): Only modify handling_signal if
9698 !SYNC_INPUT. (Bug#11080)
9699
e99a9b8b
EZ
97002012-03-23 Eli Zaretskii <eliz@gnu.org>
9701
9702 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9703 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9704 when fetching a multibyte character consumes more bytes than
9705 CHAR_BYTES returns, due to unification of CJK characters in
9706 string_char. (Bug#11073)
9707
5063c0e1
TN
97082012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9709
9710 * process.c (wait_reading_process_output): Handle pty disconnect
9711 by refraining from sending oneself a SIGCHLD (bug#10933).
9712
9f851fbd
CY
97132012-03-22 Chong Yidong <cyd@gnu.org>
9714
9715 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9716
5063c0e1 9717 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9718 Mark string as coming from a prefix property.
9719 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9720 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9721
fb5b8aca
CY
97222012-03-21 Chong Yidong <cyd@gnu.org>
9723
9724 * xfaces.c (Vface_remapping_alist): Doc fix.
9725
62356a1b
EZ
97262012-03-20 Eli Zaretskii <eliz@gnu.org>
9727
9728 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9729 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9730 Doc fixes.
62356a1b 9731
025de85b
CY
97322012-03-20 Chong Yidong <cyd@gnu.org>
9733
9734 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9735 to reflect default non-nil value of redisplay-dont-pause.
9736
4827f94e
KH
97372012-03-19 Kenichi Handa <handa@m17n.org>
9738
9739 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9740 it fit in a valid range (Bug#11003).
9741
e50a24a2
EZ
97422012-03-18 Eli Zaretskii <eliz@gnu.org>
9743
9744 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9745 that is not from display property, accept the row as a "cursor
9746 row" if one of the string's character has a non-nil `cursor'
9747 property. Fixes cursor positioning when there are newlines in
9748 overlay strings, e.g. in icomplete.el. (Bug#11035)
9749
9af5ed87
PE
97502012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9751
9752 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9753
d1f55f16
CY
97542012-03-12 Chong Yidong <cyd@gnu.org>
9755
9756 * eval.c (inhibit_lisp_code): Rename from
9757 inhibit_window_configuration_change_hook; move from window.c.
9758
9759 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9760 * window.c (run_window_configuration_change_hook)
9761 (syms_of_window): Callers changed.
9762
66c5eebd
CY
97632012-03-11 Chong Yidong <cyd@gnu.org>
9764
413df973
CY
9765 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9766
66c5eebd
CY
9767 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9768
1de11f56
CY
97692012-03-10 Chong Yidong <cyd@gnu.org>
9770
9771 * frame.c (other_visible_frames): Don't assume the selected frame
9772 is visible (Bug#10955).
9773
cae07000
SM
97742012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9775
9776 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9777
89c94350
JD
97782012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9779
9780 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9781 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9782 zero (Bug#10954).
9783
999dd333
GM
97842012-03-03 Glenn Morris <rgm@gnu.org>
9785
01a6dcc8 9786 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9787
de0100f2
EZ
97882012-03-02 Eli Zaretskii <eliz@gnu.org>
9789
9790 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9791 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9792 (redisplay_window, next_element_from_string): Fix typos in
9793 comments.
3e441275
EZ
9794 (redisplay_window): Pass to move_it_vertically the margin in
9795 pixels, not in screen lines.
de0100f2 9796
96a72ee9
GM
97972012-03-02 Glenn Morris <rgm@gnu.org>
9798
9799 * buffer.c (buffer-list-update-hook): Doc fix.
9800
312508d7
EZ
98012012-02-29 Eli Zaretskii <eliz@gnu.org>
9802
9803 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9804 push_it before setting up the iterator for the first overlay
9805 string, even if we have an empty string loaded.
9806 (next_overlay_string): If there's an empty string on the iterator
9807 stack, pop the stack. (Bug#10903)
9808
27f3c637
PE
98092012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9810
9811 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9812 Suggested by Stefan Monnier in
9813 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9814 * alloc.c (widen_to_Lisp_Object): New static function.
9815 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9816 and widening them to Lisp_Objects. This would work even if
9817 USE_LSB_TAG is defined and wide integers are used, which might
9818 happen in a future version of Emacs.
9819
3c9dfce6
CY
98202012-02-25 Chong Yidong <cyd@gnu.org>
9821
fa74b241
CY
9822 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9823 Doc fix.
9824
3c9dfce6
CY
9825 * xselect.c (Fx_selection_exists_p): Doc fix.
9826 (x_clipboard_manager_save_all): Print an informative message
9827 before saving to clipboard manager.
9828
9486df08
CY
98292012-02-24 Chong Yidong <cyd@gnu.org>
9830
9831 * keyboard.c (process_special_events): Handle all X selection
9832 requests in kbd_buffer, not just the next one (Bug#8869).
9833
f01d3321
CY
98342012-02-23 Chong Yidong <cyd@gnu.org>
9835
9836 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9837 call when setting menu-bar-lines and tool-bar-lines parameters.
9838 (unwind_create_frame_1): New helper function.
9839
9840 * window.c (inhibit_window_configuration_change_hook): New var.
9841 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9842 (syms_of_window): Initialize it.
f01d3321 9843
86b847b6
CY
98442012-02-22 Chong Yidong <cyd@gnu.org>
9845
9846 * xterm.c (x_draw_image_relief): Add missing type check for
9847 Vtool_bar_button_margin (Bug#10743).
9848
a59225b1
CY
98492012-02-21 Chong Yidong <cyd@gnu.org>
9850
9851 * fileio.c (Vfile_name_handler_alist): Doc fix.
9852
9853 * buffer.c (Fget_file_buffer): Protect against invalid file
9854 handler return value.
9855
310f5bd4
PE
98562012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9857
cb3a28cc
PE
9858 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9859 when computing $valmask.
9860
310f5bd4
PE
9861 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9862 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9863 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9864 It's useless in that case, and it can cause problems on hosts
9865 that allocate halves of EMACS_INT values separately.
9866 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9867 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9868 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9869 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9870 it avoids undefined behavior on hosts where shifting right by more
9871 than the word width has undefined behavior.
9872
2375c96a
CY
98732012-02-19 Chong Yidong <cyd@gnu.org>
9874
9875 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9876 (Funhandled_file_name_directory, Ffile_name_as_directory)
9877 (Fdirectory_file_name, Fexpand_file_name)
9878 (Fsubstitute_in_file_name): Protect against invalid file handler
9879 return values (Bug#10845).
9880
3eb49e71
EZ
98812012-02-18 Eli Zaretskii <eliz@gnu.org>
9882
9883 * .gdbinit (pitx): Fix incorrect references to fields of the
9884 iterator stack.
9885
7b926f3f
CY
98862012-02-17 Chong Yidong <cyd@gnu.org>
9887
9888 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9889
11273115
PE
98902012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9891
9892 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9893 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9894
c3a70e2b
CY
98952012-02-15 Chong Yidong <cyd@gnu.org>
9896
9897 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9898 marked as special. Also, starting docstrings with * is obsolete.
9899
0ca43699
AS
99002012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9901
9902 * gnutls.c (emacs_gnutls_write): Fix last change.
9903
2e8f3c56
LI
99042012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9905
9906 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9907 send_process.
9908
af70074f
SM
99092012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9910
9911 * keymap.c (Fsingle_key_description): Handle char ranges.
9912
95986d52
CY
99132012-02-12 Chong Yidong <cyd@gnu.org>
9914
afd83bd1
CY
9915 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9916 as that creates a dangerous corner case.
9917
95986d52
CY
9918 * window.c (Fdelete_window_internal): Invalidate the mouse
9919 highlight (Bug#9904).
9920
bd7da63e
GM
99212012-02-12 Glenn Morris <rgm@gnu.org>
9922
9923 * xselect.c (Fx_own_selection_internal)
9924 (Fx_get_selection_internal, Fx_disown_selection_internal)
9925 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
9926 * nsselect.m (Fx_own_selection_internal)
9927 (Fx_disown_selection_internal, Fx_selection_exists_p)
9928 (Fx_selection_owner_p, Fx_get_selection_internal):
9929 Sync docs and argument specs with the xselect.c versions.
9930
77abcbc2
LI
99312012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
9932
9933 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
9934
90b671e2
EZ
99352012-02-11 Eli Zaretskii <eliz@gnu.org>
9936
1c0ca0b7
EZ
9937 * w32select.c (Fx_selection_exists_p): Sync doc string and
9938 argument list with xselect.c. (Bug#10783)
9939
9940 * w16select.c (Fx_selection_exists_p): Sync doc string and
9941 argument list with xselect.c. (Bug#10783)
90b671e2 9942
49241268
GM
99432012-02-10 Glenn Morris <rgm@gnu.org>
9944
9945 * fns.c (Fsecure_hash): Doc fix.
9946
f998bbe7 99472012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
9948
9949 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
9950
0992bd9c
CY
99512012-02-07 Chong Yidong <cyd@gnu.org>
9952
9953 * buffer.c (Fbuffer_local_variables)
9954 (buffer_lisp_local_variables): Handle unbound vars correctly;
9955 don't let Qunbound leak into Lisp.
9956
af008560
GM
99572012-02-07 Glenn Morris <rgm@gnu.org>
9958
dd605cc4
GM
9959 * image.c (Fimagemagick_types): Doc fix.
9960
af008560
GM
9961 * image.c (imagemagick-render-type): Change it from a lisp object
9962 to an integer. Move the doc here from the lisp manual.
9963 Treat all values not equal to 0 the same.
9964
1449fa1d
CY
99652012-02-06 Chong Yidong <cyd@gnu.org>
9966
9967 * doc.c (store_function_docstring): Avoid applying docstring of
9968 alias to base function (Bug#2603).
9969
3723ec07
AS
99702012-02-04 Andreas Schwab <schwab@linux-m68k.org>
9971
9972 * .gdbinit (pp1, pv1): Remove redundant defines.
9973 (pr): Use pp.
9974
79c1cc1e
CY
99752012-02-04 Chong Yidong <cyd@gnu.org>
9976
9977 * nsterm.m: Declare a global (Bug#10694).
9978
d7f29f8e
EZ
99792012-02-04 Eli Zaretskii <eliz@gnu.org>
9980
cae07000
SM
9981 * w32.c (get_emacs_configuration_options):
9982 Include --enable-checking, if specified, in the return value.
d7f29f8e 9983
3b95a6f9
MR
99842012-02-04 Martin Rudalics <rudalics@gmx.at>
9985
9986 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
9987 after rounding frame sizes. (Bug#9723)
9988
d6fa96a6
EZ
99892012-02-04 Eli Zaretskii <eliz@gnu.org>
9990
9991 * keyboard.c (adjust_point_for_property): Don't position point
9992 before BEGV. (Bug#10696)
9993
df0b2940
PE
99942012-02-03 Paul Eggert <eggert@cs.ucla.edu>
9995
9996 Handle overflow when computing char display width (Bug#9496).
9997 * character.c (char_width): Return EMACS_INT, not int.
9998 (char_width, c_string_width): Check for overflow when
9999 computing the width; this is possible now that individual
10000 characters can have unbounded width. Problem introduced
10001 by merge from Emacs 23 on 2012-01-19.
10002
6bee44d6
MA
100032012-02-02 Michael Albinus <michael.albinus@gmx.de>
10004
10005 * dbusbind.c (Fdbus_register_method): Mention the return value
10006 :ignore in the docstring.
10007
44f92739
GM
100082012-02-02 Glenn Morris <rgm@gnu.org>
10009
1b9f60cc
GM
10010 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10011
44f92739
GM
10012 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10013 Unconditionally set to t. (Bug#10673)
10014 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10015 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10016 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10017
c5d3843c
KH
100182012-02-02 Kenichi Handa <handa@m17n.org>
10019
10020 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10021 0, do not call append_composite_glyph.
10022
159462d4 100232012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
10024
10025 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10026 NULL (Bug#6988).
10027 (x_produce_glyphs): If the component of a composition is a null
10028 string, set it->pixel_width to 1 to avoid zero-width glyph.
10029
78cef877
EZ
100302012-02-01 Eli Zaretskii <eliz@gnu.org>
10031
10032 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10033 first 2 arguments are identical. This makes inserting large
10034 output from a subprocess an order of magnitude faster on
10035 MS-Windows, where all sbrk'ed memory is always contiguous.
10036
97897668
GM
100372012-01-31 Glenn Morris <rgm@gnu.org>
10038
10039 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 10040 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
10041 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10042
31fd3586
GM
100432012-01-29 Glenn Morris <rgm@gnu.org>
10044
10045 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10046
0e24a8b2
CY
100472012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10048
10049 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10050
cc0adcb0
CY
100512012-01-28 Chong Yidong <cyd@gnu.org>
10052
10053 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10054
acc28cb9
CY
100552012-01-26 Chong Yidong <cyd@gnu.org>
10056
9c69cfb7
CY
10057 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10058
acc28cb9
CY
10059 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10060 repeat counts (Bug#10507).
10061
48da7392
GM
100622012-01-26 Glenn Morris <rgm@gnu.org>
10063
10064 * lread.c (syms_of_lread): Doc fix.
10065
14af5f7f
CY
100662012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10067
10068 * coding.c (encode_designation_at_bol): Change return value to
10069 EMACS_INT.
10070
0b21c100
CY
100712012-01-25 Chong Yidong <cyd@gnu.org>
10072
10073 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10074
3c2907f7
CY
100752012-01-21 Chong Yidong <cyd@gnu.org>
10076
10077 * floatfns.c (Fcopysign): Make the second argument non-optional,
10078 since nil is not allowed anyway.
10079
959ad23f
AS
100802012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10081
10082 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10083 (send_process): Likewise.
10084
34a02f46
MR
100852012-01-19 Martin Rudalics <rudalics@gmx.at>
10086
10087 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
10088 (Vwindow_persistent_parameters): Do not use Qstate.
10089 Rewrite doc-strings.
34a02f46 10090
1259009a 100912012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
10092
10093 * character.c (char_width): New function.
70d4fdf6
GM
10094 (Fchar_width, c_string_width, lisp_string_width):
10095 Use char_width (Bug#9496).
25ed9e61 10096
6a6ee00d
MR
100972012-01-16 Martin Rudalics <rudalics@gmx.at>
10098
10099 * window.c (Vwindow_persistent_parameters): New variable.
10100 (Fset_window_configuration, save_window_save): Handle persistent
10101 window parameters.
10102
c85efaf7
EZ
101032012-01-14 Eli Zaretskii <eliz@gnu.org>
10104
10105 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10106 thrashing the stack of the thread. (Bug#9087)
10107
5944709e
PE
101082012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10109
10110 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10111
e71f5d99
EZ
101122012-01-11 Eli Zaretskii <eliz@gnu.org>
10113
10114 * xdisp.c (rows_from_pos_range): Handle the case where the
10115 highlight ends on a newline. (Bug#10464)
10116 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10117 he end column for display of highlight that ends on a newline
10118 before a R2L line.
10119
ce316182
GM
101202012-01-11 Glenn Morris <rgm@gnu.org>
10121
10122 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10123 from load-path also when installation-directory is nil. (Bug#10208)
10124
5b43da69
GM
101252012-01-10 Glenn Morris <rgm@gnu.org>
10126
74cc8ff9
GM
10127 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10128
7d8d6e4e
GM
10129 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10130 Update template values to be closer to their typical values these days.
5b43da69 10131
a0db8d43
EZ
101322012-01-09 Eli Zaretskii <eliz@gnu.org>
10133
10134 * xdisp.c (rows_from_pos_range): Accept additional argument
10135 DISP_STRING, and accept any glyph in a row whose object is that
10136 string as eligible for mouse highlight. Fixes mouse highlight of
10137 display strings from overlays. (Bug#10464)
10138
9a0115ab 101392012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 10140
b9110d6a 10141 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
10142 * fileio.c (auto_saving_dir_umask): New static var.
10143 (Fmake_directory_internal): Use it.
10144 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10145 creating the directory. The old code temporarily assigns
10146 too-generous permissions to the directory.
10147 (do_auto_save_eh): Clear it.
b9110d6a 10148 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
10149 that the var is always cleared.
10150
6c1bd3f3
EZ
101512012-01-07 Eli Zaretskii <eliz@gnu.org>
10152
10153 * search.c (scan_buffer): Pass character positions to
10154 know_region_cache, not byte positions. (Bug#6540)
10155
069d2b50
L
101562012-01-07 LynX <_LynX@bk.ru> (tiny change)
10157
10158 * w32.c (sys_rename): Report EXDEV when rename of a directory
10159 fails because the target is on another logical disk. (Bug#10284)
10160
75bf0d33
DB
101612012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10162
10163 * xterm.c (x_embed_request_focus): New function.
10164
10165 * xterm.h: Add prototype.
10166
10167 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10168
1c6e5a32
GM
101692012-01-05 Glenn Morris <rgm@gnu.org>
10170
10171 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10172
651e947e
EZ
101732012-01-01 Eli Zaretskii <eliz@gnu.org>
10174
10175 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10176 Load gnutls_transport_set_lowat only if GnuTLS version is below
10177 2.11.1.
10178 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10179 GnuTLS versions below 2.11.1.
10180
3778cdd8
AL
101812011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10182
10183 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10184 to the doc string advising against its use for altering the way
10185 windows are scrolled.
10186
0e5317f7
KH
101872011-12-28 Kenichi Handa <handa@m17n.org>
10188
10189 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10190 coding-system ASCII compatible only when it does not produce BOM
10191 on encoding (Bug#10383).
10192
93d5ca1f
JD
101932011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10194
10195 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10196 can scroll.
10197 (create_and_show_popup_menu): Always use menu_position_func for
10198 Gtk3 (Bug#10361).
10199
ca22b785
AS
102002011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10201
10202 * callint.c (Fcall_interactively): Don't truncate prompt string.
10203
d048e1e6
EZ
102042011-12-23 Eli Zaretskii <eliz@gnu.org>
10205
10206 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10207 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 10208 resumed from there (after widening). (Bug#10360)
d048e1e6 10209
5ccaba1f
JD
102102011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10211
10212 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10213
204ee57f
JD
102142011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10215
b81d40f0
JB
10216 * nsterm.m (x_free_frame_resources):
10217 Release f->output_data.ns->miniimage.
204ee57f
JD
10218 (ns_index_color): Fix indentation. Do not retain
10219 color_table->colors[i].
10220
10221 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10222 before returning.
10223
10224 * nsfns.m (x_set_background_color): Assign return value from
10225 ns_index_color to face-background instead of NSColor*.
10226 (ns_implicitly_set_icon_type): Fix indentation.
10227 Change assignment in for loop to comparison.
10228
10229 * emacs.c (ns_pool): New variable.
10230 (main): Assign ns_pool.
10231 (Fkill_emacs): Call ns_release_autorelease_pool.
10232
10233 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10234 autorelease fdesc, release fdAttrs and tdict.
10235 (ns_get_covering_families): Release charset.
10236 (ns_findfonts): Release NSFontDescriptor created with new.
10237 (ns_uni_to_glyphs): Fix indentation.
10238 (setString): Release attrStr before assigning new value.
10239
c803b2b7
JD
102402011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10241
678f4426
JD
10242 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10243 and NS_IMPL_COCOA.
10244 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10245 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10246
cd394be1 102472011-12-18 David Reitter <reitter@cmu.edu>
678f4426 10248
5fecd5fc
JD
10249 * nsterm.m (ns_term_init): Subscribe for notifications
10250 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10251 to method trackingNotification in EmacsMenu.
10252
10253 * nsmenu.m (trackingMenu): New variable.
3771cb17 10254 (trackingNotification): New method (from Aquamacs).
5fecd5fc 10255 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 10256 from Aquamacs (Bug#7030).
678f4426
JD
10257
102582011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 10259
c803b2b7
JD
10260 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10261 (symbol_to_nsstring): Fix indentation.
10262 (ns_symbol_to_pb): New function.
cae07000
SM
10263 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10264 (Fns_rotate_cut_buffers_internal): Remove.
10265 (Fns_store_selection_internal): Rename from
c803b2b7
JD
10266 Fns_store_cut_buffer_internal.
10267 (ns_get_foreign_selection, Fx_own_selection_internal)
10268 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
10269 (Fns_get_selection_internal, Fns_store_selection_internal):
10270 Use ns_symbol_to_pb and check if return value is nil.
10271 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10272 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
10273 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10274 renamed to Sns_store_selection_internal.
10275 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10276 and remove this function.
10277 (ns_handle_selection_clear): Remove, never used.
10278 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10279 here.
10280
e1b01a3a
KB
102812011-12-17 Ken Brown <kbrown@cornell.edu>
10282
10283 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10284 GID is unknown (Bug#10257).
10285
2adb6e85
PE
102862011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10287
10288 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10289 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10290 which caused a build failure on GNU/Linux IA-64. This problem was
10291 introduced by my 2011-10-07 patch.
10292
d1d7b339
JL
102932011-12-15 Juri Linkov <juri@jurta.org>
10294
10295 * image.c (imagemagick_error): New function. (Bug#10112)
10296 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10297 Use `imagemagick_error' where ImageMagick functions return
10298 `MagickFalse'.
10299 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10300 proper order.
10301
100d5755
KH
103022011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10303
10304 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10305 fill background (Bug#8992).
10306
454592a6
MR
103072011-12-13 Martin Rudalics <rudalics@gmx.at>
10308
10309 * window.c (Vwindow_combination_resize)
10310 (Vwindow_combination_limit): Use t instead of non-nil in
10311 doc-strings.
61d4b438
MR
10312 (Vrecenter_redisplay): Add first sentence of doc-string on
10313 separate line.
53524d93 10314 (Frecenter): Fix doc-string typo.
454592a6 10315
3633e3aa
KH
103162011-12-11 Kenichi Handa <handa@m17n.org>
10317
10318 * coding.c (Funencodable_char_position): Pay attention to the
10319 buffer text relocation (Bug#9389).
10320
7b9d523a 103212011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 10322
7b9d523a
JD
10323 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10324 gtk_init (Bug#10100).
10325
b73189c6
EZ
103262011-12-10 Eli Zaretskii <eliz@gnu.org>
10327
10328 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10329 IT->string is nil. (Bug#10263)
10330
f7dfe5d6
JD
103312011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10332
83faebb4
JD
10333 * nsterm.h (x_free_frame_resources): Declare.
10334
f7dfe5d6
JD
10335 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10336 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10337
10338 * nsterm.h (ns_get_defaults_value): Declare.
10339
10340 * nsterm.m (ns_default): Call ns_get_defaults_value.
10341
7cd4e72c
EZ
103422011-12-09 Eli Zaretskii <eliz@gnu.org>
10343
10344 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10345 (Bug#10170)
10346
b34d7317
YM
103472011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10348
10349 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10350 that where the value of an _OBJC_* symbol points to is in the .bss
10351 section (Bug#10240).
10352
76470ad1
KH
103532011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10354
10355 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 10356 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 10357
745fff94
KH
103582011-12-08 Kenichi Handa <handa@m17n.org>
10359
10360 * ftfont.c (get_adstyle_property): Fix previous change
10361 (Bug#10233).
10362
6e44397c
JB
103632011-12-07 Juanma Barranquero <lekktu@gmail.com>
10364
10365 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10366 dirs from the default value of EMACSLOADPATH (bug#10208).
10367
7efa6272
GM
103682011-12-07 Glenn Morris <rgm@gnu.org>
10369
10370 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10371 installation and source directories as well. (Bug#10208)
10372
f6fc4d87
CY
103732011-12-06 Chong Yidong <cyd@gnu.org>
10374
10375 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10376
2bf26180
GM
103772011-12-06 Glenn Morris <rgm@gnu.org>
10378
10379 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10380 as an error, not just -1. (Bug#10217)
10381
3a6ad4f0
CY
103822011-12-05 Chong Yidong <cyd@gnu.org>
10383
10384 * keyboard.c (process_special_events): New function.
10385 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10386
75a3b399
PE
103872011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10388
10389 * coding.c (encode_designation_at_bol): Don't use uninitialized
10390 local variable (Bug#9318).
10391
c3c9e25e
KH
103922011-12-05 Kenichi Handa <handa@m17n.org>
10393
10394 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10395 return Qnil (Bug#8046, Bug#10193).
10396
5eb05ea3
KH
103972011-12-05 Kenichi Handa <handa@m17n.org>
10398
10399 * coding.c (encode_designation_at_bol): New args charbuf_end and
10400 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10401 (coding_set_source): Return how many bytes coding->source was
10402 relocated.
10403 (coding_set_destination): Return how many bytes
10404 coding->destination was relocated.
10405 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10406 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10407
104082011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10409
10410 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10411 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10412 macro (Bug#9318).
10413
104142011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10415
10416 The following changes are to fix Bug#9318.
10417
a79703f5 10418 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10419 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10420 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10421 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10422
7dbda6df
JB
104232011-12-05 Juanma Barranquero <lekktu@gmail.com>
10424
10425 * lisp.h (process_quit_flag): Fix external declaration.
10426
6d5eb5b0
SM
104272011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10428
10429 Don't macro-inline non-performance-critical code.
10430 * eval.c (process_quit_flag): New function.
10431 * lisp.h (QUIT): Use it.
10432
a0c3fad0
JD
104332011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10434
10435 * nsfns.m (get_geometry_from_preferences): New function.
10436 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10437
6c07aac2
AS
104382011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10439
10440 * emacs.c (Qkill_emacs): Define.
10441 (syms_of_emacs): Initialize it.
10442 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10443 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10444 (quit_throw_to_read_char): Add parameter `from_signal'.
10445 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10446 * lisp.h (QUIT): Call Fkill_emacs if requested.
10447
c052ead4
JD
104482011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10449
10450 * widget.c (update_wm_hints): Return if wmshell is null.
10451 (widget_update_wm_size_hints): New function.
10452
10453 * widget.h (widget_update_wm_size_hints): Declare.
10454
10455 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10456 widget_update_wm_size_hints (Bug#10104).
10457
9e49252b
EZ
104582011-12-03 Eli Zaretskii <eliz@gnu.org>
10459
10460 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10461 before a newline, prepare the bidi iterator for consuming the
10462 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10463 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10464
02b16839
JL
104652011-12-02 Juri Linkov <juri@jurta.org>
10466
10467 * search.c (Fword_search_regexp): New Lisp function created from
10468 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10469 (Fword_search_backward, Fword_search_forward)
10470 (Fword_search_backward_lax, Fword_search_forward_lax):
10471 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10472 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10473
0068070e
SM
104742011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10475
10476 * fileio.c (Finsert_file_contents): Move after-change-function call
10477 to before the "handled:" label, since all "goto handled" appear in
10478 cases where the *-change-functions have already been properly called
10479 (bug#10117).
10480
3360a3fc
AS
104812011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10482
10483 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10484 waiting for input. (Bug#10169)
10485
73d6c093
EZ
104862011-11-30 Eli Zaretskii <eliz@gnu.org>
10487
10488 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10489 verifies glyph row's hash code--we have just reallocated the
10490 glyphs, so their contents can be complete garbage. (Bug#10164)
10491
febe6bea
JB
104922011-11-30 Juanma Barranquero <lekktu@gmail.com>
10493
10494 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10495
801a4313
EZ
104962011-11-30 Eli Zaretskii <eliz@gnu.org>
10497
10498 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10499 attributes are tested _before_ calling verify_row_hash, to protect
10500 against GCC re-ordering of the tests. (Bug#10164)
10501
2b56b87e
JD
105022011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10503
10504 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10505
10506 * xterm.c (handle_one_xevent): Only set async_visible and friends
10507 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10508 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10509 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10510
dbf31225
PE
105112011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10512
10513 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10514 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10515 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10516 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10517 All uses changed to use GCPRO1 etc.
10518 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10519 Revert to old implementation (i.e., before 2011-03-11).
10520
1305621b
YM
105212011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10522
10523 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10524 of scroll runs so as to avoid assigning disabled bogus rows and
10525 unnecessary graphics copy operations.
10526
8c9afb46
EZ
105272011-11-27 Eli Zaretskii <eliz@gnu.org>
10528
10529 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10530 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10531 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10532 (malloc, free, realloc, calloc): Redirect to e_* only when
10533 compiling Emacs.
10534
10535 * lisp.h (GCTYPEBITS): Move before first use.
10536 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10537 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10538 this macro definition.
10539
10540 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10541 _MSC_VER.
10542
54e9e3bf
JD
105432011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10544
6d5eb5b0
SM
10545 * gtkutil.c (xg_create_frame_widgets):
10546 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10547 present with Gtk+ 2.0.
10548
83aca1cb
PE
105492011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10550
10551 * fileio.c (Finsert_file_contents): Undo previous change; see
10552 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10553
5b76caa4
PE
105542011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10555
10556 Rename locals to avoid shadowing.
10557 * fileio.c (Finsert_file_contents):
10558 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10559 * process.c (wait_reading_process_output):
10560 Rename inner 'proc' to 'p' to avoid shadowing.
10561 Indent for consistency with usual Emacs style.
10562
8c535114
EZ
105632011-11-25 Eli Zaretskii <eliz@gnu.org>
10564
10565 * xdisp.c (redisplay_window): If cursor row is not fully visible
10566 after recentering, and scroll-conservatively is set to a large
10567 number, scroll window by a few more lines to make the cursor fully
10568 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10569 (start_display): Don't move to the next line if the display should
10570 start at a newline that is part of a display vector or an overlay
10571 string. (Bug#10119)
8c535114 10572
fa4fdb5c
JL
105732011-11-24 Juri Linkov <juri@jurta.org>
10574
10575 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10576 after the `MagickPingImage' call. (Bug#10112)
10577
90ec88df
CY
105782011-11-23 Chong Yidong <cyd@gnu.org>
10579
10580 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10581
56e2e794
MR
105822011-11-23 Martin Rudalics <rudalics@gmx.at>
10583
10584 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10585 making another buffer current. (Bug#10114)
10586
b6e64c41
GM
105872011-11-23 Glenn Morris <rgm@gnu.org>
10588
10589 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10590
6b21de18
CY
105912011-11-23 Chong Yidong <cyd@gnu.org>
10592
10593 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10594 using it (Bug#5984).
10595
b12cd789
EZ
105962011-11-22 Eli Zaretskii <eliz@gnu.org>
10597
10598 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10599 and header-lines, as they don't have one computed for them.
10600 (Bug#10098)
10601
10602 * .gdbinit (prow): Make displayed values more self-explaining.
10603 Add row's hash code.
10604
261b6fd4
LMI
106052011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10606
10607 * process.c (wait_reading_process_output): Fix asynchrounous
10608 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10609 (wait_reading_process_output): Add comment and URL.
261b6fd4 10610
e7cfd277
JD
106112011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10612
10613 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10614
a9b9b7f5
CY
106152011-11-21 Chong Yidong <cyd@gnu.org>
10616
10617 * window.c (Fnext_window, Fprevious_window): Doc fix.
10618
b0d15b4f
SM
106192011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10620
10621 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10622
fe7a3057
JB
106232011-11-20 Juanma Barranquero <lekktu@gmail.com>
10624
10625 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10626
d2999b1a
MR
106272011-11-20 Martin Rudalics <rudalics@gmx.at>
10628
10629 * window.c (Fset_window_combination_limit): Rename argument
10630 STATUS to LIMIT.
10631 (Vwindow_combination_limit): Remove "status" from doc-string.
10632
d5ff9cd0
AS
106332011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10634
10635 * m/ibms390.h: Remove.
10636 * m/ibms390x.h: Don't include "ibms390.h".
10637
a5bb9bd3
SM
106382011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10639
10640 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10641 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10642
cd1181db
JB
106432011-11-20 Juanma Barranquero <lekktu@gmail.com>
10644
10645 * casetab.c (Fset_case_table):
10646 * charset.c (Fcharset_after): Fix typos.
10647
615a3b8d 106482011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10649
17e845af
PE
10650 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10651 Otherwise, valgrind does not work on some platforms.
10652 Problem reported by Andreas Schwab in
6a0bf43d
PE
10653 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10654 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10655 is set, removing the need for VIRT_ADDRESS_VARIES.
10656 (PURE_P): Use a more-efficient implementation that needs just one
10657 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10658 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10659 to 4 (xorl, subq, cmpq, setbe).
10660 * alloc.c (pure): Always extern now, since that's the
10661 VIRT_ADDR_VARIES behavior.
10662 (PURE_POINTER_P): Use a single comparison, not two, for
10663 consistency with the new puresize.h.
10664 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10665 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10666 Remove VIRT_ADDR_VARIES no longer needed.
10667
f8fe6f96
EZ
106682011-11-19 Eli Zaretskii <eliz@gnu.org>
10669
10670 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10671 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10672 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10673 behave as if the cursor position were at the window margin.
10674
10675 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10676 and the cursor position is out of bounds, behave as if the cursor
10677 position were at the window margin. (Bug#10075)
10678
df05a53c
CY
106792011-11-18 Chong Yidong <cyd@gnu.org>
10680
10681 * window.c (Fwindow_combination_limit): Make first argument
10682 non-optional, since it is meaningless for live windows like the
10683 selected window.
61ccba97 10684
2071918e
DA
106852011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10686
10687 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10688
b50a28de
SM
106892011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10690
10691 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10692 (graft_intervals_into_buffer): Simplify.
10693
015137db
EZ
106942011-11-18 Eli Zaretskii <eliz@gnu.org>
10695
10696 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10697 hash values of the two rows.
10698 (copy_row_except_pointers): Preserve the used[] arrays and the
10699 hash values of the two rows. (Bug#10035)
68c95424 10700 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10701
10702 * xdisp.c (row_hash): New function, body extracted from
10703 compute_line_metrics.
10704 (compute_line_metrics): Call row_hash, instead of computing the
10705 hash code inline.
10706
10707 * dispnew.c (verify_row_hash): Call row_hash for computing the
10708 hash code of a row, instead of duplicating code from xdisp.c.
10709
10710 * dispextern.h (row_hash): Add prototype.
10711
a2addb04
TH
107122011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10713
10714 * frame.c (delete_frame): Don't delete the terminal when the last
10715 X frame is closed if emacs is built with GTK toolkit.
10716
df85d315
JB
107172011-11-17 Juanma Barranquero <lekktu@gmail.com>
10718
10719 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10720
a0c2d0ae
MR
107212011-11-17 Martin Rudalics <rudalics@gmx.at>
10722
10723 * window.c (Vwindow_splits): Rename to
10724 Vwindow_combination_resize. Suggested by Juri Linkov.
10725 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10726 of Vwindow_splits.
10727
58179cce
JB
107282011-11-16 Juanma Barranquero <lekktu@gmail.com>
10729
7877f373
JB
10730 * nsfns.m (Fns_font_name):
10731 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10732
b6f67890
MR
107332011-11-16 Martin Rudalics <rudalics@gmx.at>
10734
10735 * window.h (window): Rename slot "nest" to "combination_limit".
10736 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10737 (Fset_window_nest): Rename to Fset_window_combination_limit.
10738 (Vwindow_nest): Rename to Vwindow_combination_limit.
10739 (recombine_windows, make_parent_window, make_window)
10740 (Fsplit_window_internal, saved_window)
10741 (Fset_window_configuration, save_window_save): Rename all
10742 occurrences of window_nest to window_combination_limit.
10743
c7015153
JB
107442011-11-15 Juanma Barranquero <lekktu@gmail.com>
10745
10746 * image.c (imagemagick_load_image): Fix typo.
10747
322ad6ec
EZ
107482011-11-14 Eli Zaretskii <eliz@gnu.org>
10749
10750 * xdisp.c (display_line): Move the call to
10751 highlight_trailing_whitespace before the call to
10752 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10753 faces of all the glyphs to compute ROW's hash value.
10754 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10755
f067b8ec
JB
107562011-11-14 Juanma Barranquero <lekktu@gmail.com>
10757
10758 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10759 just return (bug#10044).
10760
1e5b2111
EZ
107612011-11-12 Eli Zaretskii <eliz@gnu.org>
10762
7ef3cbd5
EZ
10763 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10764 with user-defined heap size. Bump the default size of the temacs
10765 heap to 27MB, to avoid memory warning when running temacs.
10766 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10767
1e5b2111
EZ
10768 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10769 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10770 (verify_row_hash) [XASSERTS]: New function.
10771 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10772 that the hash value of glyph rows is correct.
1e5b2111 10773
89d61221
MR
107742011-11-12 Martin Rudalics <rudalics@gmx.at>
10775
10776 * window.h (window): Remove splits slot.
10777 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10778 (Fdelete_other_windows_internal, make_parent_window)
10779 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10780 (Fset_window_configuration, save_window_save): Don't deal with
10781 split status of windows.
10782 (saved_window): Remove splits slot.
10783 (Vwindow_splits): Rewrite doc-string.
10784
97f18cc8
JD
107852011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10786
10787 * xfns.c (unwind_create_frame):
10788 * nsfns.m (unwind_create_frame):
10789 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10790 Vframe_list (Bug#9999).
10791
22a648b4
DA
107922011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10793
0b381c7e 10794 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10795
659afede
KH
107962011-11-11 Kenichi Handa <handa@m17n.org>
10797
10798 * callproc.c (Fcall_process): Set the member dst_multibyte of
10799 process_coding.
10800
9ac0394b
KH
108012011-11-11 Johan Bockgård <bojohan@gnu.org>
10802
10803 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10804 avoid a crash (bug#9496).
10805
2fbdc249
CY
108062011-11-09 Chong Yidong <cyd@gnu.org>
10807
10808 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10809 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10810
ac6b1f81
PE
108112011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10812
10813 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10814
09db192c
PE
108152011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10816
10817 Avoid some portability problems by eschewing 'extern inline' functions.
10818 The trivial performance wins aren't worth the portability hassles; see
10819 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10820 et seq.
10821 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10822 (window_box_width, window_box_left, window_box_left_offset)
10823 (window_box_right, window_box_right_offset): Undo previous change,
10824 by removing the "extern"s.
10825 * intervals.c (adjust_intervals_for_insertion)
10826 (adjust_intervals_for_deletion): Undo previous change,
10827 making these static again.
10828 (offset_intervals, temp_set_point_both, temp_set_point)
10829 (copy_intervals_to_string): No longer inline.
10830 * xdisp.c (window_text_bottom_y, window_box_width)
10831 (window_box_height, window_box_left_offset)
10832 (window_box_right_offset, window_box_left, window_box_right)
10833 (window_box): No longer inline.
10834
105216ed
CY
108352011-11-08 Chong Yidong <cyd@gnu.org>
10836
10837 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10838 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10839 Signal an error if not a live window.
105216ed
CY
10840 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10841 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10842
ae9e237f
JB
108432011-11-07 Juanma Barranquero <lekktu@gmail.com>
10844
10845 * lisp.h (syms_of_abbrev): Remove declaration.
10846 Reported by CHENG Gao <chenggao@royau.me>.
10847
c7aa8333
EZ
108482011-11-07 Eli Zaretskii <eliz@gnu.org>
10849
10850 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10851 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10852 of temacs in GUI mode.
10853
be7f5545
MR
108542011-11-07 Martin Rudalics <rudalics@gmx.at>
10855
10856 * window.h: Declare delete_all_child_windows instead of
10857 delete_all_subwindows.
10858 * window.c (Fwindow_nest, Fset_window_nest)
10859 (Fset_window_new_total, Fset_window_new_normal)
10860 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10861 (delete_all_subwindows): Rename to delete_all_child_windows.
10862 (Fdelete_other_windows_internal, Fset_window_configuration):
10863 Call delete_all_child_windows instead of delete_all_subwindows.
10864 * frame.c (delete_frame): Call delete_all_child_windows instead
10865 of delete_all_subwindows.
10866
ca78dc43
PE
108672011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10868
10869 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10870 This is also needed for porting to any host where GC_MARK_STACK is
10871 not GC_MAKE_GCPROS_NOOPS.
10872 (which_symbols): Use it.
10873
a0241d01
KH
108742011-11-07 Kenichi Handa <handa@m17n.org>
10875
10876 * coding.c (coding_set_destination): Check coding->src_pos only
10877 when coding->src_object is a buffer (bug#9910).
10878
10879 * process.c (send_process): Set the member src_multibyte of coding
10880 to 0 (bug#9911) when sending a unibyte text.
10881
10882 * callproc.c (Fcall_process): Set the member src_multibyte of
10883 process_coding to 0 (bug#9912).
10884
a64bfdfa 108852011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
10886
10887 * xmenu.c (cleanup_widget_value_tree): New function.
10888 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10889 calling free_menubar_widget_value_tree directly (Bug#9830).
10890
cb41b32a
PE
108912011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10892
10893 Fix some portability problems with 'inline'.
10894 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10895 (window_box_width, window_box_left, window_box_left_offset)
10896 (window_box_right, window_box_right_offset): Declare extern.
10897 Otherwise, these inline functions do not conform to C99 and
10898 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10899 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10900 * intervals.c (adjust_intervals_for_insertion)
10901 (adjust_intervals_for_deletion): Now extern, because otherwise the
10902 extern inline functions 'offset_intervals' couldn't refer to it.
10903 (static_offset_intervals): Remove.
10904 (offset_intervals): Rewrite using the old contents of
10905 static_offset_intervals. The old version didn't conform to C99
10906 because an extern inline function contained a reference to an
10907 identifier with static linkage.
10908
b7041366
AS
109092011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10910
10911 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10912 GC.
10913
88a37c4d
EZ
109142011-11-06 Eli Zaretskii <eliz@gnu.org>
10915
10916 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10917 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10918 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10919 return Qleft_to_right.
10920
49745b39
CY
109212011-11-06 Chong Yidong <cyd@gnu.org>
10922
10923 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
10924 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
10925 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
10926 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
10927 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
10928 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
10929 (Fwindow_vscroll): Doc fix.
10930 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
10931 argument, since it makes no sense to pass a live window and for
10932 consistency with window-child.
10933
1f05cd82
CS
109342011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
10935
10936 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
10937 support MSVC.
10938
22610910
JR
109392011-11-05 Jason Rumney <jasonr@gnu.org>
10940
10941 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
10942 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
10943 fonts (Bug#6029).
10944 (add_font_entity_to_list): Fix logic errors in mixed boolean and
10945 bitwise arithmetic preventing use of unicode-sip and non-truetype
10946 opentype fonts.
10947
a06776b2
EZ
109482011-11-05 Eli Zaretskii <eliz@gnu.org>
10949
3ad924ba
EZ
10950 * s/ms-w32.h (fstat, stat, utime): Move redirections to
10951 "emacs"-only part.
10952
a06776b2
EZ
10953 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
10954 initialization code to keep similarity to xfns.c after changes
10955 from 2011-11-05.
10956
c9e7db78
JD
109572011-11-05 Jan Djärv <jan.h.d@swipnet.se>
10958
a97f8f3f
JD
10959 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
10960 (unwind_create_frame): New function (Bug#9943).
10961 (Fx_create_frame): Restructure code to be more similar to the one in
10962 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
10963 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
10964 Move terminal->reference_count++ just before making the frame official
10965 (Bug#9943).
10966
10967 * nsterm.m (x_free_frame_resources): New function.
10968 (x_destroy_window): Move code to x_free_frame_resources.
10969
c9e7db78 10970 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
10971 (Fx_create_frame, x_create_tip_frame):
10972 Move terminal->reference_count++ just before making the frame
75f1671a 10973 official. Move initialization of image_cache_refcount and
c9e7db78
JD
10974 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
10975
a6fc3b5c
EZ
109762011-11-05 Eli Zaretskii <eliz@gnu.org>
10977
10978 Support MSVC build with newer versions of Visual Studio.
10979 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
10980 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
10981 nt/gmake.defs.
10982
10983 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
10984 which are not supported by MSVC.
10985 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
10986 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
10987 bitfields.
10988 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
10989 types in bitfields.
10990 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
10991
10992 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
10993
58179cce 109942011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
10995
10996 Support MSVC build with newer versions of Visual Studio.
10997 * w32.c: Don't include w32api.h for MSVC.
10998 (init_environment) [_MSC_VER]: Call sys_access, not _access.
10999
11000 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11001 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11002 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11003 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11004 e_* cousins.
11005 (alloca) [_MSC_VER]: Define to _alloca.
11006
11007 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11008
11009 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11010
a58c13ed
EZ
110112011-11-04 Eli Zaretskii <eliz@gnu.org>
11012
11013 * xdisp.c (note_mouse_highlight): If either of
11014 previous/next-single-property-change returns nil, treat that as
11015 the beginning or the end of the buffer. (Bug#9955)
11016
fe0b6370
JD
110172011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11018
a58c13ed 11019 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
11020 label is not null (Bug#9951).
11021 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11022 may be NULL.
11023
89bd5ee1
EZ
110242011-11-04 Eli Zaretskii <eliz@gnu.org>
11025
11026 * window.c (Fwindow_body_size): Mention in the doc string that the
11027 return value is in frame's canonical units. (Bug#9949)
11028
84c3edb9
EZ
110292011-11-03 Eli Zaretskii <eliz@gnu.org>
11030
4e2fb5c7
EZ
11031 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11032
84c3edb9 11033 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 11034 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 11035 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 11036
bc17a887
EZ
110372011-11-01 Eli Zaretskii <eliz@gnu.org>
11038
11039 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11040 Don't stop backward scan on the continuation glyph, even though
11041 its CHARPOS is positive.
6d5eb5b0
SM
11042 (mouse_face_from_buffer_pos, note_mouse_highlight):
11043 Rename cover_string to disp_string.
bc17a887 11044
4ee88440
MR
110452011-11-01 Martin Rudalics <rudalics@gmx.at>
11046
11047 * window.c (temp_output_buffer_show): Don't use
11048 Vtemp_buffer_show_specifiers.
11049 (Vtemp_buffer_show_specifiers): Remove unused variable.
11050
c2ff3c02
EZ
110512011-10-30 Eli Zaretskii <eliz@gnu.org>
11052
11053 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11054 past the beginning of the current glyph matrix.
11055
58179cce 110562011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
11057
11058 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11059 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11060 HAVE_GTK3 (Bug#9869).
b77a6a7f 11061
3b574623
JD
11062 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11063 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11064
b77a6a7f
JD
11065 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11066
11067 * xterm.c: Declare x_handle_net_wm_state to return int.
11068 (handle_one_xevent): Check if we are iconified but don't have
11069 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11070 (get_current_wm_state): Return non-zero if not hidden,
11071 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11072 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11073 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11074 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11075
196e41e4
PE
110762011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11077
11078 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11079 so that this new function doesn't get optimized away by a
11080 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11081
021f2e1a
AS
110822011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11083
11084 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11085
8b058d44
EZ
110862011-10-29 Eli Zaretskii <eliz@gnu.org>
11087
11088 Fix the `xbytecode' command.
11089 * .gdbinit (xprintbytestr): New command.
b50a28de 11090 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
11091 (xbytecode): Print the byte-code string as well.
11092
4452fb80
EZ
110932011-10-29 Kim Storm <storm@cua.dk>
11094
8b058d44
EZ
11095 * alloc.c (which_symbols): New function.
11096
21b72067
AS
110972011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11098
11099 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11100 line. (Bug#9903)
11101
83ed7b5c
GM
111022011-10-29 Glenn Morris <rgm@gnu.org>
11103
11104 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11105 Not clear what it was for, and it causes various bugs. (Bug#9839)
11106
5a7a728b
EZ
111072011-10-28 Eli Zaretskii <eliz@gnu.org>
11108
11109 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11110 possible random value that matches one of those tested as
11111 condition to clear the mouse face.
11112
d3d0842f
CY
111132011-10-28 Chong Yidong <cyd@gnu.org>
11114
11115 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11116
31b39d13
DN
111172011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11118
11119 * window.c (make_window): Initialize phys_cursor_on_p.
11120
9aba6043
SM
111212011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11122
11123 * lisp.h (struct Lisp_Symbol): Update comments.
11124
c20992f4
JB
111252011-10-28 Juanma Barranquero <lekktu@gmail.com>
11126
11127 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11128
db4f02f2
EZ
111292011-10-28 Eli Zaretskii <eliz@gnu.org>
11130
11131 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11132 <oslsachem@gmail.com> for helping to debug this.
11133
11134 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11135 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11136 (g_b_init_get_glyph_outline_w): New static variables.
11137 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11138 (GetGlyphOutlineW_Proc): New typedefs.
11139 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
11140 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11141 New functions.
11142 (w32font_open_internal, compute_metrics):
11143 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
11144 instead of calling the "wide" APIs directly.
11145
11146 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11147
11148 * w32.h (syms_of_w32font): Add prototype.
11149
87e68db4
JB
111502011-10-27 Juanma Barranquero <lekktu@gmail.com>
11151
11152 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11153 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11154 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11155 (Fmove_to_window_line): Doc fix.
11156
435c1d67
CY
111572011-10-27 Chong Yidong <cyd@gnu.org>
11158
11159 * process.c (make_process): Set gnutls_state to NULL.
11160
11161 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11162 non-NULL, regardless of GNUTLS_INITSTAGE.
11163 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11164 an error. Set process slots as soon as we allocate them.
11165
11166 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11167
9c6c6f49
CY
111682011-10-27 Chong Yidong <cyd@gnu.org>
11169
9aba6043
SM
11170 * gnutls.c (emacs_gnutls_deinit): New function.
11171 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
11172 (Fgnutls_deinit, Fgnutls_boot): Use it.
11173
11174 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11175 (deactivate_process): Call emacs_gnutls_deinit.
11176
657d08d3
JB
111772011-10-27 Juanma Barranquero <lekktu@gmail.com>
11178
11179 * image.c (x_create_x_image_and_pixmap):
11180 * w32.c (sys_rename, w32_delayed_load):
11181 * w32font.c (fill_in_logfont):
11182 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11183
5430d399
JB
111842011-10-26 Juanma Barranquero <lekktu@gmail.com>
11185
11186 * w32fns.c (w32_default_color_map): New function,
11187 extracted from Fw32_default_color_map.
a7ef684b 11188 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 11189
fe0055fa
PE
111902011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11191
11192 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11193
e6346438
SM
111942011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11195
11196 * keyboard.c (test_undefined): New function (bug#9751).
11197 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11198
e112cc37
ET
111992011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11200
11201 * sysdep.c (init_sys_modes): Fix the check for the controlling
11202 terminal (Bug#6649).
11203
7b5d6677
EZ
112042011-10-20 Eli Zaretskii <eliz@gnu.org>
11205
11206 * dispextern.h (struct bidi_it): New member next_en_type.
11207
11208 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11209 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11210 current character, check also for next_en_type being WEAK_EN.
11211 (bidi_resolve_weak): Don't enter the expensive loop if the current
11212 position is before next_en_pos. Record the bidi type of the first
11213 non-ET, non-BN character we find, in addition to its position.
11214 (bidi_level_of_next_char): Invalidate next_en_type when
11215 next_en_pos is over-stepped.
11216
7da0b018
PE
112172011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11218
11219 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11220 * editfns.c: Rewrite current-time-zone so that it invokes
11221 the equivalent of (format-time-string "%Z") to get the time zone name.
11222 This fixes a bug when the time zone name contains characters that
11223 need converting from the system time locale to Emacs internal format.
11224 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11225 that patch fixed format-time-string to do the conversion, but
11226 I forgot to fix current-time-zone.
11227 (format_time_string): New function, containing most of
11228 what Fformat_time_string used to contain.
11229 (Fformat_time_string): Rewrite in terms of format_time_string.
11230 This doesn't change this function's behavior.
11231 (current-time-zone): Rewrite to use format_time_string.
11232 This fixes the bug reported by Michael Schierl in
11233 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11234 Jason Rumney's 2007-06-07 change worked around this bug, but
11235 didn't fix it.
11236 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11237
8547b010
EZ
112382011-10-19 Eli Zaretskii <eliz@gnu.org>
11239
11240 * xdisp.c (start_display): If the character at POS is displayed
11241 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
11242 (try_window_reusing_current_matrix): If a line ends in a display
11243 vector or the next line starts in a display vector, continue
11244 redrawing the window even though the character position of
11245 start_row was reached.
8547b010
EZ
11246 (Bug#9771, part 2)
11247
4e948d15
CY
112482011-10-18 Chong Yidong <cyd@gnu.org>
11249
11250 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11251 with nobreak-char-display too.
11252
4787455f
EZ
112532011-10-18 Eli Zaretskii <eliz@gnu.org>
11254
11255 Fix part 3 of bug#9771.
11256 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11257 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11258 non-neutral characters if the current character is a paragraph
11259 separator (a.k.a. Newline). This avoids running the same
11260 expensive loop twice, once when we consume the preceding newline
11261 and the other time when the line actually needs to be displayed.
11262 Avoid the loop when we see neutrals on the base embedding level
11263 following a character whose directionality is the same as the
11264 paragraph's. This avoids running the expensive loop when a line
11265 ends in a long sequence of neutrals, like control characters.
11266 Add assertion against STRONG_AL type. Slightly rearrange code
11267 that determines the type of a neutral given the first non-neutral
11268 that follows it.
11269 (bidi_level_of_next_char): Set next_en_pos to zero when
11270 invalidating its info.
11271
2c91f553
EZ
112722011-10-17 Eli Zaretskii <eliz@gnu.org>
11273
11274 * xdisp.c (push_display_prop): Determine whether to record string
11275 or buffer position by IT->string, not by IT->method. Allow
11276 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
11277 (move_it_vertically_backward): Don't look for character position
11278 immediately after the newline when in a continuation line.
11279 (Bug#9771, part 1)
2c91f553 11280
c7b08b0d
MR
112812011-10-15 Martin Rudalics <rudalics@gmx.at>
11282
11283 * window.c (coordinates_in_window): Rewrite and delabelize
11284 vertical border check. (Bug#5357) (Bug#9618)
11285
6b02f655
SM
112862011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11287
11288 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11289 errors in XSetWindowBorder (bug#9310).
11290
81d40c92
DA
112912011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11292
11293 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11294 avoid crash when xmalloc overrun checking is enabled.
11295
d4172c3b
EZ
112962011-10-13 Eli Zaretskii <eliz@gnu.org>
11297
11298 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11299 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11300 cursor motion with <left> and <right> arrow keys.
11301
11302 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11303 some callers set that themselves.
11304
b00eea75
EZ
113052011-10-12 Eli Zaretskii <eliz@gnu.org>
11306
11307 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11308 display string and the previous row comes from the same string and
11309 is empty. (Bug#9739) (Bug#9738)
11310
8fe012c4
SM
113112011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11312
11313 * doc.c (get_doc_string): Encode file name (bug#9735).
11314
0074aef2
EZ
113152011-10-12 Eli Zaretskii <eliz@gnu.org>
11316
79beb178
EZ
11317 * bidi.c (bidi_level_of_next_char):
11318 * xdisp.c (get_visually_first_element): Remove old incorrect
11319 comments regarding the Unicode Line Separator character.
11320
0074aef2
EZ
11321 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11322
6e4b3fbe
DA
113232011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11324
11325 * alloc.c (Fgc_status): Do not access beyond zombies array
11326 boundary if nzombies > MAX_ZOMBIES.
11327 * alloc.c (dump_zombies): Add missing format specifier.
11328
0324f3af
PE
113292011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11330
b5525cac
PE
11331 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11332 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11333
0324f3af
PE
11334 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11335 Some packages use them to denote characters with modifiers.
11336
e9b5f888
AS
113372011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11338
11339 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11340 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11341 matching a pp-number. Rename parameter var to var1.
11342
127827c0
SM
113432011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11344
11345 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11346
c8fd3bd0
GM
113472011-10-08 Glenn Morris <rgm@gnu.org>
11348
11349 * callint.c (Fcall_interactively): Give a more explicit error for the
11350 'c' case with a non-character input. (Bug#8479)
11351
352ec8ff
EZ
113522011-10-08 Eli Zaretskii <eliz@gnu.org>
11353
03669ccb
EZ
11354 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11355 lines.
7061c986
EZ
11356 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11357 lines that are hscrolled on the left.
03669ccb 11358
352ec8ff
EZ
11359 * dispnew.c (buffer_posn_from_coords): Account for a possible
11360 presence of header-line. (Bug#4426)
11361
a66cfb1c
SM
113622011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11363
6b02f655
SM
11364 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11365 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 11366
7c5ee88e
PE
113672011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11368
11369 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11370 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11371 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11372 this makes Emacs dump core during garbage collection on rare
11373 occasions. sizeof is obviously inferior to offsetof here, so
11374 stick with offsetof.
11375 (GC_POINTER_ALIGNMENT): New macro.
11376 (mark_memory): Omit 3rd (offset) arg; caller changed.
11377 Don't assume EMACS_INT alignment is the same as pointer alignment.
11378
df1bbe5b
SM
113792011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11380
11381 * keyboard.c (read_key_sequence_remapped): New var.
11382 (read_key_sequence): Compute remapping in the right buffer.
11383 (command_loop_1): Use read_key_sequence's remapping directly.
11384
51553db6
SM
113852011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11386
32c1fffd
SM
11387 * dired.c (file_name_completion): Don't expand file name.
11388 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11389 before checking file name handler.
11390
51553db6
SM
11391 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11392 they've been requested explicitly (bug#9591).
11393
b6bd1599 113942011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
11395
11396 * keymap.c (Fsingle_key_description): Use make_specified_string
11397 instead of build_string to build string from push_key_description.
11398 (Bug#5193)
11399
f701dc2a
PE
114002011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11401
4222c55d
PE
11402 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11403 This fixes a Y2038 bug on 64-bit hosts.
11404 * buffer.c (reset_buffer):
11405 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11406 (Fclear_buffer_auto_save_failure):
11407 Use 0, not -1, to represent an unset failure time, since time_t
11408 might not be signed.
11409
f701dc2a
PE
11410 Remove dependency on glibc malloc internals.
11411 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11412 Move back here from lisp.h, but with their new implementations.
11413 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11414 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11415 * charset.c (charset_table_init): New static var.
11416 (syms_of_charset): Use it instead of xmalloc. This removes a
11417 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11418 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11419 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11420 Move back to alloc.c.
11421 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11422 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11423
9ceebf39
JD
114242011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11425
11426 * nsterm.m (windowDidResize): Call x_set_window_size only when
11427 ns_in_resize is true. Otherwise set pixelwidth/height and
11428 call change_frame_size (Bug#9628).
11429
cb993c58
PE
114302011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11431
3930c88b
PE
11432 Port --enable-checking=all to Fedora 14 x86-64.
11433 * charset.c (syms_of_charset): Also account for glibc malloc's
11434 internal overhead when calculating the initial malloc maximum.
11435
cb993c58
PE
11436 Port --enable-checking=all to Fedora 14 x86.
11437 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11438 Move to lisp.h.
11439 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11440 (overrun_check_realloc, overrun_check_free):
11441 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11442 That way, xmalloc returns a properly-aligned pointer even if
11443 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11444 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11445 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11446 into account when calculating the initial malloc maximum.
11447 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11448 Move here from alloc.c, so that charset.c can use it too.
11449 Properly align; the old code wasn't right for common 32-bit hosts
11450 when configured with --enable-checking=all.
11451 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11452 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11453
31bed486
EZ
114542011-09-29 Eli Zaretskii <eliz@gnu.org>
11455
04c70788 11456 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11457 use EDOM.
11458
fbcaa2f3
EZ
114592011-09-28 Eli Zaretskii <eliz@gnu.org>
11460
11461 * xdisp.c (compute_display_string_end): If there's no display
11462 string at CHARPOS, return -1.
11463
11464 * bidi.c (bidi_fetch_char): When compute_display_string_end
11465 returns a negative value, treat the character as a normal
11466 character not covered by a display string. (Bug#9624)
11467
a239d4e9
JB
114682011-09-28 Juanma Barranquero <lekktu@gmail.com>
11469
11470 * lread.c (Fread_from_string): Fix typo in docstring.
11471
88652fd5
EZ
114722011-09-27 Eli Zaretskii <eliz@gnu.org>
11473
11474 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11475 newline, reseat the iterator instead of bidi-iterating there one
11476 character at a time. (Bug#9610)
32c1fffd
SM
11477 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11478 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11479
ed497dd4
AS
114802011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11481
11482 * lread.c (readevalloop): Use correct code for NBSP.
11483 (read1): Likewise. (Bug#9608)
11484
b2bf61aa
MA
114852011-09-25 Michael Albinus <michael.albinus@gmx.de>
11486
11487 * dbusbind.c (Fdbus_register_signal): When service is not
11488 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11489
32bbb17c
GM
114902011-09-25 Glenn Morris <rgm@gnu.org>
11491
11492 * buffer.c (truncate-lines): Doc fix.
11493
94e0933e
CY
114942011-09-24 Chong Yidong <cyd@stupidchicken.com>
11495
11496 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11497 (Fset_window_next_buffers): Doc fix.
11498
cddde921
GM
114992011-09-24 Glenn Morris <rgm@gnu.org>
11500
11501 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11502
1260aef1
PE
115032011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11504
25b4bfa0
PE
11505 Fix minor problems found by static checking.
11506 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11507 * indent.c (Fvertical_motion): Fix == vs = typo.
11508
e3cbd34b
EZ
115092011-09-24 Eli Zaretskii <eliz@gnu.org>
11510
a66cfb1c
SM
11511 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11512 Default value is now t. Doc fix.
6bf7006f 11513
e3cbd34b 11514 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11515 logic when moving up, not only when moving down. Fix the
e3cbd34b 11516 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11517 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11518
11519 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11520 CHARPOS is covered by a display string which includes newlines.
11521 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11522 is covered by a display string with embedded newlines.
11523
a3de0cbd
MA
115242011-09-24 Michael Albinus <michael.albinus@gmx.de>
11525
11526 * dbusbind.c (Fdbus_register_signal): Add match rule to
11527 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11528 (Fdbus_register_method, Vdbus_registered_objects_table):
11529 Fix docstring.
a3de0cbd 11530
b260039d
JM
115312011-09-24 Jim Meyering <meyering@redhat.com>
11532
32c1fffd 11533 do not ignore write error for any output size
b260039d
JM
11534 The previous change was incomplete.
11535 While it makes emacs --batch detect the vast majority of stdout
11536 write failures, errors were still ignored whenever the output size is
11537 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11538 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11539 && echo FAIL: ignored write error
11540 FAIL: ignored write error
11541 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11542 && echo FAIL: ignored write error
11543 FAIL: ignored write error
11544 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11545
8eca8a7c
AS
115462011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11547
11548 * emacs.c (Fkill_emacs): In noninteractive mode exit
11549 non-successfully if a write error occurred on stdout. (Bug#9574)
11550
3341db62
EZ
115512011-09-21 Eli Zaretskii <eliz@gnu.org>
11552
11553 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11554 the xassert test.
11555
11556 * dispextern.h (struct it): Update the comment documenting what
11557 can it->OBJECT be.
11558
8c203dbf
EZ
115592011-09-20 Eli Zaretskii <eliz@gnu.org>
11560
11561 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11562 a display string, extend search for cursor position to end of row.
11563 (find_row_edges): If the row ends in a newline from a display
11564 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11565 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11566 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11567 non-empty line. Fixes confusing cursor motion with arrow keys at
11568 the beginning of a line that starts with whitespace.
8c203dbf 11569
a4824228
LMI
115702011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11571
11572 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11573 (bug#9493).
11574
33ed493b
CY
115752011-09-18 Chong Yidong <cyd@stupidchicken.com>
11576
11577 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11578 boolean (Bug#9154).
11579
56cd55c8
EZ
115802011-09-18 Eli Zaretskii <eliz@gnu.org>
11581
11582 * xdisp.c (display_line): Record maximum and minimum buffer
11583 positions even if no glyphs were produced (e.g., by a zero-width
11584 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11585 buffer positions that will be removed from the glyph row because
11586 they don't fit.
c02dcedf
EZ
11587 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11588 column is beyond frame width: don't subtract 1 "pixel" when
11589 computing width of the stretch.
3e62b7e0
EZ
11590 (reseat_at_next_visible_line_start): Undo the change made on
11591 2011-09-17 that saved paragraph information and restored it after
11592 the call to `reseat'. (Bug#9545)
56cd55c8 11593
5ed99d36 115942011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11595
11596 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11597 and turn window cursor on if cleared (Bug#9415).
11598
5ed99d36 115992011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11600
11601 * search.c (boyer_moore): Take unibyte characters from pattern
11602 literally. (Bug#9458)
11603
9bade7b2
EZ
116042011-09-18 Eli Zaretskii <eliz@gnu.org>
11605
11606 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11607
e5e9d610
PE
116082011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11609
87e4427a
PE
11610 Fix minor problem found by static checking.
11611 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11612 initialized, to pacify gcc -Wuninitialized.
11613
e5e9d610
PE
11614 * fileio.c: Report proper errno when syscall falls.
11615 (Finsert_file_contents): Save and restore errno,
11616 so that report_file_error outputs the correct diagnostic.
11617 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11618
a1674f0b
EZ
116192011-09-18 Eli Zaretskii <eliz@gnu.org>
11620
11621 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11622
fbfb6dd4
EZ
116232011-09-17 Eli Zaretskii <eliz@gnu.org>
11624
11625 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11626 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11627
bb187662
EZ
116282011-09-17 Eli Zaretskii <eliz@gnu.org>
11629
1137e8b8 11630 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11631 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11632
11633 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11634 (bidi_find_paragraph_start): Search back for paragraph beginning
11635 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11636 (bidi_move_to_visually_next): Only trigger paragraph-related
11637 computations when the last character is a newline or at EOB, not
11638 just any NEUTRAL_B. (Bug#9470)
11639
bb187662
EZ
11640 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11641 truncated lines if point is covered by a display string. (Bug#9524)
11642
2e621251
PE
116432011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11644
11645 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11646 (cons_to_x_long): New function.
11647 (lisp_data_to_selection_data): Use it. Correct the test for
11648 short-versus-long data; it was negated. Break out of vector
11649 loop, for efficiency, when a long datum is discovered.
11650
91a15bc6
SM
116512011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11652
11653 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11654
b41c3a35
EZ
116552011-09-16 Eli Zaretskii <eliz@gnu.org>
11656
11657 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11658 GCC PR/17406) by declaring this function with external scope.
11659
7812ba2d
PE
116602011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11661
11662 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11663 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11664
cf7edc2a
AS
116652011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11666
11667 * editfns.c (Fformat): Correctly handle text properties on "%%".
11668
bd01620e
EZ
116692011-09-15 Eli Zaretskii <eliz@gnu.org>
11670
11671 * xterm.c (x_draw_composite_glyph_string_foreground):
11672 * w32term.c (x_draw_composite_glyph_string_foreground):
11673 * term.c (encode_terminal_code):
11674 * composite.c (composition_update_it, get_composition_id):
11675 * xdisp.c (get_next_display_element)
11676 (fill_composite_glyph_string): Add comments about special meaning
11677 of TAB characters in a composition.
11678
a02719a3
PE
116792011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11680
11681 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11682 This occurs when processing a multibyte format.
11683 Problem reported by Wolfgang Jenker.
a02719a3 11684
72589a3c
JB
116852011-09-15 Johan Bockgård <bojohan@gnu.org>
11686
11687 * xdisp.c (try_cursor_movement): Only check for exact match if
11688 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11689
1c14176c
PE
116902011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11691
11692 Remove unused external symbols.
11693 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11694 * xdisp.c (calc_pixel_width_or_height): Now static.
11695 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11696 * indent.c (check_display_width):
11697 * w32term.c: Fix comment to match code.
11698 * xterm.c, xterm.h (x_catching_errors): Remove.
11699
d2eea5b5
PE
117002011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11701
11702 * xselect.c: Use signed conversions more consistently (Bug#9498).
11703 (selection_data_to_lisp_data): Assume incoming selection data are
11704 signed integers, not unsigned. This is to be consistent with
11705 outgoing selection data, which was modified to use signed integers
11706 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11707 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11708 expects long, not unsigned long.
11709
46888499
EZ
117102011-09-14 Eli Zaretskii <eliz@gnu.org>
11711
11712 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11713 computation of loop end. Reported by Johan Bockgård
11714 <bojohan@gnu.org>.
11715
ef8ef9fb
CY
117162011-09-13 Chong Yidong <cyd@stupidchicken.com>
11717
11718 * frame.c (Fother_visible_frames_p): Function deleted.
11719
fa819fed
EZ
117202011-09-12 Eli Zaretskii <eliz@gnu.org>
11721
11722 * indent.c (compute_motion): Process display vector front to back
11723 rather than the other way around. (Bug#2496)
11724
2ba8e008
SM
117252011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11726
11727 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11728
20f53c69
CY
117292011-09-11 Chong Yidong <cyd@stupidchicken.com>
11730
11731 * minibuf.c (Fread_from_minibuffer): Doc fix.
11732
d562d7a4
EZ
117332011-09-11 Eli Zaretskii <eliz@gnu.org>
11734
11735 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11736 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11737
1c4d7f3d
LMI
117382011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11739
11740 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11741 value for non-existent files.
11742
b885bf36
EZ
117432011-09-11 Eli Zaretskii <eliz@gnu.org>
11744
11745 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11746 set its "size" to -1. This will set the modtime_size field of
11747 the corresponding buffer to -1, which is what
11748 verify-visited-file-modtime expects for files that do not exist.
11749 (Bug#9139)
11750
6612f0bf
PE
117512011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11752
11753 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11754 here ...
11755 * lisp.h: ... from here. push_key_description is no longer
11756 defined in keyboard.c, so its declaration should not be in
11757 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11758 logically belongs with push_key_description.
11759
dfb3f755
PE
117602011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11761
11762 * buffer.h: Include <sys/types.h> instead of <time.h>.
11763 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11764 Problem reported by Herbert J. Skuhra.
11765
3134906c
LMI
117662011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11767
11768 * xml.c (parse_region): Make the parsing work for
11769 non-comment-starting XML files again (bug#9144).
11770
8d903f4e
AS
117712011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11772
11773 * image.c (gif_load): Fix calculation of bottom and right corner.
11774 (Bug#9468)
11775
80ad64f4
EZ
117762011-09-10 Eli Zaretskii <eliz@gnu.org>
11777
11778 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11779 redisplay in small windows.
11780
208a048d
EZ
117812011-09-09 Eli Zaretskii <eliz@gnu.org>
11782
11783 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11784
9b1c252e
MR
117852011-09-08 Martin Rudalics <rudalics@gmx.at>
11786
11787 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11788 Operate on live windows only.
11789
2949f33b
JB
117902011-09-08 Juanma Barranquero <lekktu@gmail.com>
11791
11792 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11793
e08dcafd
EZ
117942011-09-07 Eli Zaretskii <eliz@gnu.org>
11795
11796 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11797 only under bidi iteration.
11798
115b96bd
JD
117992011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11800
11801 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11802
c8199d0f
PE
118032011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11804
11805 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11806 Without this fix, the command to link temacs failed due to an
11807 undefined symbol __builtin_isnan. This is because
11808 /usr/include/iso/math_c99.h #defines isnan(x) to
11809 __builtin_isnan(x), but the bundled gcc, which identifies itself
11810 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11811 a __builtin_isnan.
11812 * floatfns.c (isnan): #undef, and then #define to a clone of
11813 what's in data.c.
11814 (Fisnan): Always define, since it's always available now.
11815 (syms_of_floatfns): Always define isnan at the Lisp level.
11816
e39b275c 118172011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11818
11819 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11820
b2db44d9 118212011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11822
f4af5137 11823 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11824 The previous code assumed that file offsets (off_t values) fit in
11825 EMACS_INT variables, which is not true on typical 32-bit hosts.
11826 The code messed up by falsely reporting buffer overflow in cases
11827 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11828 when "big" contains more than 2**29 bytes, even though this
11829 inserts just one byte and does not overflow the buffer.
11830 (Finsert_file_contents): Store file offsets as off_t
11831 values, not as EMACS_INT values. Check for overflow when
11832 converting between EMACS_INT and off_t. When checking for
11833 buffer overflow or for overlap, take the offsets into account.
11834 Don't use EMACS_INT for small values where int suffices.
11835 When checking for overlap, fix a typo: ZV was used where
11836 ZV_BYTE was intended.
11837 (Fwrite_region): Don't assume off_t fits into 'long'.
11838 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11839
ecfc0a49
MA
118402011-09-05 Michael Albinus <michael.albinus@gmx.de>
11841
11842 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11843
6511acf2 118442011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11845
0999621a 11846 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11847
11848 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11849 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11850 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11851 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11852 (modify_event_symbol): Do not assume that the length of
11853 name_alist_or_stem is safe to alloca and fits in int.
11854 (Fexecute_extended_command): Likewise for function name and binding.
11855 (Frecursion_depth): Wrap around reliably on integer overflow.
11856 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11857 since some callers pass EMACS_INT values.
11858 (Fsingle_key_description): Don't crash if symbol name contains more
11859 than MAX_ALLOCA bytes.
11860 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11861 (get_minibuffer): Arg is now EMACS_INT, not int.
11862 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11863 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11864 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11865
2be7d702
PE
11866 * dbusbind.c (signature_cat): New function.
11867 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
11868 Do not overrun buffer; instead, report string overflow.
11869
9d1df220
PE
11870 * dispnew.c (add_window_display_history): Don't overrun buffer.
11871 Truncate instead; this is OK since it's just a log.
11872
33ef5c64
PE
11873 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11874 even if the time zone offset is outlandishly large.
11875 Don't mishandle offset == INT_MIN.
11876
66c6fdd5
PE
11877 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11878 when creating daemon; the previous buffer-overflow check was incorrect.
11879
d749b01b
PE
11880 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11881 which has the guts of the old verror function.
11882
b5cd1905
PE
11883 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11884 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11885
6e1a67fb
PE
11886 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11887 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 11888 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 11889 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
11890 length of string rather than counting it via multiple sprintfs;
11891 that's simpler and more reliable.
c21721cc
PE
11892 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11893 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11894 sprintf, in case result does not fit in int.
11895
c57b67fc
PE
11896 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11897 (fontset_from_font): Print it.
11898
8a401434
PE
11899 * frame.c (tty_frame_count): Now printmax_t, not int.
11900 (make_terminal_frame, set_term_frame_name): Print it.
11901 (x_report_frame_params): In X, window IDs are unsigned long,
11902 not signed long, so print them as unsigned.
11903 (validate_x_resource_name): Check for implausibly long names,
11904 and don't assume name length fits in 'int'.
11905 (x_get_resource_string): Don't blindly alloca invocation name;
11906 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11907 not fit in int.
11908
6e1a67fb
PE
11909 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11910 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
11911 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11912
0df02bf3
PE
11913 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11914 Use esprintf, not sprintf, in case result does not fit in int.
11915
48e30793
PE
11916 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11917 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11918 it as a large positive number.
11919 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
11920 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11921
a66ff6d8
PE
11922 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
11923 in case result does not fit in int.
11924
aca216ff
PE
11925 * print.c (float_to_string): Detect width overflow more reliably.
11926 (print_object): Make sprintf buffer a bit bigger, to avoid potential
11927 buffer overrun. Don't assume list length fits in 'int'. Treat
11928 print length of 0 as 0, not as infinity; to be consistent with other
11929 uses of print length in this function. Don't overflow print length
11930 index. Don't assume hash table size fits in 'long', or that
11931 vectorlike size fits in 'unsigned long'.
11932
31c286f7
PE
11933 * process.c (make_process): Use printmax_t, not int, to format
11934 process-name gensyms.
11935
55e5faa1
PE
11936 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
11937
80f2e268
PE
11938 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
11939 to avoid potential buffer overrun.
11940
670741ab
PE
11941 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
11942 if X resource line is longer than 512 bytes.
11943
b7163a50
PE
11944 * xfns.c (x_window): Make sprintf buffer a bit bigger
11945 to avoid potential buffer overrun.
11946
ae58ff1f
PE
11947 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
11948
c43c8a6a
PE
11949 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
11950
3f8236f4
PE
119512011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11952
53e9fe90 11953 Integer overflow fixes for scrolling, etc.
6511acf2
PE
11954 Without these, Emacs silently mishandles large integers sometimes.
11955 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
11956 it were "C-u 1 M-x recenter" on a typical 64-bit host.
11957
6511acf2
PE
11958 * xdisp.c (try_window_id): Check Emacs fixnum range before
11959 converting to 'int'.
806add1d 11960
6511acf2 11961 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
11962 Check that an Emacs fixnum is in range before assigning it to 'int'.
11963 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
11964 values converted from Emacs fixnums.
11965 (Frecenter): Don't wrap around a line count if it is out of 'int'
11966 range; instead, treat it as an extreme value.
11967 (Fset_window_configuration, compare_window_configurations):
11968 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
11969
6511acf2
PE
11970 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
11971 that can exceed INT_MAX. Check that EMACS_INT value is in range
11972 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
11973 (match_limit): Don't assume that a fixnum can fit in 'int'.
11974
6511acf2 11975 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
11976 exceed INT_MAX.
11977
6511acf2 11978 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
11979 (Fvertical_motion): Don't wrap around LINES values that don't fit
11980 in 'int'. Instead, treat them as extreme values. This is good
11981 enough for windows, which can't have more than INT_MAX lines anyway.
11982
fcb901a7
LMI
119832011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11984
0f2f6b6d
LMI
11985 * Require libxml/parser.h to avoid compilation warning.
11986
fcb901a7
LMI
11987 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
11988
11989 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
11990 since this reportedly can destroy thread storage.
11991
6e20a0d4
CY
119922011-08-30 Chong Yidong <cyd@stupidchicken.com>
11993
11994 * syntax.c (find_defun_start): Update all cache variables if
11995 exiting early (Bug#9401).
11996
148ae00e
EZ
119972011-08-30 Eli Zaretskii <eliz@gnu.org>
11998
f6cfbd8f
EZ
11999 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12000
148ae00e
EZ
12001 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12002 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12003 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12004
12005 * term.c (tty_append_glyph): New function.
12006 (produce_stretch_glyph): Static function and its prototype deleted.
12007
a66cfb1c
SM
12008 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12009 Add prototypes.
148ae00e 12010
c4a07a4c
PE
120112011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12012
12013 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12014 when checking :margin (Bug#9390).
12015 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 12016 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
12017 so that the name doesn't mislead. All uses changed.
12018
6bc8cd65
JB
120192011-08-28 Johan Bockgård <bojohan@gnu.org>
12020
12021 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12022 set_tty_hooks.
12023
dca4927e
EZ
120242011-08-27 Eli Zaretskii <eliz@gnu.org>
12025
12026 * xdisp.c (move_it_to): Don't bail out early when reaching
12027 position beyond to_charpos, if we are scanning backwards.
12028 (move_it_vertically_backward): When DY == 0, make sure we get to
12029 the first character in the line after the newline.
12030
f2cad773
PE
120312011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12032
12033 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12034 (ccl_driver): Do not generate an out-of-range pointer.
12035 (Fccl_execute_on_string): Remove unnecessary check for
12036 integer overflow, noted by Stefan Monnier in
12037 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12038 Remove a FIXME that didn't need fixing.
12039 Simplify the newly-introduced buffer reallocation code.
12040
0cae2cdb
JB
120412011-08-27 Juanma Barranquero <lekktu@gmail.com>
12042
12043 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12044
5fc295a4 120452011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 12046
70c60eb2 12047 Integer and memory overflow issues (Bug#9196).
726e0ab1 12048
d31850da
PE
12049 * doc.c (get_doc_string): Rework so that
12050 get_doc_string_buffer_size is the actual buffer size, rather than
12051 being 1 less than the actual buffer size; this makes xpalloc more
12052 convenient.
12053
a69fbedb
PE
12054 * image.c (x_allocate_bitmap_record, cache_image):
12055 * xselect.c (Fx_register_dnd_atom):
12056 Simplify previous changes by using xpalloc.
12057
fe5c5d37
PE
12058 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12059 since either will do and ptrdiff_t is convenient with xpalloc.
12060
0065d054
PE
12061 * charset.c (charset_table_size)
12062 (struct charset_sort_data.priority): Now ptrdiff_t.
12063 (charset_compare): Don't overflow if priorities differ greatly.
12064 (Fsort_charsets): Don't assume list length fits in int.
12065 Check for size-calculation overflow when allocating sort data.
12066 (syms_of_charset): Allocate an initial charset table that is
12067 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12068
12069 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12070
12071 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12072 The actual value is always <= INT_MAX, and leaving it unsigned made
12073 overflow checking harder.
12074
12075 * dispextern.h (struct glyph_matrix.rows_allocated)
12076 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12077 with xpalloc. The values are still always <= INT_MAX.
12078
12079 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12080
12081 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12082 (SAFE_NALLOCA): New macro.
12083
12084 * region-cache.c (struct boundary.pos, find_cache_boundary)
12085 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12086 (set_cache_region, invalidate_region_cache)
12087 (revalidate_region_cache, know_region_cache, region_cache_forward)
12088 (region_cache_backward, pp_cache):
12089 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12090 so that ptrdiff_t * can be passed to xpalloc.
12091 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12092 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12093 (pp_cache): Don't assume cache_len fits in int.
12094 * region-cache.h: Adjust extern decls to match.
12095
12096 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12097 EMACS_INT, since either will do, for xpalloc.
12098
12099 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12100 (xnmalloc, xnrealloc, xpalloc): New functions.
12101
726e0ab1
PE
12102 * bidi.c (bidi_shelve_header_size): New constant.
12103 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12104 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12105
51f30bc5 12106 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
12107 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12108 (overlay_strings):
12109 Don't update size of array until after memory allocation succeeds,
12110 because xmalloc/xrealloc may not return.
0065d054
PE
12111 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12112 now that we have proper integer overflow checking.
12113 (record_overlay_string, overlay_strings): Catch overflows when
12114 calculating size of overlay_str_buf.
726e0ab1 12115
0065d054
PE
12116 * callproc.c (Fcall_process): Check for size overflow when
12117 calculating size of args2.
12118 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12119 Normally we prefer signed values, but sticking with ptrdiff_t would
12120 require adding more-complicated checks.
726e0ab1
PE
12121
12122 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12123 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12124 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 12125 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
12126
12127 * character.c (Fstring): Check for size-calculation overflow.
12128
12129 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12130 unnecessary integer overflow. Check for size overflow.
12131 (encode_coding_object): Don't update size until xmalloc succeeds.
12132
12133 * composite.c (get_composition_id): Check for overflow in glyph
12134 length calculations.
12135
12136 Integer and memory overflow fixes for display code.
12137 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12138 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12139 (scrolling_window): Check for overflow in size calculations.
12140 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12141 Don't assume glyph table len fits in int.
12142 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12143 (row_table_size): Now ptrdiff_t, not int.
12144 (scrolling_window): Avoid overflow in size calculations.
12145 Don't update size until allocation succeeds.
12146 * fns.c (concat): Check for overflow in size calculations.
12147 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12148 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12149 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12150
12151 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12152 (get_doc_string): Check for size calculation overflow.
12153 Don't update size until allocation succeeds.
12154 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12155 EMACS_INT, where ptrdiff_t will do.
12156 (Fsubstitute_command_keys): Check for string overflow.
12157
12158 * editfns.c (set_time_zone_rule): Don't assume environment length
12159 fits in int.
12160 (message_length): Now ptrdiff_t, not int.
12161 (Fmessage_box): Don't update size until allocation succeeds.
12162 Don't assume message length fits in int.
12163 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12164
0065d054
PE
12165 * emacs.c (main): Do not reallocate argv, since there is a null at
12166 the end that can be overwritten, and this way there's no need to
12167 worry about size-calculation overflow.
12168 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
12169
12170 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12171 alloc succeeds.
12172 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12173
12174 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12175 (x_set_scroll_bar_width, x_figure_window_size):
12176 Check for integer overflow.
12177 (x_set_alpha): Do not assume XINT fits in int.
12178
12179 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12180 This is for the members text_lines, text_cols, total_lines, total_cols,
12181 where the system imposes an 'int' limit.
12182
12183 * fringe.c (Fdefine_fringe_bitmap):
12184 Don't update size until alloc works.
12185
12186 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12187 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12188
12189 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12190 Check for size-calculation overflow.
12191 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12192 do, as we prefer signed integers.
12193 (id_to_widget.max_size, id_to_widget.used)
12194 (xg_store_widget_in_map, xg_remove_widget_from_map)
12195 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12196 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12197 Use and return ptrdiff_t, not int.
12198 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12199 * gtkutil.h: Change prototypes to match the above.
12200
12201 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12202 are duplicate now that they've been promoted to lisp.h.
12203 (x_allocate_bitmap_record, x_alloc_image_color)
12204 (make_image_cache, cache_image, xpm_load):
12205 Don't update size until alloc is done.
12206 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12207 (x_detect_edges):
3256efce 12208 Check for size calculation overflow.
726e0ab1
PE
12209 (ct_colors_allocated_max): New constant.
12210 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12211 overflow.
3256efce 12212
726e0ab1
PE
12213 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12214 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12215 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12216 Use ptrdiff_t, not int, to count maps.
12217 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
12218 calculations. Don't update size until allocation succeeds.
12219 Redo calculations to avoid overflow.
726e0ab1
PE
12220 * keyboard.h: Change prototypes to match the above.
12221
12222 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12223 to count maps.
12224 (current_minor_maps): Check for size calculation overflow.
12225 * keymap.h: Change prototypes to match the above.
12226
12227 * lread.c (read1, init_obarray): Don't update size until alloc done.
12228
12229 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12230 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12231
726e0ab1
PE
12232 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12233 Now ptrdiff_t, not int.
12234 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12235 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12236
12237 * process.c (Fnetwork_interface_list): Check for overflow
12238 in size calculation.
12239
12240 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12241
12242 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12243 overflow. Don't bother calling xmalloc when xrealloc will do.
12244
12245 * search.c (Freplace_match): Check for size calculation overflow.
12246 (Fset_match_data): Don't assume list lengths fit in 'int'.
12247
12248 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12249 for command line length. Do not attempt to address one before the
12250 beginning of an array, as that's not portable.
12251
12252 * term.c (max_frame_lines): Remove; unused.
12253 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12254 not int.
12255 (encode_terminal_code, calculate_costs): Check for size
12256 calculation overflow.
12257 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12258 table lengths and related sizes. Don't update size until alloc
12259 done. Redo calculations to avoid overflow.
12260 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12261
12262 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12263 subtracting pointers.
12264 (gobble_line): Check for overflow more carefully. Don't update size
12265 until alloc done.
12266
12267 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12268 Don't update size until alloc done.
12269 Redo size calculations to avoid overflow.
12270 Check for size calculation overflow.
0065d054 12271 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
12272
12273 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12274 Use ptrdiff_t, not int, for sizes.
12275 (store_mode_line_noprop_char): Don't update size until alloc done.
12276
0065d054
PE
12277 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12278 Use ptrdiff_t, not int, for sizes.
12279 (Finternal_make_lisp_face, cache_face):
12280 Check for size calculation overflow.
12281 (cache_face): Treat size calculation overflows as if they were
12282 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
12283
12284 * xfns.c (x_encode_text, x_set_name_internal)
12285 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12286 sizes, since they can exceed INT_MAX in size. Check for size
12287 calculation overflow.
12288
0065d054
PE
12289 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12290 (xg_select): Check for size calculation overflow.
726e0ab1
PE
12291 Don't update size until alloc done.
12292
0065d054 12293 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 12294 as sprintf is limited to int lengths.
1d526e2f 12295
252c5ee1
PE
12296 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12297 (X_LONG_MIN): New macros.
864d7ce7
PE
12298 Use them to make the following changes clearer.
12299 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12300 This change doesn't affect the value now, but it may help remind
12301 future maintainers not to raise the value too much later.
12302 (SELECTION_QUANTUM): Remove, replacing with ...
12303 (selection_quantum): ... new function, which avoids overflow.
12304 All uses changed.
12305 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12306 assumption that selection length fits in 'int'.
12307 (x_reply_selection_request, x_handle_selection_request)
12308 (x_get_window_property, receive_incremental_selection)
12309 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12310 (lisp_data_to_selection_data, clean_local_selection_data):
12311 Use ptrdiff_t, not int, to record length of selection.
12312 (x_reply_selection_request, x_get_window_property)
12313 (receive_incremental_selection, x_property_data_to_lisp):
12314 Redo calculations to avoid overflow.
12315 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 12316 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
12317 something.
12318 (x_get_window_property, receive_incremental_selection)
12319 (lisp_data_to_selection_data, x_property_data_to_lisp):
12320 Check for size-calculation overflow.
12321 (x_get_window_property, receive_incremental_selection)
12322 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12323 Don't store size until memory allocation succeeds.
12324 (x_get_window_property): Plug memory leak on memory exhaustion.
12325 Don't double-block input; malloc is safe here. Don't assume 2**34
12326 - 4 fits in unsigned long. Add an xassert to check
12327 XGetWindowProperty overflow. Be more careful about overflow
12328 calculations, and distinguish size from memory overflow better.
12329 (receive_incremental_selection): When tracing, don't assume
12330 unsigned int is less than INT_MAX.
12331 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12332 harmful) conversions of unsigned short to int.
12333 (lisp_data_to_selection_data): Don't assume that integers
12334 in the range -65535 through -1 fit in an X unsigned short.
12335 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12336 result parameters unless successful. Rely on cons_to_unsigned
12337 to report problems with elements; the old code wasn't right anyway.
12338 (x_check_property_data): Check for int overflow; we cannot use
12339 a wider type due to X limits.
12340 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12341
726e0ab1 12342 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 12343
0065d054
PE
12344 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12345 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
12346 (x_color_cells): Don't store size until memory allocation succeeds.
12347 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 12348 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
12349 (x_term_init): Don't assume length fits in int (sprintf is limited
12350 to int size).
bc18e09d 12351
ebfa62c0
PE
12352 Use ptrdiff_t for composition IDs.
12353 * character.c (lisp_string_width):
12354 * composite.c (composition_table_size, n_compositions)
12355 (get_composition_id, composition_gstring_from_id):
12356 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12357 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12358 * window.c (Frecenter):
12359 Use ptrdiff_t, not int, for composition IDs.
12360 * composite.c (get_composition_id): Check for integer overflow.
12361 * composite.h: Adjust prototypes to match the above changes.
12362
d3411f89
PE
12363 Use ptrdiff_t for hash table indexes.
12364 * category.c (hash_get_category_set):
12365 * ccl.c (ccl_driver):
12366 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12367 * coding.c (coding_system_charset_list, detect_coding_system):
12368 * coding.h (struct coding_system.id):
12369 * composite.c (get_composition_id, gstring_lookup_cache):
12370 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12371 * image.c (xpm_get_color_table_h):
12372 * lisp.h (hash_lookup, hash_put):
12373 * minibuf.c (Ftest_completion):
12374 Use ptrdiff_t for hash table indexes, not int (which is too
12375 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12376 32-bit --with-wide-int hosts).
12377
e097a6fa
PE
12378 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12379 Add a FIXME comment about memory leaks.
12380 (syms_of_charset): Don't assume xmalloc returns.
12381
5637687f
PE
12382 Don't assume that stated character widths fit in int.
12383 * character.c (Fchar_width, c_string_width, lisp_string_width):
12384 * character.h (CHAR_WIDTH):
12385 * indent.c (MULTIBYTE_BYTES_WIDTH):
12386 Use sanitize_char_width to avoid undefined and/or bad behavior
12387 with outlandish widths.
a66cfb1c 12388 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
12389 now that we have two such functions. All uses changed.
12390 (sanitize_char_width): New inline function.
12391
a2271ba2
PE
12392 Don't assume that tab-width fits in int.
12393 * character.h (sanitize_width): New inline function.
12394 (SANE_TAB_WIDTH): New macro.
12395 (ASCII_CHAR_WIDTH): Use it.
12396 * indent.c (sane_tab_width): Remove. All uses replaced by
12397 SANE_TAB_WIDTH (current_buffer).
12398 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12399
18c52557
PE
12400 * fileio.c: Integer overflow issues with file modes.
12401 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12402
caeeedc1
PE
12403 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12404 Remove unreachable code.
12405 (read_hex, load_charset_map_from_file): Check for integer overflow.
12406
6df6ae42 12407 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12408 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12409 (x_send_scroll_bar_event): Likewise. Check that the size does not
12410 exceed limits imposed by XClientMessageEvent, as well as the usual
12411 ptrdiff_t and size_t limits.
12412
b13995db
PE
12413 * keyboard.c: Overflow, signedness and related fixes.
12414 (make_lispy_movement): Use same integer type in forward decl
12415 that is used in the definition.
12416 (read_key_sequence, keyremap_step):
12417 Change bufsize argument back to int, undoing my 2011-03-30 change.
12418 We prefer signed types, and int is wide enough here.
12419 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12420 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12421 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12422 length, not size_t. Use ptrdiff_t for index, not int.
12423 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12424 possibility of integer overflow.
12425
13464394
PE
12426 Overflow, signedness and related fixes for images.
12427
12428 * dispextern.h (struct it.stack[0].u.image.image_id)
12429 (struct_it.image_id, struct image.id, struct image_cache.size)
12430 (struct image_cache.used, struct image_cache.ref_count):
12431 * gtkutil.c (update_frame_tool_bar):
12432 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12433 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12434 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12435 * nsmenu.m (update_frame_tool_bar):
12436 * xdisp.c (calc_pixel_width_or_height):
12437 * xfns.c (image_cache_refcount):
12438 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12439 on typical 64-bit hosts.
12440
12441 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12442 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12443 Omit unnecessary casts to int.
12444 (parse_image_spec): Check that integers fall into 'int' range
12445 when the callers expect that.
12446 (image_ascent): Redo ascent calculation to avoid int overflow.
12447 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12448 (lookup_image): Remove unnecessary tests.
12449 (xbm_image_p): Locals are now of int, not EMACS_INT,
12450 since parse_image_check makes sure they fit into int.
12451 (png_load, gif_load, svg_load_image):
12452 Prefer int to unsigned where either will do.
12453 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12454 old tiff_error_handler and tiff_warning_handler.
12455 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12456 stack buffer overflows. It uses only the features of vsnprintf
12457 that are common to both POSIX and native Microsoft.
12458 (tiff_error_handler, tiff_warning_handler): Use it.
12459 (tiff_load, gif_load, imagemagick_load_image):
12460 Don't assume :index value fits in 'int'.
12461 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12462 (imagemagick_load_image): Check that crop parameters fit into
12463 the integer types that MagickCropImage accepts. Don't assume
12464 Vimagemagick_render_type has a nonnegative value. Don't assume
12465 size_t fits in 'long'.
12466 (gs_load): Use printmax_t to print the widest integers possible.
12467 Check for integer overflow when computing image height and width.
12468
c11821d4
EZ
124692011-08-26 Eli Zaretskii <eliz@gnu.org>
12470
12471 * xdisp.c (redisplay_window): Don't force window start if point
12472 will be invisible in the resulting window. (Bug#9324)
12473
0c95fcf7
EZ
124742011-08-25 Eli Zaretskii <eliz@gnu.org>
12475
12476 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12477 the display spec is of the form `(space ...)'.
12478 (handle_display_spec): Return the value returned by
12479 handle_single_display_spec, not just 1 or zero.
12480 (handle_single_display_spec): If the display spec is of the form
12481 `(space ...)', and specifies display in the text area, return 2
12482 rather than 1.
fee65a97 12483 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12484 accurately, and prefer exact match for point under bidi.
12485 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12486
12487 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12488 into disp_prop; all users changed.
12489
12490 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12491 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12492 for the text covered by the display property.
12493
e4ed06f1
CY
124942011-08-25 Chong Yidong <cyd@stupidchicken.com>
12495
12496 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12497 Change return value to nil.
12498 (Frecord_buffer): Delete unused function.
12499
f67cdd7f
EZ
125002011-08-24 Eli Zaretskii <eliz@gnu.org>
12501
5980d4c6
EZ
12502 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12503 buffers, return left-to-right.
8610fe8b
EZ
12504 (set_cursor_from_row): Consider candidate row a win if its glyph
12505 represents a newline and point is on that newline. Fixes cursor
12506 positioning on the newline at EOL of R2L text within L2R
12507 paragraph, and vice versa.
12508 (try_cursor_movement): Check continued rows, in addition to
12509 continuation rows. Fixes unwarranted scroll when point enters a
12510 continued line of R2L text within an L2R paragraph, or vice versa.
12511 (cursor_row_p): Consider the case of point being equal to
12512 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12513 from the end of a short line to the beginning of a continued line
12514 of R2L text within L2R paragraph.
12515 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12516 composed characters.
5980d4c6 12517
f67cdd7f
EZ
12518 * bidi.c (bidi_check_type): Use xassert.
12519 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12520 members.
12521
bca633fb
EZ
125222011-08-23 Eli Zaretskii <eliz@gnu.org>
12523
12524 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12525 a character.
12526
4a5885a7
CY
125272011-08-23 Chong Yidong <cyd@stupidchicken.com>
12528
12529 * nsfont.m (ns_otf_to_script): Fix typo.
12530
0902a04e
KH
125312011-08-22 Kenichi Handa <handa@m17n.org>
12532
12533 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12534 extra slot even if the purpose is char-code-property-table.
12535
1a2e6670
EZ
125362011-08-23 Eli Zaretskii <eliz@gnu.org>
12537
8ddde651
EZ
12538 * xdisp.c (redisplay_window): When computing centering_position,
12539 account for the height of the header line. (Bug#8874)
12540
425cc014
EZ
12541 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12542 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12543 candidate is selected by the mouse, and that candidate has a
12544 composed character under the mouse.
12545
1a2e6670
EZ
12546 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12547 coordinates reported by pos-visible-in-window-p for a composed
12548 character in column zero.
12549
8b76d6f8
SM
125502011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12551
12552 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12553
dac347dd
EZ
125542011-08-22 Eli Zaretskii <eliz@gnu.org>
12555
12556 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12557 consider it a hit if to_charpos is anywhere in the range of the
12558 composed buffer positions.
12559
e013fb34
CY
125602011-08-22 Chong Yidong <cyd@stupidchicken.com>
12561
12562 * image.c (gif_load): Don't assume that each subimage has the same
12563 dimensions as the base image. Handle disposal method that is
12564 "undefined" by the gif spec (Bug#9335).
12565
bd1ba3e8
CY
125662011-08-20 Chong Yidong <cyd@stupidchicken.com>
12567
12568 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12569 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12570
54a1215b
EZ
125712011-08-19 Eli Zaretskii <eliz@gnu.org>
12572
823564e5
EZ
12573 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12574 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12575 from an Org mode buffer to a Speedbar frame.
12576
54a1215b
EZ
12577 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12578 a composition, take its buffer position from IT->cmp_it.charpos.
12579 Fixes cursor positioning at the beginning of a line that begins
12580 with a composed character.
12581
9778ebcc
EZ
125822011-08-18 Eli Zaretskii <eliz@gnu.org>
12583
0be6ee06
EZ
12584 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12585 character bidirectional type, use STRONG_L instead. Fixes crashes
12586 in a buffer produced by `describe-categories'.
12587
9778ebcc
EZ
12588 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12589 members before the level stack, so they would be saved and
12590 restored when copying iterator state. Fixes incorrect reordering
12591 around TABs covered by display properties.
12592
156bffbe
AS
125932011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12594
6b02f655 12595 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12596
72ad093b
CY
125972011-08-17 Chong Yidong <cyd@stupidchicken.com>
12598
12599 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12600 (internal_condition_case_2, internal_condition_case_n):
12601 Remove unnecessary aborts (Bug#9081).
72ad093b 12602
35774242
EZ
126032011-08-17 Eli Zaretskii <eliz@gnu.org>
12604
12605 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12606 has no `load' handler, try opening the file locally. (Bug#9311)
12607
db76dd85
KB
126082011-08-16 Ken Brown <kbrown@cornell.edu>
12609
12610 * gmalloc.c: Expand comment.
12611
b215eee5
EZ
126122011-08-16 Eli Zaretskii <eliz@gnu.org>
12613
12614 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12615 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12616
a4579d33
KB
126172011-08-16 Ken Brown <kbrown@cornell.edu>
12618
12619 Fix memory allocation problems in Cygwin build (Bug#9273).
12620
12621 * unexcw.c ( __malloc_initialized): Declare external variable.
12622 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12623
8b76d6f8
SM
12624 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12625 New variables.
a4579d33
KB
12626 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12627 dumped emacs.
12628 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12629 in the static heap.
12630 [CYGWIN] (special_realloc): New function.
12631 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12632 requests to realloc storage in the static heap.
12633
3ebec551
PE
126342011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12635
12636 * bidi.c (bidi_initialize): Remove unused local.
12637
9fd8be00
EZ
126382011-08-15 Eli Zaretskii <eliz@gnu.org>
12639
6b02f655
SM
12640 * bidimirror.h:
12641 * biditype.h: Remove file.
12642 * makefile.w32-in ($(BLD)/bidi.$(O)):
12643 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12644
12645 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12646
12647 * chartab.c: Improve commentary for the uniprop_table API.
12648
32413314
EZ
12649 * bidi.c (bidi_paragraph_init): Support zero value of
12650 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12651 (bidi_initialize): Use uniprop_table instead of including
12652 biditype.h and bidimirror.h.
32413314 12653
9fd8be00
EZ
12654 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12655 coordinates of the iterator when restoring from ppos_it.
12656 (Bug#9296)
12657
5cf2b69b
KH
126582011-08-14 Kenichi Handa <handa@m17n.org>
12659
12660 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12661 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12662
daf17d00
EZ
126632011-08-14 Eli Zaretskii <eliz@gnu.org>
12664
12665 * xdisp.c (move_it_in_display_line_to): Don't invoke
12666 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12667 ppos_it. Fixes vertical cursor motion when line beginning is
12668 covered by an image. (Bug#9296)
12669
08e3161a
JD
126702011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12671
12672 * nsterm.h (ns_run_ascript): Declare.
12673 (NSAPP_DATA2_RUNASSCRIPT): Define.
12674
12675 * nsfns.m (as_script, as_result, as_status): New static variables.
12676 (ns_run_ascript): New function.
5e617bc2 12677 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12678 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12679 the event loop. Get status from as_status (Bug#7276).
12680
12681 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12682 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12683 the event loop (Bug#7276).
12684
a3720aa2
AS
126852011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12686
12687 * gnutls.c (QCgnutls_bootprop_priority)
12688 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12689 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12690 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12691 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12692 (QCgnutls_bootprop_verify_hostname_error)
12693 (QCgnutls_bootprop_callbacks_verify): Rename from
12694 Qgnutls_bootprop_..., all uses changed.
12695
12696 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12697 uses changed.
12698
0a0d27fb
PE
126992011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12700
19d5c50c
PE
12701 * xfaces.c (Qframe_set_background_mode): Now static.
12702 * dispextern.h (Qframe_set_background_mode): Remove decl.
12703
0a0d27fb
PE
12704 * process.c (Fnetwork_interface_info): Declare local only if needed.
12705
377538cb
JD
127062011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12707
12708 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12709 (Fnetwork_interface_list): Allocate in increments of bytes instead
12710 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12711 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12712 sockaddr.
12713 (struct ifflag_def): notrailers is smart on OSX.
12714 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12715 Get hardware address with getifaddrs if available.
12716
08fff70c
EZ
127172011-08-12 Eli Zaretskii <eliz@gnu.org>
12718
12719 * xdisp.c (iterate_out_of_display_property): xassert that
12720 IT->position is set to within IT->object's boundaries. Break from
12721 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12722 when IT->position is set up wrongly due to some bug.
12723 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12724 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12725 entry. Force push_it to save on the stack the current
12726 buffer/string position, to be restored by pop_it. Fix flags in
12727 the iterator structure wrt the object coming from a display
12728 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12729 properties. (Bug#9284)
12730
7be1c708 127312011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12732
7be1c708
CY
12733 * fontset.c (fontset_get_font_group): Add proper type checks.
12734 (Bug#9172)
aac0c6e3 12735
7be1c708 127362011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12737
7be1c708
CY
12738 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12739 and LC_VERSION_MIN_MACOSX.
12740 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12741 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12742
97bb72a6
EZ
127432011-08-08 Eli Zaretskii <eliz@gnu.org>
12744
12745 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12746 no-display-properties-and-no-overlays under bidi display.
12747 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12748 properties and overlays.
97bb72a6 12749
d5617611
CY
127502011-08-08 Chong Yidong <cyd@stupidchicken.com>
12751
37e11a63
CY
12752 * editfns.c (Fset_time_zone_rule): Document relationship with the
12753 setenv function.
12754
d5617611
CY
12755 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12756 the font entity extracted from the cache (Bug#8109).
12757
58872834
CY
127582011-08-07 Chong Yidong <cyd@stupidchicken.com>
12759
12760 * composite.c (autocmp_chars): Don't reset point. That is done by
12761 restore_point_unwind (Bug#5984).
12762
75bfc667
JL
127632011-08-07 Juri Linkov <juri@jurta.org>
12764
12765 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12766 to show the arg `TIME' instead of `TIMEVAL'.
12767
d1410150
EZ
127682011-08-06 Eli Zaretskii <eliz@gnu.org>
12769
12770 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12771 display property strides EOL and includes a newline, as in
12772 longlines-mode. (Bug#9254)
75b771e4
EZ
12773 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12774 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12775
12776 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12777 is non-zero, even if the data buffer is NULL. Fixes a crash in
12778 vertical-motion with longlines-mode. (Bug#9254)
12779
35928349
EZ
127802011-08-05 Eli Zaretskii <eliz@gnu.org>
12781
ec7cc85b
EZ
12782 * bidi.c <bidi_cache_total_alloc>: Now static.
12783 (bidi_initialize): Initialize bidi_cache_total_alloc.
12784
8b76d6f8 12785 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12786 cache. (Bug#9221)
12787
12788 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12789 amount allocated this far in `bidi_cache_total_alloc'.
12790 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12791 non-zero, only free the data buffer without restoring the cache
12792 contents. All callers changed.
12793
12794 * dispextern.h (bidi_unshelve_cache): Update prototype.
12795
12796 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12797 (move_it_in_display_line, move_it_to)
12798 (move_it_vertically_backward, move_it_by_lines): Replace the call
12799 to xfree to an equivalent call to bidi_unshelve_cache.
12800 (move_it_in_display_line_to): Fix logic of returning
412b6358 12801 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12802
e2e2423b
EZ
128032011-08-05 Eli Zaretskii <eliz@gnu.org>
12804
12805 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12806 came from a string character with a `cursor' property. (Bug#9229)
12807
ae9e757a
JD
128082011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12809
12810 * Makefile.in (LIB_PTHREAD): New variable.
12811 (LIBES): Add LIB_PTHREAD (Bug#9216).
12812
12813 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12814 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12815
213bd7f2
AS
128162011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12817
6b02f655 12818 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12819
99aaf75f
JD
128202011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12821
12822 * xterm.c (x_find_topmost_parent): New function.
12823 (x_set_frame_alpha): Find topmost parent window with
12824 x_find_topmost_parent and set the property there also (bug#9181).
12825 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12826
c74e9d86
PE
128272011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 * callproc.c (Fcall_process): Avoid vfork clobbering
12830 the local vars buffer, coding_systems, current_dir.
12831
640c8776
SM
128322011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12833
12834 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12835
f26d0e4c
PE
128362011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12837
8a10d76c
PE
12838 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12839 so that it is not optimized away.
12840
f26d0e4c
PE
12841 * xdisp.c (compute_display_string_pos): Remove unused local.
12842
55439c61
EZ
128432011-08-02 Eli Zaretskii <eliz@gnu.org>
12844
12845 Fix slow cursor motion and scrolling in large buffers with
12846 selective display, like Org Mode buffers. (Bug#9218)
12847
12848 * dispextern.h (struct bidi_it): New member disp_prop_p.
12849
12850 * xdisp.c: Remove one-slot cache of display string positions.
12851 (compute_display_string_pos): Accept an additional argument
5e617bc2 12852 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12853 for a display string or property. If found, set DISP_PROP_P
12854 non-zero.
12855
12856 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12857 DISP_PROP_P, and pass it to compute_display_string_pos.
12858 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12859 non-zero. All callers of bidi_fetch_char changed.
12860
fb33fa43
SM
128612011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12862
12863 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12864
b099e063
DM
128652010-12-03 Don March <don@ohspite.net>
12866
12867 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12868 last character M-[char] is translated to ESC [char] (bug#7541).
12869
5cc7f7af
KH
128702011-08-02 Kenichi Handa <handa@m17n.org>
12871
d0fffa3f 12872 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
12873
12874 * chartab.c (uniprop_table): Make it non-static.
12875
525d5e6e
EZ
128762011-08-01 Eli Zaretskii <eliz@gnu.org>
12877
12878 * xdisp.c (forward_to_next_line_start): Accept additional argument
12879 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12880 on the newline.
12881 (reseat_at_next_visible_line_start): Use the bidi iterator state
12882 returned by forward_to_next_line_start to restore the state of
12883 it->bidi_it after backing up to previous newline. (Bug#9212)
12884
31011111
AS
128852011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12886
12887 * regex.c (re_comp): Protoize.
12888 (re_exec): Fix return type.
12889 (regexec): Fix type of `ret'. (Bug#9203)
12890
476371c4
PE
128912011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12892
e5d76069
PE
12893 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12894 This is needed if max-image-size is a floating-point number.
12895
9a79b20c
AS
128962011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12897
12898 * print.c (print_object): Print empty symbol as ##.
12899
12900 * lread.c (read1): Read ## as empty symbol.
12901
d8c2fa78
AA
129022011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12903
12904 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12905 setting frame foreground color (Bug#9175).
12906 (x_set_background_color): Likewise.
12907
ffe57a7a
AA
12908 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12909 contents (Bug#9176).
12910 (EmacsTooltip -init): Remove bezels and add shadows to
12911 tooltip windows.
12912
bf3492a5
AA
12913 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12914 or scroll bar (Bug#8470).
12915
d55e9c53
AA
12916 * nsfont.m (nsfont_open): Remove assignment to voffset and
12917 unnecessary vars hshink, expand, hd, full_height, min_height.
12918 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12919
12920 * nsterm.h (nsfont_info): Remove voffset field.
12921
d8c2fa78 129222011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
12923
12924 Implement strike-through and overline on NextStep (Bug#8863).
12925
12926 * nsfont.m (nsfont_open): Use underline position provided by font,
12927 instead of hard-coded value of 2.
12928 (nsfont_draw): Call ns_draw_text_decoration instead.
12929
12930 * nsterm.h: Add declaration for ns_draw_text_decoration.
12931
12932 * nsterm.m (ns_draw_text_decoration): New function for drawing
12933 underline, overline, and strike-through.
12934 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
12935 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 12936 accommodate underlining, etc.
4843aac3 12937
4cc60b9b
EZ
129382011-07-28 Eli Zaretskii <eliz@gnu.org>
12939
bc7ece87
EZ
12940 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
12941 default.
4cc60b9b 12942
476371c4
PE
129432011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12944
66606eea
PE
12945 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
12946 Without this fix, if a signal arrives just after memory fills up,
12947 'malloc' might be invoked reentrantly.
12948
476371c4
PE
12949 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
12950 In other words, assume that every image size is allowed, on non-X
12951 hosts. This assumption is probably wrong, but it lets Emacs compile.
12952
f3fcc40d
AS
129532011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12954
12955 * regex.c (re_iswctype): Convert return values to boolean.
12956
350c992f
EZ
129572011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
12958
12959 * xdisp.c (compute_display_string_pos): Don't use cached display
12960 string position if the buffer had its restriction changed.
12961 (Bug#9184)
12962
5266b4bb
PE
129632011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12964
12965 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12966
2573a837 129672011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 12968
41f55ccd 12969 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 12970
39e378da
PE
12971 * bidi.c: Integer size and overflow fixes.
12972 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
12973 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
12974 (bidi_cache_find_level_change, bidi_cache_ensure_space)
12975 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
12976 (bidi_find_other_level_edge):
12977 Use ptrdiff_t instead of EMACS_INT where either will do.
12978 This works better on 32-bit hosts configured --with-wide-int.
12979 (bidi_cache_ensure_space): Check for size-calculation overflow.
12980 Use % rather than repeated addition, for better worst-case speed.
12981 Don't set bidi_cache_size until after xrealloc returns, because it
12982 might not return.
12983 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
12984 (bidi_cache_ensure_space): Also check that the bidi cache size
12985 does not exceed that of the largest Lisp string or buffer. See Eli
12986 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 12987
5e927815
PE
12988 * alloc.c (__malloc_size_t): Remove.
12989 All uses replaced by size_t. See Andreas Schwab's note
12990 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
12991
ca4aa935
PE
12992 * image.c: Improve checking for integer overflow.
12993 (check_image_size): Assume that f is nonnull, since
12994 it is always nonnull in practice. This is one less thing to
12995 worry about when checking for integer overflow later.
12996 (x_check_image_size): New function, which checks for integer
12997 overflow issues inside X.
12998 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
12999 This removes the need for a memory_full check.
13000 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13001 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13002 (xbm_read_bitmap_data): Change locals back to 'int', since
13003 their values must fit in 'int'.
13004 (xpm_load_image, png_load, tiff_load):
13005 Invoke x_create_x_image_and_pixmap earlier,
13006 to avoid much needless work if the image is too large.
13007 (tiff_load): Treat overly large images as if
13008 x_create_x_image_and_pixmap failed, not as malloc failures.
13009 (gs_load): Use x_check_image_size.
13010
5f8f9cc2
PE
13011 * gtkutil.c: Omit integer casts.
13012 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13013 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13014
5adf60bc
PE
13015 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13016
c8907a93
PE
13017 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13018 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13019 would wrongly return t on a 64-bit host.
13020
e3c25c68
PE
13021 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13022 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13023 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13024 and therefore cause GCC to emit a bogus diagnostic in some cases.
13025
3f791afe
PE
13026 * image.c: Integer signedness and overflow and related fixes.
13027 This is not an exhaustive set of fixes, but it's time to
13028 record what I've got.
13029 (lookup_pixel_color, check_image_size): Remove redundant decls.
13030 (check_image_size): Don't assume that arbitrary EMACS_INT values
13031 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13032 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13033 (tiff_load, imagemagick_load_image):
13034 Check for overflow in size calculations.
13035 (x_create_x_image_and_pixmap): Remove unnecessary test for
13036 xmalloc returning NULL; that can't happen.
13037 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13038 (xpm_color_bucket): Use better integer hashing function.
13039 (xpm_cache_color): Don't possibly over-allocate memory.
13040 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13041 (gif_memory_source):
13042 Use ptrdiff_t, not int or size_t, to record sizes.
13043 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13044 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13045 either works, as we prefer signed integers.
13046 (tiff_read_from_memory, tiff_write_from_memory):
13047 Return tsize_t, not size_t, since that's what the TIFF API wants.
13048 (tiff_read_from_memory): Don't fail simply because the read would
13049 go past EOF; instead, return a short read.
13050 (tiff_load): Omit no-longer-needed casts.
13051 (Fimagemagick_types): Don't assume size fits into 'int'.
13052
3cc5a532
PE
13053 Improve hashing quality when configured --with-wide-int.
13054 * fns.c (hash_string): New function, taken from sxhash_string.
13055 Do not discard information about ASCII character case; this
13056 discarding is no longer needed.
13057 (sxhash-string): Use it. Change sig to match it. Caller changed.
13058 * lisp.h: Declare it.
13059 * lread.c (hash_string): Remove, since we now use fns.c's version.
13060 The fns.c version returns a wider integer if --with-wide-int is
13061 specified, so this should help the quality of the hashing a bit.
13062
b312a492
PE
13063 * emacs.c: Integer overflow minor fix.
13064 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13065 Define only if GNU_LINUX.
13066 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13067
dfd153ae
PE
13068 * dispnew.c: Integer signedness and overflow fixes.
13069 Remove unnecessary forward decls, that were a maintenance hassle.
13070 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13071 All uses changed.
13072 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13073 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13074 (prepare_desired_row, line_draw_cost):
13075 Use int, not unsigned, where either works.
13076 (save_current_matrix, restore_current_matrix):
13077 Use ptrdiff_t, not size_t, where either works.
13078 (init_display): Check for overflow more accurately, and without
13079 relying on undefined behavior.
13080
a81d11a3
PE
13081 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13082 Remove, replacing with the new symbols in lisp.h. All uses changed.
13083 * fileio.c (make_temp_name):
13084 * filelock.c (lock_file_1, lock_file):
13085 * xdisp.c (message_dolog):
13086 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13087 Use pMd etc. instead.
13088 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13089 replacing the pWIDE etc. symbols removed from editfns.c.
13090
3300e6fd
PE
13091 * keyboard.h (num_input_events): Now uintmax_t.
13092 This is (very slightly) less likely to mess up due to wraparound.
13093 All uses changed.
13094
fd05c7e9
PE
13095 * buffer.c: Integer signedness fixes.
13096 (alloc_buffer_text, enlarge_buffer_text):
13097 Use ptrdiff_t rather than size_t when either will do, as we prefer
13098 signed integers.
13099
903fe15d
PE
13100 * alloc.c: Integer signedness and overflow fixes.
13101 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13102 (__malloc_size_t): Default to size_t, not to int.
13103 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13104 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13105 Prefer ptrdiff_t to size_t when either would do, as we prefer
13106 signed integers.
13107 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13108 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13109 Now const. Initialize with values that are in range even if char
13110 is signed.
13111 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13112 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13113 These functions do the right thing with sizes > 2**32.
13114 (check_depth): Now ptrdiff_t, not int.
13115 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13116 Adjust to new way of storing sizes. Check for size overflow bugs
13117 in rest of code.
13118 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13119 slightly wrong anyway, as it missed one instance of
13120 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13121 (refill_memory_reserve): Omit needless cast to size_t.
13122 (mark_object_loop_halt): Mark as externally visible.
13123
ac82cc6a
PE
13124 * xselect.c: Integer signedness and overflow fixes.
13125 (Fx_register_dnd_atom, x_handle_dnd_message):
13126 Use ptrdiff_t, not size_t, since we prefer signed.
13127 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13128 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13129 x_dnd_atoms_size and x_dnd_atoms_length.
13130
c2d1e36d
PE
13131 * doprnt.c: Prefer signed to unsigned when either works.
13132 * eval.c (verror):
13133 * doprnt.c (doprnt):
13134 * lisp.h (doprnt):
13135 * xdisp.c (vmessage):
13136 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13137 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13138 prefer signed arithmetic to avoid comparison confusion.
13139 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13140 but is a bit tricky.
13141
0e926e56
PE
13142 Assume freestanding C89 headers, string.h, stdlib.h.
13143 * data.c, doprnt.c, floatfns.c, print.c:
13144 Include float.h unconditionally.
13145 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13146 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13147 * regex.c: Likewise for stddef.h, string.h.
13148 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13149 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13150 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13151 (STDC_HEADERS): Remove obsolete defines.
13152 * sysdep.c: Include limits.h unconditionally.
13153
9cfdb3ec
PE
13154 Assume support for memcmp, memcpy, memmove, memset.
13155 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13156 * regex.c (memcmp, memcpy):
13157 Remove; we assume C89 now.
13158
13159 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13160 (__malloc_safe_bcopy): Remove; no longer needed.
13161
cf950e6b 13162 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
13163 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13164 well either way, and we prefer signed to unsigned.
13165
dbf38e02
LMI
131662011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13167
13168 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13169 closes the connection while we're reading (bug#9182).
13170
d6f0886c 131712011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 13172
d6f0886c
JD
13173 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13174 are specified (Bug#9168).
24e0f6b1 13175
2eb1f9e6
PE
131762011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13177
13178 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13179 Found by GCC static checking and --with-wide-int on a 32-bit host.
13180
22381272 131812011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
13182
13183 * xdisp.c (compute_display_string_pos): Fix logic of caching
13184 previous display string position. Initialize cached_prev_pos to
13185 -1. Fixes slow-down at the beginning of a buffer.
13186
f25e39b4
EZ
131872011-07-24 Eli Zaretskii <eliz@gnu.org>
13188
13189 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13190 for attrs[LFACE_FONTSET_INDEX].
13191
04c4b52e
PE
131922011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13193
13194 * xml.c (parse_region): Remove unused local
13195 that was recently introduced.
13196
c1734fbd
EZ
131972011-07-23 Eli Zaretskii <eliz@gnu.org>
13198
be18c5a5
EZ
13199 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13200 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13201
c1734fbd
EZ
13202 * xdisp.c (move_it_in_display_line_to): Record the best matching
13203 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
13204 exit if none of the characters scanned was an exact match.
13205 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
13206 when exact match is impossible due to invisible text, and the
13207 lines are truncated.
13208
a258d627
JD
132092011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13210
13211 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13212 for OSX >= 10.7.
13213
b6d5a689
EZ
132142011-07-22 Eli Zaretskii <eliz@gnu.org>
13215
0f74f785
EZ
13216 Fix a significant slow-down of cursor motion with C-n, C-p,
13217 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13218 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 13219 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
13220 (next_element_from_buffer): Call compute_stop_pos_backwards to
13221 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
13222 base_level_stop.
13223 (reseat): Don't look for prev_stop, as that could mean a very long
13224 run.
13225 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13226 <cached_disp_overlay_modiff>: Cache for last found display string
13227 position.
551918c1 13228 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
13229 about the same buffer in the same area of character positions, and
13230 the buffer wasn't changed since the time the display string
13231 position was cached.
551918c1 13232
b2d0c91a
EZ
132332011-07-22 Eli Zaretskii <eliz@gnu.org>
13234
13235 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13236 is an integer, which is important for empty lines. (Bug#9149)
13237
043604ee
CY
132382011-07-22 Chong Yidong <cyd@stupidchicken.com>
13239
13240 * frame.c (Fmodify_frame_parameters): In tty case, update the
13241 default face if necessary (Bug#4238).
13242
da4adb04
CY
132432011-07-21 Chong Yidong <cyd@stupidchicken.com>
13244
13245 * editfns.c (Fstring_to_char): No need to explain what a character
13246 is in the docstring (Bug#6576).
13247
9abd0532
LMI
132482011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13249
13250 * xml.c (parse_region): Make sure we always return a tree.
13251
36881d16
HK
132522011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13253
13254 * xml.c (parse_region): If a document contains only comments,
13255 return that, too.
13256
1e98674d
LMI
132572011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13258
13259 * xml.c (make_dom): Return comments, too.
13260
590bd467
PE
132612011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13262
13263 Port to OpenBSD.
13264 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13265 and the surrounding thread.
13266 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13267 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13268 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13269 timer goes off.
13270 * s/openbsd.h (BROKEN_SIGIO): Define.
13271 * unexelf.c (unexec) [__OpenBSD__]:
13272 Don't update the .mdebug section of the Alpha COFF symbol table.
13273
f41628b2
LMI
132742011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13275
13276 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13277 (bug#8460).
13278
b59b67c5
PE
132792011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13280
15e3a074
PE
13281 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13282 This fixes some race conditions on the permissions of any newly
13283 created file.
13284
41bed37d
PE
13285 * alloc.c (valid_pointer_p): Use pipe, not open.
13286 This fixes some permissions issues when debugging.
13287
b59b67c5
PE
13288 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13289 If fchown fails to set both uid and gid, try to set just gid,
13290 as that is sometimes allowed. Adjust the file's mode to eliminate
13291 setuid or setgid bits that are inappropriate if fchown fails.
13292
925a6be7
SM
132932011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13294
13295 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13296 to compare Lisp_Objects.
13297 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13298 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13299 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13300
52968808
AS
133012011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13302
0a6a104b
AS
13303 * lread.c (read_integer): Unread even EOF character.
13304 (read1): Likewise. Properly record start position of symbol.
13305
52968808
AS
13306 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13307 symbol character follows.
13308
9e381cdd
PE
133092011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13310
13311 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13312 This works around a problem with the previous change to Fcopy_file.
13313 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13314 and without this change, GCC might complain about discarding
13315 fchown's return value.
13316
b5641435
JB
133172011-07-16 Juanma Barranquero <lekktu@gmail.com>
13318
13319 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13320
a8031457
PE
133212011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13322
13323 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13324
dd889327
LMI
133252011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13326
750c33f7
LMI
13327 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13328 it's used from the C level.
13329
dd889327
LMI
13330 * process.c: Use the same condition for POLL_FOR_INPUT in both
13331 keyboard.c and process.c (bug#1858).
13332
87e86684
LM
133332011-07-09 Lawrence Mitchell <wence@gmx.li>
13334
13335 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13336 (Fgnutls_boot): Use it.
13337
64348f40
AS
133382011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13339
13340 * doc.c (Fsubstitute_command_keys): Revert last change.
13341
1d698799
LMI
133422011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13343
f863868c
LMI
13344 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13345 quotes the next character, and doesn't affect other longer
13346 sequences (bug#8935).
13347
1d698799
LMI
13348 * lread.c (syms_of_lread): Clarify that is isn't only
13349 `eval-buffer' and `eval-defun' that's affected by
13350 `lexical-binding' (bug#8460).
13351
aa4b6df6
EZ
133522011-07-15 Eli Zaretskii <eliz@gnu.org>
13353
13354 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 13355 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 13356
5d856da6
PE
133572011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13358
ad6042bb
PE
13359 Fix minor problems found by static checking.
13360 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13361 (elsz): Now a signed constant, not a size_t var. We prefer signed
13362 types to unsigned, to avoid integer comparison confusion. Without
13363 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13364 "cannot optimize loop, the loop counter may overflow", a symptom
13365 of the confusion.
f00bbb22 13366 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
13367 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13368
6468f31c
LMI
133692011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13370
49080b10
LMI
13371 * search.c (Fre_search_backward): Mention `case-fold-search' in
13372 all the re_search_* functions (bug#8138).
13373
6468f31c
LMI
13374 * keyboard.c (Fopen_dribble_file): Document when the file is
13375 closed (bug#8056).
13376
c965adc5
EZ
133772011-07-14 Eli Zaretskii <eliz@gnu.org>
13378
df9733bf
EZ
13379 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13380 bidi_cache_idx.
13381
0bb23927
EZ
13382 Support bidi reordering of display and overlay strings.
13383 * xdisp.c (compute_display_string_pos)
13384 (compute_display_string_end): Accept additional argument STRING.
13385 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13386 (reseat_to_string): Initialize bidi_it->string.s and
13387 bidi_it->string.schars.
13388 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
13389 NULL (avoids a crash in bidi_paragraph_init).
13390 Initialize itb.string.lstring.
0bb23927
EZ
13391 (init_iterator): Call bidi_init_it only of a valid
13392 buffer position was specified. Initialize paragraph_embedding to
13393 L2R.
13394 (reseat_to_string): Initialize the bidi iterator.
13395 (display_string): If we need to ignore text properties of
13396 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13397 original value of -1 will not work with bidi.)
13398 (compute_display_string_pos): First arg is now struct
13399 `text_pos *'; all callers changed. Support display properties on
13400 Lisp strings.
13401 (compute_display_string_end): Support display properties on Lisp
13402 strings.
13403 (init_iterator, reseat_1, reseat_to_string): Initialize the
13404 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13405 when iterating on a string not from display properties).
640c8776
SM
13406 (compute_display_string_pos, compute_display_string_end):
13407 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13408 arrow keys.
13409 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13410 base_level_stop; instead, set base_level_stop to BEGV.
13411 Fixes crashes in vertical-motion.
0bb23927
EZ
13412 (next_element_from_buffer): Improve commentary for when
13413 the iterator is before prev_stop.
13414 (init_iterator): Initialize bidi_p from the default value of
13415 bidi-display-reordering, not from buffer-local value. Use the
13416 buffer-local value only if initializing for buffer iteration.
13417 (handle_invisible_prop): Support invisible properties on strings
13418 that are being bidi-reordered.
13419 (set_iterator_to_next): Support bidi reordering of C strings and
13420 Lisp strings.
13421 (next_element_from_string): Support bidi reordering of Lisp
13422 strings.
13423 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13424 (display_string): Support display of R2L glyph rows.
13425 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13426 (init_iterator): Don't initialize it->bidi_p for strings
13427 here.
13428 (reseat_to_string): Initialize it->bidi_p for strings here.
13429 (next_element_from_string, next_element_from_c_string)
13430 (next_element_from_buffer): Add xassert's for correspondence
13431 between IT's object being iterated and it->bidi_it.string
13432 structure.
13433 (face_before_or_after_it_pos): Support bidi iteration.
13434 (next_element_from_c_string): Handle the case of the first string
13435 character that is not the first one in the visual order.
13436 (get_visually_first_element): New function, refactored from common
13437 parts of next_element_from_buffer, next_element_from_string, and
13438 next_element_from_c_string.
13439 (tool_bar_lines_needed, redisplay_tool_bar)
13440 (display_menu_bar): Force left-to-right direction. Add a FIXME
13441 comment for making that be controlled by a user option.
13442 (push_it, pop_it): Save and restore the state of the
13443 bidi iterator. Save and restore the bidi_p flag.
13444 (pop_it): Iterate out of display property for string iteration as
13445 well.
13446 (iterate_out_of_display_property): Support iteration over strings.
13447 (handle_single_display_spec): Set up it->bidi_it for iteration
13448 over a display string, and call bidi_init_it.
13449 (handle_single_display_spec, next_overlay_string)
13450 (get_overlay_strings_1, push_display_prop): Set up the bidi
13451 iterator for displaying display or overlay strings.
13452 (forward_to_next_line_start): Don't use the shortcut if
13453 bidi-iterating.
13454 (back_to_previous_visible_line_start): If handle_display_prop
13455 pushed the iterator stack, restore the internal state of the bidi
13456 iterator by calling bidi_pop_it same number of times.
13457 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13458 and we are bidi-iterating, don't decrement the iterator position;
13459 instead, set the first_elt flag in the bidi iterator, to produce
13460 the same effect.
13461 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13462 (push_display_prop): xassert that we are iterating a buffer.
13463 (push_it, pop_it): Save and restore paragraph_embedding member.
13464 (handle_single_display_spec, next_overlay_string)
13465 (get_overlay_strings_1, reseat_1, reseat_to_string)
13466 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13467 correctly. Don't assume unibyte strings are not bidi-reordered.
13468 (compute_display_string_pos)
13469 (compute_display_string_end): Fix handling the case of C string.
13470 (push_it, pop_it): Save and restore from_disp_prop_p.
13471 (handle_single_display_spec, push_display_prop): Set the
13472 from_disp_prop_p flag.
13473 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13474 (pop_it): Call iterate_out_of_display_property only if we are
13475 popping after iteration over a string that came from a display
13476 property. Fix a typo in popping stretch info. Add an assertion
13477 for verifying that the iterator position is in sync with the bidi
13478 iterator.
13479 (handle_single_display_spec, get_overlay_strings_1)
13480 (push_display_prop): Fix initialization of paragraph direction for
13481 string when that of the parent object is not yet determined.
13482 (reseat_1): Call bidi_init_it to resync the bidi
13483 iterator with IT's position. (Bug#7616)
13484 (find_row_edges): If ROW->start.pos gives position
13485 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13486 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13487 Reset the from_disp_prop_p flag.
13488 (SAVE_IT, RESTORE_IT): New macros.
13489 (pos_visible_p, face_before_or_after_it_pos)
13490 (back_to_previous_visible_line_start)
13491 (move_it_in_display_line_to, move_it_in_display_line)
13492 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13493 (try_scrolling, redisplay_window, display_line): Use them when
13494 saving a temporary copy of the iterator and restoring it back.
13495 (back_to_previous_visible_line_start, reseat_1)
13496 (init_iterator): Empty the bidi cache "stack".
13497 (move_it_in_display_line_to): If iterator ended up at
13498 EOL, but we never saw any buffer positions smaller than
13499 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13500 motion in bidi-reordered lines.
13501 (move_it_in_display_line_to): Record prev_method and prev_pos
13502 immediately before the call to set_iterator_to_next. Fixes cursor
13503 motion in bidi-reordered lines with stretch glyphs and strings
13504 displayed in margins. (Bug#8133) (Bug#8867)
13505 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13506 TO_CHARPOS.
640c8776
SM
13507 (pos_visible_p): Support positions in bidi-reordered lines.
13508 Save and restore bidi cache.
0bb23927
EZ
13509
13510 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13511 (bidi_paragraph_info): Delete unused struct.
13512 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13513 (bidi_cache_start): New variable.
13514 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13515 to zero.
13516 (bidi_cache_fetch_state, bidi_cache_search)
13517 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13518 (bidi_cache_find, bidi_peek_at_next_level)
13519 (bidi_level_of_next_char, bidi_find_other_level_edge)
13520 (bidi_move_to_visually_next): Compare cache index with
13521 bidi_cache_start rather than with zero.
13522 (bidi_fetch_char): Accept new argument STRING; all callers
13523 changed. Support iteration over a string. Support strings with
13524 display properties. Support unibyte strings. Fix the type of
13525 `len' according to what STRING_CHAR_AND_LENGTH expects.
13526 (bidi_paragraph_init, bidi_resolve_explicit_1)
13527 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13528 (bidi_level_of_next_char, bidi_move_to_visually_next):
13529 Support iteration over a string.
0bb23927
EZ
13530 (bidi_set_sor_type, bidi_resolve_explicit_1)
13531 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13532 can now be zero (for strings); special values 0 and -1 were
13533 changed to -1 and -2, respectively.
13534 (bidi_char_at_pos): New function.
13535 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13536 Call it instead of FETCH_MULTIBYTE_CHAR.
13537 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13538 initialized to valid values.
13539 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13540 values.
13541 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13542 the test for valid cached positions. Fix the logic for looking up
13543 the sentinel state in the cache. GCPRO the Lisp string we are
13544 iterating.
13545 (bidi_push_it, bidi_pop_it): New functions.
13546 (bidi_initialize): Initialize the bidi cache start stack pointer.
13547 (bidi_cache_ensure_space): New function, refactored from part of
13548 bidi_cache_iterator_state. Don't assume the required size is just
13549 one BIDI_CACHE_CHUNK away.
13550 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13551 (bidi_count_bytes, bidi_char_at_pos): New functions.
13552 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13553 always valid if bidi_cache_idx is valid.
13554 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13555 is valid if it's going to be used.
13556 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13557 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13558 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13559 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13560 (bidi_find_other_level_edge, bidi_cache_start_stack):
13561 All variables related to cache indices are now EMACS_INT.
c965adc5 13562
0bb23927
EZ
13563 * dispextern.h (struct bidi_string_data): New structure.
13564 (struct bidi_it): New member `string'. Make flag members be 1-bit
13565 fields, and put them last in the struct.
640c8776
SM
13566 (compute_display_string_pos, compute_display_string_end):
13567 Update prototypes.
0bb23927
EZ
13568 (bidi_push_it, bidi_pop_it): Add prototypes.
13569 (struct iterator_stack_entry): New members bidi_p,
13570 paragraph_embedding, and from_disp_prop_p.
13571 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13572 (bidi_shelve_cache, bidi_unshelve_cache):
13573 Declare prototypes.
0bb23927
EZ
13574
13575 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13576 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13577 and vector-like objects.
13578
13579 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13580 cache around display iteration.
13581
13582 * window.c (Fwindow_end, window_scroll_pixel_based)
13583 (displayed_window_lines, Frecenter): Save and restore the bidi
13584 cache around display iteration.
13585
3bbd2265
LMI
135862011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13587
13588 * editfns.c (Fdelete_region): Clarify the use of the named
13589 parameters (bug#6788).
13590
adc47434
MR
135912011-07-14 Martin Rudalics <rudalics@gmx.at>
13592
13593 * indent.c (Fvertical_motion): Set and restore w->pointm when
13594 saving and restoring the window's buffer (Bug#9006).
13595
837c31f8
LMI
135962011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13597
13598 * editfns.c (Fstring_to_char): Clarify just what is returned
13599 (bug#6576). Text by Eli Zaretskii.
13600
ac389d0c
JB
136012011-07-13 Juanma Barranquero <lekktu@gmail.com>
13602
13603 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13604
0be0ce47
EZ
136052011-07-13 Eli Zaretskii <eliz@gnu.org>
13606
13607 * buffer.c (mmap_find): Fix a typo.
13608
cd18e7e3
JB
136092011-07-13 Johan Bockgård <bojohan@gnu.org>
13610
13611 Fix execution of x selection hooks.
13612 * xselect.c (Qx_lost_selection_functions)
13613 (Qx_sent_selection_functions): New vars.
13614 (syms_of_xselect): DEFSYM them.
13615 (x_handle_selection_request): Pass Qx_sent_selection_functions
13616 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13617 (x_handle_selection_clear,x_clear_frame_selections):
13618 Pass Qx_lost_selection_functions rather than
13619 Vx_lost_selection_functions to Frun_hook_with_args.
13620
47ea7f44
PE
136212011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13622
ac389d0c 13623 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13624 The old code sometimes used this field without initializing it.
13625
47ea7f44
PE
13626 * alloc.c (gc_sweep): Don't read past end of array.
13627 In theory, the old code could also have corrupted Emacs internals,
13628 though it'd be very unlikely.
13629
bc985c87
AS
136302011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13631
13632 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13633 argument. (Bug#4026)
bc985c87 13634
0cf34688
LMI
136352011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13636
b3dadd76
LMI
13637 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13638 key" (bug#4257).
13639
0cf34688
LMI
13640 * window.c (Fset_window_start): Doc fix (bug#4199).
13641 (Fset_window_hscroll): Ditto.
13642
270768cd
PE
136432011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13644
077e3dda 13645 Fix minor new problems caught by GCC 4.6.1.
270768cd 13646 * term.c (init_tty): Remove unused local.
490011a6 13647 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13648 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13649 not used otherwise.
270768cd 13650
b1f58454
CY
136512011-07-12 Chong Yidong <cyd@stupidchicken.com>
13652
13653 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13654
22b9578d
LMI
136552011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13656
6e70ab07
LMI
13657 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13658 are the mini-buffer and the echo area (bug#3320).
13659
22b9578d
LMI
13660 * term.c (init_tty): Remove support for supdup, c10 and perq
13661 terminals, which are no longer supported (bug#1482).
13662
8974cc9f
JB
136632011-07-10 Johan Bockgård <bojohan@gnu.org>
13664
13665 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13666
a560d974
JD
136672011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13668
13669 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13670 for non-popups (Bug#3642).
13671
1dae0f0a
AS
136722011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13673
268c2c36 13674 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13675 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13676 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13677 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13678 * data.c (fmod): Likewise.
13679 * dispnew.c (swap_glyphs_in_rows): Likewise.
13680 * emacs.c (memory_warning_signal): Likewise.
13681 * floatfns.c (float_error): Likewise.
13682 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13683 (otf_open, font_otf_capability, generate_otf_features)
13684 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13685 Likewise.
13686 * image.c (pbm_read_file): Likewise.
13687 * indent.c (string_display_width): Likewise.
13688 * intervals.c (check_for_interval, search_for_interval)
13689 (inc_interval_count, count_intervals, root_interval)
13690 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13691 * lread.c (defalias): Likewise.
268c2c36 13692 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13693 * regex.c (set_image_of_range_1, set_image_of_range)
13694 (regex_grow_registers): Likewise.
13695 * sysdep.c (strerror): Likewise.
13696 * termcap.c (valid_filename_p, tprint, main): Likewise.
13697 * tparam.c (main): Likewise.
13698 * unexhp9k800.c (run_time_remap, save_data_space)
13699 (update_file_ptrs, read_header, write_header, calculate_checksum)
13700 (copy_file, copy_rest, display_header): Likewise.
13701 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13702 Likewise.
13703 * xdisp.c (check_it): Likewise.
13704 * xfaces.c (register_color, unregister_color, unregister_colors):
13705 Likewise.
13706 * xfns.c (print_fontset_result): Likewise.
13707 * xrdb.c (member, fatal, main): Likewise.
13708
99033785
PE
137092011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13710
13711 Fix minor problems found by static checking (Bug#9031).
13712 * chartab.c (char_table_set_range, map_sub_char_table):
13713 Remove unused locals.
13714 (uniprop_table): Now static.
13715 * composite.c (_work_char): Remove unused static var.
13716
9cb2ac56
JB
137172011-07-09 Juanma Barranquero <lekktu@gmail.com>
13718
13719 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13720
f25661f0
JD
137212011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13722
13723 * gtkutil.c (qttip_cb): Remove code without function.
13724
8278c4fe
EZ
137252011-07-09 Eli Zaretskii <eliz@gnu.org>
13726
13727 * w32.c (pthread_sigmask): New stub.
13728
1692ae2d 137292011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13730
8a6ebd58 13731 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13732 sigprocmask is portable only for single-threaded applications, and
13733 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13734 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13735 (LIBES): Use it.
13736 * callproc.c (Fcall_process):
13737 * process.c (create_process):
13738 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13739 Use pthread_sigmask, not sigprocmask.
123403e4 13740
1b854618
JD
137412011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13742
13743 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13744 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13745 wrong (Bug#8591).
13746
3fe4b549
JD
137472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13748
0ce7e563
JD
13749 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13750 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13751 (xg_hide_tooltip): Fix comment.
13752
3fe4b549
JD
13753 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13754 in registerServicesMenuSendTypes.
13755 (validRequestorForSendType): Don't check ns_return_types.
13756
13757 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13758 ns_return_type.
13759
5df75e47
JR
137602011-07-08 Jason Rumney <jasonr@gnu.org>
13761
22610910
JR
13762 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13763 SH_SHOW for hidden windows (Bug#5482).
13764
5df75e47
JR
13765 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13766 frame struct members of non-existent frames (Bug#6284).
13767
699c10bd
JD
137682011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13769
4393663b
JD
13770 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13771 variable firstTime not needed on OSX >= 10.6.
13772 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13773 >= 10.5. Use setKnobProportion, setDoubleValue.
13774
13775 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13776 (MAC_OS_X_VERSION_10_5): Define if not defined.
13777 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13778 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13779 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13780
13781 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13782 cString and lossyCString on OSX >= 10.4.
4393663b 13783
58179cce 13784 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13785 sizeToFit on OSX >= 10.2.
13786
13787 * nsimage.m (allocInitFromFile): Don't use deprecated method
13788 bestRepresentationForDevice on OSX >= 10.6.
13789
13790 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13791 to avoid warning.
13792
13793 * emacs.c: Declare unexec_init_emacs_zone.
13794
a63e0781
JD
13795 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13796
699c10bd
JD
13797 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13798
13799 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13800 on svcsMenu (Bug#8842).
13801
13802 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13803 ns_return_types.
13804 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13805
13806 * nsterm.m (QUTF8_STRING): Declare.
13807 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13808 (validRequestorForSendType): Return type is (id).
13809 Change indexOfObjectIdenticalTo to indexOfObject.
13810 Check if we have local selection before returning self (Bug#8842).
13811 (writeSelectionToPasteboard): Put local selection into paste board
13812 if we have a local selection (Bug#8842).
13813 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13814
13815 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13816 (ns_get_local_selection): Declare.
13817
54e10184
LMI
138182011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13819
9888ff71
LMI
13820 * keymap.c (describe_map_tree): Don't insert a double newline at
13821 the end of the buffer (bug#1169) and return whether we inserted
13822 something.
13823
54e10184
LMI
13824 * callint.c (Fcall_interactively): Change "reading args" to
13825 "providing args" to try to clarify what it does (bug#1010).
13826
15fa4783
KH
138272011-07-07 Kenichi Handa <handa@m17n.org>
13828
13829 * composite.c (composition_compute_stop_pos): Ignore a static
13830 composition starting before CHARPOS (Bug#8915).
13831
13832 * xdisp.c (handle_composition_prop): Likewise.
13833
a8815b00
EZ
138342011-07-07 Eli Zaretskii <eliz@gnu.org>
13835
13836 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13837 (Bug#9015)
13838
ef7b981d 138392011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13840
13841 * character.h (unicode_category_t): New enum type.
13842
13843 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13844 (Qchar_code_property_table): New variable.
13845 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13846 (UNIPROP_COMPRESSED_FORM_P): New macros.
13847 (char_table_ascii): Uncompress the compressed values.
13848 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13849 Uncompress the compressed values.
ac389d0c 13850 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13851 (char_table_ref_and_range): Uncompress the compressed values.
13852 (sub_char_table_set): New arg is_uniprop. Callers changed.
13853 Uncompress the compressed values.
13854 (sub_char_table_set_range): Args changed. Callers changed.
13855 (char_table_set_range): Adjuted for the above change.
13856 (map_sub_char_table): Delete args default_val and parent. Add arg
13857 top. Give decoded values to a Lisp function.
640c8776 13858 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13859 values to a Lisp function. Gcpro more variables.
13860 (uniprop_table_uncompress)
13861 (uniprop_decode_value_run_length): New functions.
13862 (uniprop_decoder, uniprop_decoder_count): New variables.
13863 (uniprop_get_decoder, uniprop_encode_value_character)
13864 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13865 New functions.
13866 (uniprop_encoder, uniprop_encoder_count): New variables.
13867 (uniprop_get_encoder, uniprop_table)
13868 (Funicode_property_table_internal, Fget_unicode_property_internal)
13869 (Fput_unicode_property_internal): New functions.
13870 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13871 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 13872 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
13873 char-code-property-alist.
13874
640c8776 13875 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
13876 Vunicode_category_table.
13877
640c8776 13878 * font.c (font_range): Adjust for the change of
c805dec0
KH
13879 Vunicode_category_table.
13880
76b397fb
DN
138812011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13882
13883 * m/iris4d.h: Remove file, move contents ...
13884 * s/irix6-5.h: ... here.
13885
22b4128e
PE
138862011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13887
13888 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
13889 * alloc.c (mark_buffer):
13890 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13891 (clone_per_buffer_values): Don't assume that
22b4128e
PE
13892 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13893 This isn't true in general, and it's particularly not true
13894 if Emacs is configured with --with-wide-int.
13895 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13896 New macros, used in the buffer.c change.
13897
869795d6
JD
138982011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13899
13900 * xsettings.c: Use both GConf and GSettings if both are available.
13901 (store_config_changed_event): Add comment.
13902 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13903 (store_tool_bar_style_changed): New functions.
5e617bc2 13904 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
13905 (struct xsettings): Move font inside HAVE_XFT.
13906 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 13907 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 13908 Move inside HAVE_XFT.
640c8776 13909 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
13910 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13911 also.
13912 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 13913 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 13914 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
13915 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13916 (parse_settings): Move check for font inside HAVE_XFT.
13917 (read_settings, apply_xft_settings): Add comment.
13918 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13919 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
13920 call store_font_name_changed.
13921 (xft_settings_event): Add comment.
13922 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
13923 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
13924 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
13925 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
13926 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
13927 (xsettings_get_system_font, xsettings_get_system_normal_font):
13928 Add comment.
869795d6 13929
d8ed26bd
PE
139302011-07-05 Paul Eggert <eggert@cs.ucla.edu>
13931
13932 Random fixes. E.g., (random) never returned negative values.
13933 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
13934 subseconds part to the entropy, as that's a bit more random.
13935 Prefer signed to unsigned, since the signedness doesn't matter and
13936 in general we prefer signed. When given a limit, use a
13937 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
13938 latter isn't right if USE_2_TAGS_FOR_INTS.
13939 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
13940 not 0..VALMASK. Don't discard "excess" bits that random () returns.
13941
cabf1cac
SM
139422011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
13943
13944 * textprop.c (text_property_stickiness):
13945 Obey Vtext_property_default_nonsticky.
13946 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
13947 * w32fns.c (syms_of_w32fns):
13948 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
13949
6e9b2be9
PE
139502011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13951
13952 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
13953 This is more efficient than Ffile_directory_p and avoids a minor race.
13954
90186c68
LMI
139552011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13956
7c301272
LMI
13957 * buffer.c (Foverlay_put): Say what the return value is
13958 (bug#7835).
13959
c4f2d8d4
LMI
13960 * fileio.c (barf_or_query_if_file_exists): Check first if the file
13961 is a directory before asking whether to use the file name
13962 (bug#7564).
ad637907
LMI
13963 (barf_or_query_if_file_exists): Make the "File is a directory"
13964 error be more correct.
c4f2d8d4 13965
90186c68
LMI
13966 * fns.c (Frequire): Remove the mention of the .gz files, since
13967 that's installation-specific, but keep the mention of
13968 `get-load-suffixes'.
13969
da64016e
PE
139702011-07-04 Paul Eggert <eggert@cs.ucla.edu>
13971
13972 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
13973 Report string overflow if the output is too long.
13974
7d47b580
JB
139752011-07-04 Juanma Barranquero <lekktu@gmail.com>
13976
a555cb87
JB
13977 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
13978 (syms_of_gnutls): Remove duplicate DEFSYM for
13979 Qgnutls_bootprop_verify_hostname_error, an error for
13980 Qgnutls_bootprop_verify_error (which is no longer used).
13981
7d47b580
JB
13982 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
13983 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
13984 Also (re)move comments that are misplaced or no longer relevant.
13985
1e49bfab
LMI
139862011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13987
13988 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
13989
1485f4c0
CY
139902011-07-03 Chong Yidong <cyd@stupidchicken.com>
13991
13992 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
13993 and background color parameters if they have been changed.
13994
a9ab721e
LMI
139952011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13996
13997 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
13998
cf7cff57
PE
139992011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14000
2e13213d
PE
14001 * xsettings.c (SYSTEM_FONT): Define only when used.
14002 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14003
cf7cff57
PE
14004 * keymap.c (access_keymap_1): Now static.
14005
7a8e04f7
CY
140062011-07-02 Chong Yidong <cyd@stupidchicken.com>
14007
14008 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14009 leave any prefix arg for the up event (Bug#1586).
14010
61352f62
LMI
140112011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14012
69bb1ef7
LMI
14013 * lread.c (syms_of_lread): Mention single symbols defined by
14014 `defvar' or `defconst' (bug#7154).
14015
61352f62 14016 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 14017 (Frequire): Mention get-load-suffixes.
61352f62 14018
28545e04
MR
140192011-07-02 Martin Rudalics <rudalics@gmx.at>
14020
14021 * window.h (window): Remove clone_number slot.
14022 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14023 Remove.
14024 (make_parent_window, make_window, saved_window)
14025 (Fset_window_configuration, save_window_save): Don't deal with
14026 clone numbers.
14027 * buffer.c (Qclone_number): Remove declaration.
14028 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14029
3349e122
SM
140302011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14031
14032 Add multiple inheritance to keymaps.
14033 * keymap.c (Fmake_composed_keymap): New function.
14034 (Fset_keymap_parent): Simplify.
14035 (fix_submap_inheritance): Remove.
14036 (access_keymap_1): New function extracted from access_keymap to handle
14037 embedded parents and handle lists of maps.
14038 (access_keymap): Use it.
14039 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14040 (Fcopy_keymap): Handle embedded parents.
14041 (Fcommand_remapping, define_as_prefix): Simplify.
14042 (Fkey_binding): Simplify.
14043 (syms_of_keymap): Move minibuffer-local-completion-map,
14044 minibuffer-local-filename-completion-map,
14045 minibuffer-local-must-match-map, and
14046 minibuffer-local-filename-must-match-map to Elisp.
14047 (syms_of_keymap): Defsubr make-composed-keymap.
14048 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14049 (parse_menu_item): Trivial simplification.
14050
3279eb87
GM
140512011-07-01 Glenn Morris <rgm@gnu.org>
14052
14053 * Makefile.in (SETTINGS_LIBS): Fix typo.
14054
39cb9e56 140552011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
14056
14057 * coding.c (Fencode_coding_string): Record the last coding system
14058 used, as the function doc string says (bug#8738).
14059
0949d2b6
JD
140602011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14061
14062 * xsettings.c (store_monospaced_changed): Take new font as arg and
14063 check for change against current_mono_font.
14064 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14065 (emacs_settings_constructor, emacs_settings_get_property)
14066 (emacs_settings_set_property, emacs_settings_class_init)
14067 (emacs_settings_init, gsettings_obj): Remove.
14068 (something_changedCB): New function for HAVE_GSETTINGS.
14069 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14070 with value as argument.
14071 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14072 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 14073 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
14074 "changed".
14075
14076 * xgselect.c: Add defined (HAVE_GSETTINGS).
14077 (xgselect_initialize): Ditto.
14078
14079 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14080 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14081 xg_select.
14082
bbc6b304
PE
140832011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14084
14085 * eval.c (struct backtrace): Simplify and port the data structure.
14086 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14087 signed bit field, as this assumption is not portable and it makes
14088 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14089 "char debug_on_exit : 1" as this is not portable either; instead,
14090 use the portable "unsigned int debug_on_exit : 1". Remove unused
14091 member evalargs. Remove obsolete comments about cc bombing out.
14092
9851bfc5
JD
140932011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14094
51bb811f 14095 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
14096 Let HAVE_GSETTINGS override HAVE_GCONF.
14097 (store_monospaced_changed): New function.
14098 (EMACS_SETTINGS): A new type derived from GObject to handle
14099 GSettings notifications.
14100 (emacs_settings_constructor, emacs_settings_get_property)
14101 (emacs_settings_set_property, emacs_settings_class_init):
14102 New functions.
14103 (gsettings_client, gsettings_obj): New variables.
14104 (GSETTINGS_SCHEMA): New define.
14105 (something_changedCB): Call store_monospaced_changed.
14106 (init_gsettings): New function.
14107 (xsettings_initialize): Call init_gsettings.
14108 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14109 to NULL.
14110
640c8776 14111 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
14112 GCONF_CFLAGS/LIBS.
14113
5386012d
MR
141142011-06-29 Martin Rudalics <rudalics@gmx.at>
14115
14116 * window.c (resize_root_window, grow_mini_window)
14117 (shrink_mini_window): Rename Qresize_root_window to
14118 Qwindow_resize_root_window and Qresize_root_window_vertically to
14119 Qwindow_resize_root_window_vertically.
14120
f13e0b08
PE
141212011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14122
14123 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14124
94515237
JB
141252011-06-27 Juanma Barranquero <lekktu@gmail.com>
14126
14127 * makefile.w32-in: Redesign dependencies so they reflect more
14128 clearly which files are directly included by each source file,
14129 and not through other includes.
14130
e43b6e43
MR
141312011-06-27 Martin Rudalics <rudalics@gmx.at>
14132
14133 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14134 (sort_overlays, overlay_strings): When an overlay's clone number
14135 matches the window's clone number process the overlay even if
14136 the overlay's window property doesn't match the current window.
14137
d68443dc
MR
14138 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14139 (Fwindow_hchild): Rename to Fwindow_left_child.
14140 (Fwindow_next): Rename to Fwindow_next_sibling.
14141 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
14142 (resize_window_check): Rename to window_resize_check.
14143 (resize_window_apply): Rename to window_resize_apply.
14144 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14145 (Fdelete_other_windows_internal, resize_frame_windows)
14146 (Fsplit_window_internal, Fdelete_window_internal)
14147 (grow_mini_window, shrink_mini_window)
14148 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 14149
c7e73be5
JD
141502011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14151
14152 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14153 (emacs_fixed_set_min_size): Remove.
14154 (emacs_fixed_new): Take frame as argument.
14155
14156 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14157 (_EmacsFixedPrivate): Remove minwidth/height.
14158 Add struct frame *f.
14159 (emacs_fixed_init): Initialize priv->f.
14160 (get_parent_class, emacs_fixed_set_min_size): Remove.
14161 (emacs_fixed_new): Set priv->f to argument.
14162 (emacs_fixed_get_preferred_width)
14163 (emacs_fixed_get_preferred_height): Use min_width/height from
14164 frames size_hint to set minimum and natural (Bug#8919).
14165 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14166 and use min_width/height from frames size_hint to set
14167 min_width/height (Bug#8919).
14168
14169 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
14170 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14171 Fix indentation.
c7e73be5 14172
cf99dcf8
EZ
141732011-06-26 Eli Zaretskii <eliz@gnu.org>
14174
14175 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14176 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14177 called at ZV.
14178
029529ac
CY
141792011-06-26 Chong Yidong <cyd@stupidchicken.com>
14180
14181 * process.c (wait_reading_process_output): Bypass select if
14182 waiting for a cell while ignoring keyboard input, and input is
14183 pending. Suggested by Jan Djärv (Bug#8869).
14184
7a7ef429
PE
141852011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14186
14187 Use gnulib's dup2 module instead of rolling our own.
14188 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14189
11fdef7d 141902011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
14191
14192 * dispnew.c (scrolling_window): Before scrolling, turn off a
14193 mouse-highlight in the window being scrolled.
14194
cd3520a4
JB
141952011-06-24 Juanma Barranquero <lekktu@gmail.com>
14196
14197 Move DEFSYM to lisp.h and use everywhere.
14198
14199 * character.h (DEFSYM): Move declaration...
14200 * lisp.h (DEFSYM): ...here.
14201
14202 * gnutls.c:
14203 * minibuf.c:
14204 * w32menu.c:
14205 * w32proc.c:
14206 * w32select.c: Don't include character.h.
14207
14208 * alloc.c (syms_of_alloc):
14209 * buffer.c (syms_of_buffer):
14210 * bytecode.c (syms_of_bytecode):
14211 * callint.c (syms_of_callint):
14212 * casefiddle.c (syms_of_casefiddle):
14213 * casetab.c (init_casetab_once):
14214 * category.c (init_category_once, syms_of_category):
14215 * ccl.c (syms_of_ccl):
14216 * cmds.c (syms_of_cmds):
14217 * composite.c (syms_of_composite):
14218 * dbusbind.c (syms_of_dbusbind):
14219 * dired.c (syms_of_dired):
14220 * dispnew.c (syms_of_display):
14221 * doc.c (syms_of_doc):
14222 * editfns.c (syms_of_editfns):
14223 * emacs.c (syms_of_emacs):
14224 * eval.c (syms_of_eval):
14225 * fileio.c (syms_of_fileio):
14226 * fns.c (syms_of_fns):
14227 * frame.c (syms_of_frame):
14228 * fringe.c (syms_of_fringe):
14229 * insdel.c (syms_of_insdel):
14230 * keymap.c (syms_of_keymap):
14231 * lread.c (init_obarray, syms_of_lread):
14232 * macros.c (syms_of_macros):
14233 * msdos.c (syms_of_msdos):
14234 * print.c (syms_of_print):
14235 * process.c (syms_of_process):
14236 * search.c (syms_of_search):
14237 * sound.c (syms_of_sound):
14238 * syntax.c (init_syntax_once, syms_of_syntax):
14239 * terminal.c (syms_of_terminal):
14240 * textprop.c (syms_of_textprop):
14241 * undo.c (syms_of_undo):
14242 * w32.c (globals_of_w32):
14243 * window.c (syms_of_window):
14244 * xdisp.c (syms_of_xdisp):
14245 * xfaces.c (syms_of_xfaces):
14246 * xfns.c (syms_of_xfns):
14247 * xmenu.c (syms_of_xmenu):
14248 * xsettings.c (syms_of_xsettings):
14249 * xterm.c (syms_of_xterm): Use DEFSYM.
14250
4228cf16
TZ
142512011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14252
cd3520a4 14253 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 14254
7fcccf1e
PE
142552011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14256
7efb4e0e
PE
14257 Integer and buffer overflow fixes (Bug#8873).
14258
ff5844ad
PE
14259 * print.c (printchar, strout): Check for string overflow.
14260 (PRINTPREPARE, printchar, strout):
14261 Don't set size unless allocation succeeds.
14262
90532f02
PE
14263 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14264 for sizes. Check for string overflow more accurately.
14265 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14266
6d84508d
PE
14267 * macros.c: Integer and buffer overflow fixes.
14268 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14269 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14270 Use ptrdiff_t, not int, for sizes.
14271 Don't increment bufsize until after realloc succeeds.
14272 Check for size-calculation overflow.
14273 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14274
437b2cb4
PE
14275 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14276
8b9ac8b4
PE
14277 * lread.c: Integer overflow fixes.
14278 (read_integer): Radix is now EMACS_INT, not int,
14279 to improve quality of diagnostics for out-of-range radices.
14280 Calculate buffer size correctly for out-of-range radices.
14281 (read1): Check for integer overflow in radices, and in
14282 read-circle numbers.
82cb60d3
PE
14283 (read_escape): Avoid int overflow.
14284 (Fload, openp, read_buffer_size, read1)
14285 (substitute_object_recurse, read_vector, read_list, map_obarray):
14286 Use ptrdiff_t, not int, for sizes.
14287 (read1): Use EMACS_INT, not int, for sizes.
20270765 14288 Check for size overflow.
8b9ac8b4 14289
7fcccf1e
PE
14290 * image.c (cache_image): Check for size arithmetic overflow.
14291
bfbbd7e7
PE
14292 * lread.c: Integer overflow issues.
14293 (saved_doc_string_size, saved_doc_string_length)
14294 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14295 Now ptrdiff_t, not int.
14296 (read1): Don't assume doc string length fits in int. Check for
14297 out-of-range doc string lengths.
14298 (read_list): Don't assume file position fits in int.
39019e54 14299 (read_escape): Check for hex character overflow.
bfbbd7e7 14300
4e323265
LL
143012011-06-22 Leo Liu <sdl.web@gmail.com>
14302
14303 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14304 Move to minibuffer.el.
14305
85fece3e
PE
143062011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14307
20b84ce9 14308 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
14309 The following patches are for when GLYPH_DEBUG && !XASSERT.
14310 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14311 * dispnew.c (flush_stdout):
14312 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14313 Mark as externally visible.
14314 * dispnew.c (check_window_matrix_pointers): Now static.
14315 * dispnew.c (window_to_frame_vpos):
14316 * xfns.c (unwind_create_frame):
14317 * xterm.c (x_check_font): Remove unused local.
14318 * scroll.c (CHECK_BOUNDS):
14319 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14320 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14321 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14322 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14323 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14324 Now static.
14325 (debug_method_add): Use va_list and vsprintf rather than relying
14326 on undefined behavior with wrong number of arguments.
14327 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14328 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14329 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14330 since we're not interested in debugging glyphs with old libraries.
14331 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14332 GCC 4.6.0's static checking.
14333
0766b489
PE
143342011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14335
31fd4b32
PE
14336 Integer overflow and signedness fixes (Bug#8873).
14337 A few related buffer overrun fixes, too.
14338
b79e8648
PE
14339 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14340
0766b489
PE
14341 * dispextern.h (struct face.stipple):
14342 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14343 (x_bitmap_mask, x_allocate_bitmap_record)
14344 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14345 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14346 (x_create_bitmap_from_xpm_data):
14347 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14348 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14349 (.bitmaps_last):
14350 * xfaces.c (load_pixmap):
14351 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14352 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14353 (.bitmaps_last, struct x_output.icon_bitmap):
14354 Use ptrdiff_t, not int, for bitmap indexes.
14355 (x_allocate_bitmap_record): Check for size overflow.
14356 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14357
b081724f
PE
14358 Use ptrdiff_t, not int, for overlay counts.
14359 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14360 * editfns.c (overlays_around, get_pos_property):
14361 * textprop.c (get_char_property_and_overlay):
14362 * xdisp.c (next_overlay_change, note_mouse_highlight):
14363 * xfaces.c (face_at_buffer_position):
21514da7
PE
14364 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14365 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14366 (Fnext_overlay_change, Fprevious_overlay_change)
14367 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 14368 Use ptrdiff_t, not int, for sizes.
21514da7 14369 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 14370
3de73e5e
PE
14371 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14372
2606c57b
PE
14373 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14374 (x_session_initialize): Do not assume string length fits in int.
14375
aaafe47a
PE
14376 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14377 This is unlikely, but can occur if DPI is outlandish.
14378
2674ddc8 14379 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
14380 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14381
28154962
PE
14382 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14383 * xrdb.c (magic_file_p, search_magic_path):
14384 Omit last arg SUFFIX; it was always 0. All callers changed.
14385 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14386
7de51af5
PE
14387 * xfont.c (xfont_match): Avoid need for strlen.
14388
25ed6cc3
PE
14389 * xfns.c: Don't assume strlen fits in int.
14390 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14391
4eab31dd
PE
14392 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14393 not unsigned long, as we prefer signed integers. All callers changed.
14394 Detect integer overflow in repeat count.
14395 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14396 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14397
171e2a58
PE
14398 * termcap.c: Don't assume sizes fit in int and never overflow.
14399 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14400 (gobble_line): Check for size-calculation overflow.
14401
ad39faca 14402 * minibuf.c (Fread_buffer):
6e5bb2dc 14403 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14404 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14405 Don't assume string length fits in int.
14406
52c61c22 14407 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14408 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14409
b5b8c9e5
PE
14410 * font.c: Don't assume string length fits in int.
14411 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14412 Use ptrdiff_t, not int.
ccd6111c
PE
14413 (font_intern_prop): Don't assume string length fits in int.
14414 Don't assume integer property fits in fixnum.
14415 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14416
882f0d81 14417 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14418 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14419 Reformulate so as not to need the command string.
14420 Invoke gzip -cd rather than gunzip, as it's more portable.
14421 (lock_info_type, lock_file_1, lock_file):
14422 Don't assume pid_t and time_t fit in unsigned long.
14423 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14424 (current_lock_owner): Prefer signed type for sizes.
14425 Use memcpy, not strncpy, where memcpy is what is really wanted.
14426 Don't assume (via atoi) that time_t and pid_t fit in int.
14427 Check for time_t and/or pid_t out of range, e.g., via a network share.
14428 Don't alloca where an auto var works fine.
14429
93f4cf88
PE
14430 * fileio.c: Fix some integer overflow issues.
14431 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14432 Don't assume string length fits in int.
14433 (directory_file_name): Don't assume string length fits in long.
14434 (make_temp_name): Don't assume pid fits in int, or that its print
14435 length is less than 20.
14436
f3e92b69
PE
14437 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14438
1bfdaf10
PE
14439 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14440
35016e9a
PE
14441 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14442
3d1e65a1
PE
14443 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14444 We prefer signed integers, even for size calculations.
14445
0b963a93
PE
14446 * emacs.c: Don't assume string length fits in 'int'.
14447 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14448 (main): Don't invoke strlen when not needed.
14449
573f4b54
PE
14450 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14451 (XD_DEBUG_MESSAGE): Don't waste a byte.
14452
989f33ba
PE
14453 * callproc.c (getenv_internal_1, getenv_internal)
14454 (Fgetenv_internal):
965d34eb
PE
14455 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14456
e4d29b33
PE
14457 * lread.c (invalid_syntax): Omit length argument.
14458 All uses changed. This doesn't fix a bug, but it simplifies the
14459 code away from its former Hollerith-constant appearance, and it's
14460 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14461 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14462
eb49b136
PE
14463 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14464 This didn't break anything, but it didn't help either.
14465 It's confusing to put a bogus integer in a place where the actual
14466 value does not matter.
9f62aeb1 14467 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14468 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14469
15375a22
PE
14470 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14471 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14472 implementation.
b61cc01c
PE
14473 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14474 We prefer signed types, and the value cannot exceed the EMACS_INT
14475 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14476 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14477 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14478 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14479
53b2623d
PE
14480 * indent.c (sane_tab_width): New function.
14481 (current_column, scan_for_column, Findent_to, position_indentation)
14482 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14483 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14484
51cab52b 14485 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14486
f2ed8a70
PE
14487 * lisp.h (lint_assume): New macro.
14488 * composite.c (composition_gstring_put_cache):
14489 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14490
abe80cc6
PE
14491 * editfns.c, insdel.c:
14492 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14493
b02c740e
PE
14494 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14495
ebc96716
PE
14496 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14497
b4e50fa0 14498 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14499 Use much-faster test for byte-length change.
311d5d7c 14500 Don't assume string byte-length fits in 'int'.
a4cf38e4 14501 Check that character arg fits in 'int'.
85461888 14502 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14503
c0c1ee9f
PE
14504 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14505
a498d7f4
PE
14506 * fns.c (concat): Catch string overflow earlier.
14507 Do not rely on integer wraparound.
14508
51cab52b
PE
14509 * dispextern.h (struct it.overlay_strings_charpos)
14510 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14511 * xdisp.c (forward_to_next_line_start)
14512 (back_to_previous_visible_line_start)
14513 (reseat_at_next_visible_line_start, next_element_from_buffer):
14514 Don't arbitrarily truncate the value of 'selective' to int.
14515
76031fad
PE
14516 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14517
5eb55db9
PE
14518 * composite.c: Don't truncate sizes to 'int'.
14519 (composition_gstring_p, composition_reseat_it)
14520 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14521 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14522 not EMACS_UINT, for indexes.
5eb55db9 14523
0703a717
PE
14524 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14525
d6202519
PE
14526 * buffer.c: Include <verify.h>.
14527 (struct sortvec.priority, struct sortstr.priority):
8961a454 14528 Now EMACS_INT, not int.
c20998a7 14529 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14530 (struct sortstr.size, record_overlay_string)
14531 (struct sortstrlist.size, struct sortlist.used):
14532 Don't truncate size to int.
14533 (record_overlay_string): Check for size-calculation overflow.
d6202519 14534 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14535
d5a19415
JM
145362011-06-22 Jim Meyering <meyering@redhat.com>
14537
029529ac 14538 Don't leak an XBM-image-sized buffer
d5a19415
JM
14539 * image.c (xbm_load): Free the image buffer after using it.
14540
a9041e6c
PE
145412011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14542
14543 Port to Sun C.
14544 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14545 that Sun C diagnosed.
14546 * fns.c (secure_hash): Fix pointer signedness issue.
14547 * intervals.c (static_offset_intervals): New function.
14548 (offset_intervals): Use it.
14549
7f3f739f
LL
145502011-06-21 Leo Liu <sdl.web@gmail.com>
14551
14552 * deps.mk (fns.o):
14553 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14554 sha512.h.
14555
14556 * fns.c (secure_hash): Rename from crypto_hash_function and change
14557 the first arg to accept symbols.
5b66d427 14558 (Fsecure_hash): New primitive.
7f3f739f
LL
14559 (syms_of_fns): New symbols.
14560
76147d94
DD
145612011-06-20 Deniz Dogan <deniz@dogan.se>
14562
14563 * process.c (Fset_process_buffer): Clarify return value in
14564 docstring.
14565
7d7d0045
CY
145662011-06-18 Chong Yidong <cyd@stupidchicken.com>
14567
14568 * dispnew.c (add_window_display_history): Use BVAR.
14569
14570 * xdisp.c (debug_method_add): Use BVAR.
14571 (check_window_end, dump_glyph_matrix, dump_glyph)
14572 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14573
14574 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14575 Likewise.
14576
14577 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14578 check till after the cache is created in init_frame_faces.
14579
ff2bc410
SM
145802011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14581
14582 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14583
28177add
PE
145842011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14585
dd3482fe
PE
14586 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14587 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14588 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14589
393d71f3 14590 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14591 * fileio.c (Finsert_file_contents):
14592 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14593 Remove the old (too-loose) buffer overflow checks.
14594 They weren't needed, since make_gap checks for buffer overflow.
14595 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14596 The old code merely checked for Emacs fixnum overflow, and relied
14597 on undefined (wraparound) behavior. The new code avoids undefined
14598 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14599
2e6813b0 14600 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14601 Tune. Don't use wider integers than needed. Don't use alloca.
14602 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14603
599a9e4f
PE
14604 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14605
99561444
PE
14606 * insdel.c, lisp.h (buffer_overflow): New function.
14607 (insert_from_buffer_1, replace_range, replace_range_2):
14608 * insdel.c (make_gap_larger):
14609 * editfns.c (Finsert_char):
14610 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14611
28177add
PE
14612 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14613
e69dafad
PE
146142011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14615
4baa020d 14616 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14617
b1c46f02
PE
14618 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14619 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14620
e69dafad
PE
14621 * fileio.c: Don't assume EMACS_INT fits in off_t.
14622 (emacs_lseek): New static function.
14623 (Finsert_file_contents, Fwrite_region): Use it.
14624 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14625
566684ea
PE
14626 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14627
e6966cd6
PE
14628 * fns.c: Don't overflow int when computing a list length.
14629 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14630 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14631 truncation on 64-bit hosts. Check for QUIT every
14632 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14633 faster and is responsive enough.
14634 (Flength): Report an error instead of overflowing an integer.
14635 (Fsafe_length): Return a float if the value is not representable
14636 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14637 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14638 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14639
dd0b0efb
PE
14640 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14641 (header_size, word_size): New constants.
14642 (allocate_vectorlike): Don't check size overflow here.
14643 (allocate_vector): Check it here instead, since this is the only
14644 caller of allocate_vectorlike that could cause overflow.
14645 Check that the new vector's length is representable as a fixnum.
14646
86fe5cfe
PE
14647 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14648 The previous code was bogus. For example, next_almost_prime (32)
14649 returned 39, which is undesirable as it is a multiple of 3; and
14650 next_almost_prime (24) returned 25, which is a multiple of 5 so
14651 why was the code bothering to check for multiples of 7?
14652
80e88859
PE
14653 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14654
4a2f0ad6
PE
14655 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14656
f66c7cf8
PE
14657 Variadic C functions now count arguments with ptrdiff_t.
14658 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14659 Back then I didn't know that the Emacs coding style prefers signed int.
14660 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14661 were being counted with int, which may truncate counts on 64-bit
14662 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14663 * lisp.h (struct Lisp_Subr.function.aMANY)
14664 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14665 Arg counts are now ptrdiff_t, not size_t.
14666 All variadic functions and their callers changed accordingly.
14667 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14668 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14669 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14670 * callint.c (Fcall_interactively): Check arg count for overflow,
14671 to avoid potential buffer overrun. Use signed char, not 'int',
14672 for 'varies' array, so that we needn't bother to check its size
14673 calculation for overflow.
14674 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14675 * eval.c (apply_lambda):
14676 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14677 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14678 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14679
a1759b76
PE
14680 * callint.c (Fcall_interactively): Don't use index var as event count.
14681
d96be9fc
PE
14682 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14683 * mem-limits.h (SIZE): Remove; no longer used.
14684
a690a978 14685 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14686
578c21e6
PE
14687 Remove unnecessary casts.
14688 * xterm.c (x_term_init):
14689 * xfns.c (x_set_border_pixel):
14690 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14691 These aren't needed now that we assume ANSI C.
14692
96f53c6c
PE
14693 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14694 It's more likely to cause problems (due to unsigned overflow)
14695 than to cure them.
14696
83c77d31
PE
14697 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14698
ee2079f1
PE
14699 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14700
6da65536
PE
14701 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14702
7147c4a4
PE
14703 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14704
193e32d9
PE
14705 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14706
e5533da6
PE
14707 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14708
9910e595
PE
14709 GLYPH_CODE_FACE returns EMACS_INT, not int.
14710 * dispextern.h (merge_faces):
14711 * xfaces.c (merge_faces):
01103c44
PE
14712 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14713 Don't assume EMACS_INT fits in int.
9910e595 14714
2638320e
PE
14715 * character.h (CHAR_VALID_P): Remove unused parameter.
14716 * fontset.c, lisp.h, xdisp.c: All uses changed.
14717
045eb8d9
PE
14718 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14719
c1f134b5
PE
14720 * fns.c (concat): Minor tuning based on overflow analysis.
14721 This doesn't fix any bugs. Use int to hold character, instead
14722 of constantly refetching from Emacs object. Use XFASTINT, not
14723 XINT, for value known to be a character. Don't bother comparing
14724 a single byte to 0400, as it's always less.
14725
395fcb93 14726 * floatfns.c (Fexpt):
327eeec8
PE
14727 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14728
abbd3d23
PE
14729 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14730 for characters.
14731
684a03ef
PE
14732 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14733
0fed43f3
PE
14734 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14735 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14736 incorrectly succeed when S was a string, because 4294967386 was
14737 truncated before it was used.
14738
8fd02eb7
PE
14739 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14740 Otherwise, an out-of-range integer could cause undefined behavior
14741 on a 64-bit host.
14742
f8c86b69
PE
14743 * composite.c: Use int, not EMACS_INT, for characters.
14744 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14745 EMACS_INT, for values that are known to be in character range.
14746 This doesn't fix any bugs but is the usual style inside Emacs and
14747 may generate better code on 32-bit machines.
14748
34206dd2
PE
14749 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14750 This is for reasons similar to the recent CHAR_STRING fix.
14751 * charset.c (Fencode_char): Check that character arg is actually
14752 a character. Pass an int to ENCODE_CHAR.
14753 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14754 wider than 'int', as a compile-time check to prevent future regressions
14755 in this area.
14756
c5958d4c 14757 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14758
14759 Make sure a 64-bit char is never passed to CHAR_STRING.
14760 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14761 by silently ignoring the top 32 bits, allowing some values
14762 that were far too large to be valid characters.
14763 * character.h: Include <verify.h>.
14764 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14765 arguments are no wider than unsigned, as a compile-time check
14766 to prevent future regressions in this area.
14767 * data.c (Faset):
01103c44 14768 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14769 (Fsubst_char_in_region):
14770 * fns.c (concat):
14771 * xdisp.c (decode_mode_spec_coding):
14772 Adjust to CHAR_STRING's new requirement.
14773 * editfns.c (Finsert_char, Fsubst_char_in_region):
14774 * fns.c (concat): Check that character args are actually
14775 characters. Without this test, these functions did the wrong
14776 thing with wildly out-of-range values on 64-bit hosts.
14777
d37ca623
PE
14778 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14779 These casts should not be needed on 32-bit hosts, either.
14780 * keyboard.c (read_char):
14781 * lread.c (Fload): Remove casts to unsigned.
14782
ea204efb
PE
14783 * lisp.h (UNSIGNED_CMP): New macro.
14784 This fixes comparison bugs on 64-bit hosts.
14785 (ASCII_CHAR_P): Use it.
14786 * casefiddle.c (casify_object):
01103c44 14787 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14788 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14789 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14790 * dispextern.h (FACE_FROM_ID):
14791 * keyboard.c (read_char): Use UNSIGNED_CMP.
14792
41cb286c
PE
14793 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14794 not to EMACS_INT, to avoid GCC warning.
14795
4a1b9832
PE
14796 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14797
55daad71
PE
14798 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14799 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14800 isn't needed on 32-bit machines.
8f95c75c 14801
01103c44
PE
14802 * buffer.c (Fgenerate_new_buffer_name):
14803 Use EMACS_INT for count, not int.
0ceccced 14804 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14805
14806 * data.c (Qcompiled_function): Now static.
14807
c6f072e7
PE
14808 * window.c (window_body_lines): Now static.
14809
20ce5912
PE
14810 * image.c (gif_load): Rename local to avoid shadowing.
14811
9c4c5f81
PE
14812 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14813 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14814 * alloc.c (make_save_value): Integer argument is now of type
14815 ptrdiff_t, not int.
14816 (mark_object): Use ptrdiff_t, not int.
14817 * lisp.h (pD): New macro.
14818 * print.c (print_object): Use it.
14819
c0c5c8ae
PE
14820 * alloc.c: Use EMACS_INT, not int, to count objects.
14821 (total_conses, total_markers, total_symbols, total_vector_size)
14822 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14823 (total_free_floats, total_floats, total_free_intervals)
14824 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14825 Now EMACS_INT, not int. All uses changed.
14826 (Fgarbage_collect): Compute overall total using a double, so that
14827 integer overflow is less likely to be a problem. Check for overflow
14828 when converting back to an integer.
5a25e253
PE
14829 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14830 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14831 These were 'int' variables that could overflow on 64-bit hosts;
14832 they were never used, so remove them instead of repairing them.
211a0b2a 14833 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14834 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14835 Previously, this ceilinged at INT_MAX, but that doesn't work on
14836 64-bit machines.
e46bb31a 14837 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14838
c78baabf 14839 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14840 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14841 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14842 when a (possibly-narrower) signed value would do just as well.
14843 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14844
c9d624c6
PE
14845 * alloc.c: Catch some string size overflows that we were missing.
14846 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14847 for convenience in STRING_BYTES_MAX.
14848 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14849 The definition here is exact; the one in lisp.h was approximate.
14850 (allocate_string_data): Check for string overflow. This catches
14851 some instances we weren't catching before. Also, it catches
14852 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14853 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14854 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14855
c9d624c6
PE
14856 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14857 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14858 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14859
353032ce
PE
14860 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14861
2bccce07
PE
14862 * alloc.c (Fmake_string): Check for out-of-range init.
14863
0ac30604
SM
148642011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14865
14866 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14867
c195f2de
JD
148682011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14869
14870 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14871 xg_get_default_scrollbar_width.
14872
14873 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14874 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14875 (style_changed_cb): Call update_theme_scrollbar_width and call
14876 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14877 all frames (Bug#8505).
14878 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14879 Call gtk_window_set_resizable if HAVE_GTK3.
14880 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14881 and height if HAVE_GTK3 (Bug#8505).
14882 (scroll_bar_width_for_theme): New variable.
14883 (update_theme_scrollbar_width): New function.
14884 (xg_get_default_scrollbar_width): Move code to
14885 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14886 (xg_initialize): Call update_theme_scrollbar_width.
14887
14888 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14889
14890 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14891
e10ac9f1
MR
148922011-06-12 Martin Rudalics <rudalics@gmx.at>
14893
14894 * frame.c (make_frame): Call other_buffer_safely instead of
14895 other_buffer.
14896
14897 * window.c (temp_output_buffer_show): Call display_buffer with
14898 second argument Vtemp_buffer_show_specifiers and reset latter
14899 immediately after the call.
14900 (Vtemp_buffer_show_specifiers): New variable.
14901 (auto_window_vscroll_p, next_screen_context_lines)
14902 (Vscroll_preserve_screen_position): Remove leading asterisks from
14903 doc-strings.
14904
2d3c217e 149052011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 14906
7b7f97e8 14907 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
14908 * buffer.c (Qclone_number): Remove for now, as it's unused.
14909 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14910 (record_buffer): Remove unused local.
14911 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14912 (set_frame_buffer_list): Remove; unused.
14913 * frame.h (other_visible_frames): Remove decl.
14914 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14915 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14916 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14917 if HAVE_GPM.
14918 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14919 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
14920 Define only if HAVE_GPM.
14921 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
14922 (update_hints_inhibit): Remove; never set. All uses removed.
14923 * widgetprv.h (emacsFrameClassRec): Remove decl.
14924 * window.c (delete_deletable_window): Now returns void, since it
14925 wasn't returning anything.
14926 (compare_window_configurations): Remove unused locals.
14927 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
14928 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
14929 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
14930 the same widths as pointers. This follows up on the 2011-05-06 patch.
14931 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
14932 * xterm.h: Likewise.
14933 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
14934
1384b89e
JB
149352011-06-12 Juanma Barranquero <lekktu@gmail.com>
14936
14937 * makefile.w32-in: Update dependencies.
14938 (LISP_H): Add lib/intprops.h.
14939
1100a63c
CY
149402011-06-11 Chong Yidong <cyd@stupidchicken.com>
14941
14942 * image.c (gif_load): Add animation frame delay to the metadata.
14943 (syms_of_image): Use DEFSYM. New symbol `delay'.
14944
6198ccd0
MR
149452011-06-11 Martin Rudalics <rudalics@gmx.at>
14946
14947 * window.c (delete_deletable_window): Re-add.
14948 (Fset_window_configuration): Rewrite to handle dead buffers and
14949 consequently deletable windows.
14950 (window_tree, Fwindow_tree): Remove. Supply functionality in
14951 window.el.
14952 (compare_window_configurations): Simplify code.
14953
b6e3633c
AS
149542011-06-11 Andreas Schwab <schwab@linux-m68k.org>
14955
1ab0dee5
AS
14956 * image.c (imagemagick_load_image): Fix type mismatch.
14957 (Fimagemagick_types): Likewise.
14958
b6e3633c
AS
14959 * window.h (replace_buffer_in_windows): Declare.
14960
9397e56f
MR
149612011-06-11 Martin Rudalics <rudalics@gmx.at>
14962
14963 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
14964 Qclone_number. Remove external declaration of Qdelete_window.
14965 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
14966 code.
640c8776
SM
14967 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
14968 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
14969 (Fother_buffer): Rewrite doc-string. Major rewrite for new
14970 buffer list implementation.
14971 (other_buffer_safely): New function.
14972 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
14973 calls to replace_buffer_in_windows and
14974 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
14975 if allowed.
14976 (record_buffer): Inhibit quitting and rewrite using quittable
14977 functions. Run Qbuffer_list_update_hook if allowed.
14978 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
14979 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
14980 Move switch-to-buffer to window.el.
9397e56f
MR
14981 (bury-buffer): Move to window.el.
14982 (Vbuffer_list_update_hook): New variable.
14983
14984 * lisp.h (other_buffer_safely): Add prototype in buffer.c
14985 section.
14986
14987 * window.h (resize_frame_windows): Move up in code.
14988 (Fwindow_frame): Remove EXFUN.
14989 (replace_buffer_in_all_windows): Remove prototype.
14990 (replace_buffer_in_windows_safely): Add prototype.
14991
14992 * window.c: Declare Qdelete_window static again. Move down
14993 declaration of select_count.
14994 (Fnext_window, Fprevious_window): Rewrite doc-strings.
14995 (Fother_window): Move to window.el.
14996 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
14997 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
14998 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
14999 window.el.
15000 (replace_buffer_in_windows): Implement by calling
15001 Qreplace_buffer_in_windows.
15002 (replace_buffer_in_all_windows): Remove with some functionality
15003 moved into replace_buffer_in_windows_safely.
15004 (replace_buffer_in_windows_safely): New function.
15005 (select_window_norecord, select_frame_norecord): Move in front
15006 of run_window_configuration_change_hook. Remove now obsolete
15007 declarations.
640c8776
SM
15008 (Fset_window_buffer): Rewrite doc-string.
15009 Call Qrecord_window_buffer.
9397e56f
MR
15010 (keys_of_window): Move binding for other-window to window.el.
15011
b50691aa
CY
150122011-06-11 Chong Yidong <cyd@stupidchicken.com>
15013
15014 * dispextern.h (struct image): Replace data member, whose int_val
15015 and ptr_val fields were not used by anything, with a single
15016 lisp_val object.
15017
15018 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15019 (gif_clear_image, gif_load, imagemagick_load_image)
15020 (gs_clear_image, gs_load): Callers changed.
15021
3f754b86
PE
150222011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15023
cca69397
PE
15024 * buffer.h: Include <time.h>, for time_t.
15025 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15026
109e28d0
PE
15027 Fix minor problems found by static checking.
15028
60737f02
PE
15029 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15030
4b66faf3
PE
15031 Make identifiers static if they are not used in other modules.
15032 * data.c (Qcompiled_function, Qframe, Qvector):
15033 * image.c (QimageMagick, Qsvg):
15034 * minibuf.c (Qmetadata):
15035 * window.c (resize_window_check, resize_root_window): Now static.
15036 * window.h (resize_window_check, resize_root_window): Remove decls.
15037
109e28d0
PE
15038 * window.c (window_deletion_count, delete_deletable_window):
15039 Remove; unused.
46a4ce9e
PE
15040 (window_body_lines): Now static.
15041 (Fdelete_other_windows_internal): Mark vars as initialized.
15042 Make sure 'resize_failed' is initialized.
15043 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15044 (resize_window_apply): Remove unused local.
15045 * window.h (delete_deletable_window): Remove decl.
15046
109e28d0 15047 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
15048 (imagemagick_load_image): Fix pointer signedness problem by changing
15049 last arg from unsigned char * to char *. All uses changed.
15050 Also, fix a local for similar reasons.
15051 Remove unused locals. Remove locals to avoid shadowing.
15052 (fn_rsvg_handle_free): Remove; unused.
15053 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 15054 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 15055
3f754b86
PE
15056 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15057
2547adb1
CY
150582011-06-10 Chong Yidong <cyd@stupidchicken.com>
15059
15060 * image.c (gif_load): Fix omitted cast error introduced by
15061 2011-06-06 change.
15062
2c8e37d4
MR
150632011-06-10 Martin Rudalics <rudalics@gmx.at>
15064
15065 * window.h (resize_proportionally, orig_total_lines)
15066 (orig_top_line): Remove from window structure.
15067 (set_window_height, set_window_width, change_window_heights)
15068 (Fdelete_window): Remove prototypes.
15069 (resize_frame_windows): Remove duplicate declaration.
15070
440a42e3
EZ
150712011-06-10 Eli Zaretskii <eliz@gnu.org>
15072
15073 * window.h (resize_frame_windows, resize_window_check)
15074 (delete_deletable_window, resize_root_window)
15075 (resize_frame_windows): Declare prototypes.
15076
15077 * window.c (resize_window_apply): Make definition be "static" to
15078 match the prototype.
15079
562dd5e9
MR
150802011-06-10 Martin Rudalics <rudalics@gmx.at>
15081
15082 * window.c: Remove declarations of Qwindow_size_fixed,
15083 window_min_size_1, window_min_size_2, window_min_size,
15084 size_window, window_fixed_size_p, enlarge_window, delete_window.
15085 Remove static from declaration of Qdelete_window, it's
15086 temporarily needed by Fbury_buffer.
15087 (replace_window): Don't assign orig_top_line and
15088 orig_total_lines.
15089 (Fdelete_window, delete_window): Remove. Window deletion is
15090 handled by window.el.
640c8776
SM
15091 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15092 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
15093 (Fdelete_other_windows): Remove. Deleting other windows is
15094 handled by window.el.
15095 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15096 handled in window.el.
15097 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15098 Window minimum sizes are handled in window.el.
15099 (shrink_windows, size_window, set_window_height)
15100 (set_window_width, change_window_heights, window_height)
15101 (window_width, CURBEG, CURSIZE, enlarge_window)
15102 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15103 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15104 handled in window.el.
15105 (make_dummy_parent): Rename to make_parent_window and give it a
15106 second argument horflag.
15107 (make_window): Don't set resize_proportionally any more.
15108 (Fsplit_window): Remove. Windows are split in window.el.
15109 (save_restore_action, save_restore_orig_size)
15110 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15111 Resize mini windows in window.el.
15112 (grow_mini_window, shrink_mini_window): Implement by calling
15113 Qresize_root_window_vertically, resize_window_check and
15114 resize_window_apply.
640c8776
SM
15115 (saved_window, Fset_window_configuration, save_window_save):
15116 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
15117 resize_proportionally.
15118 (window_min_height, window_min_width): Move to window.el.
15119 (keys_of_window): Move bindings for delete-other-windows,
15120 split-window, delete-window and enlarge-window to window.el.
15121
15122 * buffer.c: Temporarily extern Qdelete_window.
15123 (Fbury_buffer): Temporarily call Qdelete_window instead of
15124 Fdelete_window (Fbury_buffer will move to window.el soon).
15125
15126 * frame.c (set_menu_bar_lines_1): Remove code handling
15127 orig_top_line and orig_total_lines.
15128
15129 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15130 set_window_height but set heights directly.
15131 (change_frame_size_1): Use resize_frame_windows.
15132
15133 * xdisp.c (init_xdisp): Don't use set_window_height but set
15134 heights directly.
15135
640c8776
SM
15136 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15137 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
15138 run_window_configuration_change_hook.
15139
15140 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15141 instead of change_window_heights and run
15142 run_window_configuration_change_hook.
15143
1a13852e
MR
151442011-06-09 Martin Rudalics <rudalics@gmx.at>
15145
15146 * window.c (replace_window): Rename second argument REPLACEMENT to
15147 NEW. New third argument SETFLAG. Rewrite.
15148 (delete_window, make_dummy_parent): Call replace_window with
15149 third argument 1.
15150 (window_list_1): Move down in code.
15151 (run_window_configuration_change_hook): Move set_buffer part
15152 before select_frame_norecord part in order to unwind correctly.
15153 Rename count1 to count.
15154 (recombine_windows, delete_deletable_window, resize_root_window)
15155 (Fdelete_other_windows_internal)
15156 (Frun_window_configuration_change_hook, make_parent_window)
15157 (resize_window_check, resize_window_apply, Fresize_window_apply)
15158 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
15159 (Fdelete_window_internal, Fresize_mini_window_internal):
15160 New functions.
1a13852e
MR
15161 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15162
f3d1777e
MR
151632011-06-08 Martin Rudalics <rudalics@gmx.at>
15164
496e208e
MR
15165 * window.h (window): Add some new members to window structure -
15166 normal_lines, normal_cols, new_total, new_normal, clone_number,
15167 splits, nest, prev_buffers, next_buffers.
15168 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 15169 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 15170
f3d1777e
MR
15171 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15172 Remove.
496e208e
MR
15173 (make_dummy_parent): Set new members of windows structure.
15174 (make_window): Move down in code. Handle new members of window
15175 structure.
15176 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15177 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15178 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15179 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
15180 (Fset_window_next_buffers, Fset_window_clone_number):
15181 New functions.
496e208e
MR
15182 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15183 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15184 Doc-string fixes.
15185 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15186 Argument WINDOW can be now internal window too.
15187 (Fwindow_use_time): Move up in code.
15188 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15189 Rewrite doc-string.
15190 (Fset_window_configuration, saved_window)
15191 (Fcurrent_window_configuration, save_window_save): Handle new
15192 members of window structure.
b9e809c2
MR
15193 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15194 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15195 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15196 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15197 Qget_mru_window, Qresize_root_window,
15198 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15199 Qauto_buffer_name; staticpro them.
f3d1777e 15200
abde8f8c
MR
152012011-06-07 Martin Rudalics <rudalics@gmx.at>
15202
15203 * window.c (Fwindow_total_size, Fwindow_left_column)
15204 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15205 (Fwindow_list_1): New functions.
15206 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
15207 (Fwindow_width, Fscroll_left, Fscroll_right):
15208 Use window_body_cols instead of window_box_text_cols.
15209 (delete_window, Fset_window_configuration):
15210 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
15211 (delete_all_subwindows): Take a window as argument and not a
15212 structure. Rewrite.
190b47e6
MR
15213 (window_loop): Remove handling of GET_LRU_WINDOW and
15214 GET_LARGEST_WINDOW.
15215 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
15216
15217 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
15218 window_box_text_cols. delete_all_subwindows now takes a
15219 Lisp_Object as argument.
abde8f8c 15220
640c8776
SM
15221 * indent.c (compute_motion, Fcompute_motion):
15222 Use window_body_cols instead of window_box_text_cols.
abde8f8c 15223
fa8a67e6
MR
15224 * frame.c (delete_frame): Call delete_all_subwindows with root
15225 window as argument.
15226
a54e3482
DC
152272011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15228
15229 * fns.c (Fputhash): Document return value.
15230
60002bf5
CY
152312011-06-06 Chong Yidong <cyd@stupidchicken.com>
15232
15233 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15234
0c671da6 152352011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 15236
b862a52a 15237 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 15238
be44ca6c
PE
15239 Check for overflow when converting integer to cons and back.
15240 * charset.c (Fdefine_charset_internal, Fdecode_char):
15241 Use cons_to_unsigned to catch overflow.
15242 (Fencode_char): Use INTEGER_TO_CONS.
15243 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15244 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15245 * data.c (long_to_cons, cons_to_long): Remove.
15246 (cons_to_unsigned, cons_to_signed): New functions.
15247 These signal an error for invalid or out-of-range values.
15248 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15249 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15250 * font.c (Ffont_variation_glyphs):
15251 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15252 * lisp.h: Include <intprops.h>.
15253 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15254 (cons_to_signed, cons_to_unsigned): New decls.
15255 (long_to_cons, cons_to_long): Remove decls.
15256 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15257 (Fprimitive_undo): Use CONS_TO_INTEGER.
15258 * xfns.c (Fx_window_property): Likewise.
15259 * xselect.c: Include <limits.h>.
15260 (x_own_selection, selection_data_to_lisp_data):
15261 Use INTEGER_TO_CONS.
15262 (x_handle_selection_request, x_handle_selection_clear)
15263 (x_get_foreign_selection, Fx_disown_selection_internal)
15264 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15265 (lisp_data_to_selection_data): Use cons_to_unsigned.
15266 (x_fill_property_data): Use cons_to_signed.
15267 Report values out of range.
15268
d1f3d2af
PE
15269 Check for buffer and string overflow more precisely.
15270 * buffer.h (BUF_BYTES_MAX): New macro.
15271 * lisp.h (STRING_BYTES_MAX): New macro.
15272 * alloc.c (Fmake_string):
15273 * character.c (string_escape_byte8):
15274 * coding.c (coding_alloc_by_realloc):
15275 * doprnt.c (doprnt):
15276 * editfns.c (Fformat):
15277 * eval.c (verror):
15278 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15279 since they may not be the same number.
15280 * editfns.c (Finsert_char):
15281 * fileio.c (Finsert_file_contents):
15282 Likewise for BUF_BYTES_MAX.
15283
dd52fcea
PE
15284 * image.c: Use ptrdiff_t, not int, for sizes.
15285 (slurp_file): Switch from int to ptrdiff_t.
15286 All uses changed.
15287 (slurp_file): Check that file size fits in both size_t (for
15288 malloc) and ptrdiff_t (for sanity and safety).
15289
7f9bbdbb
PE
15290 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15291 if b->modtime has its maximal value.
15292
dfe18f82
PE
15293 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15294
84acfcf0
PE
15295 Don't assume time_t can fit into int.
15296 * buffer.h (struct buffer.modtime): Now time_t, not int.
15297 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15298 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15299
ccd9a01a
PE
15300 Minor fixes for signed vs unsigned integers.
15301 * character.h (MAYBE_UNIFY_CHAR):
15302 * charset.c (maybe_unify_char):
15303 * keyboard.c (read_char, reorder_modifiers):
15304 XINT -> XFASTINT, since the integer must be nonnegative.
15305 * ftfont.c (ftfont_spec_pattern):
15306 * keymap.c (access_keymap, silly_event_symbol_error):
15307 XUINT -> XFASTINT, since the integer must be nonnegative.
15308 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15309 since it makes no difference and we prefer signed.
15310 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15311 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15312 nonnegative.
15313
d6d100dd
SM
153142011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15315
15316 * window.h (Fwindow_frame): Declare.
15317
2b6148e4
PE
153182011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15319
15320 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15321 (SPARE_MEMORY): Always define.
15322 (LARGE_REQUEST): Remove.
15323 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15324
f230ecc9
MR
153252011-06-06 Martin Rudalics <rudalics@gmx.at>
15326
727e958e
MR
15327 * lisp.h: Move EXFUNS for Fframe_root_window,
15328 Fframe_first_window and Fset_frame_selected_window to window.h.
15329
15330 * window.h: Move EXFUNS for Fframe_root_window,
15331 Fframe_first_window and Fset_frame_selected_window here from
15332 lisp.h.
15333
15334 * frame.c (Fwindow_frame, Fframe_first_window)
15335 (Fframe_root_window, Fframe_selected_window)
15336 (Fset_frame_selected_window): Move to window.c.
15337 (Factive_minibuffer_window): Move to minibuf.c.
15338 (Fother_visible_frames_p): New function.
15339
15340 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15341
f230ecc9
MR
15342 * window.c (decode_window, decode_any_window): Move up in code.
15343 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15344 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
15345 (Fwindow_buffer): Move up and rewrite doc-string.
15346 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15347 (Fwindow_prev): New functions.
727e958e
MR
15348 (Fwindow_frame): Move here from frame.c. Accept any window as
15349 argument.
15350 (Fframe_root_window, Fframe_first_window)
15351 (Fframe_selected_window): Move here from frame.c. Accept frame
15352 or arbitrary window as argument. Update doc-strings.
15353 (Fminibuffer_window): Move up in code.
15354 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
15355 (Fset_frame_selected_window): Move here from frame.c.
15356 Marginal rewrite.
727e958e
MR
15357 (Fselected_window, select_window, Fselect_window): Move up in
15358 code. Minor doc-string fixes.
f230ecc9 15359
4d09bcf6
PE
153602011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15361
15362 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15363 Do not assume that spare memory exists; that assumption is valid
15364 only if SYSTEM_MALLOC.
15365 (LARGE_REQUEST): New macro, so that the issue of large requests
15366 is separated from the issue of spare memory.
15367
810928a2
AS
153682011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15369
172418ad
AS
15370 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15371 format. (Bug#8806)
15372
43f862f7
AS
15373 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15374
810928a2
AS
15375 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15376 before statements.
15377
a059fe24
JD
153782011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15379
15380 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15381
15382 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15383
15384 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15385 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15386
989bf368
JB
153872011-06-05 Juanma Barranquero <lekktu@gmail.com>
15388
15389 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15390
4b80f674
CY
153912011-06-04 Chong Yidong <cyd@stupidchicken.com>
15392
15393 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15394 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
15395 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15396 New error handlers.
4b80f674
CY
15397 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15398 Obey Vx_select_enable_clipboard_manager. Catch errors in
15399 x_clipboard_manager_save (Bug#8779).
15400 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15401 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15402
99a33b77 154032011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15404
15405 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15406
99a33b77 154072011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15408
15409 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15410 in the current matrix if keep_current_p is non-zero.
15411
8264569d
EZ
154122011-06-04 Eli Zaretskii <eliz@gnu.org>
15413
15414 * bidi.c (bidi_level_of_next_char): Fix last change.
15415
57f97249
EZ
154162011-06-03 Eli Zaretskii <eliz@gnu.org>
15417
fec2107c 15418 Support bidi reordering of text covered by display properties.
57f97249 15419
fec2107c
EZ
15420 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15421 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15422 (bidi_cache_search, bidi_cache_iterator_state)
15423 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15424 (bidi_level_of_next_char, bidi_move_to_visually_next):
15425 Support character positions inside a run of characters covered by a
fec2107c
EZ
15426 display string.
15427 (bidi_paragraph_init, bidi_resolve_explicit_1)
15428 (bidi_level_of_next_char): Call bidi_fetch_char and
15429 bidi_fetch_char_advance instead of FETCH_CHAR and
15430 FETCH_CHAR_ADVANCE.
15431 (bidi_init_it): Initialize new members.
15432 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15433 definitions.
15434 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15435 instead of using explicit *_CHAR codes.
d6d100dd
SM
15436 (bidi_resolve_explicit, bidi_resolve_weak):
15437 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15438 bidirectional text is supported only in multibyte buffers.
15439 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15440 it to initialize the frame_window_p member of struct bidi_it.
15441 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15442 (bidi_resolve_explicit, bidi_resolve_weak)
15443 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15444 bidi_it->nchars is non-positive.
15445 (bidi_level_of_next_char): Don't try to lookup the cache for the
15446 next/previous character if nothing is cached there yet, or if we
15447 were just reseat()'ed to a new position.
c40e2fb2 15448
0e14fe90
EZ
15449 * xdisp.c (set_cursor_from_row): Set start and stop points
15450 according to the row's direction when priming the loop that looks
15451 for the glyph on which to display cursor.
15452 (single_display_spec_intangible_p): Function deleted.
15453 (display_prop_intangible_p): Reimplement to call
15454 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15455 Accept 3 additional arguments needed by handle_display_spec.
15456 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15457 values: lists, `(when COND...)' forms, etc.
15458 (single_display_spec_string_p): Support property values that are
15459 lists with the argument STRING its top-level element.
15460 (display_prop_string_p): Fix the condition for processing a
15461 property that is a list to be consistent with handle_display_spec.
fec2107c 15462 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15463 last portion of handle_display_prop.
15464 (compute_display_string_pos): Accept additional argument
15465 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15466 value of a `display' property is a "replacing spec".
15467 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15468 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15469 the display property, but just return a value indicating whether
15470 the display property will replace the characters it covers.
15471 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15472 frame_window_p members of struct bidi_it.
d6d100dd
SM
15473 (compute_display_string_pos, compute_display_string_end):
15474 New functions.
fec2107c
EZ
15475 (push_it): Accept second argument POSITION, where pop_it should
15476 jump to continue iteration.
15477 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15478
fec2107c
EZ
15479 * keyboard.c (adjust_point_for_property): Adjust the call to
15480 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15481
15482 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15483 (bidi_init_it): Update prototypes.
15484 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15485 (compute_display_string_pos, compute_display_string_end):
15486 Declare prototypes.
fec2107c
EZ
15487 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15488 EMACS_INT.
fc6f18ce 15489
40087514 154902011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15491
57f53182
PE
15492 Malloc failure behavior now depends on size of allocation.
15493 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15494 * lisp.h: Change signatures accordingly.
15495 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15496 All callers changed. (Bug#8762)
15497
15498 * gnutls.c: Use Emacs's memory allocators.
15499 Without this change, the gnutls library would invoke malloc etc.
15500 directly, which causes problems on non-SYNC_INPUT hosts, and which
15501 runs afoul of improving memory_full behavior. (Bug#8761)
15502 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15503 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15504 xfree instead of the default malloc, realloc, free.
15505 (Fgnutls_boot): No need to check for memory allocation failure,
15506 since xmalloc does that for us.
15507
ac32cd99 15508 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15509 * category.c (hash_get_category_set):
15510 * ccl.c (ccl_driver):
15511 * charset.c (Fdefine_charset_internal):
15512 * charset.h (struct charset.hash_index):
15513 * composite.c (get_composition_id, gstring_lookup_cache)
15514 (composition_gstring_put_cache):
15515 * composite.h (struct composition.hash_index):
15516 * dispextern.h (struct image.hash):
15517 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15518 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15519 (hashfn_equal, hashfn_user_defined, make_hash_table)
15520 (maybe_resize_hash_table, hash_lookup, hash_put)
15521 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15522 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15523 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15524 * image.c (make_image, search_image_cache, lookup_image)
15525 (xpm_put_color_table_h):
15526 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15527 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15528 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15529 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15530 * alloc.c (allocate_vectorlike):
15531 Check for overflow in vector size calculations.
15532 * ccl.c (ccl_driver):
15533 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15534 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15535 need to be updated by these changes.
40087514
PE
15536 * fns.c (make_hash_table, maybe_resize_hash_table):
15537 Check for integer overflow with large hash tables.
0de4bb68
PE
15538 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15539 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15540 (SXHASH_REDUCE): New macro.
15541 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15542 Use it instead of discarding useful hash info with large hash values.
15543 (sxhash_float): New function.
15544 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15545 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15546 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15547 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15548 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15549 Adjust signatures to match updated version of code.
15550 (consing_since_gc): Now EMACS_INT, since a single hash table can
15551 use more than INT_MAX bytes.
15552
698d32e2
DN
155532011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15554
15555 Make it possible to build with GCC-4.6+ -O2 -flto.
15556
15557 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15558
fd6fa53f
SM
155592011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15560
15561 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15562 Call minibuffer-inactive-mode.
15563
864db017
JB
155642011-05-31 Juanma Barranquero <lekktu@gmail.com>
15565
15566 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15567 Update dependencies.
15568
2ad0baf4
DN
155692011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15570
15571 * data.c (init_data): Remove code for UTS, this system is not
15572 supported anymore.
15573
4fcc2638
DN
155742011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15575
15576 Don't force ./temacs to start in terminal mode.
15577
15578 * frame.c (make_initial_frame): Initialize faces in all cases, not
15579 only when CANNOT_DUMP is defined.
15580 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15581
c56e0fd5
DN
155822011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15583
15584 * dispnew.c (add_window_display_history): Use const for the string
15585 pointer. Remove declaration, not needed.
15586
333d54da 155872011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15588
55d4c1b2 15589 Use 'inline', not 'INLINE'.
333d54da 15590 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15591 * alloc.c, fontset.c (INLINE): Remove.
15592 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15593 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15594 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15595 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15596 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15597
738db178
DN
155982011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15599
15600 Make it possible to run ./temacs.
15601
15602 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15603 syms_of_callproc does the same thing. Remove test for
15604 "initialized", do it in the caller.
15605 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15606
620c53a6
SM
156072011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15608
15609 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15610 (read_minibuf): Use get_minibuffer.
15611 (syms_of_minibuf): Use DEFSYM.
15612 (Qmetadata): New var.
15613 * data.c (Qbuffer): Don't make it static.
15614 (syms_of_data): Use DEFSYM.
15615
e003a292
PE
156162011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15617
15618 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15619 (CCL_CODE_MIN): New macro.
15620
ed008a6d
PE
156212011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15622
3687c2ef
PE
15623 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15624
ed008a6d
PE
15625 * eval.c (Qdebug): Now static.
15626 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15627 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15628 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15629
d66c4c7c
CY
156302011-05-29 Chong Yidong <cyd@stupidchicken.com>
15631
15632 * image.c: Various fixes to ImageMagick code comments.
15633 (Fimagemagick_types): Doc fix.
15634
5fbc2025
PE
156352011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15636
0196f88a
PE
15637 Minor fixes prompted by GCC 4.6.0 warnings.
15638
15639 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15640
5fbc2025
PE
15641 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15642 (x_clipboard_manager_save_all): Move extern decl to ...
15643 * xterm.h: ... here, so that it can be checked for consistency.
15644
1dd3c2d9
CY
156452011-05-29 Chong Yidong <cyd@stupidchicken.com>
15646
15647 * xselect.c (x_clipboard_manager_save_frame)
15648 (x_clipboard_manager_save_all): New functions.
15649 (Fx_clipboard_manager_save): Lisp function deleted.
15650
15651 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15652 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15653
15654 * xterm.h: Update prototype.
15655
5ba6571d
WX
156562011-05-28 William Xu <william.xwl@gmail.com>
15657
15658 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15659 exiting (Bug#8239).
15660
3eaff834
JM
156612011-05-28 Jim Meyering <meyering@redhat.com>
15662
e1900994 15663 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15664 * fns.c (to_uchar): Define.
15665 (crypto_hash_function): Use it to convert some newly-signed
15666 variables to unsigned, to avoid sign-extension bugs. For example,
15667 without this change, (md5 "truc") would evaluate to
15668 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15669 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15670 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15671
0f6990a7
PE
156722011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15673
15674 Integer overflow fixes.
c8a9ca5a 15675
08686060
PE
15676 * dbusbind.c: Serial number integer overflow fixes.
15677 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15678 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15679 to hold a serial number that is too large for a fixnum.
15680 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15681 Check for serial numbers out of range. Decode any serial number
59568bf0 15682 that was so large that it became a float. (Bug#8722)
08686060 15683
2d1fc3c7
PE
15684 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15685 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15686 Use XFASTINT rather than XUINT when numbers are nonnegative.
15687 (xd_append_arg, Fdbus_method_return_internal):
15688 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15689 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15690 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15691 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15692 (Bug#8722)
2d1fc3c7 15693
c8a9ca5a
PE
15694 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15695
519e1d69
PE
15696 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15697
6df6ae42 15698 ccl: Add integer overflow checks.
30569699
PE
15699 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15700 (IN_INT_RANGE): New macros.
15701 (ccl_driver): Use them to check for integer overflow when
15702 decoding a CCL program. Many of the new checks are whether XINT (x)
15703 fits in int; it doesn't always, on 64-bit hosts. The new version
15704 doesn't catch all possible integer overflows, but it's an
847044ea 15705 improvement. (Bug#8719)
30569699 15706
c11285dc
PE
15707 * alloc.c (make_event_array): Use XINT, not XUINT.
15708 There's no need for unsigned here.
15709
fdccd48e
PE
15710 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15711 This follows up to the 2011-05-06 change that substituted uintptr_t
15712 for EMACS_INT. This case wasn't caught back then.
15713
37910ab2
PE
15714 Rework Fformat to avoid integer overflow issues.
15715 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15716 now (part of C89). Include <verify.h>.
15717 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15718 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15719 (Fformat): Avoid the prepass trying to compute sizes; it was only
15720 approximate and thus did not catch overflow reliably. Instead, walk
15721 through the format just once, formatting and computing sizes as we go,
15722 checking for integer overflow at every step, and allocating a larger
15723 buffer as needed. Keep track separately whether the format is
15724 multibyte. Keep only the most-recently calculated precision, rather
15725 than them all. Record whether each argument has been converted to
15726 string. Use EMACS_INT, not int, for byte and char and arg counts.
15727 Support field widths and precisions larger than INT_MAX. Avoid
15728 sprintf's undefined behavior with conversion specifications such as %#d
15729 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15730 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15731 formatting out-of-range floating point numbers with int
9173deec 15732 formats. (Bug#8668)
37910ab2 15733
2e6578fb
PE
15734 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15735
0ae6bdee
PE
15736 * data.c: Avoid integer truncation in expressions involving floats.
15737 * data.c: Include <intprops.h>.
15738 (arith_driver): When there's an integer overflow in an expression
15739 involving floating point, convert the integers to floating point
15740 so that the resulting value does not suffer from catastrophic
15741 integer truncation. For example, on a 64-bit host (* 4
15742 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15743 Do not rely on undefined behavior after integer overflow.
15744
de883a70
PE
15745 merge count_size_as_multibyte, parse_str_to_multibyte
15746 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15747 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15748 Check for integer overflow.
15749 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15750 since it's now a duplicate of the other. This is more of
15751 a character than a buffer op, so better that it's in character.c.
15752 * fns.c, print.c: Adjust to above changes.
15753
2ff916cb
PE
157542011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15755
15756 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15757
f1b54466
PE
157582011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15759
fb1ac845
PE
15760 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15761 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15762 (x_clipboard_manager_save): Now static.
15763 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15764
f1b54466
PE
15765 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15766 (crypto_hash_function): Now static.
15767 Fix pointer signedness problems. Avoid unnecessary initializations.
15768
a9f737ee
CY
157692011-05-27 Chong Yidong <cyd@stupidchicken.com>
15770
15771 * termhooks.h (Vselection_alist): Make it terminal-local.
15772
15773 * terminal.c (create_terminal): Initialize it.
15774
15775 * xselect.c: Support for clipboard managers.
15776 (Vselection_alist): Move to termhooks.h as terminal-local var.
15777 (LOCAL_SELECTION): New macro.
15778 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15779 (symbol_to_x_atom): Remove gratuitous arg.
15780 (x_handle_selection_request, lisp_data_to_selection_data)
15781 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15782 (x_own_selection, x_get_local_selection, x_convert_selection):
15783 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15784 (some_frame_on_display): Delete unused function.
15785 (Fx_own_selection_internal, Fx_get_selection_internal)
15786 (Fx_disown_selection_internal, Fx_selection_owner_p)
15787 (Fx_selection_exists_p): New optional frame arg.
15788 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15789 (x_handle_selection_clear): Don't treat other terminals with the
15790 same keyboard specially. Use the terminal-local Vselection_alist.
15791 (x_clear_frame_selections): Use Frun_hook_with_args.
15792
15793 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15794
15795 * xterm.h: Add support for those atoms.
15796
e067f0c1
CY
157972011-05-26 Chong Yidong <cyd@stupidchicken.com>
15798
15799 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15800 (converted_selections, conversion_fail_tag): New global variables.
15801 (x_selection_request_lisp_error): Free the above.
15802 (x_get_local_selection): Remove unnecessary code.
15803 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15804 of converted selections stored in converted_selections.
15805 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15806 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15807 (x_convert_selection): New function.
15808 (x_handle_selection_event): Simplify.
15809 (x_get_foreign_selection): Don't ignore incoming requests while
15810 waiting for an answer; this will fail when we implement
15811 SAVE_TARGETS, and seems unnecessary anyway.
15812 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15813 (Vx_sent_selection_functions): Doc fix.
15814
0f4aebc0
LL
158152011-05-26 Leo Liu <sdl.web@gmail.com>
15816
15817 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15818
e61124cd
YM
158192011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15820
15821 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15822
15823 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15824 for fringe update if it has periodic bitmap.
ac389d0c 15825 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15826 and fringe_bitmap_periodic_p.
15827
15828 * fringe.c (get_fringe_bitmap_data): New function.
15829 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15830 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15831 row. Mark glyph row for fringe update if periodicity changed.
15832
15833 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15834 for fringe update unless it has periodic bitmap.
15835
f16d9837
KH
158362011-05-25 Kenichi Handa <handa@m17n.org>
15837
15838 * xdisp.c (get_next_display_element): Set correct it->face_id for
15839 a static composition.
15840
e1b90ef6
LL
158412011-05-24 Leo Liu <sdl.web@gmail.com>
15842
15843 * deps.mk (fns.o):
15844 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15845
15846 * fns.c (crypto_hash_function, Fsha1): New function.
15847 (Fmd5): Use crypto_hash_function.
15848 (syms_of_fns): Add Ssha1.
15849
7400048f
PE
158502011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15851
15852 * gnutls.c: Remove unused macros.
15853 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15854 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15855 Remove macros that are defined and never used.
15856 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15857
abb71cf4
CY
158582011-05-22 Chong Yidong <cyd@stupidchicken.com>
15859
15860 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15861 (Fx_get_selection_internal): Minor cleanup.
15862 (Fx_own_selection_internal): Rename arguments for consistency with
15863 select.el.
15864
6307db39
PE
158652011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15866
15867 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15868
f3d4e0a4
CY
158692011-05-22 Chong Yidong <cyd@stupidchicken.com>
15870
15871 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15872
4d8ade89
YM
158732011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15874
15875 * dispnew.c (scrolling_window): Don't exclude the case that the
15876 last enabled row in the desired matrix touches the bottom boundary.
15877
32078c8d
GM
158782011-05-21 Glenn Morris <rgm@gnu.org>
15879
15880 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
15881 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15882 and add some more files.
32078c8d 15883
7285dc67
EZ
158842011-05-20 Eli Zaretskii <eliz@gnu.org>
15885
15886 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15887 report_file_error introduced by the change from 2011-05-07.
15888
89d1bd22
PE
158892011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15890
15891 * systime.h (Time): Define only if emacs is defined.
15892 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15893 where the include path doesn't have X11/X.h by default. See
15894 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15895
cd394be1 158962011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
15897
15898 * composite.c (find_automatic_composition): Fix previous change.
15899
b9704ad9
GM
159002011-05-20 Glenn Morris <rgm@gnu.org>
15901
15902 * lisp.mk: New file, split from Makefile.in.
15903 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15904 (shortlisp): Remove.
15905 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15906
4a720484
GM
159072011-05-19 Glenn Morris <rgm@gnu.org>
15908
15909 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15910 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15911 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15912 (lisp): Set the order to that of loadup.el.
15913 (shortlisp): Make it a copy of $lisp.
15914 (SOME_MACHINE_LISP): Remove.
15915 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15916 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15917
a28d4396
KH
159182011-05-18 Kenichi Handa <handa@m17n.org>
15919
15920 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
15921 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
15922 (find_automatic_composition): Mostly rewrite for efficiency.
15923
a2b1fa8e
JB
159242011-05-18 Juanma Barranquero <lekktu@gmail.com>
15925
15926 * makefile.w32-in: Update dependencies.
15927
8e1f5610
CS
159282011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
15929
15930 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 15931 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 15932
7025ee00 159332011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 15934
cdfa6eab
PE
15935 Fix some integer overflow issues, such as string length overflow.
15936
06d6db33
PE
15937 * insdel.c (count_size_as_multibyte): Check for string overflow.
15938
2b4560a8
PE
15939 * character.c (lisp_string_width): Check for string overflow.
15940 Use EMACS_INT, not int, for string indexes and lengths; in
15941 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
15942 the resulting string length overflows an EMACS_INT; instead,
15943 report a string overflow if no precision given. When checking for
15944 precision exhaustion, use a check that cannot possibly have
15945 integer overflow. (Bug#8675)
15946 * character.h (lisp_string_width): Adjust to new signature.
15947
cb93f9be
PE
15948 * alloc.c (string_overflow): New function.
15949 (Fmake_string): Use it. This doesn't change behavior, but saves
15950 a few bytes and will simplify future changes.
15951 * character.c (string_escape_byte8): Likewise.
15952 * lisp.h (string_overflow): New decl.
15953
1a1f3366
PE
15954 Fixups, following up to the user-interface timestamp change.
15955 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
15956 for UI timestamps, instead of unsigned long.
9fbd6841
PE
15957 * msdos.c (mouse_get_pos): Likewise.
15958 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
15959 * w32gui.h (Time): Define by including "systime.h" rather than by
15960 declaring it ourselves. (Bug#8664)
15961
d4e3e4d3
PE
15962 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
15963 * image.c (clear_image_cache): Likewise.
15964
f6a24d19
PE
15965 * term.c (term_mouse_position): Don't assume time_t wraparound.
15966
08dc5ae6
PE
15967 Be more systematic about user-interface timestamps.
15968 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
15969 and sometimes 'EMACS_UINT', to represent these timestamps.
15970 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
15971 This makes the code easier to follow, and makes it easier to catch
15972 integer overflow bugs such as Bug#8664.
15973 * frame.c (Fmouse_position, Fmouse_pixel_position):
15974 Use Time, not unsigned long, for user-interface timestamps.
15975 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
15976 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
15977 * keyboard.h (last_event_timestamp): Likewise.
15978 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
15979 * menu.h (xmenu_show): Likewise.
15980 * term.c (term_mouse_position): Likewise.
15981 * termhooks.h (struct input_event.timestamp): Likewise.
15982 (struct terminal.mouse_position_hook): Likewise.
15983 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
15984 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
15985 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
15986 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
15987 what it was before.
15988 * menu.h, termhooks.h: Include "systime.h", for Time.
15989
8e55734a
PE
15990 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
15991 Don't assume that the difference between two unsigned long values
15992 can fit into an integer. At this point, we know button_down_time
15993 <= event->timestamp, so the difference must be nonnegative, so
15994 there's no need to cast the result if double-click-time is
15995 nonnegative, as it should be; check that it's nonnegative, just in
15996 case. This bug is triggered when events are more than 2**31 ms
86db42d2 15997 apart (about 25 days). (Bug#8664)
8e55734a 15998
841f1b75 15999 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 16000 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 16001
3e26f69c
PE
16002 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16003 that always fit in int. Use a sentinel instead of a counter, to
16004 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
16005 * frame.h (struct frame): Use int for menu_bar_items_used
16006 instead of EMACS_INT, since it always fits in int.
3e26f69c 16007
5cc152c0
PE
16008 * menu.c (grow_menu_items): Check for int overflow.
16009
d89eb65e
PE
16010 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16011
5235bd3e
PE
16012 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16013 Before, the code was not consistent. These values cannot exceed
16014 2**31 - 1 so there's no need to make them unsigned.
16015 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16016 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16017 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16018 as modifiers.
16019 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16020
bc827e23
PE
16021 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16022 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16023 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16024 presumably because the widths might not match.
16025
78eb494e
PE
16026 * window.c (size_window): Avoid needless test at loop start.
16027
04f2d78b
CB
160282011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16029
16030 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16031
d2fc7e3d 160322011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
16033
16034 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16035
d2fc7e3d 160362011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
16037
16038 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16039 `width' to `bar_area_x' and `bar_area_width', respectively.
16040 (x_scroll_run): Take account of fringe background extension.
16041
04f2d78b
CB
16042 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16043 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
16044 `bar_area_width', respectively.
16045 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16046 background extension.
16047
79b70037
GM
160482011-05-10 Jim Meyering <meyering@redhat.com>
16049
16050 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16051
2f142cc5
JB
160522011-05-10 Juanma Barranquero <lekktu@gmail.com>
16053
16054 * image.c (Finit_image_library): Return t for built-in image types,
16055 like pbm and xbm. (Bug#8640)
16056
57679c86
AS
160572011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16058
16059 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16060
888c9e86
EZ
160612011-05-07 Eli Zaretskii <eliz@gnu.org>
16062
b0512a1d
EZ
16063 * w32console.c (Fset_screen_color): Doc fix.
16064 (Fget_screen_color): New function.
16065 (syms_of_ntterm): Defsubr it.
16066
7285dc67
EZ
16067 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16068 unlink the temporary file if Fcall_process didn't create it in the
16069 first place.
16070 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16071 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
16072 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16073 cue to call_process_cleanup not to close that handle.
16074
4d3fcc8e
BK
160752011-05-07 Ben Key <bkey76@gmail.com>
16076
16077 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16078 one of two shell specific rules, either bootstrap-temacs-CMD or
16079 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16080 to the previous implementation of the bootstrap-temacs rule.
16081 The bootstrap-temacs-CMD rule is similar to the previous
16082 implementation of the bootstrap-temacs rule except that it
16083 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16084 variable.
16085
16086 These changes, along with some changes to nt/configure.bat,
16087 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16088 earlier fix to add support for --cflags and --ldflags options
16089 that include quotes so that it works whether make uses cmd or
16090 sh as the shell.
16091
b4289b64
MA
160922011-05-06 Michael Albinus <michael.albinus@gmx.de>
16093
16094 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16095 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16096 is a constant.
16097 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16098 a string. Handle both cases.
16099 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16100 (Fdbus_register_method): Use Qinvalid_function.
16101
af4c0e28
JB
161022011-05-06 Juanma Barranquero <lekktu@gmail.com>
16103
16104 * makefile.w32-in: Update dependencies.
16105 (LISP_H): Add inttypes.h and stdin.h.
16106 (PROCESS_H): Add unistd.h.
16107
c51453d9
EZ
161082011-05-06 Eli Zaretskii <eliz@gnu.org>
16109
16110 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16111 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16112
8ff0ac3c 161132011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 16114
4c4b566b
PE
16115 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16116
aab2b9b5
PE
16117 * term.c (vfatal): Remove stray call to va_end.
16118 It's not needed and the C Standard doesn't allow it here anyway.
16119
c378da0b
PE
16120 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16121 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16122
288b08c7
PE
16123 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16124 bytes.
16125
e3601888
PE
16126 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16127
db6c0e74
PE
16128 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16129
dd5963ea
PE
16130 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16131
88c9450f
PE
16132 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16133
2f9442b8
PE
16134 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16135
c032b5f8
PE
16136 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16137 * charset.c (Fdefine_charset_internal): Don't initialize
16138 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 16139 32-bit int (Bug#8600).
a108c10b
PE
16140
16141 * lread.c (read_integer): Be more consistent with string-to-number.
16142 Use string_to_number to do the actual conversion; this avoids
16143 rounding errors and fixes some other screwups. Without this fix,
16144 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16145 (digit_to_number): Move earlier, for benefit of read_integer.
16146 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 16147 not a digit in any supported base. (Bug#8602)
a108c10b 16148
ad5f9eea
PE
16149 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16150
aec1708a
PE
16151 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16152 to match comment at start of function. This also removes a
16153 GCC warning about overflow in a 32+64-bit port.
16154
47be4ab5
PE
16155 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16156
371cac43
PE
16157 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16158 Reported by Stefan Monnier in
16159 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
16160 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16161 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 16162
d01a7826
PE
16163 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16164 (EMACS_UINTPTR): Likewise, with uintptr_t.
16165
7fd47d5c
PE
16166 * lisp.h: Prefer 64-bit EMACS_INT if available.
16167 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16168 on 32-bit hosts that have 64-bit int, so that they can access
16169 large files.
122b0c86
PE
16170 However, temporarily disable this change unless the temporary
16171 symbol WIDE_EMACS_INT is defined.
7fd47d5c 16172
8727937b
PE
16173 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16174
8ac068ac
PE
16175 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16176 This removes an assumption that EMACS_INT and long are the same
16177 width as pointers. The assumption is true for Emacs porting targets
16178 now, but we want to make other targets possible.
16179 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16180 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16181 In the rest of the code, change types of integers that hold casted
16182 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16183 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16184 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16185 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16186 No need to cast type when ORing.
16187 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16188 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16189 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16190 assume EMACS_INT is the same width as char *.
16191 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16192 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16193 Remove no-longer-needed casts.
16194 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16195 (xg_tool_bar_help_callback, xg_make_tool_item):
16196 Use EMACS_INTPTR to hold an integer
16197 that will be cast to void *; this can avoid a GCC warning
16198 if EMACS_INT is not the same width as void *.
16199 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16200 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16201 (current_message_1, set_message_1):
16202 Use a local to convert to proper width without a cast.
16203 * xmenu.c (dialog_selection_callback): Likewise.
16204
ede49d71
PE
16205 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16206 Also, don't assume VALBITS / RAND_BITS is less than 5,
16207 and don't rely on undefined behavior when shifting a 1 left into
16208 the sign bit.
16209 * lisp.h (get_random): Change signature to match.
16210
2f30ecd0
PE
16211 * lread.c (hash_string): Use size_t, not int, for hash computation.
16212 Normally we prefer signed values; but hashing is special, because
16213 it's better to use unsigned division on hash table sizes so that
16214 the remainder is nonnegative. Also, size_t is the natural width
16215 for hashing into memory. The previous code used 'int', which doesn't
16216 retain enough info to hash well into very large tables.
16217 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16218
2a866e7b
PE
16219 * dbusbind.c: Don't possibly lose pointer info when converting.
16220 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16221 Use XPNTR rather than XHASH, so that the high-order bits of
16222 the pointer aren't lost when converting through void *.
16223
51639eac
PE
16224 * eval.c (Fautoload): Don't double-shift a pointer.
16225
92394119
PE
16226 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16227
dbdb9a7c
JB
162282011-05-06 Juanma Barranquero <lekktu@gmail.com>
16229
16230 * gnutls.c (DEF_GNUTLS_FN):
16231 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16232
db7a0b4f
AS
162332011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16234
16235 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16236 marker. (Bug#8610)
16237
cd394be1 162382011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
16239
16240 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16241 New version that can reserve upto 2GB of heap space.
16242
f7ff1b0f 162432011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
16244
16245 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16246
639c109b
TZ
162472011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16248
16249 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16250 `gnutls_certificate_set_x509_key_file'.
16251
d2127135
JB
162522011-05-05 Juanma Barranquero <lekktu@gmail.com>
16253
16254 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16255 Update dependencies.
16256
e968f4f3
JB
162572011-05-04 Juanma Barranquero <lekktu@gmail.com>
16258
16259 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16260 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16261 Remove unused parameter `fildes'.
16262 * process.c (read_process_output, send_process): Don't pass it.
16263
84d358f0
JB
162642011-05-04 Juanma Barranquero <lekktu@gmail.com>
16265
16266 Fix previous change: the library cache is defined in w32.c.
16267 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16268 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16269
0898ca10
JB
162702011-05-04 Juanma Barranquero <lekktu@gmail.com>
16271
16272 Implement dynamic loading of GnuTLS on Windows.
16273
16274 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16275 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16276 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16277 Declare.
16278
16279 * gnutls.c (Qgnutls_dll): Define.
16280 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16281 (gnutls_*): Declare function pointers.
16282 (init_gnutls_functions): New function to initialize function pointers.
16283 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16284 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16285 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16286 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16287 (emacs_gnutls_write, emacs_gnutls_read)
16288 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16289 (Fgnutls_available_p): New function.
16290 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16291 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16292 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16293
16294 * image.c: Include w32.h.
16295 (Vimage_type_cache): Delete.
16296 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16297 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16298 (w32_delayed_load): Move to w32.c.
16299
16300 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16301
16302 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16303 (w32_delayed_load): Move from image.c. When loading a library, record
16304 its filename in the :loaded-from property of the library id.
16305 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16306 Initialize and staticpro them.
16307 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16308
16309 * process.c: Include lisp.h before w32.h, not after.
16310 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16311 instead of gnutls_record_check_pending.
16312
16313 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16314
ff4de4aa
TZ
163152011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16316
16317 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16318 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16319 as passed in.
16320
abe95abb
JD
163212011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16322
16323 * xterm.c (x_set_frame_alpha): Do not set property on anything
16324 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16325
e16e55d4
JB
163262011-05-02 Juanma Barranquero <lekktu@gmail.com>
16327
16328 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16329
bafcf6a5
JB
163302011-05-02 Juanma Barranquero <lekktu@gmail.com>
16331
16332 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16333 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16334 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16335 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16336 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16337 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16338 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16339 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16340 (Qgnutls_bootprop_callbacks_verify): Make static.
16341
e7a6747f
AS
163422011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16343
19ed11ba
AS
16344 * callproc.c: Indentation fixup.
16345
e7a6747f 16346 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
16347 (wait_for_termination, interruptible_wait_for_termination):
16348 Move after wait_for_termination_1.
e7a6747f 16349
1ef14cb4
LMI
163502011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16351
16352 * sysdep.c (interruptible_wait_for_termination): New function
16353 which is like wait_for_termination, but allows keyboard
16354 interruptions.
16355
16356 * callproc.c (Fcall_process): Add (:file "file") as an option for
16357 the STDOUT buffer.
16358 (Fcall_process_region): Ditto.
16359
330d880c
EZ
163602011-04-30 Eli Zaretskii <eliz@gnu.org>
16361
8db90b73
EZ
16362 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16363 rather than `XVECTOR (FOO)->size'.
16364
330d880c
EZ
16365 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16366 inttypes.h, as a gnulib replacement is used if it not available in
16367 system headers.
16368
15cbd324
EZ
163692011-04-21 Eli Zaretskii <eliz@gnu.org>
16370
16371 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16372 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16373 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16374
16375 * coding.c (coding_alloc_by_realloc): Error out if destination
16376 will grow beyond MOST_POSITIVE_FIXNUM.
16377 (decode_coding_emacs_mule): Abort if there isn't enough place in
16378 charbuf for the composition carryover bytes. Reserve an extra
16379 space for up to 2 characters produced in a loop.
16380 (decode_coding_iso_2022): Abort if there isn't enough place in
16381 charbuf for the composition carryover bytes.
16382
163832011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 16384
ae940cca
EZ
16385 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16386 aborting when %lld or %lll format is passed.
16387 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16388 %llo or %llx format is passed. (Bug#8545)
16389
03ab8921
EZ
16390 * window.c (window_scroll_line_based): Use a marker instead of
16391 simple variables to record original value of point. (Bug#7952)
16392
afda1437
EZ
16393 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16394 produced by %s or %c overflows available buffer space. (Bug#8545)
16395
f76dee0c
PE
163962011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16397
16398 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16399 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16400
fdc5744d
JB
164012011-04-28 Juanma Barranquero <lekktu@gmail.com>
16402
16403 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16404
638f053a
JB
164052011-04-28 Juanma Barranquero <lekktu@gmail.com>
16406
16407 * keyboard.c (Qdelayed_warnings_hook): Define.
16408 (command_loop_1): Run `delayed-warnings-hook'
16409 if Vdelayed_warnings_list is non-nil.
16410 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16411 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16412
d178f871
EZ
164132011-04-28 Eli Zaretskii <eliz@gnu.org>
16414
16415 * doprnt.c (doprnt): Don't return value smaller than the buffer
16416 size if the message was truncated. (Bug#8545).
16417
b124fd93
JB
164182011-04-28 Juanma Barranquero <lekktu@gmail.com>
16419
16420 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16421 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16422
e810457d
PE
164232011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16424
16425 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16426
ea51cceb
JB
164272011-04-27 Juanma Barranquero <lekktu@gmail.com>
16428
16429 * makefile.w32-in: Update dependencies.
16430
94dcfacf
EZ
164312011-04-27 Eli Zaretskii <eliz@gnu.org>
16432
16433 Improve `doprnt' and its usage. (Bug#8545)
16434 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16435 `format_end'. Remove support for %l as a conversion specifier.
16436 Don't use xrealloc. Improve diagnostics when the %l size modifier
16437 is used. Update the commentary.
16438
16439 * eval.c (verror): Simplify calculation of size_t.
16440
16441 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16442 messages.
16443
f61f41d7
PE
164442011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16445
16446 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16447 change.
16448
96fb4434
PE
164492011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16450
16451 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16452 This makes this file independent of the recent pseudovector change.
16453
671875da 164542011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16455
69e9b5a3
PE
16456 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16457
b5f869a7 16458 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16459 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16460 Remove unused local.
c8926152 16461 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16462
841a1577 16463 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16464 GCC 4.6.0 optimizes based on type-based alias analysis.
16465 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16466 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16467 != &v->size, and therefore "v->size = 1; b->size = 2; return
16468 v->size;" must therefore return 1. This assumption is incorrect
16469 for Emacs, since it type-puns struct Lisp_Vector * with many other
16470 types. To fix this problem, this patch adds a new type struct
f904488f 16471 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16472 and pseudovectors, and helps optimizing compilers not get fooled
16473 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16474 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16475 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16476 the size member.
eab3844f
PE
16477 (XSETPVECTYPE): Rewrite in terms of new macro.
16478 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16479 This is a bit clearer, and further avoids the possibility of
16480 undesirable aliasing.
16481 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16482 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16483 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16484 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16485 (ASIZE): Now uses header.size rather than size.
16486 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16487 to avoid the hassle of writing XVECTOR (foo)->header.size.
16488 (struct vectorlike_header): New type.
eab3844f
PE
16489 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16490 object, to help avoid aliasing.
16491 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16492 (SUBRP): Likewise, since Lisp_Subr is a special case.
16493 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16494 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16495 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16496 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16497 changed to be "header.size" and "header.next".
16498 * buffer.h (struct buffer): Likewise.
16499 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16500 * frame.h (struct frame): Likewise.
16501 * process.h (struct Lisp_Process): Likewise.
16502 * termhooks.h (struct terminal): Likewise.
16503 * window.c (struct save_window_data, struct saved_window): Likewise.
16504 * window.h (struct window): Likewise.
16505 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16506 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16507 * buffer.c (init_buffer_once): Likewise.
16508 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16509 special case.
16510 * process.c (Fformat_network_address): Use local var for size,
16511 for brevity.
16512
0df1eac5
PE
16513 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16514
847ab9d1 16515 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16516 * data.c (atof): Remove decl; no longer used or needed.
16517 (digit_to_number): Move to lread.c.
16518 (Fstring_to_number): Use new string_to_number function, to be
16519 consistent with how the Lisp reader treats infinities and NaNs.
16520 Do not assume that floating-point numbers represent EMACS_INT
16521 without losing information; this is not true on most 64-bit hosts.
16522 Avoid double-rounding errors, by insisting on integers when
16523 parsing non-base-10 numbers, as the documentation specifies.
16524 * lisp.h (string_to_number): New decl, replacing ...
16525 (isfloat_string): Remove.
bc0a5c13 16526 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16527 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16528 appears to have been a coding error. Similarly, do not accept
16529 strings like +-1e0 as floating point numbers. Do not report
16530 overflow for integer overflows unless the base is not 10 which
16531 means we have no simple and reliable way to continue.
16532 Break out the floating-point parsing into a new
16533 function string_to_number, so that Fstring_to_number parses
16534 floating point numbers consistently with the Lisp reader.
04f2d78b 16535 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16536 (E_CHAR, EXP_INT): Remove, replacing with ...
16537 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16538 (string_to_number): New function, replacing isfloat_string.
16539 This function checks for valid syntax and produces the resulting
16540 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16541 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16542 so that overflow for non-base-10 numbers is reported only when
16543 there's no portable and simple way to convert to floating point.
452f4150 16544
67769ffc
PE
16545 * textprop.c (set_text_properties_1): Rewrite for clarity,
16546 and to avoid GCC warning about integer overflow.
16547
c20db43f
PE
16548 * intervals.h (struct interval): Use EMACS_INT for members
16549 where EMACS_UINT might cause problems. See
16550 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16551 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16552 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16553 All uses changed.
37aa2f85
PE
16554 (offset_intervals): Tell GCC not to worry about length overflow
16555 when negating a negative length.
c20db43f 16556
2538aa2f
PE
16557 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16558 (overrun_check_free): Likewise.
16559
f2d3008d
PE
16560 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16561 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16562 word size.
16563
ec8df744
PE
16564 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16565 (gnutls_make_error): Rename local to avoid shadowing.
16566 (gnutls_emacs_global_deinit): ifdef out; not used.
16567 (Fgnutls_boot): Use const for pointer to readonly storage.
16568 Comment out unused local. Fix pointer signedness problems.
16569
640ee02d
PE
16570 * lread.c (openp): Don't stuff size_t into an 'int'.
16571 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16572 about possible signed overflow.
16573
6048fb2a
PE
16574 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16575 (GDK_KEY_g): Don't define if already defined.
16576 (xg_prepare_tooltip): Avoid pointer signedness problem.
16577 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16578
fa3c87e1
PE
16579 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16580 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16581
2172544b
PE
16582 * xfns.c (Fx_window_property): Simplify a bit,
16583 to make a bit faster and to avoid GCC 4.6.0 warning.
16584 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16585
9b821a21
PE
16586 * fns.c (internal_equal): Don't assume size_t fits in int.
16587
3c616cfa
PE
16588 * alloc.c (compact_small_strings): Tighten assertion a little.
16589
c2982e87
PE
16590 Replace pEd with more-general pI, and fix some printf arg casts.
16591 * lisp.h (pI): New macro, generalizing old pEd macro to other
16592 conversion specifiers. For example, use "...%"pI"d..." rather
16593 than "...%"pEd"...".
16594 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16595 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16596 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16597 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16598 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16599 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16600 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16601 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16602 64-bit hosts.
16603 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16604 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16605 * print.c (safe_debug_print, print_object): Likewise.
16606 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16607 to int.
6f04d126
PE
16608 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16609 avoiding the 0 flag, which is not portable.
c2982e87
PE
16610 * process.c (Fmake_network_process): Use pI to avoid cast.
16611 * region-cache.c (pp_cache): Likewise.
16612 * xdisp.c (decode_mode_spec): Likewise.
16613 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16614 behavior on 64-bit hosts with printf arg.
6f04d126 16615 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16616 (x_stop_queuing_selection_requests): Likewise.
16617 (x_get_window_property): Don't truncate byte count to an 'int'
16618 when tracing.
0b432f21 16619
5e073ec7
PE
16620 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16621 here, since it parses constructs like leading '-' and spaces,
16622 which are not wanted; and it overflows with large numbers.
16623 Instead, simply match F[0-9]+, which is what is wanted anyway.
16624
36372bf9
PE
16625 * alloc.c: Remove unportable assumptions about struct layout.
16626 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16627 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16628 (allocate_vectorlike, make_pure_vector): Use the new macros,
16629 plus offsetof, to remove unportable assumptions about struct layout.
16630 These assumptions hold on all porting targets that I know of, but
16631 they are not guaranteed, they're easy to remove, and removing them
16632 makes further changes easier.
16633
0b432f21
PE
16634 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16635 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16636 (string_overrun_cookie): Now const. Use initializers that
16637 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16638 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16639 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16640 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16641 multiple of sizeof (EMACS_INT); it need not be, if
16642 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16643 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16644
895009e1
JB
166452011-04-26 Juanma Barranquero <lekktu@gmail.com>
16646
16647 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16648
6a7a1b0b
TZ
166492011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16650
16651 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16652 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16653 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16654
841a1577 166552011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16656
16657 * lisp.h (Qdebug): List symbol.
895009e1 16658 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16659 * keyboard.c (debug-on-event): New variable.
16660 (handle_user_signal): Break into debugger when debug-on-event
16661 matches the current signal symbol.
16662
f2d3ba6f
DN
166632011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16664
16665 * alloc.c (check_sblock, check_string_bytes)
16666 (check_string_free_list): Convert to standard C.
16667
42ce4c63
TZ
166682011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16669
16670 * w32.c (emacs_gnutls_push): Fix typo.
16671
825cd63c
EZ
166722011-04-25 Eli Zaretskii <eliz@gnu.org>
16673
fb11d64d
EZ
16674 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16675 "cast to pointer from integer of different size".
16676
825cd63c
EZ
16677 Improve doprnt and its use in verror. (Bug#8545)
16678 * doprnt.c (doprnt): Document the set of format control sequences
16679 supported by the function. Use SAFE_ALLOCA instead of always
16680 using `alloca'.
16681
16682 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16683 is one byte too soon. Don't use xrealloc; instead xfree and
16684 xmalloc anew.
16685
e061a11b
TZ
166862011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16687
16688 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16689 callbacks stage.
16690
16691 * gnutls.c: Renamed global_initialized to
16692 gnutls_global_initialized. Added internals for the
16693 :verify-hostname-error, :verify-error, and :verify-flags
16694 parameters of `gnutls-boot' and documented those parameters in the
16695 docstring. Start callback support.
9173deec
JB
16696 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16697 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16698 on error. Return error code.
e061a11b
TZ
16699 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16700 (emacs_gnutls_read): Likewise.
16701 (Fgnutls_boot): Return handshake error code.
16702 (emacs_gnutls_handle_error): New function.
16703 (wsaerror_to_errno): Likewise.
16704
16705 * w32.h (emacs_gnutls_pull): Add prototype.
16706 (emacs_gnutls_push): Likewise.
16707
16708 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16709 (emacs_gnutls_push): Likewise.
16710
167112011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16712
16713 * process.c (wait_reading_process_output): Check if GnuTLS
16714 buffered some data internally if no FDs are set for TLS
16715 connections.
16716
16717 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16718 (LIBS): Link to USER_LIBS.
16719 ($(BLD)/gnutls.$(0)): New target.
16720
fa6996bc
EZ
167212011-04-24 Eli Zaretskii <eliz@gnu.org>
16722
eb35682e
EZ
16723 * xdisp.c (handle_single_display_spec): Rename the
16724 display_replaced_before_p argument into display_replaced_p, to
16725 make it consistent with the commentary. Fix typos in the
16726 commentary.
16727
e2ad650c
EZ
16728 * textprop.c (syms_of_textprop): Remove dead code.
16729 (copy_text_properties): Delete obsolete commentary about an
16730 interface that was deleted long ago. Fix typos in the description
16731 of arguments.
16732
1b2de274
EZ
16733 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16734 to changes in oldXMenu/XMenu.h from 2011-04-16.
16735 <menu_help_message, prev_menu_help_message>: Constify.
16736 (IT_menu_make_room): menu->help_text is now `const char **';
16737 adjust.
16738
16739 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16740 to changes in oldXMenu/XMenu.h from 2011-04-16.
16741 (struct XMenu): Declare `help_text' `const char **'.
16742
16743 * xfaces.c <Qunspecified>: Make extern again.
16744
16745 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16746 required by POSIX.
1b2de274 16747
762b15be
EZ
16748 * doc.c (get_doc_string): Improve the format passed to `error'.
16749
16750 * doprnt.c (doprnt): Improve commentary.
16751
16752 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16753
16754 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16755 them with etags.
16756
f1052e5d
EZ
16757 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16758 changes in globals.h immediately force recompilation.
762b15be
EZ
16759 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16760 $(CURDIR)/s/ms-w32.h.
16761 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16762
fa6996bc
EZ
16763 * character.c (Fchar_direction): Function deleted.
16764 (syms_of_character): Don't defsubr it.
16765 <char-direction-table>: Deleted.
16766
e6c3da20
EZ
167672011-04-23 Eli Zaretskii <eliz@gnu.org>
16768
16769 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16770 * doprnt.c: Include limits.h.
16771 (SIZE_MAX): New macro.
04f2d78b
CB
16772 (doprnt): Return a size_t value. 2nd arg is now size_t.
16773 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16774 Improve overflow protection. Support `l' modifier for integer
16775 conversions. Support %l conversion. Don't assume an EMACS_INT
16776 argument for integer conversions and for %c.
16777
16778 * lisp.h (doprnt): Restore prototype.
16779
16780 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16781 $(SRC)/character.h.
16782
16783 * Makefile.in (base_obj): Add back doprnt.o.
16784
16785 * deps.mk (doprnt.o): Add back prerequisites.
16786 (callint.o): Depend on character.h.
16787
16788 * eval.c (internal_lisp_condition_case): Include the handler
16789 representation in the error message.
16790 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16791 when breaking from the loop.
16792
16793 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16794
16795 * callint.c (Fcall_interactively): When displaying error message
16796 about invalid control letter, pass the character's codepoint, not
16797 a pointer to its multibyte form. Improve display of the character
16798 in octal and display also its hex code.
16799
16800 * character.c (char_string): Use %x to display the (unsigned)
16801 codepoint of an invalid character, to avoid displaying a bogus
16802 negative value.
16803
16804 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16805 `error', not SYMBOL_NAME itself.
16806
16807 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16808 character arguments to `error'.
16809
16810 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16811 to `error' in error message about FINAL_CHAR argument. Make sure
16812 FINAL_CHAR is a character, and use %c when it is passed as
16813 argument to `error'.
16814
4ffd0d6b 168152011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16816
16817 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16818
16819 * w32.c: Include <time.h>.
16820 (sys_localtime): New function.
16821
4ffd0d6b 168222011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16823
16824 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16825
4ffd0d6b 16826 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16827
4ffd0d6b 168282011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16829
4ffd0d6b
GM
16830 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16831 zombies (Bug#8467).
aac0c6e3 16832
04c56954
EZ
168332011-04-19 Eli Zaretskii <eliz@gnu.org>
16834
16835 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16836 gl_state.e_property when gl_state.object is Qt.
16837
16838 * insdel.c (make_gap_larger): Remove limitation of buffer size
16839 to <= INT_MAX.
16840
16a43933
CY
168412011-04-18 Chong Yidong <cyd@stupidchicken.com>
16842
16843 * xdisp.c (lookup_glyphless_char_display)
16844 (produce_glyphless_glyph): Handle cons cell entry in
16845 glyphless-char-display.
16846 (Vglyphless_char_display): Document it.
16847
16848 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16849 glyphless-char-display.
16850
4581706e
CY
168512011-04-17 Chong Yidong <cyd@stupidchicken.com>
16852
16853 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16854
16855 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16856
16857 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16858 definition for no-X builds.
16859
4887c6e2 168602011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16861
fd35b6f9
PE
16862 Static checks with GCC 4.6.0 and non-default toolkits.
16863
5c1ccb01
PE
16864 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16865
006c5daa
PE
16866 * process.c (keyboard_bit_set): Define only if SIGIO.
16867 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16868 (send_process): Repair possible setjmp clobbering.
16869
efc736d3
PE
16870 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16871
4e2fe2e6
PE
16872 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16873
f97334a2
PE
16874 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16875
4e75f29d
PE
16876 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16877 Define only if needed.
16878
90efadd1
PE
16879 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16880 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 16881 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 16882
3c647824
PE
16883 * dispextern.h (struct redisplay_interface): Rename param
16884 to avoid shadowing.
e264f262 16885 * termhooks.h (struct terminal): Likewise.
761383f4 16886 * xterm.c (xembed_send_message): Likewise.
3c647824 16887
b58c5c4a
PE
16888 * insdel.c (make_gap_smaller): Define only if
16889 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16890
cad59032
PE
16891 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16892 it.
16893
c339dc2e
PE
16894 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16895 so that we aren't warned about unused symbols.
16896
91a3e27b
PE
16897 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16898
399c71d3 16899 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 16900
8ffc96f5
PE
16901 * xfns.c (x_real_positions): Mark locals as initialized.
16902
eef9bc79
PE
16903 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16904
098db9dd
PE
16905 * xterm.c: Fix problems found by static analysis with other toolkits.
16906 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
16907 (x_dispatch_event): Declare static if USE_GTK, and
16908 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 16909 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 16910 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
16911 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16912 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 16913
eb18f6cc
PE
16914 * xmenu.c (menu_help_callback): Pointer type fixes.
16915 Use const pointers when pointing at readonly data. Avoid pointer
16916 signedness clashes.
16917 (FALSE): Remove unused macro.
16918 (update_frame_menubar): Remove unused decl.
16919
1fe72bf8
PE
16920 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
16921
60d9e1db
PE
16922 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
16923 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
16924 (single_menu_item): Rename local to avoid shadowing.
16925
39261c26
PE
16926 * keyboard.c (make_lispy_event): Remove unused local var.
16927
018c5e19
PE
16928 * frame.c, frame.h (x_get_resource_string): Bring this back, but
16929 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
16930
63d2b86e
PE
16931 * bitmaps: Change bitmaps from unsigned char back to the X11
16932 compatible char. Avoid the old compiler warnings about
16933 out-of-range initializers by using, for example, '\xab' rather
16934 than 0xab.
16935
aefd87e1
PE
16936 * xgselect.c (xgselect_initialize): Check vs interface
16937 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
16938
bf501fb9
PE
16939 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
16940
e9829fdf
PE
16941 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
16942 to read-only memory.
16943
1086c095
PE
16944 * fns.c (vector): Remove; this old hack is no longer needed.
16945
2baccd04 16946 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 16947 Remove unused var.
dde42981 16948 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 16949
72391843 16950 * xrdb.c (x_load_resources): Omit unused local.
3565b346 16951
436c16df 16952 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 16953 (x_window): Rename locals to avoid shadowing.
dc5ddd85 16954 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 16955
92bb796d 16956 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 16957 (x_term_init): Remove local to avoid shadowing.
92bb796d 16958
764430a3 16959 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
16960
16961 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
16962 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
16963
d1dfb56c
EZ
169642011-04-16 Eli Zaretskii <eliz@gnu.org>
16965
c4354cb4
EZ
16966 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
16967
d1dfb56c
EZ
16968 Fix regex.c, syntax.c and friends for buffers > 2GB.
16969 * syntax.h (struct gl_state_s): Declare character position members
16970 EMACS_INT.
16971
16972 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
16973
04f2d78b
CB
16974 * textprop.c (verify_interval_modification, interval_of):
16975 Declare arguments EMACS_INT.
d1dfb56c
EZ
16976
16977 * intervals.c (adjust_intervals_for_insertion): Declare arguments
16978 EMACS_INT.
16979
16980 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
16981
16982 * indent.c (Fvertical_motion): Local variable it_start is now
16983 EMACS_INT.
16984
16985 * regex.c (re_match, re_match_2, re_match_2_internal)
16986 (bcmp_translate, regcomp, regexec, print_double_string)
16987 (group_in_compile_stack, re_search, re_search_2, regex_compile)
16988 (re_compile_pattern, re_exec): Declare arguments and local
16989 variables `size_t' and `ssize_t' and return values `regoff_t', as
16990 appropriate.
16991 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
16992 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
16993 <compile_stack_type>: `size' and `avail' are now `size_t'.
16994
16995 * regex.h <regoff_t>: Use ssize_t, not int.
16996 (re_search, re_search_2, re_match, re_match_2): Arguments that
16997 specify buffer/string position and length are now ssize_t and
16998 size_t. Return type is regoff_t.
16999
613052cd
BK
170002011-04-16 Ben Key <bkey76@gmail.com>
17001
17002 * nsfont.m: Fixed bugs in ns_get_family and
17003 ns_descriptor_to_entity that were caused by using free to
17004 deallocate memory blocks that were allocated by xmalloc (via
17005 xstrdup). This caused Emacs to crash when compiled with
17006 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17007 --enable-checking=xmallocoverrun). xfree is now used to
17008 deallocate these memory blocks.
17009
4170f62f 170102011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 17011
71b41406
PE
17012 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17013
9587a89d
PE
17014 emacs_write: Accept and return EMACS_INT for sizes.
17015 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17016 et seq.
17017 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17018 Accept and return EMACS_INT.
17019 (emacs_gnutls_write): Return the number of bytes written on
17020 partial writes.
17021 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
17022 (emacs_read, emacs_write): Remove check for negative size, as the
17023 Emacs source code has been audited now.
9587a89d
PE
17024 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17025 (emacs_read, emacs_write): Use it.
273a5f82
PE
17026 * process.c (send_process): Adjust to the new signatures of
17027 emacs_write and emacs_gnutls_write. Do not attempt to store
17028 a byte offset into an 'int'; it might overflow.
9587a89d 17029 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 17030
3e047f51
PE
17031 * sound.c: Don't assume sizes fit in 'int'.
17032 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 17033 Return EMACS_INT, not int.
3e047f51 17034 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
17035 Accept EMACS_INT, not int.
17036 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
17037 record read return values.
17038
cc39a9db
BK
170392011-04-15 Ben Key <bkey76@gmail.com>
17040
c9d0ec6d
JB
17041 * keyboard.c (Qundefined): Don't declare static since it is used
17042 in nsfns.m.
17043 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17044 static since they are used in nsfont.m.
cc39a9db 17045
6c60eb9f
SM
170462011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17047
17048 * process.c (Qprocessp): Don't declare static.
17049 * lisp.h (Qprocessp): Declare again.
17050
7990b61a
JB
170512011-04-15 Juanma Barranquero <lekktu@gmail.com>
17052
17053 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17054
5d4cb038
PE
170552011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17056
8bd7b830 17057 Improve C-level modularity by making more things 'static'.
cd64ea1d 17058
e3b27b31
PE
17059 Don't publish debugger-only interfaces to other modules.
17060 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17061 (verify_bytepos, count_markers): Move decls to the only modules
17062 that need them.
17063 * region-cache.h (pp_cache): Likewise.
17064 * window.h (check_all_windows): Likewise.
17065 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17066
5d4cb038
PE
17067 * sysdep.c (croak): Now static, if
17068 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17069 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
17070
17071 * alloc.c (refill_memory_reserve): Now static if
17072 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17073 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 17074
e87b6180
PE
17075 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17076 Define only if USE_LUCID.
17077
ac64929e
PE
17078 * xrdb.c (x_customization_string, x_rm_string): Now static.
17079
6f37259d
PE
17080 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17081 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17082
1683e3ab
PE
17083 * xdisp.c (draw_row_with_mouse_face): Now static.
17084 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17085
de9c2632
PE
17086 * window.h (check_all_windows): Mark externally visible.
17087
2b96acb7
PE
17088 * window.c (window_deletion_count): Now static.
17089
17090 * undo.c: Make symbols static if they're not exported.
17091 (last_undo_buffer, last_boundary_position, pending_boundary):
17092 Now static.
17093
50436f33
PE
17094 * textprop.c (interval_insert_behind_hooks): Now static.
17095 (interval_insert_in_front_hooks): Likewise.
17096
64520e5c
PE
17097 * term.c: Make symbols static if they're not exported.
17098 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17099 (max_frame_lines, tty_set_terminal_modes):
17100 (tty_reset_terminal_modes, tty_turn_off_highlight):
17101 (get_tty_terminal): Now static.
17102 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17103 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 17104 HAVE_WINDOW_SYSTEM.
64520e5c
PE
17105 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17106 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17107
1fa53021
PE
17108 * sysdep.c: Make symbols static if they're not exported.
17109 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17110 Now static.
17111 (sigprocmask_set, full_mask): Remove; unused.
17112 (wait_debugging): Mark as visible.
17113 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17114 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17115
d4b43b22
PE
17116 * syntax.c (syntax_temp): Define only if !__GNUC__.
17117
b7c513d0
PE
17118 * sound.c (current_sound_device, current_sound): Now static.
17119
989b29ad
PE
17120 * search.c (searchbufs, searchbuf_head): Now static.
17121
13a55a78
PE
17122 * scroll.c (scroll_cost): Remove; unused.
17123 * dispextern.h (scroll_cost): Remove decl.
17124
de68a1fc
PE
17125 * region-cache.h (pp_cache): Mark as externally visible.
17126
40ccffa6
PE
17127 * process.c: Make symbols static if they're not exported.
17128 (process_tick, update_tick, create_process, chan_process):
17129 (Vprocess_alist, proc_buffered_char, datagram_access):
17130 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17131 (deactivate_process): Mark defn as static, as well as decl.
17132 * lisp.h (create_process): Remove decl.
17133 * process.h (chan_process, Vprocess_alist): Remove decls.
17134
ad64fc97
PE
17135 * print.c: Make symbols static if they're not exported.
17136 (print_depth, new_backquote_output, being_printed, print_buffer):
17137 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17138 (print_interval, print_number_index, initial_stderr_stream):
17139 Now static.
17140 * lisp.h (Fprinc): Remove decl.
17141 (debug_output_compilation_hack): Mark as externally visible.
17142
adddb265
PE
17143 * sysdep.c (croak): Move decl from here to syssignal.h.
17144 * syssignal.h (croak): Put it here, so the API can be checked when
17145 'croak' is called from dissociate_if_controlling_tty.
17146
1717ede2
PE
17147 * minibuf.c: Make symbols static if they're not exported.
17148 (minibuf_save_list, choose_minibuf_frame): Now static.
17149 * lisp.h (choose_minibuf_frame): Remove decl.
17150
fa5fb2bc
PE
17151 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17152
1e3890d1
PE
17153 * lread.c: Make symbols static if they're not exported.
17154 (read_objects, initial_obarray, oblookup_last_bucket_number):
17155 Now static.
17156 (make_symbol): Remove; unused.
17157 * lisp.h (initial_obarray, make_symbol): Remove decls.
17158
8a1414fa
PE
17159 * keyboard.c: Make symbols static if they're not exported.
17160 (single_kboard, recent_keys_index, total_keys, recent_keys):
17161 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17162 (this_single_command_key_start, echoing, last_auto_save):
17163 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17164 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17165 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17166 (Vlispy_mouse_stem, double_click_count):
17167 Now static.
17168 (force_auto_save_soon): Define only if SIGDANGER.
17169 (ignore_mouse_drag_p): Now static if
17170 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17171 (print_help): Remove; unused.
17172 (stop_character, last_timer_event): Mark as externally visible.
17173 * keyboard.h (ignore_mouse_drag_p): Declare only if
17174 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17175 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17176 * lisp.h (echoing): Remove decl.
17177 (force_auto_save_soon): Declare only if SIGDANGER.
17178 * xdisp.c (redisplay_window): Simplify code, to make it more
17179 obvious that ignore_mouse_drag_p is not accessed if !defined
17180 USE_GTK && !defined HAVE_NS.
17181
93ea6e8f
PE
17182 * intervals.c: Make symbols static if they're not exported.
17183 (merge_properties_sticky, merge_interval_right, delete_interval):
17184 Now static.
17185 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17186
77382fcc
PE
17187 * insdel.c: Make symbols static if they're not exported.
17188 However, leave prepare_to_modify_buffer alone. It's never
17189 called from outside this function, but that appears to be a bug.
17190 (combine_after_change_list, combine_after_change_buffer):
4889fc82 17191 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
17192 (adjust_after_replace_noundo): Remove; unused.
17193 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 17194 (signal_before_change): Remove decls.
77382fcc 17195
9306c32e
PE
17196 * indent.c (val_compute_motion, val_vmotion): Now static.
17197
cd44d2eb
PE
17198 * image.c: Make symbols static if they're not exported.
17199 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17200 if USE_GTK.
17201 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17202 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17203
ad9a7a06
PE
17204 * fringe.c (standard_bitmaps): Now static.
17205 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17206
81626931
PE
17207 * frame.c: Make symbols static if they're not exported.
17208 (x_report_frame_params, make_terminal_frame): Now static.
17209 (get_frame_param): Now static, unless HAVE_NS.
17210 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17211 (x_get_resource_string): Remove; not used.
17212 * frame.h (make_terminal_frame, x_report_frame_params):
17213 (x_get_resource_string); Remove decls.
17214 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17215 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17216
239f9db9
PE
17217 * font.c, fontset.c: Make symbols static if they're not exported.
17218 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17219 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17220 * font.c (font_close_object): Now static.
17221 * font.h (font_close_object): Remove.
17222 * fontset.c (FONTSET_OBJLIST): Remove.
17223 (free_realized_fontset) #if-0 the body, which does nothing.
17224 (face_suitable_for_char_p): #if-0, as it's never called.
17225 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
17226 * xfaces.c (face_at_string_position):
17227 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
17228 since 0 is always ASCII.
17229
dfcf3579
PE
17230 * fns.c (weak_hash_tables): Now static.
17231
5045092b
PE
17232 * fileio.c: Make symbols static if they're not exported.
17233 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17234 (Vwrite_region_annotation_buffers): Now static.
17235
57a96f5c
PE
17236 * eval.c: Make symbols static if they're not exported.
17237 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17238 * lisp.h (backtrace_list): Remove decl.
17239
35f08c38
PE
17240 * emacs.c: Make symbols static if they're not exported.
17241 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17242 (fatal_error_code, fatal_error_signal_hook, standard_args):
17243 Now static.
17244 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17245 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17246 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17247 * lisp.h (fatal_error_signal_hook): Remove decl.
17248 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17249
f44bd759
PE
17250 * editfns.c: Move a (normally-unused) function to its only use.
17251 * editfns.c, lisp.h (get_operating_system_release): Remove.
17252 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17253 worth the hassle of breaking this out.
17254
b532497d
PE
17255 * xterm.c: Make symbols static if they're not exported.
17256 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17257 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17258 (x_destroy_window, x_delete_display):
17259 Now static.
17260 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17261 (x_mouse_leave): Remove; unused.
17262 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17263 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17264 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17265 Remove decls.
17266 (x_mouse_leave): Declare only if WINDOWSNT.
17267 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17268 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17269 USE_X_TOOLKIT.
17270
1675728f
PE
17271 * ftxfont.c: Make symbols static if they're not exported.
17272 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17273 HAVE_FREETYPE.
17274 * font.h (ftxfont_driver): Likewise.
17275
e4cebfca
PE
17276 * xfns.c: Make symbols static if they're not exported.
17277 (x_last_font_name, x_display_info_for_name):
17278 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17279 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17280 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17281 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17282 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17283 (last_show_tip_args): Now static.
17284 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17285 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17286 (x_screen_planes): Remove; unused.
17287 * dispextern.h (x_screen_planes): Remove decl.
17288
5bf46f05
PE
17289 * dispnew.c: Make symbols static if they're not exported.
17290 * dispextern.h (redraw_garbaged_frames, scrolling):
17291 (increment_row_positions): Remove.
17292 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17293 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17294 Now static.
17295 (redraw_garbaged_frames): Remove; unused.
17296
435f4c28
PE
17297 * xfaces.c: Make symbols static if they're not exported.
17298 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17299 Remove decls.
17300 * xterm.h (defined_color): Remove decls.
17301 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17302 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17303 (menu_face_changed_default, defined_color, free_realized_face):
17304 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17305 (ascii_face_of_lisp_face): Remove; unused.
17306
8524aef3
PE
17307 * xdisp.c: Make symbols static if they're not exported.
17308 * dispextern.h (scratch_glyph_row, window_box_edges):
17309 (glyph_to_pixel_coords, set_cursor_from_row):
17310 (get_next_display_element, set_iterator_to_next):
17311 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17312 (show_mouse_face): Remove decls
17313 * frame.h (message_buf_print): Likewise.
17314 * lisp.h (pop_message, set_message, check_point_in_composition):
17315 Likewise.
17316 * xterm.h (set_vertical_scroll_bar): Likewise.
17317 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17318 (message_buf_print, scratch_glyph_row, displayed_buffer):
17319 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17320 (get_next_display_element, show_mouse_face, window_box_edges):
17321 (frame_to_window_pixel_xy, check_point_in_composition):
17322 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17323 (glyph_to_pixel_coords): Remove; unused.
17324
16390cd2
PE
17325 * dired.c (file_name_completion): Now static.
17326
17327 * dbusbind.c (xd_in_read_queued_messages): Now static.
17328
a25f4dfa
PE
17329 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17330 * data.c (circular_list_error): Remove.
17331
14a9c8df
PE
17332 * commands.h (last_point_position, last_point_position_buffer):
17333 (last_point_position_window): Remove decls.
17334 * keyboard.c: Make these variables static.
17335
04f2d78b
CB
17336 * coding.h (coding, code_convert_region, encode_coding_gap):
17337 Remove decls.
74ab6df5
PE
17338 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17339 (iso_code_class, detect_coding, code_convert_region): Now static.
17340 (encode_coding_gap): Remove; unused.
17341
38dfbee1
PE
17342 * chartab.c (chartab_chars, chartab_bits): Now static.
17343
a2cb4e63
PE
17344 * charset.h (charset_iso_8859_1): Remove decl.
17345 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17346 Now static.
17347
127198fd
PE
17348 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17349 * ccl.c (Vccl_program_table): Now static.
17350 (check_ccl_update): Remove; unused.
17351
d85b608f
PE
17352 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17353 * category.h: ... from here.
17354 * category.c (check_category_table, set_category_set): Now static.
17355
31cd66f3
PE
17356 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17357 * lisp.h: Remove these decls.
17358
c358e587
PE
17359 * buffer.c (buffer_count): Remove unused var.
17360
e78aecca
PE
17361 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17362 so that it's not optimized away.
17363 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17364 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17365 exported only to the debugger.
17366
e192d7d3 17367 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 17368 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 17369
92470028
PE
17370 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17371 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17372 was inaccessible from Lisp.
17373 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17374 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17375
244ed907
PE
17376 alloc.c: Import and export fewer symbols, and remove unused items.
17377 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17378 is defined.
17379 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17380 it's not optimized away by whole-program optimization.
17381 (message_enable_multibyte, free_misc): Remove.
17382 (catchlist, handlerlist, mark_backtrace):
17383 Declare only if BYTE_MARK_STACK.
17384 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17385 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17386 (message_enable_multibyte): Remove decl.
17387 (free_misc, interval_free_list, float_block, float_block_index):
17388 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17389 (cons_free_list, last_marked_index):
17390 Now static.
17391 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17392 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17393 (mark_backtrace): Define only if BYTE_MARK_STACK.
17394 * xdisp.c (message_enable_multibyte): Now static.
17395
61c2b50e 17396 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17397 This makes it easier for human readers (and static analyzers)
17398 to see whether these variables are used from other modules.
17399 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17400 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17401 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17402 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17403 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17404 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17405 * xmenu.c, xselect.c:
17406 Declare Q* vars static if they are not used in other modules.
17407 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17408 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17409 Remove decls of unexported vars.
17410 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17411
95c82688
PE
17412 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17413
16a97296
PE
17414 Make Emacs functions such as Fatom 'static' by default.
17415 This makes it easier for human readers (and static analyzers)
17416 to see whether these functions can be called from other modules.
17417 DEFUN now defines a static function. To make the function external
17418 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17419 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17420 (Finit_image_library):
16a97296
PE
17421 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17422 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17423 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17424 Remove decls, since these functions are now static.
17425 (Funintern, Fget_internal_run_time): New decls, since these functions
17426 were already external.
95c82688 17427
16a97296
PE
17428 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17429 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17430 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17431 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17432 * keyboard.c, keymap.c, lread.c:
17433 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17434 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17435 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17436 Mark functions with DEFUE instead of DEFUN,
17437 if they are used in other modules.
17438 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17439 decls for now-static functions.
17440 * buffer.h (Fdelete_overlay): Remove decl.
17441 * callproc.c (Fgetenv_internal): Mark as internal.
17442 * composite.c (Fremove_list_of_text_properties): Remove decl.
17443 (Fcomposition_get_gstring): New forward static decl.
17444 * composite.h (Fcomposite_get_gstring): Remove decl.
17445 * dired.c (Ffile_attributes): New forward static decl.
17446 * doc.c (Fdocumntation_property): New forward static decl.
17447 * eval.c (Ffetch_bytecode): New forward static decl.
17448 (Funintern): Remove extern decl; now in .h file where it belongs.
17449 * fileio.c (Fmake_symbolic_link): New forward static decl.
17450 * image.c (Finit_image_library): New forward static decl.
17451 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17452 * intervals.h (Fprevious_property_change):
17453 (Fremove_list_of_text_properties): Remove decls.
17454 * keyboard.c (Fthis_command_keys): Remove decl.
17455 (Fcommand_execute): New forward static decl.
17456 * keymap.c (Flookup_key): New forward static decl.
17457 (Fcopy_keymap): Now static.
17458 * keymap.h (Flookup_key): Remove decl.
17459 * process.c (Fget_process): New forward static decl.
17460 (Fprocess_datagram_address): Mark as internal.
17461 * syntax.c (Fsyntax_table_p): New forward static decl.
17462 (skip_chars): Remove duplicate decl.
17463 * textprop.c (Fprevious_property_change): New forward static decl.
17464 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17465 Now internal.
17466 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17467 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17468
785bbd42
PE
17469 * editfns.c (Fformat): Remove unreachable code.
17470
8b913b57
AS
174712011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17472
17473 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17474 change. (Bug#8496)
17475
a6744a35
EZ
174762011-04-13 Eli Zaretskii <eliz@gnu.org>
17477
17478 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17479 when at ZV. (Bug#8487)
17480
e7974947
AS
174812011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17482
baad03f0
AS
17483 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17484 (Bug#8437)
17485 * keyboard.c (parse_tool_bar_item): Likewise.
17486 * sound.c (sound_cleanup, alsa_close): Likewise.
17487 * termcap.c (tgetent): Likewise.
17488 * xfns.c (x_default_font_parameter): Likewise.
17489 * xsettings.c (read_and_apply_settings): Likewise.
17490
e7974947
AS
17491 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17492 (overrun_check_free): Protoize.
17493
28272684
PE
174942011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17495
17496 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17497 since callers should never pass a negative size.
17498 Change the signature to match that of plain 'read' and 'write'; see
17499 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17500 * lisp.h: Update prototypes of emacs_write and emacs_read.
17501
11997c76
EZ
175022011-04-11 Eli Zaretskii <eliz@gnu.org>
17503
17504 * xdisp.c (redisplay_window): Don't try to determine the character
17505 position of the scroll margin if the window start point w->startp
e896f03c 17506 is outside the buffer's accessible region. (Bug#8468)
11997c76 17507
8a2cbd72
EZ
175082011-04-10 Eli Zaretskii <eliz@gnu.org>
17509
17510 Fix write-region and its subroutines for buffers > 2GB.
17511 * fileio.c (a_write, e_write): Modify declaration of arguments and
17512 local variables to support buffers larger than 2GB.
17513 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17514
17515 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17516 argument, local variables, and return value.
17517
17518 * lisp.h: Update prototypes of emacs_write and emacs_read.
17519
17520 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17521
4073e537 175222011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17523
1ebfdcb6
PE
17524 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17525
b2ded58d
PE
17526 Fix more problems found by GCC 4.6.0's static checks.
17527
7d66342c
PE
17528 * xdisp.c (vmessage): Use a better test for character truncation.
17529
bbf47d44
PE
17530 * charset.c (load_charset_map): <, not <=, for optimization,
17531 and to avoid potential problems with integer overflow.
9248994d 17532 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17533 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17534 * editfns.c (Fformat): Likewise.
1e69125e 17535 * syntax.c (skip_chars): Likewise.
3befa583 17536
e3019616
PE
17537 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17538 This also lets GCC 4.6.0 generate slightly better loop code.
17539
becfa255
PE
17540 * callint.c (Fcall_interactively): <, not <=, for optimization.
17541 (Fcall_interactively): Count the number of arguments produced,
17542 not the number of arguments given. This is simpler and lets GCC
17543 4.6.0 generate slightly better code.
17544
dae0cd48
PE
17545 * ftfont.c: Distingish more carefully between FcChar8 and char.
17546 The previous code passed unsigned char * to a functions like
17547 strlen and xstrcasecmp that expect char *, which does not
17548 conform to the C standard.
17549 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17550 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17551 char * when the C standard requires it.
17552
76032d70
PE
17553 * keyboard.c (read_char): Remove unused var.
17554
eb3f1cc8
PE
17555 * eval.c: Port to Windows vsnprintf (Bug#8435).
17556 Include <limits.h>.
17557 (SIZE_MAX): Define if the headers do not.
17558 (verror): Do not give up if vsnprintf returns a negative count.
17559 Instead, grow the buffer. This ports to Windows vsnprintf, which
17560 does not conform to C99. Problem reported by Eli Zaretskii.
17561 Also, simplify the allocation scheme, by avoiding the need for
17562 calling realloc, and removing the ALLOCATED variable.
17563
70476b54
PE
17564 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17565
12020a9e
PE
17566 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17567 But keep the doprint source code for now, as we might revamp it
17568 and use it again (Bug#8435).
ea6c7ae6
PE
17569 * lisp.h (doprnt): Remove.
17570 * Makefile.in (base_obj): Remove doprnt.o.
17571 * deps.mk (doprnt.o): Remove.
17572
5fdb398c
PE
17573 error: Print 32- and 64-bit integers portably (Bug#8435).
17574 Without this change, on typical 64-bit hosts error ("...%d...", N)
17575 was used to print both 32- and 64-bit integers N, which relied on
17576 undefined behavior.
61bdb816 17577 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17578 * lisp.h (error, verror): Mark as printf-like functions.
17579 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17580 Report overflow in size calculations when allocating printf buffer.
17581 Do not truncate output string at its first null byte.
17582 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17583 Truncate the output at a character boundary, since vsnprintf does not
17584 do that.
17585 * charset.c (check_iso_charset_parameter): Convert internal
17586 character to string before calling 'error', since %c now has the
17587 printf meaning.
17588 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17589 overflow when computing char to be passed to 'error'. Do not
17590 pass Lisp_Object to 'error'; pass the integer instead.
17591 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17592 formatted with plain %d.
17593
b189fa66
PE
17594 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17595
bff87ef0
PE
17596 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17597
7e2cac20
PE
17598 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17599
ce4d90b5
PE
17600 * xterm.c (x_catch_errors): Remove duplicate declaration.
17601
266c9547
PE
17602 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17603
79c49ad2
PE
17604 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17605
368f4090
JM
176062011-04-10 Jim Meyering <meyering@redhat.com>
17607
17608 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17609 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17610 return ssize_t not "int", and use size_t as the buffer length.
17611 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17612 * gnutls.h: Update declarations.
17613 * process.c (read_process_output): Use ssize_t, to match.
17614 (send_process): Likewise.
17615
a32d4040
CY
176162011-04-09 Chong Yidong <cyd@stupidchicken.com>
17617
17618 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17619
8546720e 176202011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17621
04f2d78b
CB
17622 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17623 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17624
8546720e
GM
17625 * xterm.c (handle_one_xevent):
17626 * xmenu.c (create_and_show_popup_menu):
17627 * xselect.c (x_decline_selection_request)
17628 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17629
0a2f5c1a 176302011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17631
17632 Fix some uses of `int' instead of EMACS_INT.
17633 * search.c (string_match_1, fast_string_match)
17634 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17635 (scan_buffer, find_next_newline_no_quit)
17636 (find_before_next_newline, search_command, Freplace_match)
17637 (Fmatch_data): Make some `int' variables be EMACS_INT.
17638
17639 * xdisp.c (display_count_lines): 3rd argument and return value now
17640 EMACS_INT. All callers changed.
17641 (pint2hrstr): Last argument is now EMACS_INT.
17642
17643 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17644 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17645 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17646 (decode_coding_utf_16, decode_coding_emacs_mule)
17647 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17648 (decode_coding_ccl, decode_coding_charset)
17649 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17650 (decode_coding_iso_2022, decode_coding_emacs_mule)
17651 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17652 <char_offset, last_offset>: Declare EMACS_INT.
17653 (encode_coding_utf_8, encode_coding_utf_16)
17654 (encode_coding_emacs_mule, encode_invocation_designation)
17655 (encode_designation_at_bol, encode_coding_iso_2022)
17656 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17657 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17658 Declare EMACS_INT.
17659 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17660 (encode_invocation_designation): Last argument P_NCHARS is now
17661 EMACS_INT.
17662 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17663 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17664
17665 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17666 All users changed.
17667
17668 * ccl.c (Fccl_execute_on_string): Declare some variables
17669 EMACS_INT.
17670
8546720e 176712011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17672
17673 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17674
4e19a977
CS
176752011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17676
17677 * process.c (Fformat_network_address): Doc fix.
17678
87302331
R
176792011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17680
ee7683eb 17681 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17682
cbb59342
CY
176832011-04-08 Chong Yidong <cyd@stupidchicken.com>
17684
17685 * keyboard.c (read_char): Call Lisp function help-form-show,
17686 instead of using internal_with_output_to_temp_buffer.
17687 (Qhelp_form_show): New var.
e0d38eeb 17688 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17689
17690 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17691
17692 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17693
e67a13ab
CY
176942011-04-06 Chong Yidong <cyd@stupidchicken.com>
17695
04f2d78b
CB
17696 * process.c (Flist_processes): Remove to Lisp.
17697 (list_processes_1): Delete.
e67a13ab 17698
973f782d
EZ
176992011-04-06 Eli Zaretskii <eliz@gnu.org>
17700
7c106b1e
EZ
17701 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17702
973f782d
EZ
17703 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17704
41cf7d1a 177052011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17706
ca23cc88
PE
17707 Fix more problems found by GCC 4.6.0's static checks.
17708
f390e2d5
PE
17709 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17710
42eea0d0
PE
17711 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17712
b69769da 17713 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17714
f9541e84
PE
17715 * xdisp.c (vmessage): Mark as a printf-like function.
17716
13841b55
PE
17717 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17718
c136c10f
PE
17719 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17720
5e2d4a30
PE
17721 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17722 printf-like functions.
17723 (tiff_load): Add casts to remove these marks before passing them
17724 to system-supplied API.
17725
583f48b9
PE
17726 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17727
b25d760e
PE
17728 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17729 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17730 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17731 directly, rather than having caller test rule sign. This avoids
17732 some unnecessary tests.
17733 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17734 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17735 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17736
bc7b6697 17737 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17738 (xfont_open): Avoid unnecessary tests.
bc7b6697 17739
27ccc379
PE
17740 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17741
dcd5c89a
PE
17742 * composite.h, composite.c (composition_gstring_put_cache):
17743 Use EMACS_INT, not int, for length.
17744
b13a45c6
PE
17745 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17746 breaking out part of COMPOSITION_DECODE_RULE.
17747 (COMPOSITION_DECODE_RULE): Use it.
17748 * composite.c (get_composition_id): Remove unused local vars,
17749 by using the new macro.
17750
1e792e4d
PE
17751 * textprop.c (set_text_properties_1): Change while to do-while,
17752 since the condition is always true at first.
17753
dc6c6455 17754 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17755 (interval_deletion_adjustment): Return unsigned value.
17756 All uses changed.
dc6c6455 17757
aba7731a
PE
17758 * process.c (list_processes_1, create_pty, read_process_output):
17759 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17760 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17761 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17762 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17763 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17764
fdfc4bf3
PE
17765 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17766
fca8fe46 17767 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17768 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17769
06a0259a 17770 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17771 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17772 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17773
e7b9e80f
PE
17774 * print.c (print_error_message): Avoid int overflow.
17775
56201685
PE
17776 * font.c (font_list_entities): Redo for clarity,
17777 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17778
78834453 17779 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17780 (font_score): Avoid potential overflow in diff calculation.
78834453 17781
0bc0b309 17782 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17783 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17784
e610eaca
PE
17785 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17786
b895abce
PE
17787 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17788 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17789 can always succeed if overflow has undefined behavior.
17790
1f1d9321 17791 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17792 (wordify): Omit three unnecessary tests.
1f1d9321 17793
c59478bc
PE
17794 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17795 All callers changed. This avoids the need for an unused var.
17796
79b73827
PE
17797 * casefiddle.c (casify_region): Remove var that is set but not used.
17798
a4db5dfe
PE
17799 * dired.c (file_name_completion): Remove var that is set but not used.
17800
43aae36e
PE
17801 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17802
2a47c44d 17803 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17804 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17805
a37c69bf
PE
17806 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17807 Check for integer overflow on size calculations.
17808
328ab8e7
PE
17809 * buffer.c (Fprevious_overlay_change): Remove var that is set
17810 but not used.
17811
e5a2a5cb
PE
17812 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17813 Remove vars that are set but not used.
8d84a6eb 17814 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17815 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17816
a60e5f68
PE
17817 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17818
f661cb61 17819 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17820 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17821
f0397f5a
PE
17822 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17823 that are set but not used.
17824
8664db06 17825 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17826 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17827
6abdaa4a
PE
17828 * xselect.c (x_get_local_selection, x_handle_property_notify):
17829 Remove vars that are set but not used.
17830
0ce7538d 17831 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17832 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17833
9ae848fc
PE
17834 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17835 Remove var that is set but not used.
0b918413
PE
17836 (scroll_bar_windows_size): Now size_t, not int.
17837 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17838 Check for overflow.
9ae848fc 17839
a5a62657
PE
17840 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17841 (map_tty_color) [!defined MSDOS]: Likewise.
17842
5c5cdd39
PE
17843 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17844
66ebf983
PE
17845 * coding.c: Remove vars that are set but not used.
17846 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17847 All callers changed.
17848 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17849 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17850 (decode_coding_charset): Remove vars that are set but not used.
17851
1be4d761
PE
17852 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17853 that is set but not used.
17854
47553fa8
PE
17855 * print.c (print_object): Remove var that is set but not used.
17856
1f7196bf 17857 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17858 The gnulib version avoids calling malloc in the usual case,
17859 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17860 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17861 * filelock.c (current_lock_owner): Likewise.
17862 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17863 * sysdep.c: Include allocator.h, careadlinkat.h.
17864 (emacs_no_realloc_allocator): New static constant.
17865 (emacs_readlink): New function.
fdb61804
PE
17866 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17867 ../lib/careadlinkat.h.
d1fdcab7 17868
f84c17c7
SM
178692011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17870
17871 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17872 first non-nil return value).
17873
ef3862ad
JD
178742011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17875
17876 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17877 if not defined (Bug#8403).
17878
376a7006
JB
178792011-04-02 Juanma Barranquero <lekktu@gmail.com>
17880
17881 * xdisp.c (display_count_lines): Remove parameter `start',
17882 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17883 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17884 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17885 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17886 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17887 and thereabouts. All callers changed.
17888 (get_per_char_metric): Remove parameter `f', unused since
17889 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17890
6ca3801d
JM
178912011-04-02 Jim Meyering <meyering@redhat.com>
17892
17893 do not dereference NULL upon failed strdup
17894 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17895 (ns_get_family): Likewise.
17896
d8e2b5ba
JB
178972011-04-02 Juanma Barranquero <lekktu@gmail.com>
17898
17899 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17900
8c74fcbd
JD
179012011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17902
17903 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17904 later (Bug#8403).
17905
7200d79c
SM
179062011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17907
03408648 17908 Add lexical binding.
7200d79c 17909
03408648
SM
17910 * window.c (Ftemp_output_buffer_show): New fun.
17911 (Fsave_window_excursion):
17912 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17913
17914 * lread.c (lisp_file_lexically_bound_p): New function.
17915 (Fload): Bind Qlexical_binding.
17916 (readevalloop): Remove `evalfun' arg.
17917 Bind Qinternal_interpreter_environment.
17918 (Feval_buffer): Bind Qlexical_binding.
17919 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
17920 Mark as dynamic.
17921 (syms_of_lread): Declare `lexical-binding'.
17922
17923 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
17924
17925 * keyboard.c (eval_dyn): New fun.
17926 (menu_item_eval_property): Use it.
ca105506
SM
17927
17928 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 17929
03408648
SM
17930 * fns.c (concat, mapcar1): Accept byte-code-functions.
17931
17932 * eval.c (Fsetq): Handle lexical vars.
17933 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
17934 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
17935 (FletX, Flet): Obey lexical binding.
17936 (Fcommandp): Handle closures.
17937 (Feval): New `lexical' arg.
17938 (eval_sub): New function extracted from Feval. Use it almost
17939 everywhere where Feval was used. Look up vars in lexical env.
17940 Handle closures.
17941 (Ffunctionp): Move from subr.el.
17942 (Ffuncall): Handle closures.
17943 (apply_lambda): Remove `eval_flags'.
17944 (funcall_lambda): Handle closures and new byte-code-functions.
17945 (Fspecial_variable_p): New function.
17946 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
17947 but without exporting it to Lisp.
23aba0ea 17948
23aba0ea 17949 * doc.c (Fdocumentation, store_function_docstring):
03408648 17950 * data.c (Finteractive_form): Handle closures.
23aba0ea 17951
03408648
SM
17952 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
17953 interactive spec.
ba83908c 17954
04f2d78b
CB
17955 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
17956 New byte-codes.
03408648
SM
17957 (exec_byte_code): New function extracted from Fbyte_code to handle new
17958 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 17959
03408648 17960 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 17961
03408648 17962 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 17963
e2abce01
JB
179642011-03-31 Juanma Barranquero <lekktu@gmail.com>
17965
17966 * xdisp.c (redisplay_internal): Fix prototype.
17967
63696a73 179682011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 17969
63696a73 17970 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
17971 (try_scrolling): Use it when setting scroll_limit.
17972 Limit scrolling to 100 screen lines.
63696a73
EZ
17973 (redisplay_window): Even when falling back on "recentering",
17974 position point in the window according to scroll-conservatively,
17975 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
17976
17977 (try_scrolling): When point is above the window, allow searching
17978 as far as scroll_max, or one screenful, to compute vertical
17979 distance from PT to the scroll margin position. This prevents
17980 try_scrolling from unnecessarily failing when
17981 scroll-conservatively is set to a value slightly larger than the
17982 window height. Clean up the case of PT below the margin at bottom
17983 of window: scroll_max can no longer be INT_MAX. When aggressive
17984 scrolling is in use, don't let point enter the opposite scroll
17985 margin as result of the scroll.
17986 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
17987 threshold of 100 lines for never-recentering scrolling.
17988
e4cc2dfc
JB
179892011-03-31 Juanma Barranquero <lekktu@gmail.com>
17990
17991 * dispextern.h (move_it_by_lines):
17992 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
17993 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
17994 (message_log_check_duplicate): Remove parameters `prev_bol' and
17995 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17996 (redisplay_internal): Remove parameter `preserve_echo_area',
17997 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
17998
17999 * indent.c (Fvertical_motion):
18000 * window.c (window_scroll_pixel_based, Frecenter):
18001 Don't pass `need_y_p' to `move_it_by_lines'.
18002
1c470562
SM
180032011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18004
44f230aa
SM
18005 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18006 steal a few bits to be more compact.
18007 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18008 Remove unneeded casts.
18009
1c470562
SM
18010 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18011
888adce9
ZK
180122011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18013
18014 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18015 binding" message (bug#7967).
18016
f838ed7b
PE
180172011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18018
77861b95
PE
18019 Fix more problems found by GCC 4.6.0's static checks.
18020
de6dbc14
PE
18021 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18022 Remove unused local var.
18023
f838ed7b
PE
18024 * editfns.c (Fmessage_box): Remove unused local var.
18025
792c7b2b
PE
18026 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18027 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18028 Omit unused local vars.
c499e557 18029 * window.c (shrink_windows): Omit unused local var.
b01a1c29 18030 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
18031 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18032 Omit unused local var.
18033
ba0165e1
PE
18034 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18035 Don't assume string length fits in int.
32ad8845 18036 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 18037 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 18038
3c59b4c9
PE
18039 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18040 instead of alloca (Bug#8344).
18041
a3eed478 18042 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 18043 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 18044
eb4d412d
PE
18045 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18046
1658b401
PE
18047 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18048 concerns.
18049
18050 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18051
18052 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 18053
9a2c6e05
PE
18054 * keyboard.c (syms_of_keyboard): Use the same style as later
18055 in this function when indexing through an array. This also
18056 works around GCC bug 48267.
18057
03d0a109
PE
18058 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18059
44f730c8
PE
18060 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18061
fe75f926
PE
18062 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18063 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18064
ffa8c828
PE
18065 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18066 This avoids undefined behavior on integer overflow, and is a bit
18067 more convenient anyway since it is compared to a size_t variable.
18068
c5101a77
PE
18069 Variadic C functions now count arguments with size_t, not int.
18070 This avoids an unnecessary limitation on 64-bit machines, which
18071 caused (substring ...) to crash on large vectors (Bug#8344).
18072 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18073 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 18074 All variadic functions and their callers changed accordingly.
c5101a77
PE
18075 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18076 * data.c (arith_driver, float_arith_driver): Likewise.
18077 * editfns.c (general_insert_function): Likewise.
18078 * eval.c (struct backtrace.nargs, interactive_p)
18079 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18080 (funcall_lambda, mark_backtrace): Likewise.
18081 * fns.c (concat): Likewise.
18082 * frame.c (x_set_frame_parameters): Likewise.
18083 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18084 0 if not found, not -1. All callers changed.
18085
dd3f25f7
PE
18086 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18087 (stack_copy_size): Now size_t, not int.
18088 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18089
461c2ab9
JB
180902011-03-28 Juanma Barranquero <lekktu@gmail.com>
18091
18092 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18093 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18094 All callers changed.
18095
18096 * lisp.h (multibyte_char_to_unibyte):
18097 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18098 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18099 * character.h (CHAR_TO_BYTE8):
18100 * cmds.c (internal_self_insert):
18101 * editfns.c (general_insert_function):
18102 * keymap.c (push_key_description):
18103 * search.c (Freplace_match):
18104 * xdisp.c (message_dolog, set_message_1): All callers changed.
18105
f6d62986
SM
181062011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18107
18108 * keyboard.c (safe_run_hook_funcall): New function.
18109 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18110 don't set the hook to nil, but remove the offending function instead.
18111 (Qcommand_hook_internal): Remove, unused.
18112 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18113 Vcommand_hook_internal.
18114
18115 * eval.c (enum run_hooks_condition): Remove.
18116 (funcall_nil, funcall_not): New functions.
18117 (run_hook_with_args): Call each function through a `funcall' argument.
18118 Remove `cond' argument, now redundant.
18119 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18120 (Frun_hook_with_args_until_failure): Adjust accordingly.
18121 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18122
1db5b1ad
JB
181232011-03-28 Juanma Barranquero <lekktu@gmail.com>
18124
18125 * dispextern.h (string_buffer_position): Remove declaration.
18126
18127 * print.c (strout): Remove parameter `multibyte', unused since
18128 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18129
18130 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18131 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18132 All callers changed.
18133
18134 * w32.c (_wsa_errlist): Use braces for struct initializers.
18135
18136 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18137 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18138 All callers changed.
18139 (string_buffer_position): Likewise. Also, make static (it's never
18140 used outside xdisp.c).
18141 (cursor_row_p): Remove parameter `w', unused since
18142 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18143 (decode_mode_spec): Remove parameter `precision', introduced during
18144 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18145 All callers changed.
18146
5ffb62aa
JD
181472011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18148
18149 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18150
461c2ab9 181512011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
18152
18153 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18154 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18155 (ns_update_auto_hide_menu_bar): New functions.
18156 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18157 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18158 ns_constrain_all_frames.
18159 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18160 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18161
5c380ffb
JD
181622011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18163
18164 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18165
9af30bdf
GM
181662011-03-27 Glenn Morris <rgm@gnu.org>
18167
18168 * syssignal.h: Replace RETSIGTYPE with void.
18169 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18170 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18171 Replace SIGTYPE with void everywhere.
18172 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18173 * s/template.h (SIGTYPE): Remove commented out definition.
18174
e2abce01
JB
181752011-03-26 Eli Zaretskii <eliz@gnu.org>
18176
18177 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18178 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18179
f868cd8a
JB
181802011-03-26 Juanma Barranquero <lekktu@gmail.com>
18181
59eb0929
JB
18182 * w32.c (read_unc_volume): Use parameter `henum', instead of
18183 global variable `wget_enum_handle'.
18184
18185 * keymap.c (describe_vector): Remove parameters `indices' and
18186 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18187 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18188
f868cd8a
JB
18189 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18190
18191 * keyboard.c (timer_check): Remove parameter `do_it_now',
18192 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18193 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18194 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18195
18196 * keyboard.c (read_char):
18197 * w32menu.c (w32_menu_display_help):
18198 * xmenu.c (show_help_event, menu_help_callback):
18199 Adjust calls to `show_help_echo'.
18200
18201 * gtkutil.c (xg_maybe_add_timer):
18202 * keyboard.c (readable_events):
18203 * process.c (wait_reading_process_output):
18204 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18205
18206 * insdel.c (adjust_markers_gap_motion):
18207 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18208 (gap_left, gap_right): Don't call it.
18209
2ecf6fdb
CY
182102011-03-25 Chong Yidong <cyd@stupidchicken.com>
18211
18212 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18213 incurred during fontification.
18214
6b1f9ba4
JB
182152011-03-25 Juanma Barranquero <lekktu@gmail.com>
18216
18217 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18218 (DEFVAR_PER_BUFFER): Don't pass it.
18219
18220 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18221 (scrolling_window): Don't pass it.
18222
0f4a96b5
JB
182232011-03-25 Juanma Barranquero <lekktu@gmail.com>
18224
18225 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18226
18227 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18228 and `suffix'.
18229 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18230 of variables specific to SELinux and computation of `encoded_absname'.
18231
18232 * image.c (XPutPixel): Remove unused variable `height'.
18233
18234 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18235
18236 * unexw32.c (get_section_info): Remove unused variable `section'.
18237
18238 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18239 (system_process_attributes): Remove unused variable `sess'.
18240 (sys_read): Remove unused variable `err'.
18241
18242 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18243 (w32_wnd_proc): Remove unused variable `isdead'.
18244 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18245 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18246 (x_create_tip_frame): Remove unused variable `tem'.
18247
18248 * w32inevt.c (w32_console_read_socket):
18249 Remove unused variable `no_events'.
18250
18251 * w32term.c (x_draw_composite_glyph_string_foreground):
18252 Remove unused variable `width'.
18253
1149507c
JB
182542011-03-24 Juanma Barranquero <lekktu@gmail.com>
18255
18256 * w32term.c (x_set_glyph_string_clipping):
18257 Don't pass uninitialized region to CombineRgn.
18258
9c88f339
JB
182592011-03-23 Juanma Barranquero <lekktu@gmail.com>
18260
18261 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18262 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18263 (Fx_close_connection): Remove unused variable `i'.
18264
18265 * w32font.c (w32font_draw): Return number of glyphs.
18266 (w32font_open_internal): Remove unused variable `i'.
18267 (w32font_driver): Add missing initializer.
18268
18269 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18270 (fill_in_menu): Remove unused variable `items_added'.
18271
18272 * w32term.c (last_mouse_press_frame): Remove static global variable.
18273 (w32_clip_to_row): Remove unused variable `f'.
18274 (x_delete_terminal): Remove unused variable `i'.
18275
18276 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18277 (NOTHING): Remove unused static global variable.
18278 (uniscribe_check_otf): Remove unused variable `table'.
18279 (uniscribe_font_driver): Add missing initializers.
18280
dee091a3
JD
182812011-03-23 Julien Danjou <julien@danjou.info>
18282
18283 * term.c (Fsuspend_tty, Fresume_tty):
18284 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18285 * window.c (temp_output_buffer_show):
18286 * insdel.c (signal_before_change):
18287 * frame.c (Fhandle_switch_frame):
18288 * fileio.c (Fdo_auto_save):
18289 * emacs.c (Fkill_emacs):
18290 * editfns.c (save_excursion_restore):
18291 * cmds.c (internal_self_insert):
18292 * callint.c (Fcall_interactively):
18293 * buffer.c (Fkill_all_local_variables):
18294 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18295 Use Frun_hooks.
0f4a96b5 18296 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 18297 unconditionally since it does the check itself.
dee091a3 18298
2c520ab5 182992011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 18300
c9c49752
PE
18301 Fix more problems found by GCC 4.5.2's static checks.
18302
8abc3f12
PE
18303 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18304 the first time through the loop, since we know p0 < p1 then.
18305 This also avoids a gcc -Wstrict-overflow warning.
18306
a2d26660
PE
18307 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18308 leading to a memory leak, possible in functions like
18309 load_charset_map_from_file that can allocate an unbounded number
b12ef411 18310 of objects (Bug#8318).
a2d26660 18311
916c72e9
PE
18312 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18313 that could (at least in theory) be that large.
18314
19ab8a18
PE
18315 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18316 This is less likely to overflow, and avoids undefined behavior if
18317 overflow does occur. All callers changed. Use strtoul to scan
18318 for the unsigned long integer.
b7cbbd6f
PE
18319 (pint2hrstr): Simplify and tune code slightly.
18320 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 18321
f0641eff
PE
18322 * scroll.c (do_scrolling): Work around GCC bug 48228.
18323 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18324
7f650bb9
PE
18325 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18326 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
18327 (validate_x_resource_name): Simplify count usage.
18328 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 18329
37dd57d1
PE
18330 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18331 fail (Bug#8306).
81e56e61 18332
699979fc 18333 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 18334
401bf9b4
PE
18335 * process.c (Fmake_network_process): Use socklen_t, not int,
18336 where POSIX says socklen_t is required in portable programs.
18337 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 18338 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
18339 (Fmake_network_process, server_accept_connection):
18340 (wait_reading_process_output, read_process_output):
18341 Likewise.
18342
b93aacde
PE
18343 * process.c: Rename or move locals to avoid shadowing.
18344 (list_processes_1, Fmake_network_process):
18345 (read_process_output_error_handler, exec_sentinel_error_handler):
18346 Rename or move locals.
4dc343ee 18347 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 18348 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 18349 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 18350 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 18351 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 18352
af8a867c 18353 Make tparam.h and terminfo.c consistent.
44f230aa
SM
18354 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18355 Include tparam.h instead, since it declares them.
af8a867c
PE
18356 * cm.h (PC): Remove extern decl; tparam.h now does this.
18357 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18358 * terminfo.c: Include tparam.h, to check interfaces.
18359 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18360 (tparam): Adjust signature to match interface in tparam.h;
18361 this removes some undefined behavior. Check that outstring and len
18362 are zero, which they always are with Emacs.
18363 * tparam.h (PC, BC, UP): New extern decls.
18364
0248044d 18365 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 18366 (xftfont_open): Rename locals to avoid shadowing.
0248044d 18367
8ff096c1 18368 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
18369 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18370 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 18371 (ftfont_list): Remove unused local.
49eaafba
PE
18372 (get_adstyle_property, ftfont_pattern_entity):
18373 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18374 Rename locals to avoid shadowing.
8ff096c1 18375
e2be39f6
PE
18376 * xfont.c (xfont_list_family): Mark var as initialized.
18377
c9735e30
PE
18378 * xml.c (make_dom): Now static.
18379
8f5201ae
PE
18380 * composite.c (composition_compute_stop_pos): Rename local to
18381 avoid shadowing.
b246f932
PE
18382 (composition_reseat_it): Remove unused locals.
18383 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 18384 (composition_update_it): Mark var as initialized.
11b61122
PE
18385 (find_automatic_composition): Mark vars as initialized,
18386 with a FIXME (Bug#8290).
8f5201ae 18387
760fbc2c
PE
18388 character.h: Rename locals to avoid shadowing.
18389 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18390 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18391 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18392 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18393 to avoid shadowing.
18394
ff08eb85
PE
18395 * textprop.c (property_change_between_p): Remove; unused.
18396
fc7bf025
PE
18397 * intervals.c (interval_start_pos): Now static.
18398
235d7abc
PE
18399 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18400
44f230aa
SM
18401 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18402 Rename locals to avoid shadowing.
3e7d6594 18403
50060332
PE
18404 * sound.c (wav_play, au_play, Fplay_sound_internal):
18405 Fix pointer signedness.
d01f234b 18406 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18407 (wav_play): Initialize a variable to 0, to prevent undefined
18408 behavior (Bug#8278).
50060332 18409
c4fc4e30
PE
18410 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18411
918436ed
PE
18412 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18413
c939f91b
PE
18414 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18415 clobbering (Bug#8298).
b9c7f648
PE
18416 * sysdep.c (sys_subshell): Likewise.
18417 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18418
6bd8c144
PE
18419 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18420 This should get cleaned up, so that child_setup has the
18421 same signature on all platforms.
18422
7710357c 18423 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18424 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18425
c59da222
CY
184262011-03-22 Chong Yidong <cyd@stupidchicken.com>
18427
18428 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18429 not to be necessary, and produces flickering.
18430
66b87493
GM
184312011-03-20 Glenn Morris <rgm@gnu.org>
18432
18433 * config.in: Remove file.
18434
45b6f6d5
JB
184352011-03-20 Juanma Barranquero <lekktu@gmail.com>
18436
18437 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18438 are now in src/globals.h.
18439 (syms_of_minibuf): Remove spurious & from previous change.
18440
cd394be1 184412011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18442
18443 * minibuf.c (completing-read-function): New variable.
18444 (completing-read-default): Rename from completing-read.
18445 (completing-read): Call completing-read-function.
18446
b14e3e21
CY
184472011-03-19 Juanma Barranquero <lekktu@gmail.com>
18448
18449 * xfaces.c (Fx_load_color_file):
18450 Read color file from absolute filename (bug#8250).
18451
f2b726e6
JB
184522011-03-19 Juanma Barranquero <lekktu@gmail.com>
18453
18454 * makefile.w32-in: Update dependencies.
18455
09f6ff02
EZ
184562011-03-17 Eli Zaretskii <eliz@gnu.org>
18457
18458 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18459
29a6015a
PE
184602011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18461
a3a6c54e
PE
18462 Fix more problems found by GCC 4.5.2's static checks.
18463
b766f867
PE
18464 * process.c (make_serial_process_unwind, send_process_trap):
18465 (sigchld_handler): Now static.
18466
be02381c
PE
18467 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18468 That way, the code declares only the vars that it needs.
18469 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18470 * s/cygwin.h (PTY_ITERATION): Likewise.
18471 * s/darwin.h (PTY_ITERATION): Likewise.
18472 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18473
57048744
PE
18474 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18475 * process.c (allocate_pty): Don't declare stb unless it's needed.
18476
7914961c 18477 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18478 (CONSTANTLIM): Remove; unused.
18479 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18480 Define only if needed.
7914961c 18481
b3967b18
PE
18482 * unexelf.c (unexec): Name an expression,
18483 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18484 Use a different way to cause a compilation error if anyone uses
18485 n rather than nn, a way that does not involve shadowing.
73366a00 18486 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18487
29a6015a
PE
18488 * deps.mk (unexalpha.o): Remove; unused.
18489
43cfc33e 18490 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18491 * unexec.h: New file.
ce701a33
PE
18492 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18493 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18494 Depend on unexec.h.
18495 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18496 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18497 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18498 Change as necessary to match prototype in unexec.h.
ce701a33 18499
01f44d5a
PE
18500 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18501 shadowing.
4f63c6bb 18502 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18503
a6670b0b
PE
18504 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18505 Rename locals to avoid shadowing.
18506
cef2010d 18507 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18508 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18509
d4d7173a
PE
18510 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18511
f08b802a
PE
18512 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18513 warning when compiling print.c.
18514
3ddb0639
PE
18515 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18516 instead of using an uninitialized var.
5ad03b97 18517 (font_sort_entities): Mark var as initialized.
3ddb0639 18518
170a2692
PE
18519 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18520
e663c700
PE
18521 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18522 pointers to constants.
89bc529a 18523 (font_parse_fcname): Remove unused vars.
7b81e2d0 18524 (font_delete_unmatched): Now static.
ea838e10 18525 (font_get_spec): Remove; unused.
13a547c6
PE
18526 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18527 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18528 Rename or move locals to avoid shadowing.
e663c700 18529
2a80c887 18530 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18531 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18532
1384fa33 18533 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18534 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18535
8b2c52e9
PE
18536 * alloc.c (mark_backtrace): Move decl from here ...
18537 * lisp.h: ... to here, so that it can be checked.
18538
475545b5 18539 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18540 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18541 (lisp_indirect_variable): Name an expression,
18542 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18543 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18544
b1349114 18545 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18546 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18547 Use const pointer when appropriate.
b1349114 18548
a2928364
PE
18549 * lisp.h (get_system_name, get_operating_system_release):
18550 Move decls here, to check interfaces.
18551 * process.c (get_operating_system_release): Move decl to lisp.h.
18552 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18553 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18554 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18555 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18556 (Fformat_time_string, Fencode_time, Finsert_char):
18557 (Ftranslate_region_internal, Fformat):
18558 Rename or remove local vars to avoid shadowing.
9710023e 18559 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18560
a415e694
PE
18561 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18562 avoid shadowing.
18563
8ef4622d
PE
18564 * lisp.h (eassert): Check that the argument compiles, even if
18565 ENABLE_CHECKING is not defined.
18566
946f9a5b
PE
18567 * data.c (Findirect_variable): Name an expression, to avoid
18568 gcc -Wbad-function-cast warning.
112396d6 18569 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18570 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18571 (Fmake_variable_buffer_local, Fmake_local_variable):
18572 Mark variables as initialized.
52746918 18573 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18574
e5aab7e7 18575 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18576 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18577 Rename locals to avoid shadowing.
dff45157
PE
18578 (mark_stack): Move local variables into the #ifdef region where
18579 they're used.
7bc26fdb
PE
18580 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18581 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18582 needed otherwise.
18583 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18584 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18585 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18586
e5aab7e7
PE
18587 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18588 avoids undefined behavior in theory.
18589
4da60324
PE
18590 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18591
88043301
PE
18592 Use functions, not macros, for up- and down-casing (Bug#8254).
18593 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18594 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18595 to use the following functions instead of these macros.
18596 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18597 EMACS_INT, since callers assume the returned value fits in int.
18598 (upcase1): Likewise, for UPCASE_TABLE.
18599 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18600 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18601 the race-condition problem in the old DOWNCASE.
88043301 18602
19ed5445
PE
18603 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18604 Rename locals to avoid shadowing.
18605 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18606 (regex_compile, re_search_2, re_match_2_internal):
18607 Remove unused local vars.
952db0d7
PE
18608 (FREE_VAR): Rewrite so as not to use empty "else",
18609 which gcc can warn about.
da053e48 18610 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18611 (RETALLOC_IF): Define only if needed.
18612 (WORDCHAR_P): Likewise. This one is never needed, but is used
18613 only in a comment talking about a compiler bug, so put inside
18614 the #if 0 of that comment.
18615 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18616 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18617 Remove; unused.
19ed5445 18618
1f3561e4 18619 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18620 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18621 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18622
ded6f8f7
PE
18623 * search.c (simple_search): Remove unused var.
18624
dbd37a95
PE
18625 * dired.c (compile_pattern): Move decl from here ...
18626 * lisp.h: ... to here, so that it can be checked.
18627 (struct re_registers): New forward decl.
18628
7e47afad
PE
18629 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18630
85f24f61
PE
18631 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18632 All uses changed.
18633 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18634 Rename locals to avoid shadowing.
5671df8f 18635 (Fvertical_motion): Mark locals as initialized.
85f24f61 18636
181aa2be 18637 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18638 (casify_region): Mark local as initialized.
181aa2be 18639
930d429c
PE
18640 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18641
7082eac6
PE
18642 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18643 New macros, so that the caller can use some names other than
18644 gcpro1, gcpro2, etc.
18645 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18646 of the new macros.
18647 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18648 argument, for consistency with GCPRO2_VAR, etc: it is now the
18649 prefix of the variable, not the variable itself. All uses
18650 changed.
38b2c076
PE
18651 * dired.c (directory_files_internal, file_name_completion):
18652 Rename locals to avoid shadowing.
18653
15206ed9
PE
18654 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18655 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18656 dired.c's scmp function, had undefined behavior.
18657 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18658 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18659 * buffer.h: ... to here, because these macros use current_buffer,
18660 and the new implementation with inline functions needs to have
18661 current_buffer in scope now, rather than later when the macros
18662 are used.
18663 (downcase, upcase1): New static inline functions.
18664 (DOWNCASE, UPCASE1): Reimplement using these functions.
18665 This avoids undefined behavior in expressions like
18666 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18667 from race conditions in accessing the global variables
18668 case_temp1 and case_temp2.
18669 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18670 * lisp.h (case_temp1, case_temp2): Remove their decls.
18671 * character.h (ASCII_CHAR_P): Move from here ...
18672 * lisp.h: ... to here, so that the inline functions mentioned
18673 above can use them.
18674
4a6bea26
PE
18675 * dired.c (directory_files_internal_unwind): Now static.
18676
f14b7e14
PE
18677 * fileio.c (file_name_as_directory, directory_file_name):
18678 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18679 Now static.
2893f146
PE
18680 (file_name_as_directory): Use const pointers when appropriate.
18681 (Fexpand_file_name): Likewise. In particular, newdir might
18682 point at constant storage, so make it a const pointer.
fd4ead52 18683 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18684 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18685 signedness issues.
f839df0c
PE
18686 (Fset_file_times, Finsert_file_contents, auto_save_error):
18687 Rename locals to avoid shadowing.
f14b7e14 18688
5716756e 18689 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18690 (Ftry_completion, Fall_completions): Rename or remove locals
18691 to avoid shadowing.
5716756e 18692
b4c3046a
PE
18693 * marker.c (bytepos_to_charpos): Remove; unused.
18694
b45db522
PE
18695 * lisp.h (verify_bytepos, count_markers): New decls,
18696 so that gcc does not warn that these functions aren't declared.
18697
85876d07
PE
18698 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18699 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18700 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18701 (copy_text): Remove unused local var.
85876d07 18702
03d78a21 18703 * filelock.c (within_one_second): Now static.
b3dd38ab 18704 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18705
5df8f01b
PE
18706 * buffer.c (fix_overlays_before): Mark locals as initialized.
18707 (fix_start_end_in_overlays): Likewise. This function should be
18708 simplified by using pointers-to-pointers, but that's a different
18709 matter.
b1d876f1 18710 (switch_to_buffer_1): Now static.
8f54f30a
PE
18711 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18712 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18713
a70072c9 18714 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18715 Fix pointer signedness issue.
edced198
PE
18716 (sys_subshell): Mark local as volatile if checking for lint,
18717 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18718 (MAXPATHLEN): Define only if needed.
a70072c9 18719
a0977c44
PE
18720 * process.c (serial_open, serial_configure): Move decls from here ...
18721 * systty.h: ... to here, so that they can be checked.
18722
a884fdcc
PE
18723 * fns.c (get_random, seed_random): Move extern decls from here ...
18724 * lisp.h: ... to here, so that they can be checked.
18725
604efe86 18726 * sysdep.c (reset_io): Now static.
b8950c94 18727 (wait_for_termination_signal): Remove; unused.
604efe86 18728
38fc62d9
PE
18729 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18730 (copy_keymap_item, append_key, push_text_char_description):
18731 Now static.
1004a21a 18732 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18733 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18734 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18735 (describe_map_tree):
18736 Rename locals to avoid shadowing.
38fc62d9 18737
2f2650da
PE
18738 * keyboard.c: Declare functions static if they are not used elsewhere.
18739 (echo_char, echo_dash, cmd_error, top_level_2):
18740 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18741 (read_char, kbd_buffer_get_event, make_lispy_position):
18742 (make_lispy_event, make_lispy_movement, apply_modifiers):
18743 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18744 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18745 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18746 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18747 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18748
a053e86c 18749 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18750 (mark_kboards): Move decl here ...
18751 * alloc.c (mark_kboards): ... from here.
a053e86c 18752
4752793e
PE
18753 * lisp.h (force_auto_save_soon): New decl.
18754
74f10ca7 18755 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18756 (DEFINE_DUMMY_FUNCTION): New macro.
18757 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18758 Use it.
c03cd23f
PE
18759 (main): Add casts to avoid warnings
18760 if GCC considers string literals to be constants.
74f10ca7 18761
022e70d4
PE
18762 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18763
59d6fe83
PE
18764 * dbusbind.c: Pointer signedness fixes.
18765 (xd_signature, xd_append_arg, xd_initialize):
18766 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18767 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18768 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18769 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18770
78320123
PE
18771 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18772 if GCC considers string literals to be constants.
49cebcca 18773 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18774
35ac2a97
SM
187752011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18776
fb103ca9
SM
18777 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18778 (print_preprocess, print_object): New macro to fix last change.
18779
35ac2a97
SM
18780 * print.c (print_preprocess): Don't forget font objects.
18781
62973b41
JB
187822011-03-16 Juanma Barranquero <lekktu@gmail.com>
18783
18784 * emacs.c (USAGE3): Doc fixes.
18785
0e48bb22
AS
187862011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18787
18788 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18789 structure.
18790
7684e57b
JB
187912011-03-14 Juanma Barranquero <lekktu@gmail.com>
18792
18793 * lisp.h (VWindow_system, Qfile_name_history):
18794 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18795 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18796 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18797
18798 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18799 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18800
18801 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18802 * w32console.c (detect_input_pending, read_input_pending)
18803 (encode_terminal_code):
18804 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18805 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18806 (w32_system_caret_y, Qfile_name_history):
18807 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18808 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18809 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18810 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18811 * w32proc.c (Qlocal, report_file_error):
18812 * w32term.c (Vwindow_system, updating_frame):
18813 * w32uniscribe.c (initialized, uniscribe_font_driver):
18814 Remove unneeded extern declarations.
18815
2aa46d6c
CY
188162011-03-14 Chong Yidong <cyd@stupidchicken.com>
18817
c96bbc66 18818 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18819
cffc6f3b
CY
188202011-03-13 Chong Yidong <cyd@stupidchicken.com>
18821
18822 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18823 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18824 These macros can no longer be used for assignment.
18825
44f230aa
SM
18826 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18827 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18828 (record_buffer_markers, fetch_buffer_markers): New functions for
18829 recording and fetching special buffer markers.
18830 (set_buffer_internal_1, set_buffer_temp): Use them.
18831
18832 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18833
18834 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18835
18836 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18837 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18838
18839 * xdisp.c (hscroll_window_tree):
18840 (reconsider_clip_changes): Use PT instead of BUF_PT.
18841
d251f04b
EZ
188422011-03-13 Eli Zaretskii <eliz@gnu.org>
18843
18844 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18845 $(EMACS_ROOT)/lib/intprops.h.
18846
f0c77cd1
PE
188472011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18848
3eca4629
PE
18849 Fix more problems found by GCC 4.5.2's static checks.
18850
7c86ee98
PE
18851 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18852 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18853 (xg_free_frame_widgets): Make it clear that a local variable is
18854 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18855 (gdk_window_get_screen): Make it clear that this macro is needed
18856 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18857 (int_gtk_range_get_value): New function, which avoids a diagnostic
18858 from gcc -Wbad-function-cast.
18859 (xg_set_toolkit_scroll_bar_thumb): Use it.
18860 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18861 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18862 (get_utf8_string, xg_get_file_with_chooser):
18863 Rename locals to avoid shadowing.
18864 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18865
41729b81
PE
18866 * xgselect.c (xg_select): Remove unused var.
18867
f0c77cd1
PE
18868 * image.c (four_corners_best): Mark locals as initialized.
18869 (gif_load): Initialize transparent_p to zero (Bug#8238).
18870 Mark another local as initialized.
ec6cf4c6 18871 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 18872
ce0ad53d 18873 * image.c (clear_image_cache): Now static.
d5d5a617 18874 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 18875 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
18876 (x_edge_detection): Remove unnecessary cast that
18877 gcc -Wbad-function-cast diagnoses.
2037898d 18878 (gif_load): Fix pointer signedness.
6ae141d6
PE
18879 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18880 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 18881
33383987 188822011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 18883
d32df629
PE
18884 Improve quality of tests for time stamp overflow.
18885 For example, without this patch (encode-time 0 0 0 1 1
18886 1152921504606846976) returns the obviously-bogus value (-948597
18887 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18888 reports time overflow. See
18889 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
18890 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18891 * editfns.c: Include limits.h and intprops.h.
18892 (TIME_T_MIN, TIME_T_MAX): New macros.
18893 (time_overflow): Move earlier, to before first use.
18894 (hi_time, lo_time): New functions, for an accurate test for
18895 out-of-range times.
18896 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18897 (Fget_internal_run_time): Don't assume time_t fits in int.
18898 (make_time): Use list2 instead of Fcons twice.
18899 (Fdecode_time): More accurate test for out-of-range times.
18900 (check_tm_member): New function.
18901 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
18902 (lisp_time_argument): Don't rely on undefined left-shift and
18903 right-shift behavior when checking for time stamp overflow.
8be6f318 18904
fe31d94c
PE
18905 * editfns.c (time_overflow): New function, refactoring common code.
18906 (Fformat_time_string, Fdecode_time, Fencode_time):
18907 (Fcurrent_time_string): Use it.
18908
8be6f318
PE
18909 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18910 * dired.c (make_time): Move to ...
18911 * editfns.c (make_time): ... here.
18912 * systime.h: Note the move.
18913
09d9db2c 189142011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 18915
126bc0dc
YM
18916 * fringe.c (update_window_fringes): Remove unused variables.
18917
c47cbdfd
YM
18918 * unexmacosx.c (copy_data_segment): Also copy __got section.
18919 (Bug#8223)
18920
7ac80be9
EZ
189212011-03-12 Eli Zaretskii <eliz@gnu.org>
18922
c96bbc66 18923 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
18924 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
18925 Constify `char *' arguments and their references according to
18926 prototypes in tparam.h.
18927
ecb0f94d 18928 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 18929
7ac80be9
EZ
18930 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
18931 Adapt all references accordingly.
18932
18933 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
18934
ef1fd07e
TT
189352011-03-11 Tom Tromey <tromey@redhat.com>
18936
18937 * buffer.c (syms_of_buffer): Remove obsolete comment.
18938
7ef4b50c
EZ
189392011-03-11 Eli Zaretskii <eliz@gnu.org>
18940
18941 * termhooks.h (encode_terminal_code): Declare prototype.
18942
18943 * msdos.c (encode_terminal_code): Don't declare prototype.
18944
18945 * term.c (encode_terminal_code): Now external again, used by
18946 w32console.c and msdos.c.
18947
44f230aa
SM
18948 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
18949 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 18950
4b1ec863 189512011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 18952
1714f52b 18953 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 18954
4b1ec863
PE
18955 * fringe.c (update_window_fringes): Mark locals as initialized
18956 (Bug#8227).
18957 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 18958
524c7aa6
PE
18959 * alloc.c (mark_fringe_data): Move decl from here ...
18960 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
18961 to check its interface.
18962 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
18963
a5c0af81 18964 * fontset.c (free_realized_fontset): Now static.
7519b8cd 18965 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 18966 (fontset_font): Mark local as initialized.
a9a06e0b 18967 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 18968
b4716021
PE
18969 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
18970
811e9bac 18971 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 18972 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
18973 (x_own_selection, Fx_disown_selection_internal): Rename locals
18974 to avoid shadowing.
18975 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 18976
7e3ab302
PE
18977 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
18978 so that the caller can use some name other than gcpro1.
18979 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
18980 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18981 (Fx_backspace_delete_keys_p):
18982 Use them to avoid shadowing, and rename vars to avoid shadowing.
18983 (x_decode_color, x_set_name, x_window): Now static.
6b437900 18984 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 18985 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
18986 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
18987 Remove unused locals.
7e3ab302
PE
18988 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
18989 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
18990 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
18991 macros.
f78faa98 18992
e2b13473
PE
18993 * xterm.h (x_mouse_leave): New decl.
18994
77f23912
PE
18995 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
18996 Remove unused functions.
cdf4ba58
PE
18997 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
18998 (x_calc_absolute_position): Now static.
7411c686 18999 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 19000 Don't declare local "event" unless it's used.
ed7bf3a5
PE
19001 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19002 unless they are used.
38d0b34a
PE
19003 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19004 (x_fatal_error_signal): Remove; not used.
a6067996
PE
19005 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19006 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19007 (x_error_catcher, x_connection_closed, x_error_handler):
19008 (x_error_quitter, xembed_send_message, x_iconify_frame):
19009 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 19010 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 19011 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 19012
44f230aa
SM
19013 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19014 Rename or move locals to avoid shadowing.
6b463e58 19015 (tty_defined_color, merge_face_heights): Now static.
5967d051 19016 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
19017 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19018 does not deduce is never used uninitialized.
73719eba
PE
19019 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19020 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 19021
426994c3 19022 * terminal.c (store_terminal_param): Now static.
5489860b 19023
032f1620 19024 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 19025 (set_frame_menubar): Remove unused local.
d4323972 19026 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
19027 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19028 since they might point to immutable storage.
281585b0
PE
19029 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19030 since it's unused otherwise.
032f1620 19031
367c19e5 19032 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 19033 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
19034 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19035 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 19036 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
19037 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19038 does not deduce are never used uninitialized.
70739cbe 19039
07b48fa9
PE
19040 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19041
8868a238 19042 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
19043 * window.c (window_loop, size_window):
19044 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 19045
7e5cf297 19046 * window.c (display_buffer): Now static.
d6550a9f
PE
19047 (size_window): Mark variables that gcc -Wuninitialized
19048 does not deduce are never used uninitialized.
a586633d
PE
19049 * window.h (check_all_windows): New decl, to forestall
19050 gcc -Wmissing-prototypes diagnostic.
5b555da1 19051 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 19052
f6095868
PE
19053 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19054 shadowing.
19055 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
19056 Include <limits.h>.
19057 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19058 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
19059 (load_charset_map): Mark variables that gcc -Wuninitialized
19060 does not deduce are never used uninitialized.
53df7c11 19061 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 19062
f38b440c
PE
19063 * coding.c (coding_set_source, coding_set_destination):
19064 Use "else { /* comment */ }" rather than "else /* comment */;"
19065 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
19066 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19067 a block, when the outer 'i' will do.
19068 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19069 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19070 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19071 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19072 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19073 Rename locals to avoid shadowing.
19074 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
19075 * coding.c (emacs_mule_char, encode_invocation_designation):
19076 Now static, since they're not used elsewhere.
413bb2db 19077 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 19078 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
19079 (decode_coding_emacs_mule): Mark variables that gcc
19080 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
19081 (detect_coding_iso_2022): Initialize a local variable that might
19082 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 19083 this initialization is needed. (Bug#8211)
5f58e762
PE
19084 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19085 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19086 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19087 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19088 Remove unused macros.
f38b440c 19089
232b38b9 19090 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 19091 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 19092 * character.c (string_count_byte8): Likewise.
232b38b9 19093
fb90da1b
PE
19094 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19095 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19096
fb93dbc2
PE
19097 * chartab.c (copy_sub_char_table): Now static, since it's not used
19098 elsewhere.
5c156ace
PE
19099 (sub_char_table_ref_and_range, char_table_ref_and_range):
19100 Rename locals to avoid shadowing.
bbcd0949 19101 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 19102
7d3b3862 19103 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 19104 (BIDI_BOB): Remove unused macro.
7d3b3862 19105
6be7d3da
PE
19106 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19107 deduce are never used uninitialized.
c2ed9c8b 19108 * term.c (encode_terminal_code): Likewise.
6be7d3da 19109
75f8807f 19110 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 19111
50938595
PE
19112 * tparam.h: New file.
19113 * term.c, tparam.h: Include it.
19114 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19115 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19116 Move these decls to tparam.h, and make them agree with what
19117 is actually in tparam.c. The previous trick of using incompatible
19118 decls in different modules does not conform to the C standard.
19119 All callers of tparam changed to use tparam's actual API.
19120 * tparam.c (tparam1, tparam, tgoto):
19121 Use const pointers where appropriate.
19122
fbceeba2
PE
19123 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19124 * cm.h (struct cm): Likewise.
19125 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19126 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19127 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19128 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19129 (turn_on_face, init_tty): Likewise.
19130 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 19131
7f3f1250
PE
19132 * term.c (term_mouse_position): Rename local to avoid shadowing.
19133
e6ca6543
PE
19134 * alloc.c (mark_ttys): Move decl from here ...
19135 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19136
c40f8d15
AS
191372011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19138
19139 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19140
cfe0661d
JB
191412011-03-09 Juanma Barranquero <lekktu@gmail.com>
19142
19143 * search.c (compile_pattern_1): Remove argument regp, unused since
19144 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19145 (compile_pattern): Don't pass it.
19146
0afb4571
J
191472011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19148
19149 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19150 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19151 for ! HAVE_GTK3.
19152 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19153
19154 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19155
19156 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19157 gdk_window_get_screen, gdk_window_get_geometry,
19158 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19159 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19160 (xg_get_pixbuf_from_pixmap): New function.
19161 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19162 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19163 Call xg_get_pixbuf_from_pixmap instead of
19164 gdk_pixbuf_get_from_drawable.
19165 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19166 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19167 (xg_check_special_colors): Use GtkStyleContext and its functions
19168 for HAVE_GTK3.
19169 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19170 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19171 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
19172 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19173 Call gtk_widget_get_preferred_size.
0afb4571
J
19174 (xg_frame_resized): gdk_window_get_geometry only takes 5
19175 parameters.
44f230aa
SM
19176 (xg_win_to_widget, xg_event_is_for_menubar):
19177 Call gdk_x11_window_lookup_for_display.
0afb4571
J
19178 (xg_set_widget_bg): New function.
19179 (delete_cb): New function.
895009e1 19180 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 19181 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
19182 (xg_set_background_color): Call xg_set_widget_bg.
19183 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19184 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19185 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19186 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19187 if ! HAVE_GTK3.
19188 (update_frame_tool_bar): Call gtk_widget_hide.
19189 (xg_initialize): Use GDK_KEY_g.
19190
19191 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19192 if ! HAVE_GTK3
19193 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19194
19195 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19196 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19197 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19198
1c2cc4ef
JB
191992011-03-08 Juanma Barranquero <lekktu@gmail.com>
19200
19201 * w32xfns.c (select_palette): Check success of RealizePalette against
19202 GDI_ERROR, not zero.
19203
33383987 19204See ChangeLog.11 for earlier changes.
aac0c6e3
MR
19205
19206;; Local Variables:
19207;; coding: utf-8
aac0c6e3
MR
19208;; End:
19209
2f097256 19210 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
19211
19212 This file is part of GNU Emacs.
19213
19214 GNU Emacs is free software: you can redistribute it and/or modify
19215 it under the terms of the GNU General Public License as published by
19216 the Free Software Foundation, either version 3 of the License, or
19217 (at your option) any later version.
19218
19219 GNU Emacs is distributed in the hope that it will be useful,
19220 but WITHOUT ANY WARRANTY; without even the implied warranty of
19221 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19222 GNU General Public License for more details.
19223
19224 You should have received a copy of the GNU General Public License
19225 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.