Window-related stuff cleanup here and there.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
b9e9df47
DA
12012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Window-related stuff cleanup here and there.
4 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5 Use decode_any_window.
6 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
7 * xdisp.c (Fformat_mode_line): Likewise.
8 * font.c (Ffont_at): Use decode_live_window.
9 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
10 * window.c (decode_next_window_args): Likewise.
11 (decode_any_window): Remove static.
12 * window.h (decode_any_window): Add prototype.
13 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
14 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
15 respectively.
16
2b371ff7
DA
172012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
18
19 Remove pad from struct input_event.
20 * termhooks.h (struct input_event): Remove padding field.
21 Adjust comment.
22 * keyboard.c (event_to_kboard): Simplify because frame_or_window
23 member is never cons for a long time. Adjust comment.
24 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
25 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
26 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
27 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
28
7e8b50d9
EZ
292012-11-01 Eli Zaretskii <eliz@gnu.org>
30
31 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
32
322aea6d
PE
332012-10-31 Paul Eggert <eggert@cs.ucla.edu>
34
35 Fix crash when using Emacs as commit editor for git (Bug#12697).
36 * callproc.c (setpgrp): Remove macro, as we now use setpgid
37 and it is configured in conf_post.h.
38 (Fcall_process): Don't invoke both setsid and setpgid; the former
39 is enough, if it exists.
40 * callproc.c (Fcall_process, child_setup):
41 * process.c (create_process): Use setpgid.
42 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
43 for the real thing.
44 * dispnew.c (init_display): Initialize the foreground group
45 if we are running a tty display.
46 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
47 * lisp.h (init_foreground_group): New decl.
48 * sysdep.c (inherited_pgroup): New static var.
49 (init_foreground_group, tcsetpgrp_without_stopping)
50 (narrow_foreground_group, widen_foreground_group): New functions.
51 (init_sys_modes): Narrow foreground group.
52 (reset_sys_modes): Widen foreground group.
53
220cb2bd
MA
542012-10-31 Michael Albinus <michael.albinus@gmx.de>
55
56 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
57
218e997a
MR
582012-10-31 Martin Rudalics <rudalics@gmx.at>
59
60 * minibuf.c (read_minibuf): Restore current buffer since
61 choose_minibuf_frame calling Fset_frame_selected_window may
62 change it (Bug#12766).
63
02615da0
JD
642012-10-30 Jan Djärv <jan.h.d@swipnet.se>
65
66 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
67
aee5b18e
KH
682012-10-30 Kenichi Handa <handa@gnu.org>
69
70 * font.c (Ffont_at): If WINDOW is specified and it is not
71 displaying the current buffer, signal an error.
72
ba116008
DC
732012-10-29 Daniel Colascione <dancol@dancol.org>
74
75 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
76 preparation for fixing bug#12739, move these functions from
77 here...
78
79 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
80 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
81 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 82
640bf8ad
EZ
832012-10-28 Eli Zaretskii <eliz@gnu.org>
84
85 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
86 (timer_loop, getitimer, setitimer): Use it instead of
87 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
88 'clock'.
89 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
90 literal 10000.
91
64ccff5f
JD
922012-10-28 Jan Djärv <jan.h.d@swipnet.se>
93
94 * nsterm.m (NO_APPDEFINED_DATA): New define.
95 (last_appdefined_event_data): New variable
96 (last_appdefined_event): Remove.
97 (ns_select): Initialize t from last_appdefined_event_data instead
98 of [last_appdefined_event data1].
99 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
100 remove last_appdefined_event (Bug#12698).
101
e483264c
SM
1022012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
103
104 * frame.c (x_set_font): Catch internal error.
105
6c16c13e
EZ
1062012-10-27 Eli Zaretskii <eliz@gnu.org>
107
e483264c
SM
108 Avoid overflow in w32 implementation of interval timers.
109 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
110 actually executes.
111 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
112 'volatile ULONGLONG' types. All the other data which was
113 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
114 (GetThreadTimes_Proc): New typedef.
115 (w32_get_timer_time): New function, returns a suitable time value
116 for the timer.
117 (timer_loop): Enter critical section when accessing ULONGLONG
118 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
119 atomic. Call 'w32_get_timer_time' instead of 'clock'.
120 Remove unused variable.
6c16c13e
EZ
121 (init_timers): Initialize s_pfn_Get_Thread_Times.
122 (start_timer_thread): Don't assign itimer->caller_thread here.
123 (getitimer): Assign itimer->caller_thread here.
124 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 125 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 126
ccc83f50
EZ
1272012-10-26 Eli Zaretskii <eliz@gnu.org>
128
129 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
130 mouse movement events if the menu bar is active. This avoids
131 producing a busy "hour-glass" cursor by Windows if the mouse
132 pointer is positioned over a tooltip shown for some menu item.
133
69deda53
PE
1342012-10-25 Paul Eggert <eggert@cs.ucla.edu>
135
136 Don't assume process IDs fit in int.
137 * emacs.c (shut_down_emacs) [!DOS_NT]:
138 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
139 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
140 Use pid_t, not int, to store process IDs, as 'int'
141 is not wide enough on a few platforms (e.g., AIX and IRIX).
142
7e70a152
KH
1432012-10-23 Kenichi Handa <handa@gnu.org>
144
145 The following change is to make face-font-rescale-alist work
146 correctly for non-ASCII fonts.
147
148 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
149 (font_open_for_lface): Handle Vface_font_rescale_alist.
150
49238e7f
CY
1512012-10-23 Chong Yidong <cyd@gnu.org>
152
153 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
154
5ec86886
JD
1552012-10-21 Jan Djärv <jan.h.d@swipnet.se>
156
ef446959
JD
157 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
158 for screen font.
159 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
160
5ec86886
JD
161 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
162 event (Bug#12681).
163
ee7a418d
GM
1642012-10-21 Glenn Morris <rgm@gnu.org>
165
166 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
167
4973679b
PE
1682012-10-20 Paul Eggert <eggert@cs.ucla.edu>
169
170 Port to OpenBSD 5.1.
171 * frame.c (Fmouse_position, Fmouse_pixel_position):
172 * xdisp.c (produce_stretch_glyph):
173 Declare local vars only when they're needed.
174 This is clearer and avoids a warning on OpenBSD about unused vars.
175 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
176 This is safer, and avoids OpenBSD warnings about unused vars.
177 * keyboard.c (record_menu_key): Remove unnecessary decl.
178 (poll_timer): Define only if POLL_FOR_INPUT is defined.
179 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
180 as our definition clashes with OpenBSD's.
181 * xfaces.c (load_face_colors, check_lface_attrs)
182 (get_lface_attributes_no_remap, get_lface_attributes)
183 (lface_fully_specified_p, x_supports_face_attributes_p)
184 (tty_supports_face_attributes_p, face_fontset, realize_face)
185 (realize_x_face, realize_tty_face):
186 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
187 merely Lisp_Object *. This is more informative and avoids
188 a warning on OpenBSD about accessing beyond an object's size.
189
c664f463
CY
1902012-10-20 Chong Yidong <cyd@gnu.org>
191
192 * lread.c (Fload): Doc fix (Bug#12592).
193
6ec83f92 1942012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
195
196 * font.c (Ffont_at): Fix previous change.
197
d2824928
EZ
1982012-10-19 Eli Zaretskii <eliz@gnu.org>
199
e483264c
SM
200 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
201 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
202 for the reasons.
203
d2824928
EZ
204 * alloc.c (NSTATICS): Decrease to 0x800.
205
f60d391f
SM
2062012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
207
208 * fns.c (Fnreverse): Include the problem element when signalling an
209 error (bug#12677).
210
1a9327d5
JD
2112012-10-18 Jan Djärv <jan.h.d@swipnet.se>
212
213 * nsterm.m (ns_select): Check writefds before call to
214 FD_ISSET (Bug#12668).
215
14145a1e
DC
2162012-10-18 Daniel Colascione <dancol@dancol.org>
217
218 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
219 (staticpro): If we run out of staticpro slots, die with an
220 informative error instead of just calling emacs_abort.
221
1f76f6f5
MR
2222012-10-18 Martin Rudalics <rudalics@gmx.at>
223
224 Fix two flaws reported by Dmitry Antipov.
225 * window.c (Ftemp_output_buffer_show): Remove.
226 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
227 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
228
fcf14875
EZ
2292012-10-17 Eli Zaretskii <eliz@gnu.org>
230
1f76f6f5
MR
231 * makefile.w32-in ($(BLD)/w32.$(O)):
232 ($(BLD)/vm-limit.$(O)):
233 ($(BLD)/term.$(O)):
234 ($(BLD)/unexw32.$(O)):
235 ($(BLD)/fileio.$(O)):
a68089e4
EZ
236 ($(BLD)/dispnew.$(O)): Update dependencies.
237
238 * w32term.h (w32_initialize_display_info, initialize_w32_display):
239 Add prototypes.
240
241 * w32proc.c: Include ctype.h.
242
243 * w32.h (init_environment, check_windows_init_file)
244 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
245 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
246 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
247 (sys_link): Add prototypes.
248
249 * w32.c: Include w32select.h.
250 (sys_access, e_malloc, sys_select): Add prototypes.
251 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
252
253 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
254
255 * unexw32.c: Include lisp.h and w32.h.
256
257 * term.c [WINDOWSNT]: Include w32term.h.
258
259 * process.c [WINDOWSNT]: Add prototype of sys_select.
260
261 * fileio.c [WINDOWSNT]: Include w32.h.
262
263 * dispnew.c [WINDOWSNT]: Include w32.h.
264
fcf14875
EZ
265 * cygw32.c (Fcygwin_convert_path_to_windows)
266 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
267 Lisp_Object values. (Bug#12661)
268
269 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
270 to Lisp_Object. (Bug#12661)
271
fe0b1ec4
KH
2722012-10-17 Kenichi Handa <handa@gnu.org>
273
274 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
275 invalidate.
276
d556ebf9
DA
2772012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
278
279 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 280 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 281
f0863a54
DA
2822012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
283
284 Do not verify indirection counters of killed buffers (Bug#12579).
285 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
286 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
287
12fbe755
DA
2882012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
289
290 * alloc.c (Fmake_byte_code): Fix typo in comment.
291 * print.c (print_interval): Define as static to match prototype.
292 * indent.c (disptab_matches_widthtab, recompute_width_table):
293 Convert to eassert.
294
61655b89
DA
2952012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
296
297 * editfns.c (get_system_name): Remove.
298 * lisp.h (get_system_name): Remove prototype.
299 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
300 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
301
9520f2f2
DC
3022012-10-15 Daniel Colascione <dancol@dancol.org>
303
304 * dbusbind.c: Add comment explaining reason for previous change.
305
dca778d5
MR
3062012-10-15 Martin Rudalics <rudalics@gmx.at>
307
308 * window.c (Fwindow_end): Rewrite check whether cached position
309 can be used (Bug#12600).
310 (resize_frame_windows, grow_mini_window, shrink_mini_window):
311 Set windows_or_buffers_changed.
312
3e0341b0
DC
3132012-10-15 Daniel Colascione <dancol@dancol.org>
314
315 * dbusbind.c: Fix cygw32 build break when compiling with dbus
316 enabled by undefining the symbol "interface", which the platform
317 headers define to something incompatible.
318
33d4113c
DC
3192012-10-14 Daniel Colascione <dancol@dancol.org>
320
321 * image.c (init_tiff_functions, init_imagemagick_functions)
322 (init_svg_functions): Fix cygw32 build break by using these
323 functions only when WINDOWSNT _and_ HAVE_NTGUI.
324
a36fb15e
JD
3252012-10-14 Jan Djärv <jan.h.d@swipnet.se>
326
327 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
328
537f336d
JD
3292012-10-13 Jan Djärv <jan.h.d@swipnet.se>
330
331 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
332
0ba06a77
KH
3332012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
334
335 * coding.c (detect_coding): Set coding->id before calling
336 this->detector.
337
ce2fe65a
AS
3382012-10-13 Andreas Schwab <schwab@linux-m68k.org>
339
340 * fileio.c: Formatting fixes.
341
d6453ce4
PE
3422012-10-13 Paul Eggert <eggert@cs.ucla.edu>
343
344 Fix some stat-related races.
345 * fileio.c (Fwrite_region): Avoid race condition if a file is
346 removed or renamed by some other process immediately after Emacs
347 writes it but before Emacs stats it. Do not assume that stat (or
348 fstat) succeeds.
349 * image.c (slurp_file): Resolve the file name with fopen + fstat
350 rather than stat + fopen.
351 (pbm_read_file) [0]: Remove unused code with stat race.
352 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
353 Remove ineffective code with stat race.
354
06485aa8
SM
3552012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
356
357 * doc.c (get_doc_string): Don't signal an error if the file is missing.
358
167e3640
JD
3592012-10-12 Jan Djärv <jan.h.d@swipnet.se>
360
361 * nsterm.m (hold_event_q): New static variable.
362 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
363 ! q_event_ptr.
364 (hold_event): New function.
365 (ns_read_socket): If hold_event_q have events, store them and
366 return (Bug#12384).
367 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
368 is zero (Bug#12384).
369
c40239df
JB
3702012-10-12 Juanma Barranquero <lekktu@gmail.com>
371
372 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
373
bb385a92
EZ
3742012-10-12 Eli Zaretskii <eliz@gnu.org>
375
2a9f1099
EZ
376 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
377
bb385a92
EZ
378 * fileio.c (check_existing): New function.
379 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
380 instead of calling 'stat', when what's needed is to check whether
381 a file exists. This avoids expensive system calls on MS-Windows.
382 (Bug#12587)
383
8599b23a 384 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
385
386 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
387 determine whether a file exists and is not a directory.
388
389 * lisp.h (check_existing): Add prototype.
390
2b9c2e68
JD
3912012-10-12 Jan Djärv <jan.h.d@swipnet.se>
392
393 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
394
81749a23
GM
3952012-10-12 Glenn Morris <rgm@gnu.org>
396
397 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
398
5253a5fd
SM
3992012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
400
389a94a5
SM
401 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
402
5253a5fd
SM
403 * eval.c (Fautoload): Remember previous autoload status in load-history.
404
7cded46f
PE
4052012-10-11 Paul Eggert <eggert@cs.ucla.edu>
406
407 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
408 * lread.c (load_each_byte, new_backquote_flag, readchar)
409 (read_filtered_event, lisp_file_lexically_bound_p)
410 (safe_to_load_version, Fload, complete_filename_p, openp)
411 (build_load_history, readevalloop, read_escape, read1)
412 (string_to_number, read_vector, read_list):
413 * macros.c (Fstart_kbd_macro):
414 * marker.c (CONSIDER):
415 * menu.c (parse_single_submenu, digest_single_submenu)
416 (find_and_return_menu_selection, Fx_popup_menu):
417 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
418 (Ftry_completion):
419 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
420 (ns_menu_show):
421 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
422 (xmenu_show, xdialog_show):
423 Use bool for booleans.
424 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
425 as it's not a predicate. All uses changed. Omit unnecessary
426 buffer termination.
427
549c3414
DA
4282012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
429
430 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
431 (save_excursion_restore): Do not restore mark if it was not saved.
432
e85aafe7
PE
4332012-10-11 Paul Eggert <eggert@cs.ucla.edu>
434
fd2f90cf
PE
435 * marker.c (cached_modiff): EMACS_INT, not int.
436
c1af190b
PE
437 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
438 instead of having a wrong decl.
e85aafe7
PE
439 * nsmenu.m (waiting_for_input): Remove wrong decl.
440
e738ca56
PE
4412012-10-10 Paul Eggert <eggert@cs.ucla.edu>
442
9fa1de30
PE
443 keyboard.c, keymap.c: Use bool for booleans.
444 * dispnew.c (sit_for): Distinguish between 3-way display_option
445 and boolean do_display.
446 * keyboard.c (single_kboard, this_command_key_count_reset)
447 (waiting_for_input, echoing, immediate_quit, input_pending)
448 (interrupt_input, interrupts_deferred, pop_kboard)
449 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
450 (command_loop_1, adjust_point_for_property)
451 (safe_run_hooks_error, input_polling_used, read_char):
452 (help_char_p, readable_events, kbd_buffer_events_waiting)
453 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
454 (lucid_event_type_list_p, get_input_pending):
455 (gobble_input, menu_separator_name_p, menu_bar_item)
456 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
457 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
458 (keyremap_step, test_undefined, read_key_sequence)
459 (detect_input_pending, detect_input_pending_ignore_squeezables)
460 (detect_input_pending_run_timers, requeued_events_pending_p)
461 (quit_throw_to_read_char, Fset_input_interrupt_mode):
462 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
463 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
464 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
465 (accessible_keymaps_1, Fkey_description, push_key_description):
466 (shadow_lookup, struct where_is_internal_data)
467 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
468 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
469 (describe_map, describe_vector):
470 * menu.c (single_menu_item):
471 * nsmenu.m (ns_update_menubar):
472 * process.c (wait_reading_process_output):
473 * search.c (scan_buffer, scan_newline):
474 Use bool for boolean.
475 * keyboard.c (timers_run, swallow_events)
476 (detect_input_pending_run_timers):
477 * process.c (wait_reading_process_output):
478 Use unsigned for counter where wraparound-on-overflow is desired,
479 since unsigned is guaranteed to have that behavior and signed is not.
480 (read_char): Use ptrdiff_t for string length.
481 (get_input_pending): Remove first argument, since it was always
482 the same pointer-to-int (now pointer-to-boolean) &input_pending,
483 and behave as if it had that value. Return new value of
484 input_pending. All callers changed.
485 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
486 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
487 a string length.
488 * keymap.c (push_key_description): Omit last arg, which was always 1.
489 All callers changed.
490
e738ca56
PE
491 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
492
29f21cdf
JB
4932012-10-10 Juanma Barranquero <lekktu@gmail.com>
494
495 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
496 ($(BLD)/term.$(O)): Update dependencies.
497
6aea7528
DA
4982012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
499
500 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
501 * lisp.h (enum pvec_type): Adjust comments and omit explicit
502 initializer for PVEC_NORMAL_VECTOR.
503
5f3f57be
PE
5042012-10-10 Paul Eggert <eggert@cs.ucla.edu>
505
506 Clean out old termopts cruft.
507 * termopts.h (flow_control, meta_key): Remove unused decls.
508 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
509 Don't include termopts.h.
510
3e98c68e
DA
5112012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
512
513 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
514
77e344e5
PE
5152012-10-10 Paul Eggert <eggert@cs.ucla.edu>
516
517 * commands.h (immediate_quit): Remove duplicate decl.
518
5683d7cd
JD
5192012-10-09 Jan Djärv <jan.h.d@swipnet.se>
520
521 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
522 caching.
523 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 524 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 525
cf5fc6db
EZ
5262012-10-09 Eli Zaretskii <eliz@gnu.org>
527
b15736e6
EZ
528 * w32fns.c (w32_last_error): Change the return value to DWORD, to
529 match what GetLastError returns. Explain why the function is
530 needed.
531
cf5fc6db
EZ
532 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
533 'is_tooltip_frame', to avoid confusion with its global namesake.
534
f99714ce
DC
5352012-10-08 Daniel Colascione <dancol@dancol.org>
536
537 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
538 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
539 build that caused Emacs to display the hourglass cursor forever.
f99714ce 540
fd59cb29
GM
541 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
542 which is broken under remote desktop, calculate the number of
543 colors available for a display based on the display's number of
544 planes and number of bits per pixel per plane. (bug#10397).
545
62c480c9 5462012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 547
62c480c9
JD
548 * nsfont.m (Vfonts_in_cache): New variable.
549 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
550 are used. Add cached fonts to Vfonts_in_cache.
551 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
552
607446ba
JB
5532012-10-08 Juanma Barranquero <lekktu@gmail.com>
554
fd5125ad
JB
555 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
556 in nt/config.nt.
46979e0b
JB
557 (FONT_H): Define after FRAME_H.
558 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
559 Update dependencies.
fd5125ad 560
607446ba
JB
561 * w32term.c: Remove leftover declaration of keyboard_codepage.
562
b6f4e300
EZ
5632012-10-08 Eli Zaretskii <eliz@gnu.org>
564
c54ebba4
EZ
565 * makefile.w32-in (FONT_H): Add $(FRAME_H).
566 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
567 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
568 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
569 ($(BLD)/unexw32.$(O)):
570 ($(BLD)/w32.$(O)):
571 ($(BLD)/w32console.$(O)):
572 ($(BLD)/w32fns.$(O)):
573 ($(BLD)/w32heap.$(O)):
574 ($(BLD)/w32menu.$(O)):
15c720a3 575 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 576
b6f4e300
EZ
577 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
578 'const char *'.
579 (x_to_w32_color): Don't modify the argument, modify a copy instead.
580
501199a3
DC
5812012-10-08 Daniel Colascione <dancol@dancol.org>
582
583 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
584 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
585 accidental message numbering hole. Change other messages to
586 match.
587
588 * w32select.h (HAVE_W32SELECT): Remove.
589
590 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 591 w32common.h instead of w32heap.h.
501199a3
DC
592
593 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
594 (get_allocation_unit, get_processor_type, get_w32_major_version)
595 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
596 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
597 (OS_NT, os_subtype, cache_system_info): Move declarations to
598 w32common.
599
600 * w32heap.c: Include w32common.h.
601 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
602 (w32_minor_version, w32_build_number, w32_subtype):
603 Remove duplicate definitions.
501199a3
DC
604
605 * w32fns.c: Include w32common.h; include w32heap.h only in
606 WINDOWSNT.
607
608 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
609 Use `report_file_error' instead of `error' in order to better
610 inform users of what went wrong. Increase NTGUI_UNICODE file
611 dialog box file name length to 32k, the maximum allowed by the NT
612 kernel.
613
614 * w32common.h: New file.
615 (ROUND_UP, ROUND_DOWN, get_page_size)
616 (get_allocation_unit, get_processor_type, get_w32_major_version)
617 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
618 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
619 (OS_NT, os_subtype, cache_system_info): Move here.
620
621 * unexw32.c, unexcw.c: Include w32common.h.
622
623 * emacs.c (main): Use (defined (WINDOWSNT) || defined
624 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
625 to call syms_of_w32select.
626
627 * cygw32.h: Remove obsolete EXFUN declarations.
628
629 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
630
631 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
632 of w32inevt.o from SOME_MACHINE_OBJECTS.
633
93aa5c81
DC
6342012-10-08 Daniel Colascione <dancol@dancol.org>
635
636 * image.c: Permanent fix for JPEG compilation issue --- limit
637 jpeglib `boolean' redefinition to Cygwin builds.
638
d424f3d8
EZ
6392012-10-08 Eli Zaretskii <eliz@gnu.org>
640
8ee4c6ce
EZ
641 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
642
d424f3d8
EZ
643 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
644 Cygwin.
645
e08348a0
DC
6462012-10-08 Daniel Colascione <dancol@dancol.org>
647
648 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
649 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
650 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
651 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
652 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
653 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
654 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
655 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
656 now a supported configuration.
657
658 * Makefile.in: consolidate image variables into LIBIMAGE; add
659 W32_OBJ and W32_LIBS. Compile new files.
660
661 * conf_post.h:
662 (_DebPrint) declare tracing facility for W32 debugging. We need
663 to unify tracing later.
664
665 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
666 unconditional use of W32 Unicode functions. Cygwin runs only on
667 100% Unicode operating systems.
668
669 * cygw32.c: New file. Define Cygwin-specific facilities.
670 (Fcygwin_convert_path_to_windows)
671 (Fcygwin_convert_path_from_windows): New user functions for
672 accessing Cygwin path-munging routines.
673
674 * cygw32.h: New file.
675 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
676 UTF-16LE strings temporarily inside non-Lisp-visible string
677 objects.
678
679 (w32_strerror): Just what it says on the tin.
680
681 * emacs.c: Make the NS fork-then-exec code for daemon-launching
682 also run for Cygwin; both systems have the same problem with using
683 GUI facilities in a forked child. Also call syms_of_cygw32,
684 syms_of_w32select in correct places.
685
686 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
687 needs fork-then-exec for daemon launching.
688
689 * font.h: Include frame.h.
690
691 * image.c: Use the image library cache machinery only when we're
692 compiling for native WINDOWSNT; Cygwin can use shared libraries
693 like any other Unixlike system.
694
695 * keyboard.c: Clarify a comment regarding the input loop.
696
697 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
698 functions directly instead of trying to detect at runtime that our
699 host operating system supports them. We make this change for two
700 reasons: Cygwin lacks support for the multibyte character
701 conversion functions used by the legacy menu code, and Cygwin
702 never needs to rely on non-Unicode APIs.
703
704 * unexw32.c (hinst): Declare extern.
705
706 * w32.c: Change header order;
707 (w32_strerror): Move to w32fns.c because we need it for
708 non-WINDOWSNT builds.
709
710 * w32.h: Add #error macro to make sure we don't include w32.h for
711 Cygwin builds. Remove w32select declarations.
712
713 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 714 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
715
716 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
717 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
718 POSIXy alternative.
719 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
720 (w32_major_version, w32_minor_version, w32_build_number)
721 (os_subtype, sound_type): Define here
722 (w32_defined_color): Make color parameter const for consistency
723 with other _defined_color functions.
724 (w32_createwindow): Unconditionally call w32_init_class instead of
725 doing so only when hprevinst is non-NULL. Plumbing hprevinst
726 through the code is complex and unnecessary because class
727 registration is practically free.
728 (w32_name_of_message): New EMACSDEBUG-only function.
729 (Fset_message_beep): Move here
730 (Fx_open_connection): Require that the display name for Windows be
731 "w32" for consistency, emacsclient disambiguation, and maybe, one
732 day, multi-window-system support.
733 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
734 Cygwin files for W32 GUI facilities, since these clearly don't
735 expect Cygwin names.
736 (_DebPrint): Define.
737 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
738 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
739 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
740 (w32_last_error): Remove.
741
742 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
743
744 * w32heap.c (syspage_mask): Declare here.
745 (cache_system_info): Remove.
746
747 * w32inevt.c (faked_key): Define globally, not statically.
748 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
749 (w32_console_toggle_lock_key): Move to w32fns.c.
750
751 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
752
753 * w32proc.c (_DebPrint): Move to w32fns.c.
754 * w32select.c: Include string.h, stdio.h for Cygwin.
755 * w32select.h: New File.
756
757 * w32term.c: Include io.h for non-CYGWIN builds; needed for
758 get_osfhandle.
759 (w32_message_fd): New variable. Under Cygwin, holds the file
760 descriptor the system used to tell us about pending thread
761 messages.
762
763 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
764 that prevented compilation under non-WINDOWSNT systems.
765
766 (w32_initialize): Open /dev/windows and assign it to
767 w32_message_fd. Provide w32 feature.
768
769 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
770 (WM_EMACS_INPUT_READY): add.
771 (prepend_msg, w32_message_fd): Declare globally.
772
773 * w32xfns.c:
774 (keyboard_handle): Use only when WINDOWSNT.
775 (notify_msg_ready): New function. Posts a message to the main
776 thread's message queue under CYGWIN, which wakes up the main
777 thread from select(2) by making the /dev/windows file descriptor
778 ready. Under WINDOWSNT, it sets an event the same way the old
779 code did.
780
781 (post, prepend_msg): Actually call notify_msg_ready instead of
782 setting the input event directly.
783
98daa893
EZ
7842012-10-07 Eli Zaretskii <eliz@gnu.org>
785
786 * ralloc.c (relinquish): If a heap is ready to be relinquished,
787 but it still has blocs in it, don't return it to the system,
788 instead of aborting. (Bug#12402)
789
3bc0a2f7
JD
7902012-10-07 Jan Djärv <jan.h.d@swipnet.se>
791
8ad5b73b 792 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 793
335f5ae4
JD
794 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
795 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
796 (syms_of_nsterm): Remove comment about Panther and above for
797 ns-antialias-text.
335f5ae4
JD
798 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
799 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
800 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
801
802 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
803 MAC_OS_X_VERSION_10_4.
804
8ad5b73b
JD
805 * nsmenu.m (fillWithWidgetValue:): Remove code for <
806 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
807
808 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
809
810 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
811 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
812
3bc0a2f7
JD
813 * nsterm.m (ns_in_resize): Remove (Bug#12479).
814 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
815 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
816 Remove ns_in_resize check.
3bc0a2f7
JD
817 (ns_clear_frame_area): Remove resize handle code.
818
819 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
820 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
821 Remove ns_in_resize check.
3bc0a2f7 822
c622b48f
PE
8232012-10-07 Paul Eggert <eggert@cs.ucla.edu>
824
825 Improve sys_siglist detection.
826 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
827 defined as a macro, as is done in Solaris.
828 (sys_siglist_entries): New macro.
829 (save_strsignal): Use it.
830 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
831 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
832
04fafa46
JD
8332012-10-06 Jan Djärv <jan.h.d@swipnet.se>
834
835 * nsfns.m (Fx_create_frame): Call x_default_parameter with
836 fullscreen/Fullscreen.
837
838 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
839 tobar_height is new.
840
841 * nsterm.m (x_make_frame_visible): Check for fullscreen.
842 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
843 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
844 (windowDidResize:): Check for correct window if old style fullscreen.
845 Capitalize word in comment. Remove incorrect comment.
846 (initFrameFromEmacs:): tbar_height renamed tibar_height.
847 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
848 error in drawing background.
1f9f395d 849 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
850 Set toolbar values to zero, save old height in tobar_height.
851 Restore tool bar height when leaving fullscreen.
852 (canBecomeMainWindow): New function.
853
c6e21c03
PE
8542012-10-06 Paul Eggert <eggert@cs.ucla.edu>
855
856 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
857
0d9f584b
EZ
8582012-10-05 Eli Zaretskii <eliz@gnu.org>
859
a65fbb5f
EZ
860 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
861
0d9f584b 862 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
863 that time stamps of directories could also be changed.
864 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
865 FILE_WRITE_ATTRIBUTES access rights.
866
867 * fileio.c (Fset_file_times): Special-case ignoring errors for
868 directories only on MSDOS, not on MS-Windows.
869
e8757f09 8702012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
871
872 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
873
7604f298
EZ
8742012-10-04 Eli Zaretskii <eliz@gnu.org>
875
876 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
877 see whether CreateFile failed.
878
88d69b7d
PE
8792012-10-04 Paul Eggert <eggert@cs.ucla.edu>
880
881 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
882 to avoid similar races.
883 * keyboard.c (pending_signals): Now bool, not int.
884
7509f454
PE
885 Port timers to OpenBSD, plus check for timer failures.
886 OpenBSD problem reported by Han Boetes.
887 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
888 and/or setitimer.
889 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
890 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
891 like OpenBSD, which has timer_settime but does not declare it.
892 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
893 whether to use itimerspec-related primitives. All uses of
894 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
895
a3c5c0c5
PE
8962012-10-02 Paul Eggert <eggert@cs.ucla.edu>
897
898 * profiler.c (handle_profiler_signal): Fix a malloc race
899 that caused Emacs to hang on Fedora 17 when profiling Lisp.
900
914e743b
JD
9012012-10-02 Jan Djärv <jan.h.d@swipnet.se>
902
903 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
904
d8ab37a8
EZ
9052012-10-02 Eli Zaretskii <eliz@gnu.org>
906
907 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
908 consistent with the change in return value of 'safe_strsignal'.
909
b3ecad33
PE
9102012-10-02 Paul Eggert <eggert@cs.ucla.edu>
911
0a99eee1
PE
912 Prefer plain 'static' to 'static inline' (Bug#12541).
913 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
914 (bidi_set_sor_type, bidi_push_embedding_level)
915 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
916 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
917 (bidi_cache_search, bidi_cache_ensure_space)
918 (bidi_cache_iterator_state, bidi_cache_find)
919 (bidi_peek_at_next_level, bidi_set_paragraph_end)
920 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
921 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
922 Now 'static', not 'static inline'.
923
b3ecad33
PE
924 Count overruns when profiling; change units to ns.
925 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
926 Give extra weight to samples after overruns, to attempt to count
927 the time more accurately.
928 (setup_cpu_timer): Change sampling interval units from ms to ns, since
929 the underlying primitives nominally do ns.
930 (Fprofiler_cpu_start): Document the change. Mention that
931 the sampling intervals are only approximate.
932
090cf9db
SM
9332012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
934
935 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
936
937 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
938 case for the special 0 coding-system.
939
940 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
941 (Fmake_overlay): Remove redundant tests.
64edc777 942 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 943
81550bf4
JB
9442012-10-02 Juanma Barranquero <lekktu@gmail.com>
945
946 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
947 Update dependencies.
948
aa1ba90e
PE
9492012-10-01 Paul Eggert <eggert@cs.ucla.edu>
950
951 Fix a malloc race condition involving strsignal.
952 A signal can arrive in the middle of a malloc, and Emacs's signal
953 handler can invoke strsignal, which can invoke malloc, which is
954 not portable. This race condition bug makes Emacs hang on GNU/Linux.
955 Fix it by altering the signal handler so that it does not invoke
956 strsignal.
957 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
958 * process.c (status_message): Use const pointer, in case strsignal
959 is #defined to safe_strsignal.
960 * sysdep.c (sys_siglist, init_signals): Always define and
961 initialize a substitute sys_siglist if the system does not define
962 one, even if HAVE_STRSIGNAL.
963 (safe_strsignal): Rename from strsignal. Always define,
964 using sys_siglist. Return a const pointer.
965 * syssignal.h (safe_strsignal): New decl.
966 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
967
ace917bd
EZ
9682012-10-01 Eli Zaretskii <eliz@gnu.org>
969
970 * w32proc.c (timer_loop): Fix code that waits for timer
971 expiration, to avoid high CPU usage.
972
9eb71b9c
SM
9732012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
974
975 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
976 (sweep_weak_table): Remove redundant prototypes.
977
b3317662
FP
9782012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
979
980 * emacs.c: Move the inclusion of TERM_HEADER after including
981 windows.h on WINDOWSNT. This avoids compilation problems with
982 MSVC.
983
f0e5f225
EZ
9842012-10-01 Eli Zaretskii <eliz@gnu.org>
985
2d7d1608
EZ
986 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
987 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
988 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
989 as the previous version used 'void *'.
990
991 * ralloc.c (ROUNDUP): Fix last change.
992 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
993 'size_t'.
994
f0e5f225
EZ
995 * w32proc.c <disable_itimers>: New static flag.
996 (init_timers): Initialize it to zero, after creating the critical
997 sections used by the timer threads.
998 (term_timers): Set to 1 before deleting the critical sections.
999 (getitimer, setitimer): If disable_itimers is non-zero, return an
1000 error indication without doing anything. Reported by Fabrice
1001 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
1002 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1003 return results.
1004 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1005 support timers.
f0e5f225
EZ
1006
1007 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1008 term_ntproc after all the other bookkeeping, to get timers working
1009 as long as possible.
1010
82ef37c1
PE
10112012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1012
b3a4c387
PE
1013 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1014 Suggested by Juri Linkov in
1015 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1016
b0ab8123
PE
1017 Prefer plain 'static' to 'static inline' (Bug#12541).
1018 With static functions, modern compilers inline pretty well by
1019 themselves; advice from programmers often hurts as much as it helps.
1020 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1021 this change shrinks the text size of the Emacs executable by 1.1%
1022 without affecting CPU significantly in my benchmark.
1023 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1024 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1025 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1026 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1027 (bset_auto_fill_function, bset_auto_save_file_format)
1028 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1029 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1030 (bset_cache_long_line_scans, bset_case_fold_search)
1031 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1032 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1033 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1034 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1035 (bset_header_line_format, bset_indicate_buffer_boundaries)
1036 (bset_indicate_empty_lines, bset_invisibility_spec)
1037 (bset_left_fringe_width, bset_major_mode, bset_mark)
1038 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1039 (bset_name, bset_overwrite_mode, bset_pt_marker)
1040 (bset_right_fringe_width, bset_save_length)
1041 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1042 (bset_scroll_up_aggressively, bset_selective_display)
1043 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1044 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1045 (set_buffer_overlays_after):
1046 * category.c (bset_category_table):
1047 * charset.c (read_hex):
1048 * coding.c (produce_composition, produce_charset)
1049 (handle_composition_annotation, handle_charset_annotation)
1050 (char_encodable_p):
1051 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1052 (assign_row, set_frame_matrix_frame, make_current)
1053 (add_row_entry):
1054 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1055 * fns.c (maybe_resize_hash_table):
1056 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1057 * gmalloc.c (register_heapinfo):
1058 * image.c (lookup_image_type):
1059 * intervals.c (set_interval_object, set_interval_left)
1060 (set_interval_right, copy_interval_parent, rotate_right)
1061 (rotate_left, balance_possible_root_interval):
1062 * keyboard.c (kset_echo_string, kset_kbd_queue)
1063 (kset_keyboard_translate_table, kset_last_prefix_arg)
1064 (kset_last_repeatable_command, kset_local_function_key_map)
1065 (kset_overriding_terminal_local_map, kset_real_last_command)
1066 (kset_system_key_syms, clear_event, set_prop):
1067 * lread.c (digit_to_number):
1068 * marker.c (attach_marker, live_buffer, set_marker_internal):
1069 * nsterm.m (ns_compute_glyph_string_overhangs):
1070 * process.c (pset_buffer, pset_command)
1071 (pset_decode_coding_system, pset_decoding_buf)
1072 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1073 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1074 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1075 * syntax.c (bset_syntax_table, dec_bytepos):
1076 * terminal.c (tset_param_alist):
1077 * textprop.c (interval_has_some_properties)
1078 (interval_has_some_properties_list):
1079 * window.c (wset_combination_limit, wset_dedicated)
1080 (wset_display_table, wset_hchild, wset_left_fringe_width)
1081 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1082 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1083 (wset_right_fringe_width, wset_right_margin_cols)
1084 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1085 (wset_vertical_scroll_bar_type, wset_window_parameters):
1086 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1087 (wset_column_number_displayed, wset_region_showing)
1088 (window_box_edges, run_window_scroll_functions)
1089 (append_glyph_string_lists, prepend_glyph_string_lists)
1090 (append_glyph_string, set_glyph_string_background_width)
1091 (append_glyph, append_composite_glyph)
1092 (take_vertical_position_into_account):
1093 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1094 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1095 (lface_hash, lface_same_font_attributes_p, lookup_face):
1096 * xml.c (libxml2_loaded_p):
1097 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1098 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1099 Now 'static', not 'static inline'.
1100
05584c31
PE
1101 * bidi.c: Tune.
1102 (bidi_copy_it): Do the whole copy with a single memcpy.
1103 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1104
86ec63ba
PE
1105 Revert the FOLLOW-SYMLINKS change for file-attributes.
1106 Doing it right would require several changes to Tramp, and there's
1107 not enough time to get that tested before the freeze today.
1108 * dired.c (directory_files_internal, Ffile_attributes):
1109 Undo last change.
1110
82ef37c1
PE
1111 * frame.c (x_report_frame_params): Port better to wider ints.
1112 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1113 or that pointers can be printed in 15 decimal digits.
1114 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1115
62aba0d4
FP
11162012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1117
1118 Support x64 build on MS-Windows.
1119 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1120 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1121 compatibility with x64.
5e4daaf3 1122 (x_get_focus_frame): Add prototype.
62aba0d4
FP
1123
1124 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1125 defining an XRectangle structure.
1126
1127 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1128 arithmetics for compatibility with x64.
1129
1130 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1131 compatibility with x64.
1132
1133 * w32heap.h: Adjust prototypes and declarations.
1134
1135 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1136 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1137 DWORD, long, and unsigned long, for compatibility with x64.
1138 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1139 (sbrk): Argument is now of type ptrdiff_t.
1140
1141 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1142 less than 0x0500.
1143 (w32_msg_pump): Use WPARAM type for 'result'.
1144
1145 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1146 architecture.
1147 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1148 compatibility with x64.
1149
1150 * vm-limit.c (lim_data): Now size_t.
1151 (check_memory_limits): Adjust prototypes of real_morecore and
1152 __morecore to receive argument of type ptrdiff_t. Use size_t for
1153 five_percent and data_size.
1154
1155 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1156 variables, for compatibility with x64.
1157 (rva_to_section, offset_to_section, relocate_offset)
1158 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1159 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1160 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1161 for compatibility with x64.
1162
1163 * sysdep.c (STDERR_FILENO): Define if not already defined.
1164
1165 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1166 (__morecore): Argument type is now ptrdiff_t.
1167 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1168 (relinquish): Use ptrdiff_t type for 'excess'.
1169 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1170
1171 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1172 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1173 instead of a literal number.
1174
1175 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1176 (min): Define only if not already defined.
1177
1178 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1179 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1180 hosts.
1181
1182 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1183 'bitmaps' is a pointer.
1184
1185 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1186
1187 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1188
e7a2937b
PE
11892012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1190
1191 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1192 * dired.c (directory_files_internal, Ffile_attributes):
1193 New arg follow_symlinks. All uses changed.
1194
b43d62ae
SM
11952012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1196
1197 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1198
c06c382a
EZ
11992012-09-30 Eli Zaretskii <eliz@gnu.org>
1200
1201 Support atimers and CPU profiler via profile.c on MS-Windows.
1202 * w32proc.c (sig_mask, crit_sig): New static variables.
1203 (sys_signal): Support SIGALRM and SIGPROF.
1204 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 1205 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
1206 sigfillset, and sigprocmask are no longer no-ops.
1207 (sigismember): New function.
1208 (struct itimer_data): New definition.
1209 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1210 (crit_prof): New static variables.
1211 (MAX_SINGLE_SLEEP): New definition.
1212 (timer_loop, stop_timer_thread, term_timers, init_timers)
1213 (start_timer_thread, getitimer, setitimer): New functions.
1214 (alarm): No longer a no-op, calls setitimer.
1215
1216 * w32.c (term_ntproc): Call term_timers.
1217 (init_ntproc): Make sure all signals are unblocked at startup, to
1218 erase any traces of dumping. Call init_timers.
1219
1220 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1221 Windows-specific code to display the hourglass mouse pointer is no
1222 longer used.
1223 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1224 to hourglass timer expiration.
1225 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1226 Remove, no longer used.
b43d62ae
SM
1227 (w32_note_current_window, show_hourglass, hide_hourglass):
1228 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
1229 window systems.
1230 (syms_of_w32fns): Don't initialize hourglass_timer.
1231
1232 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1233 WINDOWSNT as well.
1234 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1235
1236 * w32.h (init_timers, term_timers): Add prototypes.
1237
95402d5f
KH
12382012-09-30 Kenichi Handa <handa@gnu.org>
1239
1240 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1241 to the buffer relocation which may be caused by ccl_driver.
1242
dd946752
JD
12432012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1244
d7e642cc
JD
1245 * xfns.c (Fx_file_dialog): Update comment.
1246
1247 * w32fns.c (Fx_file_dialog): Update comment.
1248
1249 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1250 Initialize panel name field if OSX >= 10.6.
1251
1252 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1253
dd946752
JD
1254 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1255
1256 * nsterm.m (NEW_STYLE_FS): New define.
1257 (ns_fullscreen_hook, windowWillEnterFullScreen)
1258 (windowDidEnterFullScreen, windowWillExitFullScreen)
1259 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1260 (setFSValue): New functions.
1261 (EmacsFSWindow): New implementation.
1262 (canBecomeKeyWindow): New function for EmacsFSWindow.
1263 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1264 (dealloc): Release nonfs_window if in fullscreen.
1265 (updateFrameSize:): Call windowDidMove to update top/left.
1266 (windowWillResize:toSize:): Check if frame is still maximized.
1267 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1268 next_maximized, maximized_width, maximized_height and nonfs_window.
1269 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1270 tbar_height.
1271 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 1272 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
1273
1274 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1275 (EmacsView): Add variables for fullscreen.
1276 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1277 (EmacsFSWindow): New interface for fullscreen.
1278
427730eb
JB
12792012-09-30 Juanma Barranquero <lekktu@gmail.com>
1280
1281 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1282
48de8b12
CY
12832012-09-30 Chong Yidong <cyd@gnu.org>
1284
1285 * fns.c (Frandom): Doc fix.
1286
5938d519
MR
12872012-09-30 Martin Rudalics <rudalics@gmx.at>
1288
1289 * window.c (Vwindow_combination_limit): New default value.
1290 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1291
cb5b0266
PE
12922012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1293
1294 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1295 Suggested by Eli Zaretskii in
1296 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1297
84f72efd
EZ
12982012-09-30 Eli Zaretskii <eliz@gnu.org>
1299
1300 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1301 HAVE_TIMER_SETTIME is defined.
1302
9d4dcdc9
PE
13032012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1304
d89460ed
PE
1305 Profiler improvements: more-accurate timers, overflow checks.
1306 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1307 signal.h, setjmp.h. Include systime.h instead.
1308 (saturated_add): New function.
1309 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1310 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1311 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1312 New static vars.
84f72efd 1313 (enum profiler_cpu_running): New enum.
d89460ed
PE
1314 (profiler_cpu_running): Now of that enum type, not bool.
1315 All uses changed to store the new value.
1316 (handle_profiler_signal): Rename from sigprof_handler_1,
1317 for consistency with other handlers. Do not check whether
1318 cpu_log is a hash-table if garbage collecting, since it
1319 doesn't matter in that case.
1320 (deliver_profiler_signal): Rename from sigprof_handler,
1321 for consistency with other handlers.
1322 (setup_cpu_timer): New function, with much of what used to be in
1323 Fprofiler_cpu_start. Check for out-of-range argument.
1324 Prefer timer_settime if available, and prefer
1325 thread cputime clocks, then process cputime clocks, then
1326 monotonic clocks, to the old realtime clock. Use make_timeval
1327 to round more-correctly when falling back to setitimer.
1328 (Fprofiler_cpu_start): Use it.
1329 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1330 Don't assume that passing NULL as the 2nd argument of setitimer
1331 is the same as passing a pointer to all-zero storage.
1332 Ignore SIGPROF afterwards.
1333 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1334 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1335 non-fatal signal handlers. Ignore SIGPROF on startup.
1336 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1337 in profiler.c, since sysdep.c now uses it.
1338
9d4dcdc9
PE
1339 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1340 Suggested by Eli Zaretskii in
1341 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1342
8e5691a0
JB
13432012-09-29 Juanma Barranquero <lekktu@gmail.com>
1344
1345 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1346
e7c1b6ef
SM
13472012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1348
1349 * lisp.h (struct backtrace): Remove indirection for `function' field.
1350 * xdisp.c (redisplay_internal):
1351 * profiler.c (record_backtrace, sigprof_handler_1):
1352 * alloc.c (Fgarbage_collect):
1353 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1354 (Fbacktrace_frame): Adjust accordingly.
1355
e61d39cd 13562012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
1357
1358 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1359 (Frun_hook_with_args_until_failure): Doc fixes.
1360
404043ea
EZ
13612012-09-28 Eli Zaretskii <eliz@gnu.org>
1362
1363 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1364 Qautomatic_redisplay and change the symbol name. All users changed.
1365
704d3f45
TM
13662012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1367
1368 * profiler.c (sigprof_handler): Fix race condition.
1369
757140ff
GM
13702012-09-28 Glenn Morris <rgm@gnu.org>
1371
1372 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1373
a615a3ae
PE
13742012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1375
1376 Check more robustly for timer_settime.
89d17fd0
PE
1377 * Makefile.in (LIB_TIMER_TIME): New macro.
1378 (LIBES): Add it.
a615a3ae
PE
1379 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1380 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1381 call timer_settime.
1382
3670daf7
TM
13832012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1384
1385 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1386
6a586b7f
JB
13872012-09-26 Juanma Barranquero <lekktu@gmail.com>
1388
1389 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1390
41c8bfcf
PE
13912012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1392
1393 * character.h (MAYBE_UNIFY_CHAR): Remove.
1394 * charset.c, charset.h (maybe_unify_char): Now static.
1395 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1396 Since this stuff is now private to charset.c, there's no need for
1397 a public macro and no need to inline by hand.
1398
3a880af4
SM
13992012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1400 Stefan Monnier <monnier@iro.umontreal.ca>
1401 Juanma Barranquero <lekktu@gmail.com>
611b7507 1402
3a880af4
SM
1403 * profiler.c: New file.
1404 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
1405 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1406 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
1407 * emacs.c (main): Call syms_of_profiler.
1408 * alloc.c (Qautomatic_gc): New constant.
1409 (MALLOC_PROBE): New macro.
1410 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1411 (total_bytes_of_live_objects): New function.
1412 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1413 Call malloc_probe for the memory profiler.
1414 (syms_of_alloc): Define Qautomatic_gc.
1415 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1416 race condition.
1417 (struct backtrace): Move definition...
1418 * lisp.h (struct backtrace): ..here.
1419 (Qautomatic_gc, profiler_memory_running): Declare vars.
1420 (malloc_probe, syms_of_profiler): Declare functions.
1421 * xdisp.c (Qautomatic_redisplay): New constant.
1422 (redisplay_internal): Record itself in backtrace_list.
1423 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 1424
5938d519 14252012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
14262012-09-25 Juanma Barranquero <lekktu@gmail.com>
1427
1428 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1429
e26fd2e4
PE
14302012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1431
1432 Prefer POSIX timers if available.
1433 They avoid a race if the timer is too close to the current time.
1434 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1435 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 1436 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 1437
eedec3ee
EZ
14382012-09-25 Eli Zaretskii <eliz@gnu.org>
1439
1440 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1441 CHAR_STRING_ADVANCE.
1442 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1443 STRING_CHAR_ADVANCE.
1444
aa15c6bb
JB
14452012-09-25 Juanma Barranquero <lekktu@gmail.com>
1446
1447 Move Vlibrary_cache to emacs.c and reset before dumping.
1448
1449 * lisp.h (reset_image_types): Declare.
1450 [WINDOWSNT] (Vlibrary_cache): Declare.
1451
1452 * image.c (reset_image_types): New function.
1453
1454 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1455 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1456 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1457
1458 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1459 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1460
1461 * w32.h (Vlibrary_cache): Do not declare.
1462
54d629be
EZ
14632012-09-25 Eli Zaretskii <eliz@gnu.org>
1464
16b22fef
EZ
1465 * w32proc.c (sys_signal): Handle all signals defined by the
1466 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1467 handlers for signals supported by Windows. Don't override
1468 term_ntproc as the handler for SIGABRT.
1469 (sigaction): Rewrite to call sys_signal instead of duplicating its
1470 code.
1471 (sys_kill): Improve commentary.
1472
1473 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1474 consistency with a signature of a signal handler. All callers
1475 changed.
1476 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1477 install term_ntproc as a signal handler for SIGABRT, as that
1478 should be done by the dumped Emacs.
1479
1480 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1481
1482 * w32select.c (term_w32select): Protect against repeated
1483 invocation by setting clipboard_owner to NULL after calling
1484 DestroyWindow.
1485
1486 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1487 and term_ntproc to their modified signatures.
1488
54d629be
EZ
1489 * character.c (char_string, string_char): Remove calls to
1490 MAYBE_UNIFY_CHAR. See the discussion starting at
1491 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1492 for the details.
1493
59f7af81
CY
14942012-09-25 Chong Yidong <cyd@gnu.org>
1495
1496 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1497
22e8cf4a
SM
14982012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1499
1500 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1501 when encountering an unknown bytecode.
1502
578098f3
PE
15032012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1504
1505 image.c, indent.c: Use bool for booleans.
1506 * dispextern.h (struct image_type): Members valid_p, load, init
1507 now return bool, not int. All uses changed.
1508 * image.c: Omit unnecessary static decls.
1509 (x_create_bitmap_mask, x_build_heuristic_mask):
1510 Return void, not int, since callers don't care about the return value.
1511 (x_create_bitmap_mask, define_image_type, valid_image_p)
1512 (struct image_keyword, parse_image_spec, image_spec_value)
1513 (check_image_size, image_background)
1514 (image_background_transparent, x_clear_image_1)
1515 (postprocess_image, lookup_image, x_check_image_size)
1516 (x_create_x_image_and_pixmap, xbm_image_p)
1517 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1518 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1519 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1520 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1521 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1522 (png_image_p, init_png_functions, png_load_body, png_load)
1523 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1524 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1525 (init_gif_functions, gif_load, imagemagick_image_p)
1526 (imagemagick_load_image, imagemagick_load, svg_image_p)
1527 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1528 (gs_load):
1529 * nsimage.m (ns_load_image):
1530 * nsterm.m (ns_defined_color):
1531 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1532 * xfns.c (x_defined_color):
1533 * xterm.c (x_alloc_lighter_color_for_widget)
1534 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1535 (x_alloc_lighter_color):
1536 * indent.c (disptab_matches_widthtab, current_column)
1537 (scan_for_column, string_display_width, indented_beyond_p)
1538 (compute_motion, vmotion, Fvertical_motion):
1539 Use bool for booleans.
1540
a5f2b6ec
CY
15412012-09-24 Chong Yidong <cyd@gnu.org>
1542
1543 * chartab.c (Fset_char_table_default): Obsolete function removed.
1544
18e27ea8
PE
15452012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1546
afea8a8a
PE
1547 Move pid_t related decls out of lisp.h.
1548 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1549 (interruptible_wait_for_termination):
1550 Move these decls from lisp.h to syswait.h, since they use pid_t.
1551 Needed on FreeBSD; see Herbert J. Skuhra in
1552 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1553 * callproc.c: Include syswait.h.
1554
18e27ea8
PE
1555 gnutls.c, gtkutil.c: Use bool for boolean.
1556 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1557 (emacs_gnutls_handle_error):
1558 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1559 (xg_hide_tooltip, xg_create_frame_widgets)
1560 (create_dialog, xg_uses_old_file_dialog)
1561 (xg_get_file_with_chooser, xg_get_file_with_selection)
1562 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1563 (xg_item_label_same_p, xg_update_menubar)
1564 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1565 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1566 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1567 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1568 (update_frame_tool_bar, free_frame_tool_bar):
1569 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1570 * nsmenu.m (ns_update_menubar):
1571 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1572 * xfns.c (Fx_show_tip) [USE_GTK]:
1573 Use bool for boolean.
1574 * gtkutil.c (xg_update_frame_menubar):
1575 * xmenu.c (update_frame_menubar):
1576 Return void, not int, since caller ignores return value.
1577 * gtkutil.c (xg_change_toolbar_position):
1578 Return void, not 1.
1579
af0e9f75
JB
15802012-09-23 Juanma Barranquero <lekktu@gmail.com>
1581
1582 * makefile.w32-in (BLOCKINPUT_H): Remove.
1583 (SYSSIGNAL_H): New macro.
1584 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1585 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1586 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1587 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1588 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1589 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1590 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1591 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1592 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1593 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1594 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1595 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1596 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1597 ($(BLD)/w32xfns.$(O)): Update dependencies.
1598
5101529e
EZ
15992012-09-23 Eli Zaretskii <eliz@gnu.org>
1600
1601 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1602 fatal_error_backtrace.
1603
1604 * w32proc.c (sys_kill): Undo last change: don't do anything when
1605 invoked to deliver SIGABRT to our own process. This is now
1606 handled by emacs_raise.
1607
2c3ee0ad
JB
16082012-09-23 Juanma Barranquero <lekktu@gmail.com>
1609
1610 * w32term.c (w32_read_socket): Remove leftover reference to
1611 interrupt_input_pending.
1612
62a1d661
PE
16132012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1614
1615 Do not use SA_NODEFER.
1616 Problem reported by Dani Moncayo in
1617 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1618 * alloc.c (die):
1619 * sysdep.c (emacs_abort): Do not reset signal handler.
1620 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1621 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1622 wanted even on POSIXish hosts, and it doesn't work on Windows.
1623
a0942b9a
JD
16242012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1625
1626 * xterm.c (x_term_init): Call fixup_locale before and after calling
1627 gtk_init (Bug#12392).
1628
d07ff9db
CY
16292012-09-23 Chong Yidong <cyd@gnu.org>
1630
1631 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1632 Vdynamic_library_alist.
1633
1634 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1635 (Fgnutls_available_p): Caller changed.
1636
1637 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1638 (Flibxml_parse_xml_region): Likewise.
1639
1640 * dispextern.h (struct image_type): Remove arg from init function.
1641
1642 * image.c (Finit_image_library, lookup_image_type)
1643 (define_image_type): Remove now-unneeded second arg.
1644 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1645 (init_tiff_functions, init_gif_functions, init_svg_functions):
1646 Arglist and w32_delayed_load calling convention changed.
1647 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 1648 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 1649
4d7e6e51
PE
16502012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1651
1652 Simplify and avoid signal-handling races (Bug#12471).
1653 * alloc.c (die):
1654 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1655 Avoid recursive loop if there's a fatal error in the function itself.
1656 * atimer.c (pending_atimers):
1657 * blockinput.h: Don't include "atimer.h"; no longer needed.
1658 (interrupt_input_pending): Remove. All uses removed.
1659 pending_signals now counts both atimers and ordinary interrupts.
1660 This is less racy than having three separate pending-signal flags.
1661 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1662 (input_blocked_p):
1663 Rename from their upper-case counterparts BLOCK_INPUT,
1664 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1665 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1666 This makes it easier to access volatile variables more accurately.
1667 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1668 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1669 that's more reliable if the code is buggy and sets
1670 interrupt_input_blocked to a negative value. All uses changed.
1671 * atimer.c (deliver_alarm_signal):
1672 Remove. No need to deliver this to the parent; any thread can
1673 handle this signal now. All uses replaced by underlying handler.
1674 * atimer.c (turn_on_atimers):
1675 * dispnew.c (handle_window_change_signal):
1676 * emacs.c (handle_danger_signal):
1677 * keyboard.c (kbd_buffer_get_event):
1678 Don't reestablish signal handler; not needed with sigaction.
1679 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1680 (UNBLOCK_INPUT_TO):
1681 Rework to avoid unnecessary accesses to volatile variables.
1682 (UNBLOCK_INPUT_TO): Now a function.
1683 (totally_unblock_input, unblock_input): New decls.
1684 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1685 (init_data): Remove. Necessary stuff now done in init_signal.
1686 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1687 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1688 (fatal_error_code): Remove; no longer needed.
1689 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1690 it doesn't always backtrace. All uses changed. No need to reset
1691 signal to default, since sigaction and/or die does that for us now.
1692 Use emacs_raise (FOO), not kill (getpid (), FOO).
1693 (main): Check more-accurately whether we're dumping.
1694 Move fatal-error setup to sysdep.c
1695 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1696 * gtkutil.c (xg_get_file_name, xg_get_font):
1697 Remove no-longer-needed signal-mask manipulation.
1698 * keyboard.c, process.c (POLL_FOR_INPUT):
1699 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1700 * keyboard.c (read_avail_input): Remove.
1701 All uses replaced by gobble_input.
1702 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1703 (kbd_buffer_store_event_hold, gobble_input):
1704 (record_asynch_buffer_change) [USABLE_SIGIO]:
1705 (store_user_signal_events):
1706 No need to mess with signal mask.
1707 (gobble_input): If blocking input and there are terminals, simply
1708 set pending_signals to 1 and return. All hooks changed to not
1709 worry about whether input is blocked.
1710 (process_pending_signals): Clear pending_signals before processing
1711 them, in case a signal comes in while we're processing.
1712 By convention callers now test pending_signals before calling us.
1713 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1714 New functions, to support changes to blockinput.h.
1715 (handle_input_available_signal): Now extern.
1716 (reinvoke_input_signal): Remove. All uses replaced by
1717 handle_async_input.
1718 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
1719 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1720 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
1721 Clear sigmask reliably, even if Fsignal returns, which it can.
1722 Omit unnecessary accesses to volatile var.
1723 (quit_throw_to_read_char): No need to restore sigmask.
1724 * keyboard.c (gobble_input, handle_user_signal):
1725 * process.c (wait_reading_process_output):
1726 Call signal-handling code rather than killing ourselves.
1727 * lisp.h: Include <float.h>, for...
1728 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1729 (pending_signals): Now volatile.
1730 (syms_of_data): Now const if IEEE floating point.
1731 (handle_input_available_signal) [USABLE_SIGIO]:
1732 (terminate_due_to_signal, record_child_status_change): New decls.
1733 * process.c (create_process): Avoid disaster if memory is exhausted
1734 while we're processing a vfork, by tightening the critical section
1735 around the vfork.
1736 (send_process_frame, process_sent_to, handle_pipe_signal)
1737 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1738 ignores SIGPIPE.
1739 (send_process): No need for setjmp/longjmp any more, since the
1740 SIGPIPE stuff is now gone. Instead, report an error if errno
1741 is EPIPE.
1742 (record_child_status_change): Now extern. PID and W are now args.
1743 Return void, not bool. All callers changed.
1744 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1745 Remove. All uses removed. This bug should be fixed now in a
1746 different way.
1747 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1748 and record the child status change directly. This avoids the
1749 need to futz with the signal mask.
1750 (process_fatal_action): Move here from emacs.c.
1751 (emacs_sigaction_flags): New function, containing
1752 much of what used to be in emacs_sigaction_init.
1753 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1754 caught by emacs, to make races less likely.
1755 (deliver_process_signal): Rename from handle_on_main_thread.
1756 All uses changed.
1757 (BACKTRACE_LIMIT_MAX): Now at top level.
1758 (thread_backtrace_buffer, threadback_backtrace_pointers):
1759 New static vars.
1760 (deliver_thread_signal, deliver_fatal_thread_signal):
1761 New functions, for more-accurate delivery of thread-specific signals.
1762 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1763 (deliver_arith_signal): Handle in this thread, not
1764 in the main thread, since it's triggered by this thread.
1765 (maybe_fatal_sig): New function.
1766 (init_signals): New arg DUMPING so that we can be more accurate
1767 about whether we're dumping. Caller changed.
1768 Treat thread-specific signals differently from process-general signals.
1769 Block all signals while handling fatal error; that's safer.
1770 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1771 on IEEE hosts.
1772 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1773 Ignore SIGPIPE unless batch.
1774 (emacs_backtrace): Output backtrace for the appropriate thread,
1775 which is not necessarily the main thread.
1776 * syssignal.h: Include <stdbool.h>.
1777 (emacs_raise): New macro.
1778 * xterm.c (x_connection_signal): Remove; no longer needed
1779 now that we use sigaction.
1780 (x_connection_closed): No need to mess with sigmask now.
1781 (x_initialize): No need to reset SIGPIPE handler here, since
1782 init_signals does this for us now.
1783
8f4635e9
JD
17842012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1785
1786 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 1787 background rect may be larger (Bug#12245).
8f4635e9 1788
3296976d
CY
17892012-09-23 Chong Yidong <cyd@gnu.org>
1790
1791 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1792
d41e491e
PE
17932012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1794
1795 * .gdbinit: Just stop at fatal_error_backtrace.
1796 See Stefan Monnier's request in
1797 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1798 Remove no-longer-used query of system type.
1799
c88b867f
CY
18002012-09-22 Chong Yidong <cyd@gnu.org>
1801
1802 * search.c (Freplace_match): Doc fix (Bug#12325).
1803
1804 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1805
1806 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1807 (Fline_end_position): Doc fix.
1808
1809 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1810
bb4d86b4
CY
18112012-09-22 Chong Yidong <cyd@gnu.org>
1812
1813 * dispextern.h (struct image_type): Add new slot, storing a type
1814 initialization function.
1815
1816 * image.c (define_image_type): Call the image initializer function
1817 if it is defined. Arguments and return value changed.
1818 (valid_image_p, make_image): Callers changed.
1819 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
1820 (gif_type, imagemagick_type, svg_type, gs_type):
1821 Add initialization functions.
bb4d86b4
CY
1822 (Finit_image_library): Call lookup_image_type.
1823 (CHECK_LIB_AVAILABLE): Macro deleted.
1824 (lookup_image_type): Call define_image_type here, rather than via
1825 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1826 (syms_of_image): Move define_image_type calls for xbm_type and
1827 pbm_type to lookup_image_type.
1828
df9685f3
EZ
18292012-09-22 Eli Zaretskii <eliz@gnu.org>
1830
1831 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1832 'idle_timers' from here ...
1833 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1834 lists, to avoid infloops when the timer does something stupid,
1835 like reinvoke itself with the same or smaller time-out.
1836 (Bug#12447)
1837
8e17c9ba
MR
18382012-09-22 Martin Rudalics <rudalics@gmx.at>
1839
1840 * window.c (Fsplit_window_internal): Handle only Qt value of
1841 Vwindow_combination_limit separately.
1842 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
1843 (Vwindow_combination_limit): New default value.
1844 Rewrite doc-string.
8e17c9ba 1845
589bd69b
EZ
18462012-09-22 Eli Zaretskii <eliz@gnu.org>
1847
1848 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1849 the new overlay string. (Bug#10159)
1850
01108e3f
PE
18512012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1852
1853 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1854 or that fprintf is async-signal-safe. POSIX doesn't require
1855 either assumption.
1856
82f8cd94
CY
18572012-09-22 Chong Yidong <cyd@gnu.org>
1858
1859 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1860 (Bug#8207).
1861
3cccbd87
KH
18622012-09-22 Kenichi Handa <handa@gnu.org>
1863
1864 * composite.c (composition_reseat_it): Handle the case that a
1865 grapheme cluster is not covered by a single font (Bug#12352).
1866
09c01941
CY
18672012-09-21 Chong Yidong <cyd@gnu.org>
1868
1869 * image.c (define_image_type): Avoid adding duplicate types to
1870 image_types (Bug#12463). Suggested by Jörg Walter.
1871
acfa068f 18722012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
1873
1874 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1875 (print_load_command_name): Add case LC_DATA_IN_CODE.
1876 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1877
acfa068f 18782012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
1879
1880 * eval.c (Frun_hook_with_args_until_success)
1881 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1882
acfa068f 18832012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
1884
1885 * fileio.c (Ffile_selinux_context): Only call freecon when
1886 lgetfilecon succeeded.
1887 (Fset_file_selinux_context): Likewise. (Bug#12444)
1888
acfa068f 18892012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
1890
1891 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1892 reordering, locate the cursor by calling set_cursor_from_row; if
1893 that fails, clear the desired glyph matrix before returning a
1894 failure indication to the caller. Fixes leaving garbled display
1895 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
1896 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1897 scrolling through multibyte text.
aa36e4d2 1898
e99f70c8
SM
18992012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1900
1901 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1902 calling mark_vectorlike since that's the one that marks the window.
1903 (mark_discard_killed_buffers): Mark the final cdr.
1904 * window.h (struct window): Move prev/next_buffers to the
1905 non-standard fields.
1906 * window.c (make_window): Initialize prev/next_buffers manually.
1907
f75beb47
PE
19082012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1909
1910 Omit unused arg EXPECTED from socket hooks.
1911 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1912 * nsterm.m (ns_term_init):
1913 * termhooks.h (struct terminal.read_socket_hook):
1914 * w32inevt.c (w32_console_read_socket):
1915 * w32term.c (w32_read_socket):
1916 * xterm.c (XTread_socket):
1917 Omit unused arg EXPECTED. All callers changed.
1918 (store_user_signal_events): Return void, not int, since callers no
1919 longer care about the return value. All uses changed.
1920
b019b76a
JB
19212012-09-20 Juanma Barranquero <lekktu@gmail.com>
1922
1923 * w32gui.h (XParseGeometry): Do not declare.
1924
05642592
PE
19252012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1926
e4bce92a 1927 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 1928 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
1929 <http://bugs.gnu.org/12471#8> (last line).
1930
05642592
PE
1931 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1932 (XParseGeometry): Now static. Substitute extremal values for
1933 values that are out of range.
1934
e543ae91
JD
19352012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1936
1937 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1938
1939 * nsfns.m (XParseGeometry): Remove.
1940 (Fx_create_frame): Call x_set_offset to correctly interpret
1941 top_pos in geometry.
1942
3a880af4 1943 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
1944 (Fx_parse_geometry): If there is a space in string, call
1945 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1946
45ba16c7
EZ
19472012-09-17 Eli Zaretskii <eliz@gnu.org>
1948
c8b9f1bc
EZ
1949 * search.c (scan_buffer): Use character positions in calls to
1950 region_cache_forward and region_cache_backward, not byte
1951 positions. (Bug#12196)
1952
b4c932a2
EZ
1953 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1954 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1955
45ba16c7
EZ
1956 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1957 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1958 emacs_blocked_malloc, now deleted.
1959
eeceac93
PE
19602012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1961
1962 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1963 The workaround was for improving performance on Solaris 2.4, but
1964 is getting in the way now. Emacs will still work if someone is
1965 still running Solaris 2.4 in a museum somewhere; Sun dropped
1966 support for Solaris 2.4 in 2003.
1967 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1968 * process.c (create_process) [HAVE_WORKING_VFORK]:
1969 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1970 since Emacs no longer uses vfork on that platform.
1971
78f83752
GM
19722012-09-17 Glenn Morris <rgm@gnu.org>
1973
1974 * emacs.c: Use COPYRIGHT.
1975
634b8cac
PE
19762012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1977
0caaedb1
PE
1978 Remove configure's --without-sync-input option (Bug#12450).
1979 When auditing signal-handling in preparation for cleaning it up,
1980 I found that SYNC_INPUT has race conditions and would be a real
1981 pain to fix. Since it's an undocumented and deprecated
1982 configure-time option, now seems like a good time to remove it.
1983 Also see <http://bugs.gnu.org/11080#16>.
1984 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1985 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1986 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1987 (malloc_hysteresis):
1988 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1989 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1990 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1991 (dont_register_blocks, bytes_used_when_reconsidered)
1992 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1993 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1994 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 1995 Remove. All uses removed.
0caaedb1
PE
1996 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1997 implementation, one that depends on whether the new macro
1998 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1999 is defined.
2000 * atimer.c (run_timers, handle_alarm_signal):
2001 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2002 (handle_async_input, process_pending_signals)
2003 (handle_input_available_signal, init_keyboard):
2004 * nsterm.m (ns_read_socket):
2005 * process.c (wait_reading_process_output):
2006 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2007 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2008 (emacs_write):
2009 * xterm.c (XTread_socket):
2010 Assume SYNC_INPUT.
2011 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2012 * eval.c (handling_signal): Remove. All uses removed.
2013 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2014 All uses replaced with the SYNC_INPUT version.
2015 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2016 Remove decls.
2017 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2018 Now static.
2019
634b8cac
PE
2020 * font.c (Ffont_shape_gstring): Remove unused local.
2021
83da1b55
GM
20222012-09-16 Glenn Morris <rgm@gnu.org>
2023
518650a5
GM
2024 * Makefile.in (clean): No longer run nextstep's clean.
2025
83da1b55
GM
2026 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2027 (ns_frag): Remove.
2028 (ns-app): Move here from ns.mk, and simplify.
2029 (clean): Simplify nextstep entry.
2030 * ns.mk: Remove file.
2031
85a43e2e
KH
20322012-09-17 Kenichi Handa <handa@gnu.org>
2033
2034 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2035 not covert the last few charactes.
2036
ba13e616 20372012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
2038
2039 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2040 here, but just check the validity of glyphs in the glyph-string.
2041
a8c729af
MR
20422012-09-16 Martin Rudalics <rudalics@gmx.at>
2043
3a880af4
SM
2044 * window.c (Fwindow_parameter, Fset_window_parameter):
2045 Accept any window as argument (Bug#12452).
a8c729af 2046
c077c059
JD
20472012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2048
2049 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2050 to ns_term_init to avoid memory leak.
2051
2052 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2053 explicit retain/release.
2054 (ns_term_init): Only allow one display. Initialize outerpool and
2055 ns_*_types.
2056
39a57ad0
PE
20572012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2058
2059 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2060 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2061 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2062 the Microsoft problem in a different way, by altering ../nt/config.nt.
2063
7105c8cb
EZ
20642012-09-15 Eli Zaretskii <eliz@gnu.org>
2065
2066 * w32xfns.c:
2067 * w32uniscribe.c:
2068 * w32term.c:
2069 * w32select.c:
2070 * w32reg.c:
2071 * w32proc.c:
2072 * w32menu.c:
2073 * w32inevt.c:
2074 * w32heap.c:
2075 * w32font.c:
2076 * w32fns.c:
2077 * w32console.c:
2078 * w32.c:
2079 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2080 by lisp.h. This completes removal of setjmp.h inclusion
2081 erroneously announced in the previous commit. (Bug#12446)
2082
2083 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2084 more accurate.
2085
2086 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2087 not defined as a macro. The latter happens on MS-Windows.
2088 (Bug#12446)
2089
0328b6de
PE
20902012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2091
2092 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2093 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 2094 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
2095 only reason for the instance was because "lisp.h" was included.
2096 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2097 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2098 and _longjmp with the new symbols. Emacs already uses _setjmp if
2099 available, so this change affects only POSIXish hosts that have
2100 sigsetjmp but not _setjmp, such as some versions of Solaris and
2101 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2102 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2103 (png_load_body) [HAVE_PNG]:
2104 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2105 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2106 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2107 since PNG requires jmp_buf. This is the only exception to the
2108 general rule that we now use sys_setjmp and sys_longjmp.
2109 This exception is OK since this code does not change the signal
2110 mask or longjmp out of a signal handler.
2111
2af03429
PE
21122012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2115 Include "syssignal.h", for 'main_thread'.
2116
2f294edf
DA
21172012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2118
2119 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
2120 * insdel.c (replace_range, replace_range_2):
2121 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
2122 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2123 Remove redundant check before calling offset_intervals.
2124
6b533e9c
MR
21252012-09-14 Martin Rudalics <rudalics@gmx.at>
2126
2127 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2128 current buffer (Bug#12387).
2129
2a7931e3
JB
21302012-09-14 Juanma Barranquero <lekktu@gmail.com>
2131
2132 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2133
c18e885b
PE
21342012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2135
2136 Use a more backwards-compatible timer format (Bug#12430).
2137 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2138 vector element, not from the 4th, since PSECS is now at the end.
2139 (Fcurrent_idle_time): Doc fix.
2140
d59a1afb
DA
21412012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2142
2143 Function to mark objects and remove killed buffers at once.
2144 * alloc.c (discard_killed_buffers): Rename to ...
2145 (mark_discard_killed buffers) ... new name. Add marking
2146 of remaining objects. Fix comment. Adjust users.
2147 (mark_object): Do not touch frame buffer lists here.
2148 * frame.c (delete_frame): Reset frame buffer lists here.
2149
5f0cb45a
PE
21502012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2151
8ea47e3a
PE
2152 Better workaround for GNOME bug when --enable-gcc-warnings.
2153 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2154 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2155 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2156
4a4bbad2
PE
2157 Simplify SIGIO usage (Bug#12408).
2158 The code that dealt with SIGIO was crufty and confusing, e.g., it
2159 played tricks like "#undef SIGIO" but these tricks were not used
2160 consistently. Simplify mostly by not #undeffing standard symbols,
2161 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2162 or not as we please) rather than "defined SIGIO" (standard symbol
2163 that we probably shouldn't #undef).
2164 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2165 Modules that need it can include it.
2166 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2167 * dispextern.h (ignore_sigio): New decl.
2168 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2169 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2170 * emacs.c (shut_down_emacs):
2171 * keyboard.c (kbd_buffer_store_event_hold):
2172 Use ignore_sigio rather than invoking 'signal' directly.
2173 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2174 for FIONREAD.
2175 (FIONREAD, SIGIO): Do not #undef.
2176 (tty_read_avail_input): Use #error rather than a syntax error.
2177 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2178 for I_PIPE, used by SETUP_SLAVE_PTY.
2179 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2180 * sysdep.c (croak): Remove; no longer needed. This bit of
2181 temporary code, with Fred N. Fish's comment that it's temporary,
2182 has been in Emacs since at least 1992!
2183 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2184 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2185 * syssignal.h (croak): Remove decl.
2186 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2187 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2188 now that we're termios-only.
2189 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2190 * term.c (dissociate_if_controlling_tty): Use #error rather than
2191 a run-time error.
2192
5f0cb45a
PE
2193 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2194 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2195 to work around GNOME bug 683906.
2196 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2197 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2198 This works around GCC bug 54561.
2199
40bce90b
PE
22002012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2201
2202 More fixes for 'volatile' and setjmp/longjmp.
2203 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2204 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2205 (png_load_body) [HAVE_PNG]:
2206 (jpeg_load_body) [HAVE_JPEG]:
2207 New function, with most of the old parent function's body.
2208 (png_load) [HAVE_PNG]:
2209 (jpeg_load) [HAVE_JPEG]:
2210 Invoke the new function, to avoid longjmp munging our locals.
2211 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2212 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2213 longjmp is passed 2, as the C standard doesn't guarantee this.
2214 Instead, store the failure code into mgr->failure_code.
2215
bfeae2cf
SM
22162012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2217
2218 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2219 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2220 (syms_of_keyboard): Remove support for unread-command-char.
2221
8099e36b
EZ
22222012-09-12 Eli Zaretskii <eliz@gnu.org>
2223
2224 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2225 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2226 violation. (Bug#12426)
2227
92547ff9
PE
22282012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2229
2230 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2231
45b82ad0
SM
22322012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2233
2234 * eval.c: Add `inhibit-debugger'.
2235 (Qinhibit_debugger): New symbol.
2236 (call_debugger): Bind it instead of Qdebug_on_error.
2237 (maybe_call_debugger): Test Vinhibit_debugger.
2238 (syms_of_eval): Define inhibit-debugger.
2239 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2240 (syms_of_xdisp): Remove inhibit-debug-on-message.
2241
5779a1dc
PE
22422012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2243
50f2e553
PE
2244 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2245 If a nonvolatile local variable is written before a _longjmp to
2246 the frame containing the variable, and is read after the _longjmp,
2247 the value read is indeterminate. Some local variables of type
2248 'struct handler' and 'struct catchtag' are used in this way, so
2249 mark each of their slots as volatile if the slot can be set before
2250 _longjmp and read afterwards.
2251 * lisp.h (struct handler): var and chosen_clause are now volatile.
2252 (struct catchtag): val, next, and pdlcount are now volatile.
2253
ae1d87e2
PE
2254 * bidi.c (bidi_push_it, bidi_pop_it):
2255 * fns.c (copy_hash_table):
2256 * image.c (define_image_type):
2257 * keyboard.c (kbd_buffer_store_event_hold):
2258 * process.c (Fprocess_send_eof):
2259 * xfaces.c (x_create_gc) [HAVE_NS]:
2260 * xgselect.c (xg_select):
2261 Prefer assignment to memcpy when either will do.
2262
5779a1dc
PE
2263 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2264 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2265 time an item is removed. No need to mark this function 'inline';
2266 the compiler knows better than we do.
2267
c4c9756b
JD
22682012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2269
2270 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2271 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2272 to change_frame_size (Bug#12388).
2273 (windowDidResize:): Pass YES to updateFrameSize.
2274
2275 * nsterm.h: Add delay parameter to updateFrameSize.
2276
d73e321c
DA
22772012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2278
2279 Discard killed buffers from deleted window and frame objects.
2280 This reduces an amount of references to killed buffers and
2281 helps GC to reclaim them faster.
2282 * alloc.c (discard_killed_buffers): New function.
2283 (mark_object): Use it for deleted windows and frames.
2284 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 2285 or deleted frame, restore its global binding.
d73e321c
DA
2286 * data.c (swap_in_global_binding): Add GC notice.
2287 (swap_in_symval_forwarding): Use convenient set_blv_where.
2288 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2289 * window.h: ... to here.
2290
e578f381
DA
22912012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2292
2293 Convenient macro to check whether the buffer is live.
2294 * buffer.h (BUFFER_LIVE_P): New macro.
2295 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2296 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2297
3057e615
YM
22982012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2299
2300 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2301 composition cases (Bug#12364).
2302
2303 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2304 overhang of succeeding glyphs overlapping box cursor.
2305
2306 * w32term.c (x_draw_glyph_string): Likewise.
2307
6fda35f2
PE
23082012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2309
c990426a
PE
2310 Simplify, document, and port floating-point (Bug#12381).
2311 The porting part of this patch fixes bugs on non-IEEE platforms
2312 with frexp, ldexp, logb.
2313 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2314 Now static.
2315 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2316 support, by removing commented-out code and briefly listing the
2317 C89 functions excluded. The commented-out stuff was confusing
2318 maintenance, e.g., we thought we needed cbrt but it was commented out.
2319 (logb): Remove decl; no longer needed.
2320 (isfinite): New macro, if not already supplied.
2321 (isnan): Don't replace any existing macro.
2322 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2323 are present on all C89 platforms.
2324 (Ffrexp): Do not special-case zero, as frexp does the right thing
2325 for that case.
2326 (Flogb): Do not use logb, as it doesn't have the desired meaning
2327 on hosts that use non-base-2 floating point. Instead, stick with
2328 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2329 frexp, to avoid getting an unspecified result.
2330
6fda35f2
PE
2331 * xdisp.c (Qinhibit_debug_on_message): Now static.
2332
16130a58
JD
23332012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2334
2335 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2336 NSBezierPath (Bug#12131).
2337
d105a573
CY
23382012-09-10 Chong Yidong <cyd@gnu.org>
2339
2340 * fns.c (Fdelq, Fdelete): Doc fix.
2341
ff55dfe8
PE
23422012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2343
2344 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2345 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2346
e7032e7c
SM
23472012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2348
2349 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2350 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2351 Use it.
2352
e9957956
EZ
23532012-09-09 Eli Zaretskii <eliz@gnu.org>
2354
aba05ce9
EZ
2355 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2356 left fringe if the window has a left margin. This avoids leaving
2357 traces of the cursor because its leftmost pixel is not drawn over.
2358
e9957956
EZ
2359 * dispnew.c (update_window_line): When the left margin area of a
2360 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2361 that screen line. (Bug#12277)
2362
f6196b87
PE
23632012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2364
2365 Assume C89 or later for math functions (Bug#12381).
2366 This simplifies the code, and makes it a bit smaller and faster,
2367 and (most important) makes it easier to clean up signal handling
2368 since we can stop worring about floating-point exceptions in
2369 library code. That was a problem before C89, but the problem
2370 went away many years ago on all practical Emacs targets.
2371 * data.c, image.c, lread.c, print.c:
2372 Don't include <math.h>; no longer needed.
2373 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2374 might be autoconfigured, as that never happens.
2375 * data.c (fmod):
2376 * doprnt.c (DBL_MAX_10_EXP):
2377 * print.c (DBL_DIG):
2378 Remove. C89 or later always defines these.
2379 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2380 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2381 (arith_error, domain_error, domain_error2):
2382 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2383 no longer needed -- we simply return what C returns. All uses removed.
2384 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2385 the wrapped code.
2386 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2387 Remove. All uses expanded, as these macros are no longer used
2388 more than once and are now more trouble than they're worth.
2389 (Ftan): Use tan, not sin / cos.
2390 (Flogb): Assume C89 frexp.
2391 (fmod_float): Assume C89 fmod.
2392 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2393 (init_floatfns): Remove. All uses removed.
2394
9d7f1863
JD
23952012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2396
2397 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2398 compositeToPoint for OSX < 10.6 (Bug#12390).
2399
eabf0404
PE
24002012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2401
2402 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2403 This produces more-accurate results.
2404
0b3b1d23
JD
24052012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2406
2407 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2408 changes (Bug#12088).
2409
6dcef6ec
CY
24102012-09-08 Chong Yidong <cyd@gnu.org>
2411
2412 * syntax.c (Fstring_to_syntax): Doc fix.
2413
aa7d57c5
JD
24142012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2415
2416 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2417 in the internal border.
2418 (x_set_window_size): Remove static variables and their usage.
2419 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
2420 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2421 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
2422 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2423 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2424 (ns_fix_rect_ibw): Remove.
2425 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2426 (ns_dumpglyphs_box_or_relief): Ditto.
2427 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2428 adjustment.
2429 (ns_dumpglyphs_image): Ditto.
fc0c31f8 2430 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
2431 border adjustment.
2432 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2433 their usage. Add fringe_extended_p and its use as in other terms.
2434 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2435 scroll bar was removed.
2436 (updateFrameSize): New function.
2437 (windowDidResize): Move code to updateFrameSize and call it.
2438
2439 * nsterm.h (EmacsView): Add updateFrameSize.
2440
1a5432bc
CY
24412012-09-07 Chong Yidong <cyd@gnu.org>
2442
b4f5313e
CY
2443 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2444
1a5432bc
CY
2445 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2446
1a4f1e9b
PE
24472012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2448
2449 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
2450 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2451 Problem introduced when merging patches. Noted by Eli Zaretskii in
2452 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
2453 * floatfns.c: Comment fix.
2454 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2455 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2456 and anyway the declaration is harmless even if SIGDANGER is not defined.
2457 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2458 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2459 source files not surprisingly expected syssignal.h to define, or
2460 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2461 Include <sys/ioctl.h>, for FIONREAD.
2462 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2463 This eliminates a problem whereby other files mysteriously had
2464 to include "syssignal.h" before including "systty.h" if they
2465 wanted to use "#ifdef SIGIO".
2466
bc8000ff
EZ
24672012-09-07 Eli Zaretskii <eliz@gnu.org>
2468
3e6d6928
EZ
2469 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2470
2471 * w32.c (sigemptyset): Empty the set.
2472 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2473
bc8000ff
EZ
2474 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2475
b4fa72f2
DA
24762012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2477
2478 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2479 (mark_object): Likewise for frame objects.
2480
30730c93
PE
24812012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2482
2483 * syssignal.h (handle_on_main_thread): Always declare,
2484 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2485 This ports to platforms without HAVE_PTHREAD.
2486
2fe28299
PE
24872012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2488
2489 Signal-handler cleanup (Bug#12327).
2490 Emacs's signal handlers were written in the old 4.2BSD style with
2491 sigblock and sigmask and so forth, and this led to some
2492 inefficiencies and confusion. Rewrite these to use
2493 pthread_sigmask etc. without copying signal sets around. Also,
2494 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2495 'signal', and instead use functions that do not attempt to take
2496 over the system name space. This patch causes Emacs's text
2497 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2498 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2499 Do not include <signal.h> or "syssignal.h", as these
2500 modules do not use signals.
2501 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2502 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2503 Do not include <signal.h>, as "syssignal.h" does that for us now.
2504 * atimer.c (sigmask_atimers): New function.
2505 (block_atimers, unblock_atimers): New functions,
2506 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2507 All uses replaced.
2508 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2509 no longer needed here.
2510 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 2511 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
2512 * sysdep.c (struct save_signal): New member 'action', replacing
2513 old member 'handler'.
2514 (save_signal_handlers, restore_signal_handlers):
2515 Use sigaction instead of 'signal' to save and restore.
2516 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2517 New function. All users of 'signal' modified to use set_sighandler
2518 if they're writeonly, and to use sys_signal if they're read+write.
2519 (emacs_sigaction_init, forwarded_signal): New functions.
2520 (sys_signal): Remove. All uses replaced by calls to sigaction
2521 and emacs_sigaction_init, or by direct calls to 'signal'.
2522 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2523 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2524 all uses replaced by pthread_sigmask etc. calls.
2525 * syssignal.h: Include <signal.h>.
2526 (emacs_sigaction_init, forwarded_signal): New decls.
2527 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2528 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2529 (sigmask, sys_sigmask): Remove; no longer needed.
2530 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2531 (sigblock, sigunblock, sigfree):
2532 (sigsetmask) [!defined sigsetmask]:
2533 Remove. All uses replaced by pthread_sigmask.
2534 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2535 no longer need to be replaced, and its typical old uses
2536 are now done via emacs_sigaction_init and sigaction.
2537 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2538 (sys_sigdel): Remove; unused.
2539 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2540
0216c128
EZ
25412012-09-06 Eli Zaretskii <eliz@gnu.org>
2542
2543 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2544 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2545
c752cfa9
DA
25462012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2547
2548 Explicitly mark buffer_defaults and buffer_local_symbols.
2549 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2550 mark_local_symbols here.
2551 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2552 since special buffers aren't marked here any more.
2553 (allocate_buffer): Chain new buffer with all_buffers here...
2554 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2555 not here.
2556 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2557 (syms_of_buffer): Remove staticpro of the above.
2558 (init_buffer_once): Set names for buffer_defaults and
2559 buffer_local_symbols.
2560
a864ef14
PE
25612012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2562
2563 Use bool for booleans in font-related modules.
2564 * font.c (font_intern_prop, font_style_to_value)
2565 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2566 (generate_otf_features, font_check_otf_features, font_check_otf)
2567 (font_match_p, font_list_entities, font_at):
2568 * fontset.c (fontset_id_valid_p, reorder_font_vector
2569 (fontset_find_font, Fset_fontset_font)
2570 (face_suitable_for_char_p) [0]:
2571 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2572 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2573 (m17n_flt_initialized, ftfont_shape_by_flt):
2574 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2575 * nsfont.m (nsfont_draw):
2576 * w32font.c (w32font_draw):
2577 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2578 Use bool for booleans.
2579 * font.h: Adjust to above API changes.
2580 (struct font, struct font_driver, struct font_driver_list):
2581 Use bool for booleans.
2582 (struct font): Remove useless member encoding_type.
2583 All users removed.
2584 * fontset.c, xftfont.c: Omit unnecessary static decls.
2585
0699fc18
DA
25862012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2587
2588 * alloc.c (mark_object): Revert window marking code
2589 since it's unsafe for the Fset_window_configuration.
2590
20ef56db
PE
25912012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2592
2fe28299 2593 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2594 Be more systematic about preserving errno whenever a signal
2595 handler returns, even if it's not in the main thread. Do this by
2596 renaming signal handlers to distinguish between signal delivery
2597 and signal handling. All uses changed.
2598 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2599 * data.c (deliver_arith_signal): Rename from arith_error.
2600 * dispnew.c (deliver_window_change_signal): Rename from
2601 window_change_signal.
2602 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2603 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2604 * keyboard.c (deliver_input_available_signal): Rename from
2605 input_available_signal.
2606 (deliver_user_signal): Rename from handle_user_signal.
2607 (deliver_interrupt_signal): Rename from interrupt_signal.
2608 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2609 (deliver_child_signal): Rename from sigchld_handler.
2610 * atimer.c (handle_alarm_signal):
2611 * data.c (handle_arith_signal):
2612 * dispnew.c (handle_window_change_signal):
2613 * emacs.c (handle_fatal_signal, handle_danger_signal):
2614 * keyboard.c (handle_input_available_signal):
2615 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2616 * process.c (handle_pipe_signal, handle_child_signal):
2617 New functions, with the actual signal-handling code taken from the
2618 original respective signal handlers, sans the sporadic attempts to
2619 preserve errno, since that's now done by handle_on_main_thread.
2620 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2621 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2622 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2623 Move to sysdep.c.
2624 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2625 Move initialization of main_thread to sysdep.c's init_signals.
2626 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2627 our usage, and simplifies the mainline code.
2628 (record_child_status_change): New static function, as a helper
2629 for handle_child_signal, and with most of the old child handler's
2630 contents.
2631 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2632 (handle_child_signal): Use the above.
2633 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2634 Moved here from emacs.c.
2635 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2636 code moved here from emacs.c's main function.
2637 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
2638 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2639 This lets callers save and restore errno properly.
20ef56db 2640
e3ccf108
DA
26412012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2642
2643 Remove redundant or unused things here and there.
2644 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2645 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2646 * editfns.c (Fcompare_buffer_substrings): Likewise.
2647 * frame.h (struct terminal, struct font_driver_list):
2648 Remove redundant declarations.
2649 * window.h (Qleft, Qright): Likewise.
2650
697e1e39
DA
26512012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 Do not mark objects from deleted buffers, windows and frames.
2654 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2655 (mark_object): Likewise for windows and frames.
2656
c1ca42ca
DA
26572012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2658
2659 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2660 buffer_defaults and buffer_local_symbols as valid objects.
2661 Return special value to denote them.
2662
014d93be
PE
26632012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2664
f75d7a91
PE
2665 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2666 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2667 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2668 (file_name_absolute_p, Fsubstitute_in_file_name):
2669 (check_executable, check_writable, Ffile_accessible_directory_p)
2670 (Fset_file_selinux_context, Fdefault_file_modes)
2671 (Finsert_file_contents, choose_write_coding_system)
2672 (Fwrite_region, build_annotations, a_write, e_write)
2673 (Fdo_auto_save):
2674 * filelock.c (boot_time_initialized, get_boot_time)
2675 (get_boot_time_1, lock_file_1, within_one_second):
2676 * floatfns.c (in_float):
2677 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2678 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2679 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2680 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2681 * window.c (compare_window_configurations):
2682 Use bool for booleans.
2683 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2684 (Fdefault_file_modes): Now mode_t, not int, for modes.
2685 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2686 (internal_delete_file): Now returns void, not a (boolean) int,
2687 since nobody was looking at the return value.
2688 * lisp.h, window.h: Adjust to above API changes.
2689
014d93be
PE
2690 * xdisp.c (set_message): Simplify and reindent last change.
2691
776f29e1
JB
26922012-09-05 Juanma Barranquero <lekktu@gmail.com>
2693
2694 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2695
7f7e0167
LI
26962012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2697
2698 * eval.c (call_debugger): Make the function non-static so that we
2699 can call it from set_message.
2700
2701 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2702 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2703
cf29dd84
PE
27042012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2705
2706 Give more-useful info on a fatal error (Bug#12328).
2707 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2708 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2709 of doing the work ourselves.
2710 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2711 do most of the work.
2712 (fatal_error_backtrace): New function, taken from the guts
2713 of the old fatal_error_signal, but with a new option to output
2714 a backtrace.
2715 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2716 info about the signal than just its number.
2717 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2718 * sysdep.c: Include <execinfo.h>
2719 (emacs_backtrace): New function, taken partly from the previous
2720 code of the 'die' function.
2721 (emacs_abort): Call fatal_error_backtrace rather than abort.
2722
972debf2
SM
27232012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2724
2725 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2726 eager (load-time) macro-expansion.
2727 * lisp.mk (lisp): Add macroexp.
2728
1088b922
PE
27292012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2730
2731 Simplify redefinition of 'abort' (Bug#12316).
2732 Do not try to redefine the 'abort' function. Instead, redo
2733 the code so that it calls 'emacs_abort' rather than 'abort'.
2734 This removes the need for the NO_ABORT configure-time macro
2735 and makes it easier to change the abort code to do a backtrace.
2736 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2737 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2738 Remove; sysdep.c's emacs_abort now takes its place.
2739 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2740 'abort' changed to use 'emacs_abort'.
2741 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2742 (abort) [!defined abort]: Rename to ...
2743 (emacs_abort): ... new name.
2744 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2745 the place of the old 'abort' in emacs.c.
2746 * w32.c, w32fns.c (abort): Do not #undef.
2747 * w32.c (emacs_abort): Rename from w32_abort.
2748
30934d33
EZ
27492012-09-04 Eli Zaretskii <eliz@gnu.org>
2750
2751 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2752 offsets[j].dv, since the y axis of the screen coordinates points
2753 down, while the y axis of the font definition coordinates points
2754 up. This fixes display of Arabic diacritics such as KASRA and
2755 KASRATAN. (Bug#11860)
2756
af26b72c
PE
27572012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2758
2759 Be more systematic about _setjmp vs setjmp.
2760 * alloc.c (test_setjmp, mark_stack):
2761 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2762 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2763 (png_load, my_error_exit, jpeg_load):
2764 * process.c (send_process_trap, send_process):
2765 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2766 The underscored versions are up to 30x faster on some hosts.
2767 Formerly, the code used setjmp+longjmp sometimes and
2768 _setjmp+_longjmp at other times, with no particular reason to
2769 prefer setjmp+longjmp.
2770
26d4541d
PE
27712012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2772
d42f4f0f 2773 Fix minor problem found by static checking.
26d4541d 2774 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 2775
c5e28e39
MR
27762012-09-03 Martin Rudalics <rudalics@gmx.at>
2777
2778 * buffer.c (Fdelete_all_overlays): New function.
2779
3eab3ca9
CY
27802012-09-03 Chong Yidong <cyd@gnu.org>
2781
2782 * gtkutil.c: Add extern decl for Qxft.
2783
c04889f8
PE
27842012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2785
1882aa38
PE
2786 * emacs.c, eval.c: Use bool for boolean.
2787 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2788 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2789 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2790 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2791 (main, decode_env_path, Fdaemon_initialized):
2792 * eval.c (call_debugger, Finteractive_p, interactive_p):
2793 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2794 (maybe_call_debugger, Fbacktrace):
2795 * process.c (read_process_output, exec_sentinel):
2796 Use bool for booleans.
2797 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2798 All callers changed.
2799 * eval.c (interactive_p): Omit always-true boolean argument
2800 EXCLUDE_SUBRS_P. All callers changed.
2801 * dispextern.h, lisp.h: Reflect above API changes.
2802 * firstfile.c (dummy): Use the address of 'main', whose signature
2803 won't change, instead of the address of 'initialize', whose
2804 signature just changed from int to bool.
2805 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2806 * msdos.c (fatal_error_in_progress): ... from here.
2807 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2808 of incrementing it.
2809 (redisplay_internal, unwind_redisplay): Simply clear
2810 REDISPLAYING_P when unwinding, instead of saving its previous,
2811 always-false value and then restoring it.
2812
a411ac43
PE
2813 Clean up some extern decls.
2814 Mostly, this hoists extern decls out of .c files and into .h files.
2815 That way, we're more likely to catch errors if the interfaces change.
2816 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2817 declare xg_mark_data.
2818 * dispextern.h (x_frame_parm_handlers):
2819 * font.h (Qxft):
2820 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2821 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2822 (Qultra_bold, Qoblique, Qitalic):
2823 Move extern decl here from .c file.
2824 * alloc.c (xg_mark_data) [USE_GTK]:
2825 * doc.c (Qclosure):
2826 * eval.c (Qlexical_binding):
2827 * fns.c (time) [!HAVE_UNISTD_H]:
2828 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2829 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2830 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2831 * lread.c (Qinternal_interpreter_environment):
2832 * minibuf.c (Qbuffer):
2833 * process.c (QCfamily, QCfilter):
2834 * widget.c (free_frame_faces):
2835 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2836 * xfont.c (x_clear_errors):
2837 * xterm.c (x_frame_parm_handlers):
2838 Remove now-redundant extern decls.
2839 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2840 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2841 Now static.
2842 * xfaces.c: Remove unnecessary static decls.
2843 * xterm.c (updating_frame): Remove decl of nonexistent object.
2844
c04889f8
PE
2845 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2846 when building globals.h, as the objects that are not built on
2847 this host are not needed to compile C files on this host.
2848
8b339673
JD
28492012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2850
2851 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2852
2853 * frame.h: Add missing prototype for x_wm_set_size_hint.
2854
a08d4ba7
PE
28552012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2856
2857 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2858 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2859 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2860 (Fsubstitute_command_keys):
2861 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2862 (save_excursion_save, save_excursion_restore)
2863 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2864 (format_time_string, general_insert_function)
2865 (make_buffer_string, make_buffer_string_both)
2866 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2867 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2868 (copy_text, insert_1, insert_1_both, insert_from_string)
2869 (insert_from_string_before_markers, insert_from_string_1)
2870 (insert_from_buffer, insert_from_buffer_1, replace_range)
2871 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2872 (del_range_2, modify_region):
2873 * intervals.c (intervals_equal, balance_possible_root_interval)
2874 (adjust_intervals_for_insertion, merge_properties_sticky)
2875 (graft_intervals_into_buffer, lookup_char_property)
2876 (adjust_for_invis_intang, set_point_both)
2877 (get_property_and_range, compare_string_intervals)
2878 (set_intervals_multibyte_1, set_intervals_multibyte):
2879 * keyboard.c (decode_timer):
2880 Use bool for boolean.
2881 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2882 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2883
48c948de
CY
28842012-09-02 Chong Yidong <cyd@gnu.org>
2885
2886 * keymap.c (push_key_description): Print M-TAB as C-M-i
2887 (Bug#11758).
2888
6c49a40b
JB
28892012-09-02 Juanma Barranquero <lekktu@gmail.com>
2890
2891 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2892 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2893 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2894 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2895 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2896 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2897 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2898
4dfbd238
EZ
28992012-09-01 Eli Zaretskii <eliz@gnu.org>
2900
7e510e28
EZ
2901 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2902 more than one grapheme cluster passed to the shaper: compute the
2903 offset adjustment values separately for each cluster. (Bug#11860)
2904
4dfbd238
EZ
2905 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2906 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2907 about implicit conversions from integer to pointer.
2908
86571ae0
DC
29092012-09-01 Daniel Colascione <dancol@dancol.org>
2910
2911 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2912 system used too early.
2913
0e23ef9d
PE
29142012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2915
2916 Better seed support for (random).
2917 * emacs.c (main): Call init_random.
2918 * fns.c (Frandom): Set the seed from a string argument, if given.
2919 Remove long-obsolete Gentzel cruft.
2920 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2921 (init_random): New function.
2922
17a2cbbd
DC
29232012-09-01 Daniel Colascione <dancol@dancol.org>
2924
2925 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2926 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2927 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2928 x_wm_set_size_hint, x_query_colors, x_real_positions,
2929 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2930 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2931 all of which have been moved to common code.
2932
2933 * xfaces.c: Include TERM_HEADER instead of listing all possible
2934 window-system headers.
2935
2936 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2937 to match header.
2938
2939 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2940 directly accessing frame internals.
2941
f18cbb28 2942 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
2943 globals_of_w32font.
2944
2945 * process.c: Include TERM_HEADER instead of listing all possible
2946 window-system headers.
2947
3a880af4
SM
2948 * nsterm.h: Remove declarations now in frame.h.
2949 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
2950
2951 * menu.c: Include TERM_HEADER instead of listing all possible
2952 window-system headers.
2953
2954 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2955 window system.
2956
2957 * keyboard.c: Include TERM_HEADER instead of listing all possible
2958 window-system headers.
2959
2960 * image.c: Include TERM_HEADER instead of listing all possible
2961 window-system headers. Declare Vlibrary_cache when compiling for
2962 Windows.
2963
2964 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2965 window system declarations.
2966
2967 * frame.h: Move common functions here: set_frame_menubar,
2968 x_set_window_size, x_sync, x_get_focus_frame,
2969 x_set_mouse_position, x_set_mouse_pixel_position,
2970 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2971 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2972 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2973 x_activate_menubar, x_real_positions, x_bitmap_icon,
2974 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2975 and x_query_colors.
2976
2977 * frame.c: Include TERM_HEADER instead of listing all possible
2978 window-system headers.
2979
2980 * font.c: Include TERM_HEADER instead of listing all possible
2981 window-system headers.
2982
2983 * emacs.c: Include TERM_HEADER.
2984
f18cbb28
EZ
2985 * dispnew.c: Include TERM_HEADER instead of listing all possible
2986 window-system headers.
17a2cbbd 2987
f18cbb28 2988 * ccl.h: Include character.h.
17a2cbbd
DC
2989
2990 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2991 the current window system; include in list of objects to link into
2992 Emacs.
2993
c650a5de
DA
29942012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2995
2996 Remove mark_ttys function and fix tty_display_info initialization.
2997 * lisp.h (mark_ttys): Remove prototype.
2998 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2999 to mark_ttys because all possible values of 'top_frame' slot are
3000 the frames which are reachable from Vframe_list.
3001 * term.c (mark_ttys): Remove.
3002 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3003
4e0f6479
DA
30042012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3005
3006 Change struct frame bitfields from unsigned char to unsigned.
3007 * frame.h (struct frame): Change type of 'display_preempted',
3008 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3009 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3010 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3011 bitfields from unsigned char to unsigned.
3012
8b96a52c
DA
30132012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3014
3015 Remove unused member of struct x_output and struct w32_output.
3016 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3017 * w32term.h (struct w32_output): Likewise.
3018
b4444c8a
JD
30192012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3020
3021 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3022 does not become zero (Bug#12234).
3023
b98521db
PE
30242012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3025
3026 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3027 for GCC 4.7.1 x86-64.
3028
31d02438
GM
30292012-08-30 Glenn Morris <rgm@gnu.org>
3030
3031 * lread.c (init_lread): For out-of-tree builds, only add the
3032 source directory's site-lisp dir to the load-path if it exists,
3033 consistent with in-tree builds. (Bug#12302)
3034
7f8941d8
JD
30352012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3036
3037 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 3038 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
3039 (windowShouldClose:): Set window_closed.
3040 (dealloc): New member, free button_values.
fc0c31f8
JB
3041 (process_dialog:): Make member function. Remove window argument,
3042 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
3043 in button_values.
3044 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 3045 with tag. Remove return self, declare return value as void.
7f8941d8
JD
3046 (addString:row:): Remove return self, declare return value as void.
3047 (addSplit): Remove return self, declare return value as void.
3048 (clicked:): Remove return self, declare return value as void.
fc0c31f8 3049 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
3050 (initFromContents:isQuestion:): Adjust call to process_dialog.
3051 Code formatting change.
3052 (timeout_handler:): Set timer_fired to YES.
3053 (runDialogAt:): Set timer_fired to NO.
3054 Handle click on close button as quit.
3055
3056 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3057 Add window_closed and button_values. Add void as return value for
3058 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3059 Add process_dialog as new member.
3060
eada0861 30612012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 3062
eada0861
GM
3063 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3064 is not one of the heaps we manage. (Bug#12242)
3065
30662012-08-28 Glenn Morris <rgm@gnu.org>
3067
3068 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3069
457294dd
MR
30702012-08-28 Martin Rudalics <rudalics@gmx.at>
3071
3072 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
3073 auto-buffer-name window parameter. Install revision of reverted
3074 fix.
457294dd 3075
4f2daf31
DA
30762012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3077
3078 Do not allow to set major mode for a dead buffer.
3079 * buffer.c (Fset_buffer_major_mode): Signal an error
3080 if the buffer is dead.
3081 (Fother_buffer, other_buffer_safely): Remove redundant
3082 nested declaration.
3083
66322887
DA
30842012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3085
3086 Always use set_buffer_if_live to restore original buffer at unwind.
3087 * buffer.h (record_unwind_current_buffer): New function.
3088 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3089 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3090 * undo.c, window.c: Adjust users.
3091 * buffer.c (set_buffer_if_live): Fix comment.
3092
a3d794a1
DA
30932012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3094
3095 Fix usage of set_buffer_internal.
3096 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3097 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3098 * coding.c (decode_coding): Omit redundant test.
3099 * fileio.c (decide_coding_unwind): Likewise.
3100 * fns.c (secure_hash): Likewise.
3101 * insdel.c (modify_region): Likewise.
3102 * keyboard.c (command_loop_1): Likewise.
3103 * print.c (PRINTFINISH): Likewise.
3104 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3105
59ea14cd
PE
31062012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3107
3108 * dispnew.c: Use bool for boolean.
3109 (frame_garbaged, display_completed, delayed_size_change)
3110 (fonts_changed_p, add_window_display_history)
3111 (add_frame_display_history, verify_row_hash)
3112 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3113 (row_equal_p, realloc_glyph_pool)
3114 (allocate_matrices_for_frame_redisplay)
3115 (showing_window_margins_p)
3116 (adjust_frame_glyphs_for_frame_redisplay)
3117 (build_frame_matrix_from_leaf_window, make_current)
3118 (mirrored_line_dance, mirror_line_dance, update_frame)
3119 (update_window_tree, update_single_window)
3120 (check_current_matrix_flags, update_window, update_text_area)
3121 (update_window_line, set_window_update_flags, scrolling_window)
3122 (update_frame_1, scrolling, buffer_posn_from_coords)
3123 (do_pending_window_change, change_frame_size)
3124 (change_frame_size_1, sit_for):
3125 Use bool for boolean.
3126 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3127 and remove last int (actually boolean) argument, which was always 0.
3128 All callers changed.
3129 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3130 * dispextern.h (struct composition_it): Use bool for boolean.
3131 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3132 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3133 * dired.c (file_name_completion):
3134 Use bool for boolean. (This was missed in an earlier change.)
3135
95072a94
MR
31362012-08-27 Martin Rudalics <rudalics@gmx.at>
3137
3138 * window.c (Fset_window_configuration): Revert first part of
3139 last change.
3140
0f19feff
JD
31412012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3142
3143 * nsterm.h (NSPanel): New class variable dialog_return.
3144
3a880af4
SM
3145 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3146 Initialize dialog_return.
0f19feff
JD
3147 (windowShouldClose:): Use stop instead of stopModalWithCode.
3148 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3149 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3150 event.
3151 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3152 modal loop returns.
3153
f10fe38f
PE
31542012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3155
de1339b0
PE
3156 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3157 * composite.c (find_composition, composition_gstring_p)
3158 (composition_reseat_it, find_automatic_composition):
3159 * data.c (let_shadows_buffer_binding_p)
3160 (let_shadows_global_binding_p, set_internal, make_blv)
3161 (Fmake_variable_buffer_local, Fmake_local_variable)
3162 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3163 (cons_to_signed, arith_driver):
3164 * dbusbind.c (xd_in_read_queued_messages):
3165 * dired.c (directory_files_internal, file_name_completion):
3166 Use bool for booleans.
3167 * dired.c (file_name_completion):
3168 * process.h (fd_callback):
3169 Omit int (actually boolean) argument. It wasn't being used.
3170 All uses changed.
3171 * composite.h, lisp.h: Reflect above API changes.
3172
f10fe38f
PE
3173 * cmds.c, coding.c: Use bool for booleans.
3174 * cmds.c (move_point, Fself_insert_command):
3175 * coding.h (struct composition status, struct coding_system):
3176 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3177 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3178 (emacs_mule_char, decode_coding_emacs_mule)
3179 (encode_coding_emacs_mule, detect_coding_iso_2022)
3180 (decode_coding_iso_2022, encode_invocation_designation)
3181 (encode_designation_at_bol, encode_coding_iso_2022)
3182 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3183 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3184 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3185 (encode_coding_raw_text, detect_coding_charset)
3186 (decode_coding_charset, encode_coding_charset, detect_eol)
3187 (detect_coding, get_translation_table, produce_chars)
3188 (consume_chars, reused_workbuf_in_use)
3189 (make_conversion_work_buffer, code_conversion_save)
3190 (decode_coding_object, encode_coding_object)
3191 (detect_coding_system, char_encodable_p)
3192 (Funencodable_char_position, code_convert_region)
3193 (code_convert_string, code_convert_string_norecord)
3194 (Fset_coding_system_priority):
3195 * fileio.c (Finsert_file_contents):
3196 Use bool for booleans.
3197 * coding.h, lisp.h: Reflect above API changes.
3198 * coding.c: Remove unnecessary static function decls.
3199 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3200 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3201 not a boolean 'int', since callers never look at the return value.
3202 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3203 * coding.h (decoding_buffer_size, encoding_buffer_size)
3204 (emacs_mule_string_char): Remove unused extern decls.
3205 (struct iso_2022_spec, struct coding_system):
3206 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3207 (struct emacs_mule_spec): Remove unused field 'full_support'.
3208 All initializations removed.
3209 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3210
5474c384
DA
32112012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3212
f10fe38f 3213 Fix spare memory change (Bug#12286).
5474c384
DA
3214 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3215 (valid_lisp_object_p): Likewise.
3216
c4b6914d
MR
32172012-08-27 Martin Rudalics <rudalics@gmx.at>
3218
3219 * window.c (Fset_window_configuration): Record any window's old
3220 buffer if it's replaced (see Bug#8789). If the new current
3221 buffer doesn't appear in the selected window, go to its old
3222 point (Bug#12208).
3223
35aaa1ea
DA
32242012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3225
3226 Special MEM_TYPE_SPARE to denote reserved memory.
3227 * alloc.c (enum mem_type): New memory type.
3228 (refill_memory_reserve): Use new type for spare memory.
3229 This prevents live_cons_p and live_string_p from incorrect
3230 detection of uninitialized objects from spare memory as live.
3231
6af64513
PE
32322012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3233
8b2e00a3
PE
3234 Spelling fixes.
3235 * Makefile.in (.PHONY): versioclean -> versionclean.
3236
b52d6985
PE
3237 Remove unused external symbols.
3238 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3239 * window.c (Qwindow_valid_p, decode_valid_window):
3240 Now static, not extern.
3241 * data.c (Qinterval): Remove; unused.
3242 (syms_of_data): Do not define 'interval'.
3243 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3244 * window.h (decode_valid_window):
3245 Remove decls.
3246
d5172d4f
PE
3247 * character.c, charset.c, chartab.c: Use bool for booleans.
3248 * character.c (lisp_string_width, string_count_byte8)
3249 (string_escape_byte8):
3250 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3251 (load_charset_map_from_file, map_charset_chars)
3252 (Fdefine_charset_internal, define_charset_internal)
3253 (Fdeclare_equiv_charset, find_charsets_in_text)
3254 (Ffind_charset_region, char_charset, Fiso_charset):
3255 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3256 (sub_char_table_set, sub_char_table_set_range)
3257 (char_table_set_range, optimize_sub_char_table)
3258 (map_sub_char_table):
3259 Use bool for boolean.
3260 * character.c (str_to_unibyte): Omit last boolean argument; it was
3261 always 0. All callers changed.
3262 * character.h, charset.h: Adjust to match previous changes.
3263 * character.h (char_printable_p): Remove decl of nonexistent function.
3264 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3265 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3266 are all boolean, so make them single-bit bitfields.
3267
6af64513
PE
3268 * lisp.h (ASET): Remove attempt to detect side effects.
3269 It was meant to be temporary and it often doesn't work,
3270 because when IDX has side effects the behavior of IDX==IDX
3271 is undefined. See Stefan Monnier in
3272 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3273
e1f29348
BR
32742012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3275
3276 * lisp.h (functionp): New function (extracted from Ffunctionp).
3277 (FUNCTIONP): Use it.
3278 * eval.c (Ffunctionp): Use it.
3279
17c05d74
PE
32802012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3281
0f46bc75
PE
3282 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3283 as that's faster and simpler than static storage. Don't bother
3284 with the g_main_context_query overhead if g_main_context_pending
3285 says no events are pending.
3286 (gfds, gfds_size): Remove these static vars.
3287 (xgselect_initialize): Remove; no longer needed.
3288 All uses and decls removed.
3289
ee4c0f69
PE
3290 * emacs.c (fatal_error_signal_hook): Remove.
3291 All uses removed. This leftover from old code was always 0.
3292
17c05d74
PE
3293 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3294 * casefiddle.c (casify_object, casify_region):
3295 * casetab.c (set_case_table):
3296 * category.c, category.h (word_boundary_p):
3297 * category.h (CHAR_HAS_CATEGORY):
3298 Use bool for booleans, instead of int.
3299
391ceac5
EZ
33002012-08-25 Eli Zaretskii <eliz@gnu.org>
3301
3302 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3303
2f221583
PE
33042012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3305
f4a681b0
PE
3306 On assertion failure, print backtrace if available.
3307 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3308 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3309 * Makefile.in (LIB_EXECINFO): New macro.
3310 (LIBES): Use it.
3311
2f221583
PE
3312 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3313 * bytecode.c (exec_byte_code):
3314 * callint.c (check_mark, Fcall_interactively):
3315 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3316 (getenv_internal, sync_process_alive, call_process_exited):
3317 * lisp.h (USE_SAFE_ALLOCA):
3318 Use bool for booleans, instead of int.
3319 * lisp.h, process.h: Adjust prototypes to match above changes.
3320 * callint.c (Fcall_interactively): Don't assume the mark's
3321 offset fits in 'int'.
3322
37ef52bb
PE
33232012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3324
3325 * buffer.c, buffer.h: Use bool for boolean.
3326 * buffer.c (reset_buffer_local_variables)
3327 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3328 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3329 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3330 (overlay_touches_p, overlay_strings, Foverlay_put)
3331 (report_overlay_modification, call_overlay_mod_hooks):
3332 (mmap_enlarge, mmap_set_vars):
3333 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3334 Use bool for booleans, instead of int.
3335 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3336 since the 1-or-0 return value is always ignored anyway.
3337 (mmap_initialized_p):
3338 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3339 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3340
2cc21167
PE
33412012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3342
3343 * bidi.c: Use bool for boolean.
3344 This is a bit more readable, and makes the text segment of bidi.o
3345 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3346 Presumably it's faster too.
3347 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3348 Now bool.
3349 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3350 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3351 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3352 (bidi_explicit_dir_char, bidi_level_of_next_char)
3353 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3354 Use bool for booleans, instead of int.
3355 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3356 (bidi_unshelve_cache): Adjust decls to match code.
3357
7db4ddf4
MR
33582012-08-23 Martin Rudalics <rudalics@gmx.at>
3359
3360 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3361 argument.
3362
b1bb8011
PE
33632012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3364
3365 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3366 * atimer.h: Include <stdbool.h>.
3367
ff687885
DN
33682012-08-22 Dan Nicolaescu <dann@gnu.org>
3369
3370 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3371 compile time tests instead of run time tests on systems that do
3372 not use them.
3373 (FRAME_MAC_P): Remove leftover from deleted code.
3374 * frame.c (syms_of_frame): Remove leftover from deleted code.
3375
4ce7a138
JD
33762012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3377
3378 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3379
d733ec6d
PE
33802012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3381
3382 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3383 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 3384 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
3385 (fontset_add): Return void, for FONTSET_ADD.
3386
d0d2d26f
PE
33872012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3388
fce31d69
PE
3389 * alloc.c: Use bool for booleans.
3390 (gc_in_progress, abort_on_gc)
3391 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3392 (dont_register_blocks) [GC_MALLOC_CHECK]:
3393 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3394 (check_string_bytes, make_specified_string, memory_full)
3395 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3396 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3397 (mark_stack, valid_pointer_p, make_pure_string)
3398 (Fgarbage_collect, survives_gc_p, gc_sweep):
3399 Use bool for booleans, instead of int.
3400 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3401 Remove unused local.
3402 * alloc.c (PURE_POINTER_P):
3403 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3404 * editfns.c (Fformat):
3405 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3406 (Fdo_auto_save):
3407 * fns.c (sweep_weak_table):
3408 * lisp.h (suppress_checking, push_message, survives_gc_p)
3409 (make_pure_string, gc_in_progress, abort_on_gc):
3410 * lread.c (readchar, read1):
3411 * print.c (Fprin1_to_string):
3412 * xdisp.c (push_message):
3413 Use bool for booleans affected directly or indirectly by
3414 alloc.c's changes.
3415
d0d2d26f
PE
3416 Make recently-introduced setters macros.
3417 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3418 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3419 (set_fontset_default, set_fontset_fallback): Rename from their
3420 upper-case counterparts, and make them functions rather than macros.
3421 This is more consistent with the other recently-introduced setters.
3422 These don't need to be inline, since they're local.
3423
d18e2bb6
JD
34242012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3425
3426 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3427 the loop (Bug#12247).
3428
1b9d9d16
PE
34292012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3430
3431 * lisp.h (vcopy): Use memcpy rather than our own loop.
3432 This fixes a performance regression introduced by the recent
3433 addition of vcopy. This means 'vcopy' will need to be modified
3434 for a copying collector, but that's OK. Also, tighten the
3435 checking in the assertion.
3436
b2f09701
EZ
34372012-08-21 Eli Zaretskii <eliz@gnu.org>
3438
3439 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3440 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3441 non-base glyph for the width of the base character, according to
e1f29348
BR
3442 what x_draw_composite_glyph_string_foreground expects.
3443 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
3444 expectations, to produce correct width of the composed character.
3445 Reverse the sign of the DU offset produced by ScriptPlace.
3446
9b994fed
PE
34472012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3448
3449 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3450
086ca913
DA
34512012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3452
3453 Avoid direct writes to contents member of struct Lisp_Vector.
3454 * lisp.h (vcopy): New function to copy data into vector.
3455 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3456 * fns.c (Ffillarray): Use ASET.
3457 * keyboard.c (timer_check_2): Use AREF and ASET.
3458 (append_tool_bar_item, Frecent_keys): Use vcopy.
3459 * lread.c (read_vector): Use ASET.
3460 * msdos.c (Frecent_doskeys): Use vcopy.
3461 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3462 (Finternal_merge_in_global_face): Use ASET and vcopy.
3463 * xfont.c (xfont_list_pattern): Likewise.
3464
5481664a
MR
34652012-08-21 Martin Rudalics <rudalics@gmx.at>
3466
3467 * window.c (Fwindow_point): For the selected window always return
3468 the position of its buffer's point.
3469 (Fset_window_point): For the selected window always go in its
3470 buffer to the specified position.
3471
6d470bdd
DA
34722012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3473
3474 Setter macros for fontsets.
3475 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3476 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3477 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3478 Adjust users.
3479
24564fe1
GM
34802012-08-20 Glenn Morris <rgm@gnu.org>
3481
3482 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3483 Don't assume that `ln -f' works.
3484
0a05a035
EZ
34852012-08-20 Eli Zaretskii <eliz@gnu.org>
3486
3487 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3488 and later about non-assignments with no effect. See discussion at
3489 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3490 details.
3491
e46f2325
DA
34922012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3493
3494 Inline setter functions for Lisp_Objects slots of struct specbinding.
3495 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3496 Adjust users.
3497
734fbd86
MR
34982012-08-20 Martin Rudalics <rudalics@gmx.at>
3499
3500 * window.c (select_window): Always make selected window's buffer
3501 current.
3502
f1a95992
DA
35032012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3504
3505 Use AREF and ASET for docstrings of category tables.
3506 * category.h (CATEGORY_DOCSTRING): Use AREF.
3507 (SET_CATEGORY_DOCSTRING): Use ASET.
3508 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3509
e83064be
DA
35102012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3511
3512 Inline setter functions for hash table members.
3513 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3514 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3515 (set_hash_key_and_value, set_hash_index, set_hash_next)
3516 (set_hash_hash): New functions.
3517 * charset.c, fns.c: Adjust users.
3518
4ce60d2e
DA
35192012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3520
3521 Inline getter and setter functions for per-buffer values.
3522 * buffer.h (per_buffer_default, set_per_buffer_default)
3523 (per_buffer_value, set_per_buffer_value): New functions.
3524 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3525 * buffer.c, data.c: Adjust users.
3526
c06c9690
JB
35272012-08-20 Juanma Barranquero <lekktu@gmail.com>
3528
3529 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3530
32bd4250
PE
35312012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3532
bad03192 3533 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3534 as gnulib does this if the system doesn't.
3535 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3536 Remove declaration. MS-Windows declares it on stdlib.h which is
3537 included by conf_post.h.
b69a6d22
PE
3538 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3539 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3540 * vm-limit.c: Include <unistd.h>, for 'environ'.
3541
22d7feb2
PE
3542 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3543 (start_of_data): Remove decl; mem-limits.h provides it.
3544
32bd4250
PE
3545 * xdisp.c (handle_invisible_prop): Make it a bit faster
3546 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3547
450809af
CY
35482012-08-19 Chong Yidong <cyd@gnu.org>
3549
3550 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3551 ends (Bug#3874).
3552
9e677988
AS
35532012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3554
6b1319ce
AS
3555 * .gdbinit: Use call instead of set when calling a function in the
3556 inferior.
3557
9e677988
AS
3558 * data.c (set_internal): Don't use set_blv_found.
3559 (Fkill_local_variable): Likewise.
3560
d7191076
AA
35612012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3562
3563 * nsfont.m (ns_ascii_average_width): Ensure the string
3564 ascii_printable is initialized with a null-terminated character
3565 array. Otherwise, it can contain undesired extra characters.
3566
e757f1c6
PE
35672012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3568
3569 port new setting code to Sun C 5.8 2005/10/13
3570 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3571 Return void, not Lisp_Object. Otherwise, the compiler
3572 complains about (A?B:C) where B is void and C is Lisp_Object
3573 when compiling CHAR_TABLE_SET, due to the recent change to
3574 the API of sub_char_table_set_contents.
3575
a999ce26
CY
35762012-08-18 Chong Yidong <cyd@gnu.org>
3577
3578 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3579 for the string case (Bug#3874).
3580
3f22b86f
PE
35812012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3582
39eb03f1
PE
3583 * buffer.h (BSET): Remove (Bug#12215).
3584 Replace all uses with calls to new setter functions.
3585 (bset_bidi_paragraph_direction, bset_case_canon_table)
3586 (bset_case_eqv_table, bset_directory, bset_display_count)
3587 (bset_display_time, bset_downcase_table)
3588 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3589 (bset_last_selected_window, bset_local_var_alist)
3590 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3591 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3592 (bset_width_table):
3593 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3594 (bset_auto_fill_function, bset_auto_save_file_format)
3595 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3596 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3597 (bset_cache_long_line_scans, bset_case_fold_search)
3598 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3599 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3600 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3601 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3602 (bset_header_line_format, bset_indicate_buffer_boundaries)
3603 (bset_indicate_empty_lines, bset_invisibility_spec)
3604 (bset_left_fringe_width, bset_major_mode, bset_mark)
3605 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3606 (bset_name, bset_overwrite_mode, bset_pt_marker)
3607 (bset_right_fringe_width, bset_save_length)
3608 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3609 (bset_scroll_up_aggressively, bset_selective_display)
3610 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3611 (bset_word_wrap, bset_zv_marker):
3612 * category.c (bset_category_table):
3613 * syntax.c (bset_syntax_table):
3614 New setter functions.
3615
6a09a33b
PE
3616 * process.h (PSET): Remove (Bug#12215).
3617 Replace all uses with calls to new setter functions.
3618 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3619 (PROCESS_INLINE): New macro.
3620 (pset_childp): New setter function.
3621 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3622 * process.c (PROCESS_INLINE):
3623 Define to EXTERN_INLINE, so that the corresponding functions
3624 are compiled into code.
3625 (pset_buffer, pset_command, pset_decode_coding_system)
3626 (pset_decoding_buf, pset_encode_coding_system)
3627 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3628 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3629 (pset_type, pset_write_queue): New setter functions.
3630
e8c17b81
PE
3631 * window.h (WSET): Remove (Bug#12215).
3632 Replace all uses with calls to new setter functions.
3633 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3634 (WINDOW_INLINE): New macro.
3635 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3636 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3637 (wset_total_lines, wset_vertical_scroll_bar)
3638 (wset_window_end_pos, wset_window_end_valid)
3639 (wset_window_end_vpos): New setter functions.
3640 * window.c (WINDOW_INLINE):
3641 Define to EXTERN_INLINE, so that the corresponding functions
3642 are compiled into code.
3643 (wset_combination_limit, wset_dedicated, wset_display_table)
3644 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3645 (wset_new_normal, wset_new_total, wset_next_buffers)
3646 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3647 (wset_prev_buffers, wset_right_fringe_width)
3648 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3649 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3650 (wset_window_parameters):
3651 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3652 (wset_column_number_displayed, wset_region_showing):
3653 New setter functions.
3654
3f22b86f
PE
3655 * termhooks.h (TSET): Remove (Bug#12215).
3656 Replace all uses with calls to new setter functions.
3657 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3658 (TERMHOOKS_INLINE): New macro.
3659 (tset_charset_list, tset_selection_alist): New setter functions.
3660 * terminal.c (TERMHOOKS_INLINE):
3661 Define to EXTERN_INLINE, so that the corresponding functions
3662 are compiled into code.
3663 (tset_param_alist): New setter function.
3664
742af32f
PE
36652012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3666
15dbb4d6
PE
3667 * keyboard.h (KSET): Remove (Bug#12215).
3668 Replace all uses with calls to new setter functions.
3669 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3670 (KEYBOARD_INLINE): New macro.
3671 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3672 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3673 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3674 New setter functions.
3675 * keyboard.c (KEYBOARD_INLINE):
3676 Define to EXTERN_INLINE, so that the corresponding functions
3677 are compiled into code.
3678 (kset_echo_string, kset_kbd_queue)
3679 (kset_keyboard_translate_table, kset_last_prefix_arg)
3680 (kset_last_repeatable_command, kset_local_function_key_map)
3681 (kset_overriding_terminal_local_map, kset_real_last_command)
3682 (kset_system_key_syms): New setter functions.
3683
f00af5b1
PE
3684 * frame.h (FSET): Remove (Bug#12215).
3685 Replace all uses with calls to new setter functions.
3686 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3687 (FRAME_INLINE): New macro.
3688 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3689 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3690 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3691 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3692 (fset_param_alist, fset_root_window, fset_scroll_bars)
3693 (fset_selected_window, fset_title, fset_tool_bar_items)
3694 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3695 * frame.c (FRAME_INLINE):
3696 Define to EXTERN_INLINE, so that the corresponding functions
3697 are compiled into code.
3698 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3699
0c94c8d6
PE
3700 A few more naming-convention fixes for getters and setters.
3701 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3702 and rename from buffer_overlays_set_before.
3703 (set_buffer_overlays_after): Move here from buffer.h, and rename
3704 from buffer_overlays_set_after.
3705 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3706 All uses changed.
3707 (set_buffer_intervals): Rename from buffer_set_intervals.
3708 * intervals.c (set_interval_object): Move here from intervals.h,
3709 and rename from interval_set_object.
3710 (set_interval_left): Move here from intervals.h, and rename from
3711 interval_set_left.
3712 (set_interval_right): Move here from intervals.h, and rename from
3713 interval_set_right.
3714 (copy_interval_parent): Move here from intervals.h, and rename from
3715 interval_copy_parent.
3716 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3717 (set_interval_plist): Rename from interval_set_plist.
3718 Return void, not Lisp_Object, since no caller uses the result.
3719 * lisp.h (string_intervals): Rename from string_get_intervals.
3720 (set_string_intervals): Rename from string_set_intervals.
3721
34dabdb7
PE
3722 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3723 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 3724 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
3725 All uses changed. See the end of
3726 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3727
742af32f
PE
3728 * lisp.h (CSET): Remove (Bug#12215).
3729 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3730 (set_char_table_purpose): New functions,
3731 replacing CSET. All uses changed. For example, replace
3732 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 3733 "set_char_table_parent (char_table, parent);".
742af32f
PE
3734 The old version was confusing because it used the same name
3735 'parent' for two different things.
3736
a04e2c62
DA
37372012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3738
3739 Functions to get and set Lisp_Object fields of buffer-local variables.
3740 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3741 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3742 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3743 * data.c, eval.c, frame.c: Adjust users.
3744
383dcbf9
CY
37452012-08-17 Chong Yidong <cyd@gnu.org>
3746
3747 * xfaces.c (merge_face_vectors): If the target font specfies a
3748 font spec, make the font's attributes take precedence over
3749 directly-specified attributes.
3750 (merge_face_ref): Recognize :font.
3751
44386687
DA
37522012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3753
3754 Do not use memcpy for copying intervals.
3755 * intervals.c (reproduce_interval): New function.
3756 (reproduce_tree, reproduce_tree_obj): Use it.
3757 (reproduce_tree_obj): Remove prototype.
3758
927c7216
PE
37592012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3760
3761 * lisp.h (duration_to_sec_usec): Remove unused decl.
3762
93044f7b
AA
37632012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3764
3765 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3766 to an allocated instance of NSString, not to the class itself.
3767
9851e4a5
JB
37682012-08-17 Juanma Barranquero <lekktu@gmail.com>
3769
3770 * makefile.w32-in (C_CTYPE_H): New macro.
3771 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3772 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3773 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3774
620f13b0
PE
37752012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3776
3777 Use ASCII tests for character types.
3778 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3779 * xfns.c, xterm.c:
3780 Don't include <ctype.h>; was not needed.
3781 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3782 * sysdep.c, xfaces.c:
3783 Include <c-ctype.h> instead of <ctype.h>.
3784 * nsterm.m: Include <c-ctype.h>.
3785 * charset.c (read_hex):
3786 * doc.c (Fsnarf_documentation):
3787 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3788 (DRIVE_LETTER) [DOS_NT]:
3789 (Ffile_name_directory, Fexpand_file_name)
3790 (Fsubstitute_in_file_name):
3791 * font.c (font_parse_xlfd, font_parse_fcname):
3792 * frame.c (x_set_font_backend):
3793 * gtkutil.c (xg_get_font):
3794 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3795 * nsimage.m (hexchar):
3796 * nsterm.m (ns_xlfd_to_fontname):
3797 * sysdep.c (system_process_attributes):
3798 * xfaces.c (hash_string_case_insensitive):
3799 Use C-locale tests instead of locale-specific tests for character
3800 types, since we want the ASCII interpretation here, not the
3801 interpretation suitable for whatever happens to be the current locale.
3802
52162052
MR
38032012-08-16 Martin Rudalics <rudalics@gmx.at>
3804
3805 Consistently check windows for validity/liveness
3806 (Bug#11984, Bug#12025, Bug#12026).
3807 * lisp.h (CHECK_VALID_WINDOW): New macro.
3808 * window.c (decode_window): Rename to decode_live_window.
3809 (decode_valid_window, Fwindow_valid_p): New functions.
3810 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3811 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3812 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3813 (Fwindow_prev_sibling, Fwindow_combination_limit)
3814 (Fset_window_combination_limit, Fwindow_use_time)
3815 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3816 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3817 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3818 (Fwindow_hscroll, Fset_window_hscroll)
3819 (Fwindow_redisplay_end_trigger)
3820 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3821 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3822 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3823 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3824 (Fwindow_end, Fset_window_point, Fset_window_start)
3825 (Fpos_visible_in_window_p, Fwindow_line_height)
3826 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3827 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3828 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3829 (Fset_window_parameter, Fwindow_display_table)
3830 (Fset_window_display_table, Fdelete_other_windows_internal)
3831 (Fset_window_buffer, Fset_window_new_total)
3832 (Fset_window_new_normal, Fdelete_window_internal)
3833 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3834 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3835 (Fwindow_scroll_bars): Check whether argument window is a valid or
3836 live window. Update doc-strings.
3837 (syms_of_window): New symbol Qwindow_valid_p.
3838 * keyboard.c (Fposn_at_x_y): Check whether argument
3839 frame_or_window denotes a valid window.
3840
2751c80f
DA
38412012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3842
3843 Fix previous char table change.
3844 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3845 * chartab.c (optimize_sub_char_table): Likewise.
3846
032a42c8
CY
38472012-08-16 Chong Yidong <cyd@gnu.org>
3848
a2d19368
CY
3849 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3850
032a42c8
CY
3851 * xfont.c (xfont_open):
3852 * xftfont.c (xftfont_open): Set the font's max_width field.
3853
3854 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3855 min_width to space_width and average_width to the average over
3856 printable ASCII characters.
3857 (ns_char_width): Code cleanup.
3858 (ns_ascii_average_width): New utility function.
3859
3860 * font.h (struct font): Update comments.
3861
a098c930
DA
38622012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3863
032a42c8 3864 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
3865 * lisp.h (CSET): New macro.
3866 (char_table_set_extras, char_table_set_contents)
3867 (sub_char_table_set_contents): New function.
3868 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3869 * syntax.c: Adjust users.
3870
8be3a09c
SM
38712012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3872
3873 * eval.c (eval_sub): Bind lexical-binding.
3874 * lread.c (Qlexical_binding): Make non-static.
3875
ac4845a6
JD
38762012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3877
ddee6515
JD
3878 * nsmenu.m (popupSession): Remove.
3879 (pop_down_menu): Remove endModalSession.
3880 (timeout_handler:): New method.
3881 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3882 Call runModalForWindow. Check timer_fired when it returns.
3883 If not set, cancel timer and break out of loop.
3884 Otherwise loop again, with a new timeout.
3885
3886 * nsterm.m: Include fcntl.h if present.
3887 (fd_entry, t_readfds, inNsSelect): Remove.
3888 (select_writefds, select_valid, select_timeout, selfds)
3889 (select_mutex, apploopnr): Add.
3890 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3891 Otherwise call kbd_buffer_store_event.
3892 (ns_send_appdefined): Remove release of fd_entry.
3893 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3894 Increment and decrement apploopnr.
3895 (ns_select): If no file descriptors, just do a NSTimer.
3896 Otherwise copy read/write masks and start select thread (fd_handler).
3897 Start main loop and wait for application defined event.
3898 Inform select thread to stop selecting after main loop is exited.
3899 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 3900 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
3901 (fd_handler:): Loop forever, wait for info from the main thread
3902 to either start or stop selecting. When select returns, send
3903 and appdefined event.
3904 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3905 If not call kbd_buffer_store_event.
3906
3907 * nsterm.h (EmacsApp): fd_handler takes id argument.
3908 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3909
ac4845a6
JD
3910 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3911
eb424fe3
EZ
39122012-08-15 Eli Zaretskii <eliz@gnu.org>
3913
3914 * region-cache.c (move_cache_gap): Update gap_len using the actual
3915 growth of the boundaries array. Do not change cache_len.
3916 (Bug#12196)
3917
4e6a86c6
DA
39182012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3919
3920 Generalize and cleanup font subsystem checks.
3921 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
3922 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3923 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 3924
5bf192ca
DA
39252012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3926
3927 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3928
f2045622
CY
39292012-08-15 Chong Yidong <cyd@gnu.org>
3930
8be3a09c
SM
3931 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3932 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3933 extract the font descriptor instead of just the font name.
3934 In that case, return a font spec instead of a string.
f2045622
CY
3935 (x_last_font_name): Move to this file from xfns.c.
3936
3937 * xfns.c (Fx_select_font): The return value can also be a font
3938 spec. Move x_last_font_name management to gtkutil.c.
3939
3940 * xfaces.c: Make font weight and style symbols non-static.
3941
7f6feb56
SM
39422012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3943
3944 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3945 (bug#12117).
3946
fecbd8ff
SM
39472012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3948
3949 * alloc.c (Fgarbage_collect): Use plural form consistently.
3950
9b8d5165
EZ
39512012-08-14 Eli Zaretskii <eliz@gnu.org>
3952
3953 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3954 iteration through the command loop. Fixes a problem whereby mouse
3955 movements are ignored until the first mouse click.
3956
f5d9e83a
PE
39572012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3958
3959 Use bool, not int, for Lisp booleans.
3960 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3961 makes Emacs a bit smaller and presumably a bit faster.
3962 * lisp.h: Include <stdbool.h>.
3963 (struct Lisp_Boolfwd, defvar_bool):
3964 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3965 * regex.c [!emacs]: Include <stdbool.h>.
3966 (false, true): Remove; <stdbool.h> does this for us now.
3967
55802e4a
CY
39682012-08-14 Chong Yidong <cyd@gnu.org>
3969
4abcdac8
CY
3970 * character.c (Fcharacterp): Doc fix (Bug#12076).
3971
3972 * data.c (Findirect_variable): Doc fix (Bug#11040).
3973
55802e4a
CY
3974 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3975
3976 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 3977 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 3978
8e99d072
BR
39792012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3980
3981 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3982 (bug#12022).
3983
08908aca
MR
39842012-08-14 Martin Rudalics <rudalics@gmx.at>
3985
3986 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3987 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3988 * minibuf.c (choose_minibuf_frame, read_minibuf):
3989 * w32fns.c (x_create_tip_frame):
3990 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3991 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3992
56120d6f
PE
39932012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3994
3995 * intervals.c (offset_intervals): Remove obsolete comment.
3996
67b77c0b
AS
39972012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3998
3999 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4000
f48b82fd
GR
40012012-08-14 Gergely Risko <gergely@risko.hu>
4002
4003 * coding.c (decode_coding): Record buffer modification before
4004 disabling undo_list (Bug#11773).
4005
fd318b54
DA
40062012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4007
4008 Revert and cleanup some recent overlay changes.
4009 * buffer.h (enum overlay_type): Remove.
4010 (buffer_get_overlays, buffer_set_overlays): Likewise.
4011 (buffer_set_overlays_before, buffer_set_overlays_after):
4012 New function. Adjust users.
4013 (unchain_both): Add eassert.
4014
41a62dd9
DA
40152012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4016
4017 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4018
5884c324
PE
40192012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4020
4021 * gtkutil.c (xg_mark_data): Don't assume C99.
4022
ca06f160
JD
40232012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4024
4025 * gtkutil.c (xg_frame_tb_info): New struct.
4026 (TB_INFO_KEY): New define.
4027 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4028 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4029 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4030 if not present.
4031 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 4032 is up to date. Otherwise store new data.
ca06f160
JD
4033 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4034
7864a3f7
DA
40352012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4036
4037 Use KSET for write access to Lisp_Object members of struct kboard.
4038 * keyboard.h (KSET): New macro.
4039 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4040 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4041 * xterm.c: Adjust users.
4042
4c31be61
DA
40432012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4044
4045 Use BSET for write access to Lisp_Object members of struct buffer.
4046 * buffer.h (BSET): New macro.
4047 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4048 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4049 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4050 * window.c, xdisp.c, xfns.c: Adjust users.
4051
14ae4239
BT
40522012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4053
4054 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4055
32bcadb4
JD
40562012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4057
3d29b2ce 4058 * nsterm.m (not_in_argv): New function.
fc0c31f8 4059 (application:openFile, application:openTempFile:):
3d29b2ce
JD
4060 (application:openFileWithoutUI:, application:openFiles:): Open file
4061 if not_in_argv returns non-zero (bug#12171).
4062
32bcadb4 4063 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
4064 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4065 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
4066 (xg_get_font_name): Use those functions/macros here.
4067 Reported by Frans Oilinki <moilinki@gmail.com>.
4068
9ff9402d 40692012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
4070
4071 * unexmacosx.c (copy_data_segment): Copy initialized data in
4072 statically linked libraries from input file rather than memory.
4073
db74a5fc
YM
4074 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4075 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4076 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4077
25e65510
GM
40782012-08-10 Glenn Morris <rgm@gnu.org>
4079
4080 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4081 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4082
7961135c
DA
40832012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4084
4085 Fix last change to allow compilation with low optimization levels.
4086 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4087 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4088
42b3a444
DA
40892012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4090
4091 Use common inline syntax in intervals.h.
4092 * intervals.h (INTERVALS_INLINE): New macro.
4093 Change all users from LISP_INLINE.
4094
9fb0c957
DA
40952012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4096
4097 Define Qnone once for all platforms.
4098 * frame.c (Qnone): Define here.
4099 (syms_of_frame): DEFSYM it.
4100 * lisp.h (Qnone): New declaration.
4101 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4102 * xfns.c: Remove duplication. Adjust users.
4103
65e8ee52
DA
41042012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4105
4106 Remove unused macros from intervals.h.
4107 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4108 * intervals.c: Adjust comment.
4109
9b855fd6
EZ
41102012-08-10 Eli Zaretskii <eliz@gnu.org>
4111
4112 * w32fns.c <w32_unicode_gui>: New static variable.
4113 (globals_of_w32fns): Initialize it according to os_subtype.
4114 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4115 testing os_subtype.
4116
39cb9e56 41172012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
4118 Eli Zaretskii <eliz@gnu.org>
4119
4120 Fix bug #10299 with Unicode characters sent by customized
4121 keyboards created by MSKLC.
4122 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4123 (w32_init_class): Use it to initialize the Emacs class with either
4124 ANSI or Unicode API calls.
4125 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4126 later.
4127 (w32_wnd_proc): If the character code sent by WM_CHAR or
4128 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4129 original message. Call DefWindowProcW on NT and later.
4130
9374581a
GM
41312012-08-10 Glenn Morris <rgm@gnu.org>
4132
4b94e8cf
GM
4133 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4134
9374581a
GM
4135 * lisp.h (DIRECTORY_SEP): Let configure set it.
4136
a2752828
DA
41372012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4138
4139 Use TSET for write access to Lisp_Object slots of struct terminal.
4140 * termhooks.h (TSET): New macro.
4141 * coding.c, terminal.c, xselect.c: Adjust users.
4142
cc92c454
SM
41432012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4144
4145 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4146 the failing expression, include them in the error message.
4147 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4148 * lisp.h (internal_condition_case_n): Update declaration.
4149
4cb3e6b3
DA
41502012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4151
4152 Inline functions to examine and change buffer overlays.
4153 * buffer.c (unchain_both): New function.
4154 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4155 (buffer_has_overlays): New function.
4156 (enum overlay_type): New enum.
4157 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4158 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4159
8707c1e5
DA
41602012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4161
4162 Inline functions to examine and change buffer intervals.
4163 * alloc.c (mark_interval_tree): Remove.
4164 (MARK_INTERVAL_TREE): Simplify.
4165 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4166 * intervals.c (buffer_balance_intervals): New function.
4167 (graft_intervals_into_buffer): Adjust indentation.
4168 (set_intervals_multibyte): Simplify.
4169 * buffer.h (BUF_INTERVALS): Remove.
4170 (buffer_get_intervals, buffer_set_intervals): New function.
4171 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4172 * intervals.c, textprop.c: Adjust users.
4173
ad8c997f
DA
41742012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4175
4176 Inline functions to examine and change string intervals.
4177 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4178 (string_get_intervals, string_set_intervals): New function.
4179 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4180 * lread.c, print.c, textprop.c: Adjust users.
4181
32ac3a6b
GM
41822012-08-08 Glenn Morris <rgm@gnu.org>
4183
4184 * lisp.mk (lisp): Remove language/persian.elc.
4185
77c7bcb1
DA
41862012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4187
4188 Cleanup intervals.
4189 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4190 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
4191 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4192 Adjust comment. Move under #if 0.
77c7bcb1
DA
4193 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4194 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4195
9c08a8d4
DA
41962012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4197
4198 Check total length of intervals with eassert.
4199 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4200 * intervals.c: Change all users to eassert.
4201
26d16b35
EZ
42022012-08-07 Eli Zaretskii <eliz@gnu.org>
4203
14ae4239
BT
4204 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4205 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
4206 INTERNAL_FIELD in Lisp_Cons.
4207
c644523b
DA
42082012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4209
4210 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4211 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4212 name since all xname users are fixed long time ago. Do not
4213 use INTERNAL_FIELD.
4214 (set_symbol_name, set_symbol_function, set_symbol_plist):
4215 (set_symbol_next, set_overlay_plist): New function.
4216 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4217 (struct Lisp_Overlay): Likewise.
4218 (CVAR, MVAR, SVAR): Remove.
4219 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4220 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4221 * xterm.c: Adjust users.
4222 * .gdbinit: Change to use name field of struct Lisp_Symbol
4223 where appropriate.
4224
6a3d20cc
DA
42252012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4226
4227 Basic functions to set Lisp_Object and pointer slots of intervals.
4228 * intervals.h (interval_set_parent, interval_set_object):
4229 (interval_set_left, interval_set_right, interval_set_plist):
4230 (interval_copy_parent): New function.
4231 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
4232 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4233 Adjust indentation.
6a3d20cc
DA
4234 (INTERVAL_SIZE): Remove. Adjust users.
4235 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4236
4d2b044c
DA
42372012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4238
4239 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4240 * process.h (PGET): Remove.
4241 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4242 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4243
d3d50620
DA
42442012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4245
4246 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4247 * window.h (WGET): Remove.
4248 (struct window): Do not use INTERNAL_FIELD.
4249 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4250 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4251 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4252 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4253 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4254 Adjust users.
4255
d10a51dc
CY
42562012-08-07 Chong Yidong <cyd@gnu.org>
4257
4258 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4259 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4260 (Fdelete_window_internal): Signal an error if the window is not on
4261 a live frame (Bug#12025).
4262
e69b0960
DA
42632012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4264
4265 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4266 * frame.h (FGET): Remove.
4267 (struct frame): Do not use INTERNAL_FIELD.
4268 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4269 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4270 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4271 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4272
25a20a3a
JB
42732012-08-06 Juanma Barranquero <lekktu@gmail.com>
4274
4275 * w32.c: Silence compiler warnings.
4276 (map_w32_filename): Remove unused variable `is_fat'.
4277 (chase_symlinks): Add parentheses around expression.
4278
1c6f11f4
GM
42792012-08-06 Glenn Morris <rgm@gnu.org>
4280
1db4583a
GM
4281 * sysdep.c: Respect BROKEN_GETWD.
4282
1c6f11f4
GM
4283 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4284 Let configure handle it.
4285 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4286
2b90362b
DA
42872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4288
4289 Use GCALIGNMENT where appropriate.
4290 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4291 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4292 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4293
5f50daf2
EZ
42942012-08-06 Eli Zaretskii <eliz@gnu.org>
4295
14ae4239
BT
4296 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4297 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 4298
cbcc7007
SM
42992012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4300
4301 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4302 that should be sufficient for everyone.
4303
4d365fa4
JD
43042012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4305
4306 * keyboard.c (timer_check_2): Add break so timer_check returns next
4307 timeout.
4308
dd86bd82
DA
43092012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4310
4311 Fix Windows build errors introduced after converting to WGET and WSET.
4312 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4313 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4314
054e1668
JD
43152012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4316
4317 * nsterm.m (ns_frame_rehighlight): Use FSET.
4318
4319 * nsmenu.m (ns_update_menubar): Use FSET.
4320
21238f11
DA
43212012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4322
4323 Separate read and write access to Lisp_Object slots of Lisp_Process.
4324 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4325 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4326
077288cf
DA
43272012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4328
4329 Separate read and write access to Lisp_Object slots of struct window.
4330 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4331 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4332 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4333 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4334 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4335 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4336 Adjust users.
4337
71688bd7
DA
43382012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4339
4340 Fix Windows build errors introduced after converting to FGET and FSET.
4341 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4342 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4343 (w32_judge_scroll_bars): Change to use FSET.
4344 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4345
f99bac93
DA
43462012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4347
4348 Fix replacement typo.
4349 * window.c (replace_window): Set root_window instead of
4350 selected_window. This fixes a total window subsystem
4351 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4352
8c2a0f2d
GM
43532012-08-06 Glenn Morris <rgm@gnu.org>
4354
4355 * lisp.mk (lisp): Add language/persian.elc.
4356
edd74c35
DA
43572012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4358
4359 Separate read and write access to Lisp_Object slots of struct frame.
4360 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4361 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4362 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4363 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4364 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4365
8671676c
AS
43662012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4367
4368 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4369
663e2b3f
DA
43702012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4371
4372 Generalize common compile-time constants.
4373 * lisp.h (header_size, bool_header_size, word_size): Now here.
4374 (struct Lisp_Vector): Add comment.
4375 (struct Lisp_Bool_Vector): Move up to define handy constants.
4376 (VECSIZE, PSEUDOVECSIZE): Simplify.
4377 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4378 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4379 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4380 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4381 * xfont.c, xmenu.c: Use word_size where appropriate.
4382
d32e47af
LM
43832012-08-05 Lawrence Mitchell <wence@gmx.li>
4384
4385 * search.c (Freplace_match): Treat \? in the replacement text
4386 literally (Bug#8161).
4387
e5d9c0d1
CY
43882012-08-05 Chong Yidong <cyd@gnu.org>
4389
4390 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4391 * frame.c (Vdelete_frame_functions):
4392 * emacs.c (Vkill_emacs_hook): Doc fix.
4393
8da0576b
EZ
43942012-08-04 Eli Zaretskii <eliz@gnu.org>
4395
4396 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4397 --with-x-toolkit=no builds.
4398 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4399
02676e5d
CY
44002012-08-04 Chong Yidong <cyd@gnu.org>
4401
4402 * syntax.c (Fmodify_syntax_entry): Doc fix.
4403
97147da9
EZ
44042012-08-04 Eli Zaretskii <eliz@gnu.org>
4405
76151e2c
EZ
4406 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4407 * w32.c (init_environment): Change the default values of many
4408 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
4409 them into environment when they were not already defined.
4410 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 4411 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
4412 (check_windows_init_file): Now external, not static.
4413 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
4414 called when Vload_path is already set up.
4415
4416 * w32.h (check_windows_init_file): Add prototype.
4417
4418 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4419 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4420 compatibility with Posix platforms.
4421 (main): Move the call to check_windows_init_file to here from
4422 w32.c.
4423 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4424 any, in the DEFALT argument into the root of the Emacs build or
4425 installation tree, as appropriate.
4426
4427 * callproc.c (init_callproc_1): Call decode_env_path instead of
4428 doing its equivalent by hand.
4429 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4430 the code that sets Vexec_path run on MS-Windows.
4431
4432 * lread.c (init_lread): Add comments to #ifdef's.
4433
97147da9
EZ
4434 * msdos.c (dos_set_window_size, IT_update_begin)
4435 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4436 instead of direct references.
4437
185ee146
PE
44382012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4439
4440 Export DEFAULT_REHASH_* to GDB.
4441 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4442 Now constants, not macros.
4443
8834c57a
PE
44442012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4445
98c6f1e3
PE
4446 Remove unnecessary casts involving pointers.
4447 These casts are no longer needed now that we assume C89 or later,
4448 since they involve casting to or from void *.
4449 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4450 (make_pure_float, make_pure_vector):
4451 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4452 * macros.c (Fstart_kbd_macro):
4453 * menu.c (find_and_return_menu_selection):
4454 * minibuf.c (read_minibuf_noninteractive):
4455 * sysdep.c (closedir):
4456 * xdisp.c (x_produce_glyphs):
4457 * xfaces.c (compare_fonts_by_sort_order):
4458 * xfns.c (x_real_positions, select_visual):
4459 * xselect.c (x_stop_queuing_selection_requests)
4460 (x_get_window_property, x_get_window_property_as_lisp_data):
4461 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4462 Remove unnecessary pointer casts.
4463 * alloc.c (record_xmalloc): New function.
4464 * lisp.h (record_xmalloc): New decl.
4465 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4466 more like a function. This is because the pointer cast is not
4467 needed. All uses changed.
4468 * print.c (print_string, print_error_message): Avoid length recalc.
4469
8834c57a
PE
4470 Improve fix for macroexp crash with debugging (Bug#12118).
4471 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4472 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4473 not supposed to be invoked from the garbage collector.
4474 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4475 (gc_aset): New function, which is like ASET but can be
4476 used in the garbage collector.
4477 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4478 (set_hash_index): Use it instead of ASET.
4479
6dad7178
EZ
44802012-08-03 Eli Zaretskii <eliz@gnu.org>
4481
4482 Support symlinks on latest versions of MS-Windows.
4483 * w32.c: Include winioctl.h and aclapi.h.
4484 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4485 (revert_to_self): Forward declarations of static functions.
4486 <static BOOL g_b_init_get_security_info>:
4487 <g_b_init_create_symbolic_link>: New static flags.
4488 (globals_of_w32): Initialize them to zero.
4489 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4490 (map_w32_filename): Improve commentary. Simplify switch.
4491 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4492 headers (most versions of MinGW w32api don't).
4493 (get_security_info, create_symbolic_link)
4494 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4495 New functions.
4496 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4497 in the argument file name.
4498 (sys_access): Call unc_volume_file_attributes only if
4499 GetFileAttributes fails with network-related error codes.
4500 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4501 have the required privileges.
14ae4239 4502 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
4503 get_file_security_desc.
4504 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
4505 with addition of handling of symlinks and support for 'lstat'.
4506 If possible, get file's attributes and security information by
6dad7178
EZ
4507 handle, not by name. Produce S_IFLNK bit for symlinks, when
4508 called from 'lstat'.
4509 (stat, lstat): New functions, call 'stat_worker'.
4510 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4511 symlinks when the underlying filesystem supports them.
4512
f162bcc3
PE
45132012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4514
79ea6c20
PE
4515 Fix macroexp crash on Windows with debugging (Bug#12118).
4516 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4517 checking subscripts; problem introduced with the recent
4518 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4519 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4520 since it's used in non-static inline functions now.
4521
c0ce93fd
PE
4522 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4523 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 4524
f162bcc3
PE
4525 Use C99-style 'extern inline' if available.
4526 * buffer.h (BUFFER_INLINE):
4527 * category.h (CATEGORY_INLINE):
4528 * character.h (CHARACTER_INLINE):
4529 * charset.h (CHARSET_INLINE):
4530 * composite.h (COMPOSITE_INLINE):
4531 * dispextern.h (DISPEXTERN_INLINE):
4532 * lisp.h (LISP_INLINE):
4533 * systime.h (SYSTIME_INLINE):
4534 New macro, replacing 'static inline' in this header.
4535 * buffer.h, category.h, character.h, charset.h, composite.h:
4536 * dispextern.h, lisp.h, systime.h:
4537 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4538 * alloc.c (LISP_INLINE):
4539 * buffer.c (BUFFER_INLINE):
4540 * category.c (CATEGORY_INLINE):
4541 * character.c (CHARACTER_INLINE):
4542 * charset.c (CHARSET_INLINE):
4543 * composite.c (COMPOSITE_INLINE):
4544 * dispnew.c (DISPEXTERN_INLINE):
4545 * sysdep.c (SYSTIME_INLINE):
4546 Define to EXTERN_INLINE, so that the corresponding functions
4547 are compiled into code.
4548 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4549 (INLINE_HEADER_END): New macros.
4550 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4551 since it's used in non-static inline functions now.
a8333d03 4552 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4553
837b365b
GM
45542012-08-02 Glenn Morris <rgm@gnu.org>
4555
d66b744d
GM
4556 * s/: Remove empty directory.
4557
837b365b
GM
4558 * s/ms-w32.h: Move to ../nt/inc.
4559 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4560 Update for new ms-w32.h location.
4561
13294f95
PE
45622012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4563
4564 Port to Solaris 8.
4565 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4566
90df0db3
GM
45672012-08-02 Glenn Morris <rgm@gnu.org>
4568
4569 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4570 hard-coding the path separator.
4571
4939150c
PE
45722012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4573
4574 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4575 This how ASET and AREF are supposed to work, and makes
4576 it easier to think about future improvements. See
4577 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4578 * charset.h (set_charset_attr): New function.
4579 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4580 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4581 (aref_addr): New function. All uses of &AREF(...) changed.
4582 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4583 (set_hash_index): New functions. All lvalue-style uses of
4584 HASH_KEY etc. changed.
4585 * keyboard.c (set_prop): New function. All lvalue-style uses
4586 of PROP changed.
4587
947b2afd
AA
45882012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4589
4590 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4591 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 4592 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
4593 * nsfns.m (ns_set_name_as_filename): Likewise.
4594 * nsmenu.m (ns_update_menubar): Likewise.
4595 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4596
4f5d0325
EZ
45972012-08-01 Eli Zaretskii <eliz@gnu.org>
4598
2008beae
EZ
4599 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4600 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4601 objects.
2008beae 4602
4f5d0325
EZ
4603 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4604
fe3cc771
GM
46052012-08-01 Glenn Morris <rgm@gnu.org>
4606
4607 * s/msdos.h: Remove file.
4608 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4609 * Makefile.in (S_FILE): Remove.
4610 (config_h): Remove S_FILE.
4611
c90acc54
JB
46122012-08-01 Juanma Barranquero <lekktu@gmail.com>
4613
4614 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4615 Remove; moved to nt/config.nt.
4616
d8a05828
DA
46172012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4618
4619 Use INTERNAL_FIELD for conses and overlays.
4620 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4621 Remove obsolete comment.
4622 (MVAR): New macro.
4623 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4624 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4625
8271d590
DA
46262012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4627
4628 Use INTERNAL_FIELD for symbols.
4629 * lisp.h (SVAR): New macro. Adjust users.
4630 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4631 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4632
3193acd2
DA
46332012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4634
4635 Use INTERNAL_FIELD for processes.
4636 * process.h (PVAR): New macro. Adjust style.
4637 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4638 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4639
3a45383a
DA
46402012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4641
4642 Use INTERNAL_FIELD for windows.
4643 * window.h (WVAR): New macro.
4644 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4645 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4646 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4647 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4648 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4649 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4650
c1dbc63c
PE
46512012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4652
4653 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4654
5c0c0e8a
GM
46552012-08-01 Glenn Morris <rgm@gnu.org>
4656
4657 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4658 Move to configure.ac.
4659
552a99b4
JB
46602012-08-01 Juanma Barranquero <lekktu@gmail.com>
4661
4662 * makefile.w32-in (CONFIG_H): Update dependencies.
4663 (CONF_POST_H): New macro.
4664
4665 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4666
8d8e2dfe
GM
46672012-07-31 Glenn Morris <rgm@gnu.org>
4668
bc96620a
GM
4669 * Makefile.in (S_FILE): No longer set by configure.
4670
476b1b2d
GM
4671 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4672 is available.
4673 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4674
b2c7a106
GM
4675 * process.h (NULL_DEVICE):
4676 * emacs.c (SEPCHAR):
4677 * editfns.c (USER_FULL_NAME): Let configure set them.
4678
d53d062a
GM
4679 * s/README, s/template.h: Remove files.
4680
4515017f
GM
4681 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4682
8d8e2dfe
GM
4683 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4684 Move to configure.ac.
4685
5b20b3cc
EZ
46862012-07-31 Eli Zaretskii <eliz@gnu.org>
4687
1e0afd9a
EZ
4688 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4689 resulting renaming of 'struct frame' members.
4690
5b20b3cc
EZ
4691 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4692
4693 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4694 after introduction of FVAR.
4695
f1310128
JD
46962012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4697
79e721e0
JD
4698 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4699
4700 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4701 instead of compositeToPoint.
4702 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4703
8d7c7eed 4704 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 4705
e34f7f79
DA
47062012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4707
4708 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4709 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 4710 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
4711 (BVAR): Change to use INTERNAL_FIELD.
4712 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4713 (KVAR): Change to use INTERNAL_FIELD.
4714 * frame.h (FVAR): New macro.
4715 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
4716 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4717 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4718 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
4719 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4720
c09bfb2f
DA
47212012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4722
4723 Miscellaneous fixes for non-default X toolkits.
4724 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4725 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4726 Move under #ifdef USE_LUCID.
4727 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4728 definition and usage to avoid warnings.
4729
14c114ae
JD
47302012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4731
4732 * nsterm.m (openFiles): Fix previous checkin.
4733
3bd21e82
PE
47342012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4735
4736 * indent.c (compute_motion): Remove unused local.
4737
c1529ded
GM
47382012-07-31 Glenn Morris <rgm@gnu.org>
4739
400d5621
GM
4740 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4741
268e2432
GM
4742 * conf_post.h [USG5_4]:
4743 Move remaining contents of s/usg5-4-common.h here.
4744 * s/usg5-4-common.h: Remove file.
4745
7552f3ee
GM
4746 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4747 * s/irix6-5.h: Remove file.
4748
6a381852
GM
4749 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4750 * s/darwin.h: Remove file.
4751
c1529ded
GM
4752 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4753 * s/hpux10-20.h: Remove file, which is now empty.
4754
b429a4ee
GM
47552012-07-30 Glenn Morris <rgm@gnu.org>
4756
4757 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4758 * Makefile.in (config_h): Add conf_post.h.
4759 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4760
adff3182
JD
47612012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4762
4763 * nsterm.m (ns_do_open_file): New variable.
b9031d69 4764 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
4765 (openFile, openTempFile, openFileWithoutUI, openFiles):
4766 Open files only if ns_do_open_file.
adff3182 4767
c32af1e4
PE
47682012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4769
7393bcbb
PE
4770 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4771 This no-op macro hasn't been needed for many years.
4772 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4773
c32af1e4
PE
4774 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4775 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4776 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4777 gdb_make_enums_visible.
4778 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4779 (DIRECTORY_SEP): Now a constant, not a macro.
4780
302fc036
EZ
47812012-07-30 Eli Zaretskii <eliz@gnu.org>
4782
4783 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4784 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4785
4786 * w32term.c <w32_keyboard_codepage>: Renamed from
4787 keyboard_codepage and now external. All users changed.
4788
4789 * w32term.h: Add declaration of w32_keyboard_codepage.
4790
4791 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4792 the codepage to translate keys to Unicode. If this argument is
4793 -1, use the value returned by GetConsoleCP. All callers changed.
4794
88fb40b4
PE
47952012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4796
0aee6912
PE
4797 Update .PHONY listings in makefiles.
4798 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4799 bootstrap-clean, distclean, maintainer-clean, versioclean,
4800 extraclean, frc.
4801
88fb40b4
PE
4802 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4803 This is a bit clearer. Fix some commentary typos.
4804
0a763bd1
GM
48052012-07-30 Glenn Morris <rgm@gnu.org>
4806
32bac6d6
GM
4807 * s/netbsd.h: Let configure include signal.h if needed.
4808 Remove file, which is now empty.
4809
b65e7c46
GM
4810 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4811 Let configure set them.
4812 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4813 No more need to undefine.
0a763bd1 4814
169304bd
AS
48152012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4816
4817 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4818 non-single-byte char when adding meta modifier. (Bug#12090)
4819
6cd7a139
DA
48202012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4821
4822 Convert safe_call to use variable number of arguments.
4823 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4824 (safe_call2): Fix comment.
4825 * lisp.h (safe_call): Adjust prototype.
4826 * coding.c (encode_coding_object): Change to use safe_call2.
4827 * xfaces.c (merge_face_heights): Change to use safe_call1.
4828
d34d6ffc
GM
48292012-07-30 Glenn Morris <rgm@gnu.org>
4830
7b8a48e4 4831 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 4832 does that unconditionally. Remove file, which is now empty.
7b8a48e4 4833
d34d6ffc
GM
4834 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4835 Remove empty files.
4836
03a660a6
PE
48372012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 Export to GDB most of lisp.h's remaining object-like macros.
4840 * lisp.h (min, max): Move earlier, because they're used earlier now.
4841 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4842 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4843 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4844 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4845 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4846 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4847 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4848 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4849 Now constants, for GDB. They need not be macros.
4850 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4851 Now constants, for GDB, as well as macros, for static initializers.
4852 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4853 Move to after the definition of struct Lisp_Char_Table,
4854 since the former now needs that type defined.
4855 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4856 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4857 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4858 New enums, for gdb_make_enums_visible.
4859 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 4860 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
4861 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4862 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4863 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4864 enum maxargs, enum MAX_ALLOCA.
4865 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4866 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4867 no longer needed, now that they are done in lisp.h.
4868
e499d0ee
DA
48692012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4870
4871 Cleanup string bytes checking.
4872 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4873 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4874 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4875 (check_sblock, compact_small_strings): Simplify.
4876
d5040d2d
PE
48772012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4880 These macros are confusing and no longer need to be defined, as
4881 the enum values now suffice. All uses replaced with definiens.
4882 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4883
7f259ae6
JB
48842012-07-29 Juanma Barranquero <lekktu@gmail.com>
4885
4886 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4887 ($(BLD)/w32console.$(O)): Update dependencies.
4888
7e63e0c3
DA
48892012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4890
4891 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4892 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4893 time. Adjust users.
4894 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4895
ffd817eb
JD
48962012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4897
4898 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4899 setting sitelisp (Bug#12010).
4900
417a7a0e
EZ
49012012-07-29 Eli Zaretskii <eliz@gnu.org>
4902
14ae4239 4903 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
4904
4905 * w32heap.c (cache_system_info):
4906 * w32.c (sys_rename):
4907 * w32proc.c (find_child_console, sys_kill): All users changed.
4908
387d4d92
PE
49092012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4910
4911 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4912
55a6cca6
EZ
49132012-07-29 Eli Zaretskii <eliz@gnu.org>
4914
4915 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4916
dbcf001c
DA
49172012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4918
4919 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
4920 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4921 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 4922
e2688e4a
DA
49232012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4924
4925 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4926 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4927 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4928 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4929 (replace_range, replace_range_2, del_range_2): Change to eassert.
4930 * marker.c (byte_char_debug_check): Adjust style.
4931
b46a6a83
PE
49322012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4933
4934 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4935 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4936 long-ago-commented-out code that talks about "WIN32".
4937 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4938 All uses changed.
4939
e32a5799
PE
49402012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4941
4942 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4943 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4944 Simplify by using alignof.
4945 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4946 * lisp.h: Include <stdalign.h>.
4947 (GCALIGNMENT): New macro and constant.
4948 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4949 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4950 (stdalign): New macro, if not already defined.
4951
df81cd29
EZ
49522012-07-28 Eli Zaretskii <eliz@gnu.org>
4953
01bd1b0d
EZ
4954 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4955 * w32inevt.c: Include w32inevt.h.
4956 (w32_read_console_input): New inline function, calls either
4957 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4958 w32_console_unicode_input.
4959 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4960 (w32_kbd_patch_key, key_event): Use the codepage returned by
4961 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4962 (key_event): use uChar.UnicodeChar only if
4963 w32_console_unicode_input is non-zero.
4964
4965 * w32console.c: Include w32heap.h.
4966 <w32_console_unicode_input>: New global variable.
4967 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4968 family of Windows, zero otherwise.
4969
4970 * w32inevt.h: Declare w32_console_unicode_input.
4971
df81cd29
EZ
4972 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4973 --without-x. (Bug#11742)
4974
c20fdd9e
PE
49752012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4976
4977 Adjust GDB to reflect pvec_type changes (Bug#12036).
4978 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
4979 2012-07-04 changes to pseudovector representation.
4980 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 4981
32770973 49822012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
4983
4984 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4985 bus address.
4986 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4987
3438fe21
EZ
49882012-07-27 Eli Zaretskii <eliz@gnu.org>
4989
bcfbc9de
EZ
4990 * alloc.c (listn): Fix the order the arguments are consed onto the
4991 list.
4992
3438fe21
EZ
4993 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4994 enumeration constants, as PURE and HEAP are too general, and clash
4995 with other headers and sources, such as gmalloc.c and the
4996 MS-Windows system headers. All users changed.
4997
eeaea515
DA
49982012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4999
5000 Revert last save_excursion_save and save_excursion_restore changes.
5001 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5002 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5003
073c88c2
DA
50042012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5005
5006 Fix recently-introduced typos in Windows port.
5007 Reported by Martin Rudalics <rudalics@gmx.at>.
5008 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 5009 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 5010
4706125e
PE
50112012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 Improve GDB symbol export (Bug#12036).
5014 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5015 arms of an 'if', not using conditional expressions; otherwise GDB
5016 complains about the types in the unevaluated arm when the argument
5017 is an integer literal.
5018 (xgetint): Simplify expression.
5019 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5020 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5021 Zaretskii in <http://bugs.gnu.org/12036#13>.
5022 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5023 needed now that we have gdb_make_enums_visible.
5024 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5025 (enum enum_USE_LSB_TAG):
5026 New enum types, packaging up enums that need to be exported to GDB.
5027
694b6c97
DA
50282012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5029
5030 Utility function to make a list from specified amount of objects.
5031 * lisp.h (enum constype): New datatype.
5032 (listn): New prototype.
5033 * alloc.c (listn): New function.
5034 (Fmemory_use_count, syms_of_alloc): Use it.
5035 * buffer.c (syms_of_buffer): Likewise.
5036 * callint.c (syms_of_callint): Likewise.
5037 * charset.c (define_charset_internal): Likewise.
5038 * coding.c (syms_of_coding): Likewise.
5039 * keymap.c (syms_of_keymap): Likewise.
5040 * search.c (syms_of_search): Likewise.
5041 * syntax.c (syms_of_syntax): Likewise.
5042 * w32.c (init_environment): Likewise.
5043 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5044 * xdisp.c (syms_of_xdisp): Likewise.
5045 * xfns.c (syms_of_xfns): Likewise.
5046
6195f384
DA
50472012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5048
5049 Fast save_excursion_save and save_excursion_restore.
5050 * lisp.h (struct Lisp_Excursion): New data type.
5051 (PVEC_EXCURSION): New pseudovector type.
5052 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5053 to deal with it. Adjust comments.
5054 (init_marker, attach_marker): New prototype.
5055 (unchain_marker): Adjust prototype.
5056 * marker.c (attach_marker): Change to global.
5057 (init_marker): New function.
5058 * alloc.c (Fmake_marker, build_marker): Use it.
5059 (build_marker): More easserts.
5060 (mark_object): Handle struct Lisp_Excursion.
5061 * editfns.c (save_excursion_save, save_excursion_restore):
5062 Reimplement to use struct Lisp_Excursion. Add comments.
5063
5eceb8fb
PE
50642012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5065
5066 Fix export of symbols to GDB (Bug#12036).
5067 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5068 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5069 emacs.c, as this is a more-suitable home. Had this been done earlier
5070 the fix for 12036 would have avoided some of the problems noted in
5071 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5072 would have been more obvious.
562157c8
PE
5073 * emacs.c: Do not include <verify.h>; no longer needed.
5074 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
5075 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5076 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5077 Remove; now done in lisp.h.
5078 * lisp.h (PUBLISH_TO_GDB): New macro.
5079 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5080 (DATA_SEG_BITS): Use it.
5081 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5082 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5083 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5084 not be usable in #if. This simplifies things.
5085
d6749401
JB
50862012-07-26 Juanma Barranquero <lekktu@gmail.com>
5087
5088 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5089
1781b9e9
PE
50902012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5091
d89518db 5092 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
5093 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5094 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5095 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5096 Adjust to changes in lisp.h and emacs.c, by using
5097 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5098 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5099 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5100 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5101 instead of gdb_valbits.
5102 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5103 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5104 instead of gdb_array_mark_flag.
5105 (xboolvector): Get size from $->size, not $->header.size.
5106 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5107 (xreload, hook-run, hookpost-run): Remove.
5108 * emacs.c: Include <verify.h>.
5109 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5110 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5111 Remove.
5112 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5113 (gdb_USE_LSB_TAG): New enum constants.
5114 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5115 Also define these as enum constants, so they're visible to GDB.
5116 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5117 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5118 as constants, so they're visible to GDB.
5119 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5120 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5121 Now enum constants, not macros, so they're visible to GDB.
5122 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5123 more convenient now. All uses changed.
5124 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5125 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5126
3628596a
DA
51272012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5128
5129 Explicitly free restriction data that are not needed anymore.
5130 * editfns.c (save_restriction_restore): Free restriction data.
5131
7abaf5cc
SM
51322012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5133
5134 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5135 add argument, tune behavior, and adjust all callers.
5136
71f88e00
PE
51372012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 Use typedef for EMACS_INT, EMACS_UINT.
5140 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5141 than macros. This simplifies debugging in the usual case, since
5142 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5143 and it allows expressions involving EMACS_INT casts.
5144 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5145
57ec3034
JD
51462012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5147
5148 * nsterm.m (ns_read_socket): Return early if there is a modal
5149 window (Bug#12043).
5150
8137e7b3
MR
51512012-07-25 Martin Rudalics <rudalics@gmx.at>
5152
5153 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5154 that FOCUS-FRAME can be omitted.
5155
04e9897c
DA
51562012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5157
5158 Adjust buffer text indirection counters at the end of Fkill_buffer.
5159 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5160 buffer is definitely dead. This should really fix an issue reported
5161 by Christoph Scholtes again. (Bug#12007).
5162 (init_buffer_once): Initialize indirection counters of
5163 buffer_defaults and buffer_local_symbols (for sanity and safety).
5164
8a0484e1
EZ
51652012-07-24 Eli Zaretskii <eliz@gnu.org>
5166
5167 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5168 and continuation glyphs on tooltip frames, leave them at zero.
5169 Avoids continued lines in tooltips. (Bug#11832)
5170
fa691a83
DA
51712012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5172
5173 Simplify copy_overlay.
04e9897c 5174 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
5175 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5176
436bc8e0
EZ
51772012-07-23 Eli Zaretskii <eliz@gnu.org>
5178
5179 * print.c (print_object): Don't crash when a frame's name is nil
5180 or invalid. (Bug#12025)
5181
5182 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5183 it signals an error when a tooltip frame is being created.
5184
d7a7fda3
DA
51852012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5186
5187 Cleanup miscellaneous objects allocation and initialization.
5188 * alloc.c (allocate_misc): Change to static. Add argument to
5189 specify the subtype. Adjust comment and users.
5190 (build_overlay): New function.
5191 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5192 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5193 (allocate_misc): Remove prototype.
5194 (build_overlay): Add prototype.
5195
51962012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
5197
5198 Swap buffer text indirection counters in Fbuffer_swap_text.
5199 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5200 This avoids crash reported by Christoph Scholtes at
5201 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5202
9d7fa573
JD
52032012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5204
5205 * nsmenu.m (Popdown_data): New struct.
5206 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5207 free Popdown_data.
5208 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5209 (initWithContentRect): Make imgView and contentView non-static
5210 and autorelease them. Also autorelease img and matrix (Bug#12005).
5211 (dealloc): Remove (Bug#12005).
5212
0dd6d66d
DA
52132012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5214
5215 Adjust consing_since_gc when objects are explicitly freed.
5216 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5217 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5218 (free_cons, free_misc): Subtract object size from consing_since_gc.
5219
d36d71df
DA
52202012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5221
5222 Simplify and cleanup markers positioning code.
5223 * marker.c (attach_marker): More useful eassert.
5224 (live_buffer, set_marker_internal): New function.
5225 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5226 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5227
fb9ea40f
PE
52282012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5229
5230 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5231 as it's limited by the amount of memory, not by INT_MAX.
5232
2d5c5f7d
EZ
52332012-07-21 Eli Zaretskii <eliz@gnu.org>
5234
07fb592e
EZ
5235 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5236 in special-event-map. See the discussion at
5237 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5238 for the reasons.
5239
37a9eac8 5240 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
5241 info.dwItemData. Fixes crashes on 64-bit Windows.
5242 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 5243
c4328746
JD
52442012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5245
fc0c31f8 5246 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 5247 (conversationIdentifier): Return value is NSInteger.
784051c4 5248 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 5249
6e5d1c12
CY
52502012-07-21 Chong Yidong <cyd@gnu.org>
5251
5252 * window.c (decode_any_window): Signal an error if the window is
5253 on a dead frame (Bug#11984).
5254
9928463d
DA
52552012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5256
5257 Add indirection counting to speed up Fkill_buffer.
5258 * buffer.h (struct buffer): New member.
5259 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5260 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5261 base buffer indirection counter.
5262 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5263 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5264 through buffer list if indirection counter is 0.
5265
f8643a6b
DA
52662012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5267
5268 Extend the value returned by Fgarbage_collect with heap statistics.
5269 * alloc.c (Qheap): New symbol.
5270 (syms_of_alloc): DEFSYM it.
5271 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5272 (Fmemory_free): Remove.
5273 (syms_of_alloc): Don't defsubr it.
5274 * buffer.c (Fcompact_buffer): Remove.
5275 (syms_of_buffer): Don't defsubr it.
5276
dac616ff
DA
52772012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5278
5279 Make maybe_gc inline.
5280 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5281 * lisp.h (consing_since_gc, gc_relative_threshold)
5282 (memory_full_cons_threshold): Revert declaration.
5283 (maybe_gc): Remove prototype, define as inline.
5284 * alloc.c: Remove old commented-out code.
5285 (consing_since_gc, gc_relative_threshold)
5286 (memory_full_cons_threshold): Revert to global.
5287 (maybe_gc): Remove.
5288
d7ea76b4
DA
52892012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5290
5291 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5292 * lisp.h (build_unibyte_string): New function.
5293 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5294 * sysdep.c, w32fns.c, xfns.c: Use it.
5295 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5296 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5297 Adjust users accordingly.
5298 * font.h (font_open_by_name): Adjust prototype.
5299
765e61e3
DA
53002012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5301
5302 Cleanup calls to Fgarbage_collect.
5303 * lisp.h (maybe_gc): New prototype.
5304 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5305 Remove declarations.
5306 * alloc.c (maybe_gc): New function.
5307 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5308 Make them static.
5309 * bytecode.c (MAYBE_GC): Use maybe_gc.
5310 * eval.c (eval_sub, Ffuncall): Likewise.
5311 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5312 to avoid dependency from auto-save feature.
5313
52b852c7
PE
53142012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5315
5316 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5317 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5318 'for_each_per_buffer_object_at'.
5319 All uses changed. It's better to use upper-case for macros that
5320 cannot be implemented as functions, to give the reader a clue
5321 that they're special.
5322
5db81e33
SM
53232012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5324
5325 * alloc.c (Fgarbage_collect): Tweak docstring.
5326
5b835e1d
DA
53272012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5328
5329 Tweak the value returned from Fgarbage_collect again.
5330 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5331 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5332 Adjust documentation.
5333 (total_vector_bytes): Rename to total_vector_slots, adjust
5334 accounting.
5335 (total_free_vector_bytes): Rename to total_free_vector_slots,
5336 adjust accounting.
5337 (Qstring_bytes, Qvector_slots): New symbols.
5338 (syms_of_alloc): DEFSYM them.
5339
9cd47b72
DA
53402012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5341
5342 Buffer compaction primitive which may be used from Lisp.
5343 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5344 (syms_of_buffer): Register Fcompact_buffer.
5345 * alloc.c (Fgarbage_collect): Use compact_buffer.
5346 * buffer.h (compact_buffer): New prototype.
5347 (struct buffer_text): New member.
5348
d17337e5
DA
53492012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5350
5351 New macro to iterate over all buffers, miscellaneous cleanups.
5352 * lisp.h (all_buffers): Remove declaration.
5353 * buffer.h (all_buffers): Add declaration, with comment.
5354 (for_each_buffer): New macro.
5355 * alloc.c (Fgarbage_collect, mark_object): Use it.
5356 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5357 (init_buffer): Likewise.
5358 * data.c (Fset_default): Likewise.
5359 * coding.c (code_conversion_restore): Remove redundant check
5360 for dead buffer.
5361 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5362
60cfd278
AS
53632012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5364
5365 Fix bug that created negative-length intervals.
5366 * intervals.c (merge_interval_right, merge_interval_left):
5367 Do not zero out this interval if it is absorbed by its children,
5368 as this interval's total length doesn't change in that case. See
5369 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5370
d06714cb
PE
53712012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5372
83713154
PE
5373 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5374 when invoking (make-bool-vector N t) and N is a positive
5375 multiple of 8 -- the last 8 bits were mistakenly cleared.
5376
d06714cb
PE
5377 Remove some struct layout assumptions in bool vectors.
5378 * alloc.c (bool_header_size): New constant.
5379 (header_size, word_size): Move earlier, as they're now used earlier.
5380 Use 'word_size' in a few more places, where it's appropriate.
5381 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5382 padding before the data member of a bool vector.
5383 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5384 than doing the check by hand with an abort ().
5385
464d5a5e
SM
53862012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5387
5fbc0409
SM
5388 * eval.c (Fdefvar): Don't check constants since we only set the var if
5389 it's not yet defined anyway (bug#11904).
5390
464d5a5e
SM
5391 * lisp.h (last_undo_boundary): Declare new var.
5392 * keyboard.c (command_loop_1): Set it.
5393 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5394 were auto-added by the command loop (bug#11774).
5395
8dc2e44a
AS
53962012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5397
5398 * w32font.c (Qsymbol): Remove local definition.
5399 (syms_of_w32font): Don't DEFSYM it.
5400
169925ec
DA
54012012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5402
5403 Fix sweep_vectors to handle large bool vectors correctly.
5404 * alloc.c (sweep_vectors): Account total_vector_bytes for
5405 bool vectors larger than VBLOCK_BYTES_MAX.
5406
5fbfb018
CY
54072012-07-18 Chong Yidong <cyd@gnu.org>
5408
5409 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5410 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5411
3ab6e069
DA
54122012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5413
5414 Return more descriptive data from Fgarbage_collect.
5415 Suggested by Stefan Monnier in
5416 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5417 * alloc.c (bounded_number): New function.
5418 (total_buffers, total_vectors): New variable.
5419 (total_string_size): Rename to total_string_bytes, adjust users.
5420 (total_vector_size): Rename to total_vector_bytes, adjust users.
5421 (sweep_vectors): Account total_vectors and total_vector_bytes.
5422 (Fgarbage_collect): New return value. Adjust documentation.
5423 (gc_sweep): Account total_buffers.
5424 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5425 (VECTOR_SIZE): Remove.
5426 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5427 (Qinterval, Qmisc): New symbols.
5428 (syms_of_data): Initialize them.
5429 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5430 (Qcons, Qbuffer): New declarations.
5431
6d02fe5b
PE
54322012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5433
5434 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5435 Round up, not down. Improve doc.
5436
b7ffe040
DA
54372012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5438
5439 Restore old code in allocate_string_data to avoid Faset breakage.
5440 Reported by Julien Danjou <julien@danjou.info> in
5441 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5442 * alloc.c (allocate_string_data): Restore old code with minor
5443 adjustments, fix comment to explain this subtle issue.
5444
4dc7c8d5
SM
54452012-07-17 Eli Zaretskii <eliz@gnu.org>
5446
5447 Remove FILE_SYSTEM_CASE.
5448 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5449
5450 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5451 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5452 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5453 call-process-region passes it through expand-file-name.
5454
5455 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5456
54572012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5458
5459 Fix crash when creating indirect buffer (Bug#11917)
5460 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5461 Don't handle unbound variables specially if non-zero.
5462 (Fbuffer_local_variables): Pass zero.
5463 (clone_per_buffer_values): Pass non-zero.
5464
54652012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5466
5467 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5468 to make the loop interruptible.
5469
54702012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5471
5472 * gnutls.c (emacs_gnutls_handshake): Only retry if
5473 GNUTLS_E_INTERRUPTED.
5474
cce7fefc
DA
54752012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5476
5477 Cleanup and convert miscellaneous checks to eassert.
5478 * alloc.c (mark_interval): Fix comment, partially rephrase
5479 old comment from intervals.h (see below).
5480 * intervals.c (find_interval, adjust_intervals_for_insertion)
5481 (delete_interval, adjust_intervals_for_deletion)
5482 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5483 Convert to eassert.
5484 (adjust_intervals_for_insertion, make_new_interval):
5485 Remove obsolete and unused code.
5486 * intervals.h (struct interval): Remove obsolete comment.
5487 * textprotp.c (erase_properties): Remove unused code.
5488 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5489 (Fremove_list_of_text_properties): Convert to eassert.
5490
9ea10cc3
CY
54912012-07-17 Chong Yidong <cyd@gnu.org>
5492
5493 * editfns.c (Finsert_char): Doc fix.
5494
3900d5de
DA
54952012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5496
5497 Fix previous change to make Fmemory_free always accurate.
5498 * alloc.c (make_interval): Update total_free_intervals.
5499 (make_float): Likewise for total_free_floats.
5500 (free_cons, Fcons): Likewise for total_free_conses.
5501 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5502 Likewise for total_free_vector_bytes.
5503 (Fmake_symbol): Likewise for total_free_symbols.
5504 (bytes_free): Remove.
5505
7098646f
DA
55062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5507
5508 Simple free memory accounting feature.
5509 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5510 (sweep_vectors): Accumulate size of free vectors.
5511 (Fgarbage_collect): Setup bytes_free.
5512 (Fmemory_free): New function.
5513 (syms_of_alloc): Register it.
5514
22657b40
DA
55152012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5516
5517 Cleanup overlays checking.
5518 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5519 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5520 eassert and OVERLAYP.
5521 (sort_overlays): Change to use OVERLAYP.
5522
ddfc8813
RK
55232012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5524
5525 * editfns.c (Finsert_char): Make it interactive, and make the
5526 second arg optional. Copy interactive spec and docstring from
5527 ucs-insert.
5528
7c26cf3c
PE
55292012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5530
5531 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5532 Unlike the other wrapped functions, fabs has an unspecified
5533 effect on errno.
5534
5d127af9
JD
55352012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5536
5537 * nsterm.m (keyDown): Interpret flags without left/right bits
5538 as the left key (Bug#11670).
5539
6a0dd1d7
DA
55402012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5541
5542 Remove empty and useless init functions.
5543 * lisp.h (init_character_once, init_fns, init_image)
5544 (init_filelock, init_sound): Remove prototype.
5545 * character.c (init_character_once): Remove.
5546 * filelock.c (init_filelock): Likewise.
5547 * fns.c (init_fns): Likewise.
5548 * image.c (init_image): Likewise.
5549 * sound.c (init_sound): Likewise.
5550 * emacs.c (main): Adjust accordingly.
5551
7a6136fd
DA
55522012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5553
5554 * gtkutil.h: Tiny cleanups.
5555 (use_old_gtk_file_dialog): Remove useless declaration.
5556 (xg_uses_old_file_dialog): Add suggested const attribute.
5557
ce811ad9
EZ
55582012-07-15 Eli Zaretskii <eliz@gnu.org>
5559
5560 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5561 (bidi_paragraph_init): Use it to limit search forward for a strong
5562 directional character in abnormally large paragraphs full of
5563 neutral or weak characters. (Bug#11943)
5564
c9adfeaa
SF
55652012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5566
5567 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5568 the toolbar (Bug#9451).
5569 (xg_make_tool_item): Give the widget event box a transparent
5570 background.
5571
fff62aa9
DA
55722012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5573
5574 Cleanup basic allocation variables and functions.
5575 * alloc.c (ignore_warnings, init_intervals, init_float)
5576 (init_cons, init_symbol, init_marker): Remove.
5577 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5578 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5579 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5580 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5581 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5582 (staticidx, init_alloc_once, init_strings, free_ablock):
5583 Remove redundant initialization.
5584 * fns.c (init_weak_hash_tables): Remove.
5585 * lisp.h (init_weak_hash_tables): Remove prototype.
5586
9730daca
DA
55872012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5588
5589 Use zero_vector where appropriate.
5590 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5591 accordingly.
5592 * lisp.h (zero_vector): New declaration.
5593 * font.c (null_vector): Remove.
5594 (syms_of_font): Remove initialization and staticpro.
5595 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5596 * keymap.c (Faccessible_keymaps): Likewise.
5597
2e2d2a13
LL
55982012-07-15 Leo Liu <sdl.web@gmail.com>
5599
5600 * fringe.c: Fix typo in comments.
5601
cd276f6e
LL
56022012-07-14 Leo Liu <sdl.web@gmail.com>
5603
5604 * fringe.c: Add a new bitmap exclamation-mark.
5605
5a1131d9
EZ
56062012-07-14 Eli Zaretskii <eliz@gnu.org>
5607
5608 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5609
5610 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5611 (HAVE_MENUS): Don't define, defined by editing config.in with
5612 msdos/sed2v2.inp.
5613 (GMALLOC_INHIBIT_VALLOC): Don't define.
5614 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5615
22e983b7
JB
56162012-07-14 Juanma Barranquero <lekktu@gmail.com>
5617
5618 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5619
5b3f250f
GM
56202012-07-14 Glenn Morris <rgm@gnu.org>
5621
5622 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5623 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5624 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5625
33d63ff4
GM
56262012-07-13 Glenn Morris <rgm@gnu.org>
5627
5b633342
GM
5628 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5629
33d63ff4
GM
5630 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5631 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5632
b55b9f85
JD
56332012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5634
0dc8cf50
JD
5635 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5636 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5637 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5638 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5639 where appropriate.
5640 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5641 as boolean expression.
5642 (x_set_window_size): Remove unused variable toolbar.
5643 (ns_get_color_default, ns_mod_to_lisp): Remove.
5644 (ns_mouse_position): Remove unused variables xchar and ychar.
5645 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5646 (ns_set_vertical_scroll_bar): Remove unused variable count.
5647 (ns_delete_terminal): Remove unused variable i.
5648 (ns_term_init): Remove unused variables r, g and b.
5649 (mouseDown): Remove unused variable window.
5650 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5651 (initFrameFromEmacs): Remove unused variable vbextra.
5652 (mouseEntered): Remove unused variables p and dpyinfo.
5653 (mouseExited): Remove unused variables p and r.
5654 (ns_define_frame_cursor, ns_clear_frame_area)
5655 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5656 (menuDown): Assign [sender tag] to variable and cast the variable.
5657
5658 * nsterm.h (menuDown): Add id as type to argument sender.
5659 (ns_display_info_for_name): Add Lisp_Object argument.
5660 (ns_term_init): Add Lisp_Object argument.
5661 (ns_map_event_to_object): Add void argument.
5662 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5663 prototype with arguments and only declare if __OBJC__.
5664 (nxatoms_of_nsselect): Add void argument.
5665 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5666 (ns_alloc_autorelease_pool): Add void argument.
5667 (ns_release_autorelease_pool): Add void* argument.
5668 (ns_get_defaults_value): Add const char* argument.
5669
5670 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5671 (initFromContents): Use SSDATA where appropriate.
5672 (ns_update_menubar): Add braces to ambigous if-else.
5673 (initWithTitle): Put () around assignment in if statement.
5674 (ns_menu_show): Remove unused variables window and keymap.
5675 (update_frame_tool_bar): Remove unused variable selected_p.
5676 (initWithContentRect): Remove unused variable this_cmd_name.
5677
5678 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5679 appropriate.
5680 (setXBMColor): Remove unused variable len.
5681 (setPixmapData): Put () around assignment in loop statement.
5682
5683 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5684 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5685 where appropriate.
5686 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5687 around assignment in loop statement.
5688 (nsfont_open): Remove unused variable i.
5689 (nsfont_open): Remove unused variable len.
5690 (nsfont_draw): Remove unused variable cs.
5691
5692 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5693 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5694 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5695 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5696 (Fns_font_name, Fns_perform_service)
5697 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5698 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5699 (ns_set_name): Remove unused variable view.
5700 (x_set_menu_bar_lines): Remove unused variable olines.
5701 (x_set_tool_bar_lines): Remove unused variable root_window.
5702 (Fns_list_colors): Put () around assignment in while statement.
5703 (Fns_perform_service): Remove unused variable len.
5704 (Fns_display_usable_bounds): Remove unused variable top.
5705 (syms_of_nsfns): Remove unused variable i.
5706
b55b9f85
JD
5707 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5708 memcpy (Bug#11907).
5709
ed9265fc 57102012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
5711
5712 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5713 and free it with DestroyExceptionInfo (Bug#11558).
5714
ef099b57
JB
57152012-07-13 Juanma Barranquero <lekktu@gmail.com>
5716
5717 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5718 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5719 Set here, not in nt/config.nt.
5720
ea814a5d
EZ
57212012-07-13 Eli Zaretskii <eliz@gnu.org>
5722
5723 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5724 cursor overflow into the last glyph on display line when the right
5725 fringe is off. (Bug#11832)
5726
1a952767
PE
57272012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5728
5729 * xdisp.c (produce_special_glyphs): Now static.
5730 * dispextern.h (produce_special_glyphs): Remove decl.
5731
983188fd
GM
57322012-07-13 Glenn Morris <rgm@gnu.org>
5733
8d7c7eed 5734 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
5735 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5736
983188fd
GM
5737 * s/usg5-4-common.h (USG, USG5):
5738 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5739 * s/sol2-6.h (SOLARIS2):
5740 * s/irix6-5.h (IRIX6_5):
5741 * s/hpux10-20.h (USG, USG5, HPUX):
5742 * s/gnu-linux.h (USG, GNU_LINUX):
5743 * s/freebsd.h (BSD_SYSTEM):
5744 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5745 * s/cygwin.h (CYGWIN):
5746 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5747 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5748
d1e68667 57492012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
5750
5751 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 5752
6de0e799
GM
57532012-07-13 Glenn Morris <rgm@gnu.org>
5754
739ae010
GM
5755 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5756
dbee5793
GM
5757 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5758
6de0e799
GM
5759 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5760 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5761
b82da769
GM
57622012-07-12 Glenn Morris <rgm@gnu.org>
5763
4fae5a7a 5764 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
5765
5766 * process.c (init_process_emacs): Rename from init_process.
5767 The old name is also the name of a Mach system call.
5768 * lisp.h, emacs.c: Update for this name change.
5769 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5770 longer needed.
5771
5a979817
EZ
57722012-07-12 Eli Zaretskii <eliz@gnu.org>
5773
5774 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5775 memmove call that removes glyphs covered by the left truncation
5776 glyph. Improve commentary.
5777 (display_line): Fix display of continuation glyphs on GUI frames
5778 when the right fringe is turned off and variable-size fonts are
5779 used in the window. Move the code that appends a stretch glyph to
5780 produce_special_glyphs, so that it could be used for truncation
5781 and continuation glyphs alike.
5782 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5783 glyph of a suitably computed width, to align the special glyphs at
5784 the window margin. Code moved from display_line. (Bug#11832)
5785
3e91a053
GM
57862012-07-12 Glenn Morris <rgm@gnu.org>
5787
ba9e4b84
GM
5788 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5789
5790 * s/gnu-linux.h, s/hpux10-20.h:
5791 Do not unconditionally define HAVE_XRMSETDATABASE.
5792
3e91a053
GM
5793 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5794
b300b1f4
PE
57952012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5796
5797 Fix typos that broke OS X build.
5798 Reported by Randal L. Schwartz in
5799 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5800 * nsterm.m (ns_timeout): Add missing local decl.
5801 (ns_get_color): snprintf -> sprintf, to fix typo.
5802
6e777848
GM
58032012-07-12 Glenn Morris <rgm@gnu.org>
5804
3f922c37
GM
5805 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5806 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5807 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5808 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5809
0ab7b23a
GM
5810 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5811 Move PTY_OPEN to configure.
5812
6e777848
GM
5813 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5814 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5815 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5816
4a7edc24
DA
58172012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5818
5819 Use empty_unibyte_string where applicable.
5820 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5821 * lread.c (read1): Likewise.
5822 * xsettings.c (syms_of_xsettings): Likewise.
5823
308aab79
GM
58242012-07-12 Glenn Morris <rgm@gnu.org>
5825
42bd1719
GM
5826 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5827 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
5828 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5829 * s/hpux10-20.h (RUN_TIME_REMAP):
5830 * s/bsd-common.h (TABDLY): Move to configure.
5831
5832 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5833
5834 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5835
ea0bbd17 5836 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 5837 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
5838
5839 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 5840
308aab79
GM
5841 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5842 * s/template.h: Move NARROWPROTO to configure.
5843
ee1cf5cf
GM
58442012-07-11 Glenn Morris <rgm@gnu.org>
5845
30fe9bf4
GM
5846 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5847 unused since 2011-01-17 change to systty.h.
5848
ee1cf5cf
GM
5849 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5850 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5851 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5852
63e47e07
PE
58532012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5856
c43fb4c3
GM
58572012-07-11 Glenn Morris <rgm@gnu.org>
5858
5859 * s/darwin.h, s/gnu-linux.h, s/template.h:
5860 Move INTERRUPT_INPUT to configure.
5861
e8df9267
DA
58622012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5863
5864 Minor adjustments to interning code.
5865 * lisp.h (intern, intern_c_string): Redefine as static inline
5866 wrappers for intern_1 and intern_c_string_1, respectively.
5867 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
5868 * lread.c (intern_1, intern_c_string_1, oblookup):
5869 Simplify Vobarray checking.
e8df9267
DA
5870 * font.c (font_intern_prop): Likewise. Adjust comment.
5871 * w32font.c (intern_font_name): Likewise.
5872
34348bd4
AS
58732012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5874
d96a1e0c
AS
5875 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5876
34348bd4
AS
5877 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5878 of Fcar/Fcdr if possible.
5879 * font.c (check_otf_features): Likewise.
5880 * fontset.c (Fnew_fontset): Likewise.
5881 * gnutls.c (Fgnutls_boot): Likewise.
5882 * minibuf.c (read_minibuf): Likewise.
5883 * msdos.c (IT_set_frame_parameters): Likewise.
5884 * xmenu.c (Fx_popup_dialog): Likewise.
5885 * w32menu.c (Fx_popup_dialog): Likewise.
5886
c8add24e
GM
58872012-07-11 Glenn Morris <rgm@gnu.org>
5888
4b575b3c
GM
5889 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5890 since nothing has defined it on these platforms.
5891
09f4e3b0
GM
5892 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5893 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5894
172bedef
GM
5895 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5896 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5897 Move CLASH_DETECTION to configure.
5898
249685df
GM
5899 * s/gnu.h: Remove file, which is now empty.
5900
c8add24e
GM
5901 * s/gnu.h, s/gnu-linux.h:
5902 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5903
b41253a3
JW
59042012-07-11 John Wiegley <johnw@newartisans.com>
5905
5906 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5907 function attribute, so we only use it if it exists in the
5908 compiler.
5909
d923b542
DA
59102012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5911
5912 Avoid call to strlen in fast_c_string_match_ignore_case.
5913 * search.c (fast_c_string_match_ignore_case): Change to use
5914 length argument. Adjust users accordingly.
5915 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5916
5ebbef1d
PE
59172012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5918
bb352260
PE
5919 Assume mkdir, rmdir.
5920 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5921 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5922
57054ddd
PE
5923 Assume rename.
5924 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5925
b747d3f7
PE
5926 Assume perror.
5927 * s/hpux10-20.h (HAVE_PERROR): Remove.
5928 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5929 Remove dummy definition, as this problem was obsolete long ago.
5930
5ebbef1d
PE
5931 Assume strerror.
5932 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5933
984e7f30
DA
59342012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5935
5936 Avoid calls to strlen in font processing functions.
5937 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
5938 (font_open_by_name): Change to use length argument.
5939 Adjust users accordingly.
d923b542
DA
5940 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5941 Adjust prototypes.
5942 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5943 Change to return ptrdiff_t.
984e7f30
DA
5944 (xfont_list_pattern, xfont_match): Use length returned by
5945 xfont_decode_coding_xlfd.
5946 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5947
20e94fdd
GM
59482012-07-11 Glenn Morris <rgm@gnu.org>
5949
9d596af3
GM
5950 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5951 Move DONT_REOPEN_PTY to configure.
5952
20e94fdd
GM
5953 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5954 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5955
e99a530f
PE
59562012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5957
22ffb973
PE
5958 Remove "#define unix" that is no longer needed (Bug#11905).
5959 * s/aix4-2.h (unix): Remove; no longer needed.
5960
e9a9ae03
PE
5961 EMACS_TIME simplification (Bug#11875).
5962 This replaces macros (which typically do not work in GDB)
5963 with functions, typedefs and enums, making the code easier to debug.
5964 The functional style also makes code easier to read and maintain.
5965 * systime.h: Include <sys/time.h> on all hosts, not just if
5966 WINDOWSNT, since 'struct timeval' is needed in general.
5967 (EMACS_TIME): Now a typedef, not a macro.
5968 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5969 not macros.
5970 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5971 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5972 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5973 (EMACS_TIME_LE): Now functions, not macros.
5974 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5975 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5976 which are not functions. All uses rewritten to use:
5977 (make_emacs_time): New function.
5978 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5979 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5980 not functions. All uses rewritten to use the following, respectively:
5981 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5982 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 5983 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
5984 * fileio.c (Fcopy_file):
5985 * xterm.c (XTflash): Get the current time closer to when it's used.
5986 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5987
ffacb126
PE
5988 * bytecode.c (targets): Suppress -Woverride-init warnings.
5989
e99a530f
PE
5990 Simplify by avoiding confusing use of strncpy etc.
5991 * doc.c (Fsnarf_documentation):
5992 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5993 * frame.c (Fmake_terminal_frame):
5994 * gtkutil.c (get_utf8_string):
5995 * lread.c (openp):
5996 * nsmenu.m (ns_update_menubar):
5997 * regex.c (regerror):
5998 Prefer memcpy to strncpy and strncat when either will do.
5999 * fileio.c (Fsubstitute_in_file_name):
6000 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6001 (menu_separator_name_p):
6002 * nsmenu.m (ns_update_menubar):
6003 Prefer memcmp to strncmp when either will do.
6004 * nsterm.m: Include <ftoastr.h>.
6005 (ns_get_color):
6006 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6007 Prefer snprintf to strncpy.
6008 * nsterm.m (ns_term_init):
6009 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6010 * nsterm.m (ns_term_init):
6011 Avoid the need for strncpy, by using build_string or
6012 make_unibyte_string directly. Use dtoastr, not snprintf.
6013 * process.c (Fmake_network_process): Diagnose service names that
6014 are too long, rather than silently truncating them or creating
6015 non-null-terminated names.
6016 (Fnetwork_interface_info): Likewise, for interface names.
6017 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6018 Prefer sprintf to strncat.
6019 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6020 Prefer vsnprintf to vsprintf + strncpy.
6021
c59592b3
GM
60222012-07-10 Glenn Morris <rgm@gnu.org>
6023
6024 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6025 Clarify fallback case.
6026
7d7bbefd
DA
60272012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6028
6029 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6030 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6031 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 6032 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
6033 where argument type is known to be a Lisp_Cons.
6034
3a4c8000
TT
60352012-07-10 Tom Tromey <tromey@redhat.com>
6036
6037 * bytecode.c (BYTE_CODE_THREADED): New macro.
6038 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6039 (enum byte_code_op): New type.
6040 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6041 (exec_byte_code): Use them. Use token threading when applicable.
6042
2a0213a6
DA
60432012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6044
6045 Optimize pure C strings initialization.
6046 * lisp.h (make_pure_string): Fix prototype.
6047 (build_pure_c_string): New function, defined as static inline. This
6048 provides a better opportunity to optimize away calls to strlen when
6049 the function is called with compile-time constant argument.
6050 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6051 argument, adjust users accordingly. Use build_pure_c_string where
6052 appropriate.
6053 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6054 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6055 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6056
cb1caeaf
DA
60572012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6058
6059 Avoid calls to strlen in miscellaneous functions.
6060 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6061 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6062 * lread.c (openp): Likewise.
6063
c293e30c
DA
60642012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6065
6066 Avoid calls to strlen in path processing functions.
6067 * fileio.c (file_name_as_directory): Add comment. Change to add
6068 srclen argument and return the length of result. Adjust users
6069 accordingly.
6070 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
6071 swap 1st and 2nd arguments to obey the common convention.
6072 Adjust users accordingly.
c293e30c
DA
6073 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6074
9e059e3f
GM
60752012-07-10 Glenn Morris <rgm@gnu.org>
6076
d02eb359
GM
6077 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6078 Move PENDING_OUTPUT_COUNT definition to configure.
6079
882cf227
GM
6080 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6081 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6082 * s/gnu.h (DATA_START): Move definitions to configure.
6083
af6e839f
GM
6084 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6085 We include usg5-4-common.h, which defines them both.
6086
40289a12
GM
6087 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6088 O_RDONLY already includes it).
6089
9e059e3f
GM
6090 Stop ns builds setting the EMACSLOADPATH environment variable.
6091 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6092 Now it does not set EMACSLOADPATH, just returns the load-path string.
6093 * nsterm.h: Update accordingly.
6094 * lread.c [HAVE_NS]: Include nsterm.h.
6095 (init_lread) [HAVE_NS]: Use ns_load_path.
6096 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6097
7c4e8ec0
GM
60982012-07-09 Glenn Morris <rgm@gnu.org>
6099
d4f600ff
GM
6100 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6101 since the included bsd-common.h does so.
6102
cbb31951
GM
6103 Stop ns builds setting the EMACSPATH environment variable.
6104 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6105 (ns_init_paths): Do not set EMACSPATH.
6106 * nsterm.h (ns_exec_path): Add it.
6107 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6108 Use ns_exec_path.
6109
7c4e8ec0
GM
6110 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6111
26bccfae
PE
61122012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6113
a0bee46f
PE
6114 * process.c (wait_reading_process_output): 'waitchannels' was unset
6115 when read_kbd || !NILP (wait_for_cell); fix this.
6116
5994c183
PE
6117 Add GCC-style 'const' attribute to functions that can use it.
6118 * character.h (char_resolve_modifier_mask):
6119 * keyboard.h (make_ctrl_char):
6120 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6121 (init_character_once, next_almost_prime, init_fns, init_image)
6122 (flush_pending_output, init_sound):
6123 * mem-limits.h (start_of_data):
6124 * menu.h (finish_menu_items):
6125 Add ATTRIBUTE_CONST.
6126 * emacs.c (DEFINE_DUMMY_FUNCTION):
6127 Declare the dummy function with ATTRIBUTE_CONST.
6128 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6129 Add decls with ATTRIBUTE_CONST.
6130
26bccfae
PE
6131 Minor improvements to make_formatted_string.
6132 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6133 where int is good enough, as vsprintf returns an int.
6134 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6135
a8290ec3
DA
61362012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6137
6138 Use make_formatted_string to avoid double length calculation.
6139 * lisp.h (make_formatted_string): New prototype.
6140 * alloc.c (make_formatted_string): New function.
6141 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 6142 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
6143 * editfns.c (Fcurrent_time_zone): Likewise.
6144 * filelock.c (get_boot_time): Likewise.
6145 * frame.c (make_terminal_frame, set_term_frame_name)
6146 (x_report_frame_params): Likewise.
6147 * image.c (gs_load): Likewise.
6148 * minibuf.c (get_minibuffer): Likewise.
6149 * msdos.c (dos_set_window_size): Likewise.
6150 * process.c (make_process): Likewise.
6151 * xdisp.c (ensure_echo_area_buffers): Likewise.
6152 * xsettings.c (apply_xft_settings): Likewise.
6153
d01ba2f1
GM
61542012-07-09 Glenn Morris <rgm@gnu.org>
6155
6156 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6157 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6158 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6159 * nsterm.h (ns_etc_directory): Add it.
6160 * callproc.c [HAVE_NS]: Include nsterm.h.
6161 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6162
f1f924b6
DA
61632012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6164
6165 Move marker debugging code under MARKER_DEBUG.
6166 * marker.c (MARKER_DEBUG): Move marker debugging code under
6167 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6168 for bootstrap with --enable-checking (~3x slowdown reported
6169 by Juanma Barranquero <lekktu@gmail.com>).
6170 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6171
ab531b66
PE
61722012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6173
6174 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6175 See <http://bugs.gnu.org/11825#29>.
6176
c4b3bc8a
EZ
61772012-07-08 Eli Zaretskii <eliz@gnu.org>
6178
6179 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6180 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
6181 (display_line): Add commentary about displaying truncation glyphs
6182 on GUI frames.
6183 (produce_special_glyphs): Move here from term.c.
6184
6185 * term.c (produce_special_glyphs): Move to xdisp.c.
6186
6187 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6188 section.
c4b3bc8a 6189
b676b881
AS
61902012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6191
f17c5273
AS
6192 * xdisp.c (display_line): Avoid warning about implicit declaration
6193 of FRAME_FONT.
6194
298819b9
AS
6195 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6196
b676b881
AS
6197 * lisp.h: Remove empty conditional.
6198
6045c4fd
PE
61992012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6200
b3350bf9
PE
6201 * lread.c (load_path_check): Now static.
6202
6045c4fd
PE
6203 Fix some minor --with-ns problems found by static checking.
6204 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6205 (x_set_font) [!HAVE_X_WINDOWS]:
6206 * image.c (xpm_load_image) [HAVE_NS]:
6207 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6208 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6209 Remove unused local.
6210 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6211 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6212 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6213 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6214 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6215 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6216 Fix pointer signedness problem.
6217 * xfaces.c (FRAME_X_FONT_TABLE):
6218 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6219
929e7845
GM
62202012-07-07 Glenn Morris <rgm@gnu.org>
6221
6222 * lread.c (load_path_check): New function, split from init_lread.
6223 (init_lread): Reorganize. Motivation:
6224 If EMACSLOADPATH is set, check/warn about that rather than the
6225 defaults, which we are not going to use. Hence we can remove
6226 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6227 Don't warn if site-lisp directories are missing.
6228 If not installed, start from a blank load-path, since
6229 PATH_LOADSEARCH refers to the eventual installation directories.
6230
58dd0aa4
EZ
62312012-07-07 Eli Zaretskii <eliz@gnu.org>
6232
6233 Support truncation and continuation glyphs on GUI frames, when
6234 fringes are disabled. (Bug#11832)
6235 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
6236 continuation glyphs even if on GUI frames.
6237 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
6238 or both, are absent.
6239 (start_display, move_it_in_display_line_to): Handle the case of a
6240 GUI frame without a fringe to display continuation or truncation
6241 glyphs.
6242 (insert_left_trunc_glyphs): Support GUI frames: make sure
6243 truncation glyphs overwrite enough glyphs from the current line to
6244 have sufficient space in pixels.
6245 (display_line): Support truncation and continuation glyphs on GUI
6246 frames. If some spare pixels are left on the line after inserting
6247 the truncation glyphs, fill that space with a stretch glyph of a
6248 suitably computed width.
6249
6250 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6251 produce_glyphs, to support GUI sessions.
6252
31571fd7
PE
62532012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6254
5a16b9bc
PE
6255 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6256
f3047c75
PE
6257 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6258
31571fd7
PE
6259 Do not require float-time's arg to fit in time_t (Bug#11825).
6260 This works better on hosts where time_t is unsigned, and where
6261 float-time is applied to the (negative) difference between two times.
6262 * editfns.c (decode_time_components): Last arg is now double *,
6263 not int *, and means to store all the result as a double, without
6264 worrying about whether the seconds part fits in time_t.
6265 All callers changed.
6266 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6267 All callers changed.
6268 (Ffloat_time): Do not fail merely because the specified time falls
6269 outside of time_t range.
6270
4516fbef
GM
62712012-07-07 Glenn Morris <rgm@gnu.org>
6272
6273 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6274 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6275 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6276
07adc2c6
JB
62772012-07-07 Juanma Barranquero <lekktu@gmail.com>
6278
6279 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6280 Update dependencies.
6281
6282 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6283
fd573f31
PE
62842012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6285
fee5959d
PE
6286 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6287 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6288 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6289 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6290 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6291 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6292
fd573f31
PE
6293 * xfont.c (compare_font_names): Redo to omit the need for casts.
6294
ddadbc0e
AS
62952012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6296
fca8d6b6
AS
6297 * xfns.c (Fx_change_window_property): Doc fix.
6298 * w32fns.c (Fx_change_window_property): Doc fix.
6299
ddadbc0e
AS
6300 * w32fns.c (Fx_window_property): Accept the same arguments as the
6301 X Windows version. Doc fix.
6302 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6303
ed9265fc 63042012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
6305 Eli Zaretskii <eliz@gnu.org>
6306
6307 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6308 Windows-specific code from nt/config.nt moved here.
6309 Obsolete settings removed.
6310
216ee680
PE
63112012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6312
6313 * process.c: Avoid unnecessary calls to gettime.
6314 (wait_reading_process_output): Don't get the time of day
6315 when gobbling data immediately and not waiting, as there's no need
6316 for it in that case. This removes a FIXME.
6317
bdd091e4
JD
63182012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6319
6320 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6321 is defined (Bug#11768).
6322
9d44f8ce
DA
63232012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6324
6325 Fix marker debugging code.
6326 * marker.c (byte_char_debug_check): Do not perform the check
6327 if buffer is not multibyte.
090bd7cb
JB
6328 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6329 Call byte_char_debug_check with correct arguments.
9d44f8ce 6330
90fc4786
DA
63312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6332
6333 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
6334 * marker.c (byte_char_debug_check, count_markers):
6335 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
6336 (byte_debug_flag): Remove.
6337 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6338 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6339
7b7ae965
DA
63402012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6341
4e57b342
DA
6342 Avoid code repetition in marker-related functions.
6343 * marker.c (attach_marker): New function.
6344 (Fset_marker, set_marker_restricted, set_marker_both)
6345 (set_marker_restricted_both): Use it.
6346 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6347 Consistently rename charno to charpos.
6348 (marker_position): Add eassert.
6349 (marker_byte_position): Convert to eassert.
6350
63512012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6352
6353 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 6354 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 6355 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 6356
657924ff
DA
63572012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6358
6359 Introduce fast path for the widely used marker operation.
6360 * alloc.c (build_marker): New function.
6361 * lisp.h (build_marker): New prototype.
6362 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6363 * composite.c (autocmp_chars): Likewise.
6364 * editfns.c (buildmark): Remove.
6365 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6366 (save_restriction_save): Use build_marker.
6367 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6368 * window.c (save_window_save): Likewise.
6369
041a49a6
DA
63702012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6371
6372 Do not use Fdelete_overlay in delete_all_overlays
6373 to avoid redundant calls to unchain_overlay.
6374 * buffer.c (drop_overlay): New function.
6375 (delete_all_overlays, Fdelete_overlay): Use it.
6376 * minibuf.c (get_minibuffer): Fix comment.
6377
7dca65a4
PE
63782012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6379
6380 Port to OpenBSD 5.1 amd64.
6381 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6382 This is needed for OpenBSD, and should be harmless on all BSD systems.
6383 Also, include <sys/sysctl.h>, as it should be available on all
6384 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6385 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6386 use p_pid member, not kp_proc.pid.
6387
8eb876e2
GM
63882012-07-06 Glenn Morris <rgm@gnu.org>
6389
6390 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6391
38182d90
PE
63922012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6393
6394 More xmalloc and related cleanup.
6395 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6396 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6397 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6398 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6399 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6400 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6401 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6402 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6403 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6404 * xterm.c:
6405 Omit needless casts involving void * pointers and allocation.
6406 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6407 as the former is more robust if P's type is changed.
6408 Prefer xzalloc to xmalloc + memset 0.
6409 Simplify malloc-or-realloc to realloc.
6410 Don't worry about xmalloc returning a null pointer.
6411 Prefer xstrdup to xmalloc + strcpy.
6412 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6413 growing it.
6414 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6415 alloca of a constant.
6416
6dd5a677
EZ
64172012-07-05 Eli Zaretskii <eliz@gnu.org>
6418
6419 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6420 hscroll is larger than the line width. Fixes long and futile
6421 looping inside extend_face_to_end_of_line (on a TTY) producing
6422 glyphs that are not needed and thrown away.
6423
6b312f0f
DA
64242012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6425
6426 * marker.c (set_marker_restricted_both): Simplify by using
6427 clip_to_bounds.
6428
f520ef9b
PE
64292012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6432
383b7c95
JD
64332012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6434
6435 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6436 not defined (Bug#11768).
6437 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6438 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6439 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6440 followed by gtk_box_set_homogeneous (Bug#11768).
6441 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
6442 (update_theme_scrollbar_width, xg_create_scroll_bar):
6443 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
6444 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6445 (is_box_type): New function (Bug#11768).
6446 (xg_tool_item_stale_p): Call is_box_type.
5293d758 6447 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
6448 with default display (Bug#11768).
6449
d6e7bf45
EZ
64502012-07-05 Eli Zaretskii <eliz@gnu.org>
6451
6452 * xdisp.c (window_hscroll_limited): New function.
6453 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6454 coordinates when window's hscroll is set to insanely large
6455 values. (Bug#11857)
6456
431391ec
JB
64572012-07-05 Juanma Barranquero <lekktu@gmail.com>
6458
6459 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6460 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6461
23f86fce
DA
64622012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6463
6464 Cleanup xmalloc.
6465 * lisp.h (xzalloc): New prototype. Omit needless casts.
6466 * alloc.c (xzalloc): New function. Omit needless casts.
6467 * charset.c: Omit needless casts. Convert all calls to
6468 xmalloc with following memset to xzalloc.
6469 * dispnew.c: Likewise.
6470 * fringe.c: Likewise.
6471 * image.c: Likewise.
6472 * sound.c: Likewise.
6473 * term.c: Likewise.
6474 * w32fns.c: Likewise.
6475 * w32font.c: Likewise.
6476 * w32term.c: Likewise.
6477 * xfaces.c: Likewise.
6478 * xfns.c: Likewise.
6479 * xterm.c: Likewise.
6480 * atimer.c: Omit needless casts.
6481 * buffer.c: Likewise.
6482 * callproc.c: Likewise.
6483 * ccl.c: Likewise.
6484 * coding.c: Likewise.
6485 * composite.c: Likewise.
6486 * doc.c: Likewise.
6487 * doprnt.c: Likewise.
6488 * editfns.c: Likewise.
6489 * emacs.c: Likewise.
6490 * eval.c: Likewise.
6491 * filelock.c: Likewise.
6492 * fns.c: Likewise.
6493 * gtkutil.c: Likewise.
6494 * keyboard.c: Likewise.
6495 * lisp.h: Likewise.
6496 * lread.c: Likewise.
6497 * minibuf.c: Likewise.
6498 * msdos.c: Likewise.
6499 * print.c: Likewise.
6500 * process.c: Likewise.
6501 * region-cache.c: Likewise.
6502 * search.c: Likewise.
6503 * sysdep.c: Likewise.
6504 * termcap.c: Likewise.
6505 * terminal.c: Likewise.
6506 * tparam.c: Likewise.
6507 * w16select.c: Likewise.
6508 * w32.c: Likewise.
6509 * w32reg.c: Likewise.
6510 * w32select.c: Likewise.
6511 * w32uniscribe.c: Likewise.
6512 * widget.c: Likewise.
6513 * xdisp.c: Likewise.
6514 * xmenu.c: Likewise.
6515 * xrdb.c: Likewise.
6516 * xselect.c: Likewise.
6517
0497dc44
PE
65182012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6519
6520 * fileio.c (time_error_value): Check the right error number.
6521 Problem reported by Troels Nielsen in
6522 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6523
356e7178
PE
65242012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6525
4e71fd89
PE
6526 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6527 This should be fixed in a better way; see Eli Zaretskii in
6528 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6529 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6530
f0941253
PE
6531 * fileio.c (time_error_value): Rename from special_mtime.
6532 The old name's problems were noted by Eli Zaretskii in
6533 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6534
065c9eb4
PE
6535 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6536 This variable's comment says Emacs needs at least one GDB-visible
6537 symbol of type enum pvec_type, to work around GDB problems.
6538 The symbol's value doesn't matter.
6539
356e7178
PE
6540 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6541 that causes compilation to fail on pre-C99 compilers.
6542
ed9265fc 65432012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6544
6545 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6546 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6547
3884d954
DA
65482012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6549
d209e2fb 6550 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6551 headers for buffer_defaults and buffer_local_symbols.
6552 Reported by Juanma Barranquero <lekktu@gmail.com>.
6553
ee28be33
SM
65542012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6555
6556 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6557 * lisp.h (enum pvec_type): Use fewer bits.
6558 (PSEUDOVECTOR_SIZE_BITS): New constant.
6559 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6560 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6561 change in pvec_type.
6562 (PSEUDOVECTOR_TYPEP): New macro.
6563 (TYPED_PSEUDOVECTORP): Use it.
6564 * fns.c (internal_equal): Adapt code to extract pvectype.
6565 * emacs.c (gdb_pvec_type): Update type.
6566 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6567 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6568 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6569 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6570 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6571 abusing vector->header.next.nbytes.
6572 (live_vector_p): Use PVEC_TYPE.
6573 (mark_object): Adapt code to extract pvectype. Use switch.
6574
c7f2cd7f
PE
65752012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6576
6577 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6578 Tighten new eassert a bit.
6579
8ce70ed2
DA
65802012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6581
6582 Fix compilation with --enable-gcc-warnings and -O1
6583 optimization level.
6584 * doprnt.c (doprnt): Change type of tem to int, initialize
6585 to avoid compiler warning. Add eassert.
6586 * search.c (simple_search): Initialize match_byte to avoid
6587 compiler warning. Add eassert.
6588
dea7f1e5
PE
65892012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6590
24a212eb
PE
6591 Avoid weird behavior with large horizontal scrolls.
6592 Without this change, for example, large hscroll values would
6593 mess up Emacs's display on Fedora 15 x86, presumably due to
6594 overflows in int calculations in the display code.
6595 Also, if buffers had long lines, Emacs would freeze.
6596 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6597 (set_window_hscroll): New function, containing the old guts of
6598 Fset_window_hscroll. Return the clipped value.
6599 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6600 This avoids the need to check against PTRDIFF_MAX.
6601
dea7f1e5
PE
6602 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6603
76046526
DA
66042012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6605
6606 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6607
39adff0d
PE
66082012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6609
63807d47
PE
6610 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6611 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6612 since GCC 4.4.6 issues a bogus warning for them.
6613
39adff0d
PE
6614 Fix bugs in file timestamp newness comparisons.
6615 * fileio.c (Ffile_newer_than_file_p):
6616 * lread.c (Fload): Use full timestamp resolution of files,
6617 not just the 1-second resolution, so that files that are only
6618 slightly newer still count as newer.
6619 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6620 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6621
dbeed9a6
PE
66222012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6623
6624 * fileio.c: Improve handling of file time marker. (Bug#11852)
6625 (special_mtime): New function.
6626 (Finsert_file_contents, Fverify_visited_file_modtime):
6627 Use it to set special mtime values consistently.
6628
636334d6
AS
66292012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6630
6631 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6632 marker for non-existing file. (Bug#11852)
6633
e2017fe2
GM
66342012-07-03 Glenn Morris <rgm@gnu.org>
6635
6636 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6637 and did not make it into globals.h).
6638
404dbd37
TT
66392012-07-03 Tom Tromey <tromey@redhat.com>
6640
6641 * window.c (Fset_window_margins, Fset_window_fringes)
6642 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6643 * textprop.c (Fprevious_property_change): No longer static.
6644 * syntax.c (Fsyntax_table_p): No longer static.
6645 * process.c (Fget_process, Fprocess_datagram_address): No longer
6646 static.
6647 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6648 * keyboard.c (Fcommand_execute): No longer static.
6649 Remove EXFUN.
6650 * insdel.c (Fcombine_after_change_execute): No longer static.
6651 * image.c (Finit_image_library): No longer static.
6652 * fileio.c (Fmake_symbolic_link): No longer static.
6653 * eval.c (Ffetch_bytecode): No longer static.
6654 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
6655 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6656 No longer static.
404dbd37
TT
6657 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6658 static.
6659 * dired.c (Ffile_attributes): No longer static.
6660 * composite.c (Fcomposition_get_gstring): No longer static.
6661 * callproc.c (Fgetenv_internal): No longer static.
6662
6663 * ccl.h: Remove EXFUNs.
6664 * buffer.h: Remove EXFUNs.
6665 * dispextern.h: Remove EXFUNs.
6666 * intervals.h: Remove EXFUNs.
6667 * fontset.h: Remove EXFUN.
6668 * font.h: Remove EXFUNs.
6669 * dosfns.c (system_process_attributes): Remove EXFUN.
6670 * keymap.h: Remove EXFUNs.
6671 * lisp.h: Remove EXFUNs.
6672 * w32term.h: Remove EXFUNs.
6673 * window.h: Remove EXFUNs.
6674 * xsettings.h: Remove EXFUN.
6675 * xterm.h: Remove EXFUN.
6676
8e4fd1e1
GM
66772012-07-03 Glenn Morris <rgm@gnu.org>
6678
6679 * lisp.h (Frandom): Make it visible to C.
6680 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6681 buffer for invisible buffers. (Bug#1229)
6682
ca95b3eb
DA
66832012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6684
6685 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6686 values which aren't power of 2.
14ae4239 6687 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 6688 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
6689 accordingly.
6690
7555c33f
SM
66912012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6692
6693 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6694
6695 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6696
d12e8f5a
DA
66972012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6698
6699 * alloc.c (allocate_vector_block): Remove redundant
6700 calls to mallopt if DOUG_LEA_MALLOC is defined.
6701 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6702 avoid calls to mallopt if zero_vector is returned.
6703
296094c3
DA
67042012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6705
6706 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6707 is enabled, avoid dereferencing NULL current_sblock if
6708 running undumped.
6709
36429c89
DA
67102012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6711
6712 Cleanup basic buffer management.
6713 * buffer.h (struct buffer): Change layout to use generic vector
6714 marking code. Fix some comments. Change type of 'clip_changed'
6715 to bitfield. Remove unused #ifndef old.
6716 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6717 (GET_OVERLAYS_AT): Fix indentation.
6718 (for_each_per_buffer_object_at): New macro.
6719 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6720 (Fbuffer_local_variables): Use it.
6721 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6722 * alloc.c (allocate_buffer): Adjust to match new layout of
6723 struct buffer. Fix comment.
6724 (mark_overlay): New function.
6725 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6726 Lisp area of struct buffer.
6727 (mark_object): Use it. Adjust marking of misc objects
6728 and related comments.
6729
3b3e4cac
PE
67302012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6731
6732 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6733 wrapper that is not needed because the wrapped code is a no-op (zero
6734 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6735 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6736
cf5c0175
DA
67372012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6738
6739 * alloc.c (mark_buffer): Simplify. Remove prototype.
6740 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 6741 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
6742 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6743 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 6744
ca26824c
GM
67452012-06-30 Glenn Morris <rgm@gnu.org>
6746
2e4c5312
GM
6747 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6748
ca26824c
GM
6749 * epaths.in (PATH_SITELOADSEARCH): New.
6750 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6751 This is rather than relying on --enable-locallisppath elements
6752 having "site-lisp" in their names. (Bug#10208#25, 11658)
6753
0d23c240
EZ
67542012-06-30 Eli Zaretskii <eliz@gnu.org>
6755
c9240d7a
EZ
6756 * w32proc.c (sys_select): Accept and ignore one more argument.
6757
6758 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6759
0d23c240 6760 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 6761 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
6762
6763 * sysdep.c: Don't include dos.h and dosfns.h.
6764
6765 * process.c (sys_select):
6766 * msdos.c (sys_select): Accept one more argument and ignore it.
6767
6768 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6769 adapt data types and code to that.
6770
6771 * dosfns.c:
6772 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6773 which clashes with the gnulib function of the same name.
6774
af5a5a98
AS
67752012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6776
c5e4379c
AS
6777 * font.c (font_style_to_value, font_style_symbolic)
6778 (font_prop_validate_style): Add type checks for values in
6779 font_style_table.
6780
af5a5a98
AS
6781 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6782 argument.
6783 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6784 uses.
6785
8d38f461
EZ
67862012-06-29 Eli Zaretskii <eliz@gnu.org>
6787
2e5a6631
EZ
6788 * xdisp.c (try_window_id): Undo last change.
6789
8d38f461
EZ
6790 * w32.c (getwd): Adjust commentary about startup_dir.
6791 (init_environment): Always call sys_access, even in non-MSVC
6792 builds. Don't chdir to the directory of the Emacs executable.
6793 This undoes code from 1997 which was justified by the need to
6794 "avoid conflicts when removing and renaming directories". But its
6795 downside was that every relative file name was being interpreted
6796 relative to the directory of the Emacs executable, which can never
6797 be TRT. In particular, it broke sys_access when called with
6798 relative file names.
6799 (sys_access): Map GetLastError to errno.
6800
2af3565e
DA
68012012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6802
6803 * window.h (struct window): Change type of 'fringes_outside_margins'
6804 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 6805 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
6806 Adjust comment.
6807 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6808 to ptrdiff_t.
6809
c8d3a25c 68102012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 6811
c8d3a25c
GM
6812 * gnutls.c (emacs_gnutls_handshake):
6813 Add QUIT to make the loop interruptible.
57570cd3 6814
c8d3a25c 68152012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 6816
c8d3a25c
GM
6817 * charset.c (init_charset): Make lack of etc/charsets fatal.
6818
3e984ee8
DA
68192012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6820
6821 * editfns.c (region_limit): Fix type mismatch.
6822
ef884f23
DA
68232012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6824
6825 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6826 undefined. Convert from xassert to eassert.
6827 * nsmenu.m: Convert from xassert to eassert.
6828 * nsterm.m: Likewise.
6829
7d7e0027
SM
68302012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6831
6832 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6833
aa754e6a
PE
68342012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6835
6836 Avoid integer overflow on scroll-left and scroll-right.
6837 * window.c (HSCROLL_MAX): New macro.
6838 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6839 overflow when requested scroll falls outside ptrdiff_t range.
6840
80b00b08
DA
68412012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6842
6843 * window.h (struct window): Change type of 'hscroll',
6844 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6845 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6846 Adjust users accordingly.
6847 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6848 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6849 from EMACS_INT to ptrdiff_t.
6850 (make_window): Omit redundant initialization.
6851
62b2bcf6
JB
68522012-06-28 Juanma Barranquero <lekktu@gmail.com>
6853
6854 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6855
45942c7d
DA
68562012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6857
6858 * window.h (struct window): Change type of 'use_time' and
6859 'sequence_number' from Lisp_Object to int.
6860 * frame.c (make_frame): Adjust users accordingly.
6861 * print.c (print_object): Likewise.
6862 * window.c (select_window, Fwindow_use_time, make_parent_window)
6863 (make_window): Likewise.
6864
e509cfa6
DA
68652012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6866
6867 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6868 enabled with --enable-checking=[all,glyphs] configure option.
6869 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6870 adjust comments accordingly.
6871 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6872 undefined, adjust comments accordingly.
6873 * image.c: Likewise.
6874 * scroll.c: Likewise.
6875 * w32fns.c: Likewise.
6876 * w32term.c: Likewise.
6877 * xdisp.c: Likewise.
6878 * xfaces.c: Likewise.
6879 * xfns.c: Likewise.
6880 * xterm.c: Likewise.
6881
a54e2c05
DA
68822012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6883
6884 Generalize run-time debugging checks.
6885 * dispextern.h (XASSERTS): Remove.
6886 * fontset.c (xassert): Remove.
6887 Convert from xassert to eassert.
6888 * alloc.c: Convert from xassert to eassert.
6889 * bidi.c: Likewise.
6890 * dispnew.c: Likewise.
6891 * fns.c: Likewise.
6892 * fringe.c: Likewise.
6893 * ftfont.c: Likewise.
6894 * gtkutil.c: Likewise.
6895 * image.c: Likewise.
6896 * keyboard.c: Likewise.
6897 * menu.c: Likewise.
6898 * process.c: Likewise.
6899 * scroll.c: Likewise.
6900 * sound.c: Likewise.
6901 * term.c: Likewise.
6902 * w32console.c: Likewise.
6903 * w32fns.c: Likewise.
6904 * w32term.c: Likewise.
6905 * window.c: Likewise.
6906 * xdisp.c: Likewise.
6907 * xfaces.c: Likewise.
6908 * xfns.c: Likewise.
6909 * xselect.c: Likewise.
6910 * xterm.c: Likewise.
6911
1ec4b7b2
SM
69122012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6913
6914 * fns.c (maybe_resize_hash_table): Output message when growing the
6915 purify-hashtable.
6916
2014308a
DA
69172012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6918
6919 * alloc.c (allocate_string_data): Remove dead code.
6920 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6921 avoid GCC warning about unused macro.
6922
246155eb
DA
69232012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6924
6925 * alloc.c (allocate_string): Omit intervals initialization.
6926 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6927 as in make_pure_string and make_pure_c_string.
6928
43184b7b
DA
69292012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6930
d209e2fb 6931 * alloc.c (allocate_string): Fix last change.
43184b7b 6932
3fe6dd74
DA
69332012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6934
d209e2fb 6935 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
6936 to memset, add explicit initialization where appropriate.
6937
1ba6038a
GM
69382012-06-27 Glenn Morris <rgm@gnu.org>
6939
6940 * lisp.mk (lisp): Remove paths.elc.
6941
c89926a5
CY
69422012-06-27 Chong Yidong <cyd@gnu.org>
6943
6944 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6945
ed6b3510
JW
69462012-06-26 John Wiegley <johnw@newartisans.com>
6947
1ec4b7b2 6948 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
6949 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6950
ed6b3510
JW
6951 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6952 when building with Clang.
6953
8edd4a2b
SM
69542012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6955
6956 * eval.c (Fapply): Allow calling it with a single argument.
6957
f6f62d1b
EZ
69582012-06-26 Eli Zaretskii <eliz@gnu.org>
6959
6960 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6961 _stricmp and _strnicmp.
6962 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6963
62efea5e
DA
69642012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6965
6966 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6967 allocated window.
6968 (allocate_process): Likewise for new process.
8edd4a2b 6969 (allocate_terminal): Change to use offsetof.
62efea5e
DA
6970 (allocate_frame): Likewise.
6971 * frame.c (make_frame): Omit redundant initialization.
6972 * window.c (make_parent_window): Use memset.
6973 (make_window): Omit redundant initialization.
6974 * process.c (make_process): Omit redundant initialization.
6975 * terminal.c (create_terminal): Likewise.
6976
42997f4d
DA
69772012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6978
6979 * term.c (delete_tty): Remove redundant call to memset.
6980
1130ecfc
DA
69812012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6982
6983 * alloc.c: Remove build_string.
6984 * lisp.h: Define build_string as static inline. This provides
6985 a better opportunity to optimize away calls to strlen when the
6986 function is called with compile-time constant argument.
6987 * image.c (imagemagick_error): Convert to build_string.
6988 * w32proc.c (sys_spawnve): Likewise.
6989 * xterm.c (x_term_init): Likewise.
6990
cf38a720
PE
69912012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6992
99027bdd
PE
6993 Use sprintf return value instead of invoking strlen on result.
6994 In the old days this wasn't portable, since some sprintf
6995 implementations returned char *. But they died out years ago and
6996 Emacs already assumes sprintf returns int.
6997 Similarly for float_to_string.
6998 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6999 * ccl.c (ccl_driver):
7000 * character.c (string_escape_byte8):
7001 * data.c (Fnumber_to_string):
7002 * doprnt.c (doprnt):
7003 * print.c (print_object):
7004 * xdisp.c (message_dolog):
7005 * xfns.c (syms_of_xfns):
7006 Use sprintf or float_to_string result to avoid need to call strlen.
7007 * data.c (Fnumber_to_string):
7008 Use make_unibyte_string, since the string must be ASCII.
7009 * lisp.h, print.c (float_to_string): Now returns int length.
7010 * term.c (produce_glyphless_glyph):
7011 Use sprintf result rather than recomputing it.
7012
cf38a720
PE
7013 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7014 * Makefile.in (ALL_CFLAGS):
7015 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7016 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7017
3511c784
DA
70182012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7019
0a08eb21 7020 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
7021 strcasecmp if available.
7022 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7023
fb7da12e
AS
70242012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7025
7026 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7027 Avoid comma operator.
7028 * menu.c (push_submenu_start, push_submenu_end)
7029 (push_left_right_boundary, push_menu_pane): Likewise.
7030 * msdos.c (dos_rawgetc): Likewise.
7031
afa2ffd8
DA
70322012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7033
7034 * xfns.c (xic_create_fontsetname): Remove redundant calls
7035 to memset.
7036
b3b4476b
PE
70372012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7038
4495ff38
PE
7039 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7040 sprintf already null-terminates its output.
7041
b3b4476b
PE
7042 * xfns.c (x_window): Remove redundant cast.
7043
b00876c9
DA
70442012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7045
7046 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7047 `const char *' to `char *' to avoid compiler warning.
7048
d188e26b
PE
70492012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7050
885d1d74
PE
7051 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7052 instead of truncating it to 63 (admittedly a generous limit).
7053
d188e26b
PE
7054 * process.c: Fix spelling and caps in comments.
7055
e2f560b1
DN
70562012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7057
e86db54b 7058 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
7059 * sysdep.c (setpgrp): Remove definition, not used in this file.
7060
7583a3a1
JB
70612012-06-24 Juanma Barranquero <lekktu@gmail.com>
7062
7063 * makefile.w32-in: Update dependencies.
7064
696056c2
EZ
70652012-06-24 Eli Zaretskii <eliz@gnu.org>
7066
7067 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7068 (SYSTIME_H): Add nt/inc/sys/time.h.
7069
7070 * systime.h [WINDOWSNT]: Include sys/time.h.
7071
7072 * s/ms-w32.h (struct timespec): Definition moved from
7073 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7074
845ca893
PE
70752012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7078 * buffer.h (buffer_slot_type_mismatch):
7079 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7080 * eval.c (unwind_to_catch):
7081 * image.c (my_png_error, my_error_exit):
7082 * keyboard.c (quit_throw_to_read_char, user_error)
7083 (Fexit_recursive_edit, Fabort_recursive_edit):
7084 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7085 (wrong_type_argument, buffer_overflow, __executable_start)
7086 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7087 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7088 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7089 (fatal):
7090 (child_setup) [!DOS_NT]:
7091 * lread.c (end_of_file_error, invalid_syntax):
7092 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7093 * puresize.h (pure_write_error):
7094 * search.c (matcher_overflow):
7095 * sound.c (sound_perror, alsa_sound_perror):
7096 * sysdep.c, syssignal.h (croak):
7097 * term.c (maybe_fatal, vfatal):
7098 * textprop.c (text_read_only):
7099 * undo.c (user_error):
7100 * unexmacosx.c (unexec_error):
7101 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7102 Use _Noreturn rather than NO_RETURN.
7103 No need for separate decl merely because of _Noreturn.
7104 * sound.c (sound_warning, parse_sound):
7105 Remove unnecessary forward decls.
7106
f1dd8073
PE
71072012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7108
7109 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7110 * lisp.h (WAIT_READING_MAX): New macro.
7111 * dispnew.c (Fsleep_for, sit_for):
7112 * keyboard.c (kbd_buffer_get_event):
7113 * process.c (Faccept_process_output):
7114 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7115 This improves on the previous patch, which introduced a bug
7116 when time_t is unsigned and as wide as intmax_t.
7117 See <http://bugs.gnu.org/9000#51>.
7118
b82c1755
EZ
71192012-06-23 Eli Zaretskii <eliz@gnu.org>
7120
7121 * dispnew.c (sit_for, Fsleep_for):
7122 * keyboard.c (kbd_buffer_get_event):
7123 * process.c (Faccept_process_output): Avoid compiler warnings when
7124 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7125
ca300656
JB
71262012-06-23 Juanma Barranquero <lekktu@gmail.com>
7127
049ec95b
JB
7128 * makefile.w32-in: Update dependencies.
7129
ca300656
JB
7130 * w32.c (ltime): Add return type and declare static.
7131 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7132
db7b8d06
PE
71332012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7136 Privately reported by Herbert J. Skuhra.
7137 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7138 All uses changed.
7139 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7140 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7141
0bd8297f
EZ
71422012-06-23 Eli Zaretskii <eliz@gnu.org>
7143
96512555
EZ
7144 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7145 last argument of make_unibyte_string.
7146
0bd8297f
EZ
7147 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7148 language ID in the event parameters.
7149
7150 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7151 event.code, not the obscure "character set ID".
7152
63def6b6
CY
71532012-06-23 Chong Yidong <cyd@gnu.org>
7154
7155 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7156
e8a02204
EZ
71572012-06-23 Eli Zaretskii <eliz@gnu.org>
7158
388cdec0
EZ
7159 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7160 * w32.c (fdutimens): New function.
7161
7162 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7163
7164 * s/ms-w32.h (pselect): Redirect to sys_select.
7165
7166 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7167
e8a02204
EZ
7168 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7169 in the logic of incrementing and decrementing the value of
7170 use_relocatable_buffers.
7171
d054f3fb
PE
71722012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7175 Privately reported by Herbert J. Skuhra.
7176 [__FreeBSD__]: Remove "*/" typo after "#include".
7177 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7178 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7179 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7180 Don't assume EMACS_TIME and struct timeval are the same type.
7181
d35af63c
PE
71822012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7183
7184 Support higher-resolution time stamps (Bug#9000).
7185 The time stamps are only nanosecond-resolution at the C level,
7186 since that's the best that any real-world system supports now.
7187 But they are picosecond-resolution at the Lisp level, as that's
7188 easy, and leaves room for future OS improvements.
7189
7190 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7191 (LIBES): Use it.
7192
7193 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7194 Don't get current time unless it's needed.
7195
7196 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7197 now provides it if it's absent.
7198 (start_atimer): Port to higher-res time stamps.
7199 Check for time stamp overflow. Don't get current time more
7200 often than is needed.
7201
7202 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7203 Include systime.h, not time.h.
7204 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7205
7206 * dired.c: Include stat-time.h.
7207 (Ffile-attributes): File times now have higher resolution.
7208
7209 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7210 (struct image): Timestamp now has higher resolution.
7211
7212 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7213 has at least microseconds now. All uses removed.
7214 (update_frame, update_single_window, update_window, update_frame_1)
7215 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 7216 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
7217
7218 * editfns.c (time_overflow): Now extern.
7219 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7220 (float-time, Fformat_time_string, Fcurrent_time_string)
7221 (Fcurrent_time_zone): Accept and generate higher-resolution
7222 time stamps.
7223 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7224 (decode_time_components, lisp_seconds_argument): New functions.
7225 (make_time): Now static.
7226 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7227 Report an error if the time is invalid, rather than having the caller
7228 do that.
7229
7230 * fileio.c: Include <stat-time.h>
7231 (Fcopy_file): Copy higher-resolution time stamps.
7232 Prefer to set the time stamp via a file descriptor if that works.
7233 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7234 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7235 (Fvisited_file_modtime, Fset_visited_file_modtime):
7236 Support higher-resolution time stamps.
7237
7238 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7239
7240 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7241
7242 * image.c (prepare_image_for_display, clear_image_cache)
7243 (lookup_image): Port to higer-resolution time stamps.
7244
7245 * keyboard.c (start_polling, bind_polling_period):
7246 Check for time stamp overflow.
7247 (read_char, kbd_buffer_get_event, timer_start_idle)
7248 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7249 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7250 Port to higher-resolution time stamps. Do not assume time_t is signed.
7251 (decode_timer): New function. Timers are now vectors of length 9,
7252 not 8, to accommodate the picosecond component.
7253 (timer_check_2): Use it.
7254
7255 * nsterm.m (select_timeout, timeval_subtract): Remove.
7256 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7257 as they're a bit more accurate and handle overflow better.
7258 (ns_select): Change prototype to be compatible with pselect.
7259 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7260 * nsterm.h (ns_select): Adjust prototype.
7261
7262 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7263 us-resolution time stamps.
7264 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7265
7266 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7267
7268 * lisp.h (time_overflow): New decl.
7269 (wait_reading_process_output): First arg is now intmax_t, not int,
7270 to accommodate larger waits.
7271
7272 * process.h (struct Lisp_Process.read_output_delay):
7273 Now counts nanoseconds, not microseconds.
7274 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7275 EMACS_HAS_USECS.
7276 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7277 (wait_reading_process_output):
7278 Port to ns-resolution time stamps.
7279 (Faccept_process_output, wait_reading_process_output):
7280 Check for time stamp overflow. Do not assume time_t is signed.
7281 (select_wrapper): Remove; we now use pselect.
7282 (Fprocess_attributes): Now generates ns-resolution time stamps.
7283
7284 * sysdep.c: Include utimens.h. Don't include utime.h
7285 or worry about struct utimbuf; gnulib does that for us now.
7286 (gettimeofday): Remove; gnulib provides a substitute.
7287 (make_timeval): New function.
7288 (set_file_times): Now sets ns-resolution time stamps.
7289 New arg FD; all uses changed.
7290 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7291 (system_process_attributes):
7292 Now returns ns-resolution time stamp. All uses changed.
7293 Check for time stamp overflow.
7294
7295 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7296 provides a substitute now.
7297
7298 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7299 since it guarantees struct timespec.
7300 (EMACS_TIME): Now struct timespec, so that we can support
7301 ns-resolution time stamps.
7302 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7303 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7304 (EMACS_USECS): Remove.
7305 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7306 so multiply the arg by 1000 before storing it.
7307 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7308 New macros.
7309 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7310 Port to ns-resolution time stamps.
7311 (EMACS_TIME_NEG_P): Remove; replaced by....
7312 (EMACS_TIME_SIGN): New macro.
7313 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7314 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7315 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7316 (make_timeval, make_lisp_time, decode_time_components): New decls.
7317 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7318 that it mishandled time_t overflow. You can't compare by subtracting!
7319 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7320 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7321
7322 * term.c: Include <sys/time.h>.
7323 (timeval_to_Time): New function, for proper overflow wraparound.
7324 (term_mouse_position, term_mouse_click): Use it.
7325
7326 * undo.c (record_first_change): Support higher-resolution time stamps
7327 in the undo buffer.
7328 (Fprimitive_undo): Use them when restoring time stamps.
7329
7330 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7331 (w32_get_internal_run_time):
7332 Port to higher-resolution Emacs time stamps.
7333 (ltime): Now accepts single 64-bit integer, as that's more convenient
7334 for callers.
7335
7336 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7337
7338 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7339 for compatibility with pselect. Support ns-resolution time stamps.
7340
7341 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7342
7343 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7344 Check for time stamp overflow, and support ns-resolution time stamps.
7345
7346 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7347 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7348 (timeval_subtract): Remove; no longer needed.
7349 (XTflash, XTring_bell, x_wait_for_event):
7350 Port to ns-resolution time stamps. Don't assume time_t is signed.
7351
b6a92dfe
CY
73522012-06-22 Chong Yidong <cyd@gnu.org>
7353
7354 * xdisp.c (x_consider_frame_title): Revert last change.
7355
d251c37c
EZ
73562012-06-22 Eli Zaretskii <eliz@gnu.org>
7357
7358 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7359 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7360 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7361 staticidx goes up to 1597 out of 1600 = 0x640.)
7362
f10deafb
PE
73632012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7364
7365 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7366 Otherwise, the umask might be mistakenly 0 while handling input signals.
7367
ec6de1e2
SM
73682012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7369
7370 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7371
28be1ada
DA
73722012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7373
7374 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7375 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7376 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7377 access to `contents' member of Lisp_Vector objects with AREF and ASET
7378 where appropriate.
7379
c6bf3022
CY
73802012-06-19 Chong Yidong <cyd@gnu.org>
7381
7382 * frame.c (delete_frame): When selecting a frame on a different
7383 text terminal, do not alter the terminal's top-frame.
7384
7385 * xdisp.c (format_mode_line_unwind_data): Record the target
7386 frame's selected window and its terminal's top-frame.
7387 (unwind_format_mode_line): Restore them.
7388 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7389 Callers changed.
7390 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7391 since tty frames can be explicitly named.
7392 (prepare_menu_bars): Likewise.
7393
7394 * term.c (Ftty_top_frame): New function.
7395
defd4196
PE
73962012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7397
7398 Port byte-code-meter to modern targets.
7399 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7400 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 7401 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
7402 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7403 (METER_1, METER_2): Simplify.
7404
1053a871
SM
74052012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7406
7407 * data.c (Fdefalias): Return `symbol' (bug#11686).
7408
b7e8d081
MR
74092012-06-18 Martin Rudalics <rudalics@gmx.at>
7410
7411 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
7412 gets killed during executing of this function (Bug#11665).
7413 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
7414 (Vkill_buffer_query_functions): In doc-string say that functions
7415 run by this hook should not change the current buffer.
7416
7ea2b339
PE
74172012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7418
7419 Fix recently-introduced process.c problems found by static checking.
7420 * process.c (write_queue_push, write_queue_pop, send_process):
7421 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7422 (write_queue_pop): Fix pointer signedness problem.
7423 (send_process): Remove unused local.
7424
96a313a1
CY
74252012-06-17 Chong Yidong <cyd@gnu.org>
7426
7427 * xdisp.c (redisplay_internal): No need to redisplay terminal
7428 frames that are not on top.
7429
20ca2e94
TN
74302012-06-17 Troels Nielsen <bn.troels@gmail.com>
7431
7432 * process.c (make_process): Initialize write_queue.
7433 (write_queue_push, write_queue_pop): New functions.
7434 (send_process): Use them to maintain correct ordering of process
7435 writes (Bug#10815).
7436
9a900ca9
PE
74372012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7438
310fbfa8
PE
7439 * lisp.h (eassert): Assume C89 or later.
7440 This removes the need for CHECK.
7441 (CHECK): Remove. Its comments about always evaluating its
7442 argument were confusing, as 'eassert' typically does not evaluate
7443 its argument.
7444
27bb1ca4
PE
7445 * coding.c (produce_chars): Use ptrdiff_t, not int.
7446
9a900ca9
PE
7447 * xterm.c (x_draw_underwave): Check for integer overflow.
7448 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7449
41b7f8bc 74502012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
7451
7452 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7453 referenced (Bug#11583).
7454
9b0e3eba
AA
74552012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7456
7457 Implement wave-style variant of underlining.
7458 * dispextern.h (face_underline_type): New enum.
7459 (face): Add field for underline type.
7460 * nsterm.m (ns_draw_underwave): New function.
7461 (ns_draw_text_decoration): Use it.
7462 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7463 New functions.
7464 (x_draw_glyph_string): Use them.
7465 * xfaces.c (Qline, Qwave): New Lisp objects.
7466 (check_lface_attrs, merge_face_ref)
1053a871
SM
7467 (Finternal_set_lisp_face_attribute, realize_x_face):
7468 Handle wave-style underline face attributes.
9b0e3eba
AA
7469 * xterm.c (x_draw_underwave): New function.
7470 (x_draw_glyph_string): Use it.
7471
0fb52f11
JB
74722012-06-16 Juanma Barranquero <lekktu@gmail.com>
7473
7474 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7475 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7476 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7477 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7478 ($(BLD)/w32select.$(O)): Update dependencies.
7479
e5560ff7
AS
74802012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7481
7482 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7483 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7484 * character.c (_fetch_multibyte_char_p): Remove.
7485 * alloc.c: Include "character.h" before "buffer.h".
7486 * bidi.c: Likewise.
7487 * buffer.c: Likewise.
7488 * bytecode.c: Likewise.
7489 * callint.c: Likewise.
7490 * callproc.c: Likewise.
7491 * casefiddle.c: Likewise.
7492 * casetab.c: Likewise.
7493 * category.c: Likewise.
7494 * cmds.c: Likewise.
7495 * coding.c: Likewise.
7496 * composite.c: Likewise.
7497 * dired.c: Likewise.
7498 * dispnew.c: Likewise.
7499 * doc.c: Likewise.
7500 * dosfns.c: Likewise.
7501 * editfns.c: Likewise.
7502 * emacs.c: Likewise.
7503 * fileio.c: Likewise.
7504 * filelock.c: Likewise.
7505 * font.c: Likewise.
7506 * fontset.c: Likewise.
7507 * fringe.c: Likewise.
7508 * indent.c: Likewise.
7509 * insdel.c: Likewise.
7510 * intervals.c: Likewise.
7511 * keyboard.c: Likewise.
7512 * keymap.c: Likewise.
7513 * lread.c: Likewise.
7514 * macros.c: Likewise.
7515 * marker.c: Likewise.
7516 * minibuf.c: Likewise.
7517 * nsfns.m: Likewise.
7518 * nsmenu.m: Likewise.
7519 * print.c: Likewise.
7520 * process.c: Likewise.
7521 * regex.c: Likewise.
7522 * region-cache.c: Likewise.
7523 * search.c: Likewise.
7524 * syntax.c: Likewise.
7525 * term.c: Likewise.
7526 * textprop.c: Likewise.
7527 * undo.c: Likewise.
7528 * unexsol.c: Likewise.
7529 * w16select.c: Likewise.
7530 * w32fns.c: Likewise.
7531 * w32menu.c: Likewise.
7532 * window.c: Likewise.
7533 * xdisp.c: Likewise.
7534 * xfns.c: Likewise.
7535 * xmenu.c: Likewise.
7536 * xml.c: Likewise.
7537 * xselect.c: Likewise.
7538
2f07e6af
EZ
75392012-06-16 Eli Zaretskii <eliz@gnu.org>
7540
1053a871
SM
7541 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7542 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7543 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7544 row.
7545 (handle_face_prop): Use chunk-relative overlay string index when
7546 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7547 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7548 the rightmost. (Bug#11720)
2f07e6af 7549
29b83cec
AS
75502012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7551
7552 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7553 (CATEGORY_MEMBER): Enforce 1/0 value.
7554 * category.c (_temp_category_set): Remove.
7555
4c5501e9
EZ
75562012-06-16 Eli Zaretskii <eliz@gnu.org>
7557
7558 * window.c (Fdelete_other_windows_internal)
7559 (Fdelete_window_internal): Don't access frame's mouse highlight
7560 info of the initial frame. (Bug#11677)
7561
2b570124
PE
75622012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7563
e93864f9
PE
7564 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7565 Assume USE_2_TAGS_FOR_INTS.
7566 (xreload): Adjust $tagmask width to match recent lisp.h change.
7567
2b570124
PE
7568 Simplify lisp.h in minor ways that should not affect code.
7569 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7570 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7571 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7572 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7573 (INTTYPEBITS): New macro, for clarity.
7574 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7575 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7576 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7577 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7578 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7579
81755f69
JB
75802012-06-13 Juanma Barranquero <lekktu@gmail.com>
7581
7582 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7583
16192a57
GM
75842012-06-13 Glenn Morris <rgm@gnu.org>
7585
7586 * s/bsd-common.h (BSD4_3):
7587 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7588
646b5f55
AS
75892012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7590
7591 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7592 instead of union.
7593 (XLI, XIL): Define.
1053a871
SM
7594 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7595 Use them.
7596 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7597 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7598 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7599 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7600 * frame.c (delete_frame): Remove outdated comment.
7601 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7602 USE_LISP_UNION_TYPE.
7603 (Fw32_unregister_hot_key): Likewise.
7604 (Fw32_toggle_lock_key): Likewise.
7605 * w32menu.c (add_menu_item): Likewise.
7606 (w32_menu_display_help): Use XIL instead of checking
7607 USE_LISP_UNION_TYPE.
7608 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7609 (init_heap): Likewise.
7610 * w32term.c (w32_read_socket): Update comment.
7611
1d3823c9
GM
76122012-06-13 Glenn Morris <rgm@gnu.org>
7613
c62ff706
GM
7614 * s/usg5-4-common.h, src/s/unixware.h:
7615 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7616
1d3823c9
GM
7617 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7618
bfe3e0a2
PE
76192012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7620
7621 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7622 * alloc.c (make_number) [!defined make_number]:
7623 Remove, as lisp.h always defines this now.
7624 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7625 (roundup_size): Verify that it is a power of 2.
7626 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7627 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7628 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7629 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7630 USE_LSB_TAG now is always defined to be either 0 or 1.
7631 All uses changed.
7632 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7633 code works fine either way, and efficiency is not a concern here,
7634 as the union type is for debugging, not for production.
7635 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7636 Use an inline function on all platforms when using the union type,
7637 since this is simpler and 'static inline' can be used portably
7638 within Emacs now.
7639 (LISP_INITIALLY_ZERO): New macro.
7640 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7641 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7642
45fa9c0f
GM
76432012-06-12 Glenn Morris <rgm@gnu.org>
7644
b4492cba
GM
7645 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7646
7647 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 7648
45fa9c0f
GM
7649 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7650 Move BROKEN_SIGIO to configure.
7651
7652 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7653 Move NO_TERMIO to configure.
7654
0e25d334
CY
76552012-06-12 Chong Yidong <cyd@gnu.org>
7656
7657 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7658 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7659 MagickExportImagePixels is undefined.
7660
43682bb6
PE
76612012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7662
7663 * image.c (imagemagick_load_image): Remove unused label.
7664
a9be7d2b
GM
76652012-06-11 Glenn Morris <rgm@gnu.org>
7666
7667 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7668 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7669 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7670 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7671
3017f87f
SM
76722012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7673
7674 * alloc.c (make_byte_code): New function.
7675 (Fmake_byte_code): Use it. Don't purify here.
7676 * lread.c (read1): Use it as well to avoid extra allocation.
7677
1b9b4cf4
CY
76782012-06-11 Chong Yidong <cyd@gnu.org>
7679
7680 * image.c (imagemagick_load_image): Implement transparency.
7681
95988fcf
AS
76822012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7683
7684 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7685 account for preceding backslashes. (Bug#11663)
7686
cd4eb164
CY
76872012-06-09 Chong Yidong <cyd@gnu.org>
7688
7689 * term.c: Support italics in capable terminals (Bug#9652).
7690 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7691 (turn_on_face): Output using TS_enter_italic_mode if available.
7692 Don't handle unused blinking and alt-charset cases.
7693 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7694 and tty_alt_charset_p cases.
7695 (tty_capable_p, init_tty): Support italics.
7696
7697 * termchar.h (struct tty_display_info): Add field for italics.
7698 Remove unused blink field.
7699
7700 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7701 Handle slant.
7702
7703 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7704 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7705 tty_alt_charset_p. Add tty_italic_p.
7706
ff88beb8
MA
77072012-06-09 Michael Albinus <michael.albinus@gmx.de>
7708
7709 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7710 dbus_type_is_basic if available.
7711 (xd_extract_signed, xd_extract_unsigned): Rename from
7712 extract_signed and extract_unsigned, respectively. Adapt callers.
7713
44286096
CY
77142012-06-09 Chong Yidong <cyd@gnu.org>
7715
1682701f
CY
7716 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7717
44286096
CY
7718 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7719 case (Bug#9752).
7720
d86feb17
PE
77212012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7722
7723 * xdisp.c (vmessage): Treat frame message as multibyte.
7724 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7725 would generate the diagnostic "Making \302\247 buffer-local while
7726 let-bound!".
7727
d5c20fe8
EZ
77282012-06-08 Eli Zaretskii <eliz@gnu.org>
7729
7730 * dispnew.c (showing_window_margins_p): Undo last change, which
7731 was done due to an inadvertent commit.
7732 (adjust_frame_glyphs_for_frame_redisplay): Do call
7733 showing_window_margins_p.
7734
513749ee
SM
77352012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7736
7737 * eval.c (Fmake_var_non_special): New primitive.
7738 (syms_of_eval): Defsubr it.
7739 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7740
d4a8f5c1
JB
77412012-06-08 Juanma Barranquero <lekktu@gmail.com>
7742
7743 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7744 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7745
8bbbc977
EZ
77462012-06-08 Eli Zaretskii <eliz@gnu.org>
7747
7748 * alloc.c (allocate_vectorlike): Fix last change.
7749
f3372c87
DA
77502012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7751
7752 Block-based vector allocation of small vectors.
7753 * lisp.h (struct vectorlike_header): New field `nbytes',
7754 adjust comment accordingly.
7755 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 7756 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
7757 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7758 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7759 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7760 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7761 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7762 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7763 (roundup_size): New constant.
7764 (struct vector_block): New data type.
7765 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 7766 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
7767 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7768 (sweep_vectors): New functions.
7769 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 7770 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
7771 or equal to VBLOCK_BYTES_MAX.
7772 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7773 (init_alloc_once): Add call to init_vectors.
7774
4f18a4ed
SM
77752012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7776
7777 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7778
86f158bc
PE
77792012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7780
7781 * doprnt.c (doprnt): Truncate multibyte char correctly.
7782 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7783 would mishandle a string argument "Xc" if X was a multibyte
7784 character of length 2: it would truncate after X's first byte
7785 rather than including all of X.
7786
c5cfcbe0
CY
77872012-06-06 Chong Yidong <cyd@gnu.org>
7788
7789 * buffer.c (word_wrap): Doc fix.
7790
c05cf390
PE
77912012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7792
7793 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7794
0c3461de
GM
77952012-06-03 Glenn Morris <rgm@gnu.org>
7796
7797 * xdisp.c (tool-bar-style): Doc fix.
7798
c71232db
UM
77992012-06-03 Ulrich Müller <ulm@gentoo.org>
7800
7801 * Makefile.in (PAXCTL): Define.
7802 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7803 binary via PaX flags if the paxctl utility is available.
7804 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7805 Restore PaX flags to their default. (Bug#11398)
7806
383f7350
CY
78072012-06-03 Chong Yidong <cyd@gnu.org>
7808
7809 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7810 buffer (Bug#11226).
7811
5f2c76c6
CY
78122012-06-03 Chong Yidong <cyd@gnu.org>
7813
7814 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7815 (note_mode_line_or_margin_highlight): If there is no help echo,
7816 use mode-line-default-help-echo. Handle the case where the mouse
7817 position is past the end of the mode line string.
7818
7819 * buffer.c (buffer_local_value_1): New function, split from
7820 Fbuffer_local_value; can return Qunbound.
7821 (Fbuffer_local_value): Use it.
7822 (Vmode_line_format): Docstring tweaks.
7823
773d47f6
PE
78242012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7825
7826 * sysdep.c (system_process_attributes): Improve comment.
7827
f2d6a3df
SM
78282012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7829
7830 * keyboard.c: Export real-this-command to Elisp.
7831 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7832 and DEFVAR it. Update all users.
7833
63810350
PE
78342012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7835
7bd5c1f4
PE
7836 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7837
63810350
PE
7838 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7839 Convert pctcpu and pctmem to Lisp float properly.
7840 Let the compiler fold better, as 100.0/0x8000 is exact.
7841
a2821611
AS
78422012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7843
7844 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7845 cons_block.
7846
5fceba1d
PE
78472012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7848
7849 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7850
c98ff5dd
DA
78512012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7852
7853 For a 'struct window', replace some Lisp_Object fields to
7854 bitfields where appropriate, remove unused fields.
7855 * window.h (struct window): Remove unused 'last_mark_x' and
7856 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 7857 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
7858 Change type of 'force_start', 'optional_new_start',
7859 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 7860 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 7861
ca34e0be
PE
78622012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7863
7864 Pacify gcc -Wdouble-precision when using Xaw.
7865 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7866 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7867 Use 'float' consistently, rather than 'float' in most places
7868 and 'double' in a couple of places.
7869
efc00ab1 78702012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
7871
7872 * xdisp.c (handle_stop): Detect whether we have overlay strings
7873 loaded by testing it->current.overlay_string_index to be
7874 non-negative, instead of checking whether n_overlay_strings is
7875 positive. (Bug#11587)
7876
efc00ab1 78772012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
7878
7879 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7880
7881 * doc.c (Fsubstitute_command_keys): Doc fix.
7882
efc00ab1 78832012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
7884
7885 * search.c (search_buffer): Remove calls to
7886 r_alloc_inhibit_buffer_relocation, as it is now called by
7887 maybe_unify_char, which was the cause of relocation of buffer text
7888 in bug#11519.
7889
efc00ab1 78902012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
7891
7892 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7893 for the duration of call to load_charset, to avoid problems with
7894 callers of maybe_unify_char that access buffer text through C
7895 pointers.
7896
7897 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7898 decrement the inhibition flag, instead of just setting or
7899 resetting it.
7900
ba93a187
PE
79012012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7902
7903 Remove obsolete '#define static' cruft.
7904 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7905 This #undef was "temporary" in 2000; it is no longer needed
7906 now that '#define static' has gone away.
7907 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7908 (gray_bitmap_bits): Remove; no longer needed.
7909 All uses replaced with definiens.
7910 * xterm.c: Include "bitmaps/gray.xbm".
7911
9e4bf381
PE
79122012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7913
7914 Clean up __executable_start, monstartup when --enable-profiling.
7915 The following changes affect the code only when profiling.
7916 * dispnew.c (__executable_start): Rename from safe_bcopy.
7917 Define only on platforms that need it.
7918 * emacs.c: Include <sys/gmon.h> when profiling.
7919 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7920 (__executable_start): Remove decl, since lisp.h does it now.
7921 (safe_bcopy): Remove decl; no longer has that name.
7922 (main): Coalesce #if into single bit of code, for simplicity.
7923 Cast pointers to uintptr_t, since standard libraries want integers
7924 and not pointers.
7925 * lisp.h (__executable_start): New decl.
7926
32d72c2f
GM
79272012-05-31 Glenn Morris <rgm@gnu.org>
7928
7929 * image.c (Fimagemagick_types): Doc fix.
7930
baac5bc7
JM
79312012-05-30 Jim Meyering <meyering@redhat.com>
7932
7933 * callproc.c (Fcall_process_region): Include directory component
7934 in mkstemp error message (Bug#11586).
7935
72cb32cf
PE
79362012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7937
7938 * alloc.c, lisp.h (make_pure_vector): Now static.
7939
61b108cc
SM
79402012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7941
7942 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7943 Move to byte-run.el.
7944 (Fautoload): Do the hash-doc more carefully.
7945 * data.c (Fdefalias): Purify definition, except for keymaps.
7946 (Qdefun): Move from eval.c.
7947 * lisp.h (Qdefun): Remove.
7948 * lread.c (read1): Tiny simplification.
7949
471fe23d
TN
79502012-05-29 Troels Nielsen <bn.troels@gmail.com>
7951
934f3f58 7952 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
7953 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7954 Bug#9642, but explicitly check that the buffer the overlay would
7955 be moved to is live and rearrange lines to make sure that errors
7956 will not put the overlay in an inconsistent state.
7957 (Fdelete_overlay): Cosmetics.
7958
85d0efd1
EZ
79592012-05-28 Eli Zaretskii <eliz@gnu.org>
7960
7961 * w32term.c (my_bring_window_to_top): New function.
7962 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
7963 could be different from the original one.
7964 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
7965 (Bug#11513)
7966
7967 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7968 by calling BringWindowToTop.
7969
7970 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7971 (WM_EMACS_END): Increase by one.
7972
da92a98c
PE
79732012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7974
7975 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7976 This avoids undefined behavior that might cause the eassert
7977 to not catch an out-of-range value.
7978
74d1f848
JB
79792012-05-28 Juanma Barranquero <lekktu@gmail.com>
7980
7981 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7982 Update dependencies.
7983
9e1a06fc
EZ
79842012-05-27 Eli Zaretskii <eliz@gnu.org>
7985
7986 * bidi.c (bidi_mirror_char): Fix last change.
7987
f3dd7312
AS
79882012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7989
7990 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7991 when referring to sectname field in printf format.
7992
81899c91
PE
79932012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7994
57b81a9f
PE
7995 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7996 Only r_alloc_inhibit_buffer_relocation needed to be added;
7997 the others were already declared.
7998
81899c91
PE
7999 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8000 before checking whether it's out of range. Put the check inside
8001 eassert. See
8002 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8003
33017faf 80042012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
8005
8006 * callproc.c (Fcall_process): Restore a line that was accidentally
8007 commented out in the 2011-02-13 change (bug#11547).
8008
33017faf 80092012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
8010
8011 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8012 defined on ralloc.c.
8013
8014 * buffer.c [REL_ALLOC]: Remove prototypes of
8015 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8016 they are now on lisp.h.
8017
8018 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8019
8020 * search.c (search_buffer): Use it to inhibit relocation of buffer
8021 text while re_search_2 is doing its job, because re_search_2 is
8022 passed C pointers to buffer text. (Bug#11519)
8023
23415acf
EZ
8024 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8025 Update value to 24.
8026
44e27368
EZ
8027 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8028 state after an additional call to move_it_in_display_line_to, keep
8029 the values of it->max_ascent and it->max_descent found for the
8030 entire line.
8031 (pos_visible_p): Revert the comparison against bottom_y to what it
8032 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8033 (Bug#11464)
8034
c1892f11
PE
80352012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8036
8037 Fix coding-related core dumps with gcc -ftrapv.
8038 The code was computing A - B, where A and B are pointers, and B is
8039 random garbage. This can lead to core dumps on platforms that
8040 have special pointer registers, and it also leads to core dumps on
8041 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8042 A - B only when B is initialized properly.
8043 * coding.c (coding_set_source, coding_set_destination): Return void.
8044 (coding_change_source, coding_change_destinations): New functions,
8045 with the old behaviors of coding_set_source and coding_set_destination.
8046 All callers that need an offset changed to use these new functions.
8047
eb7afdad
GM
80482012-05-26 Glenn Morris <rgm@gnu.org>
8049
8050 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8051
f12fdf02
EZ
80522012-05-26 Eli Zaretskii <eliz@gnu.org>
8053
53a63be6 8054 Extend mouse support on W32 text-mode console.
61b108cc
SM
8055 * xdisp.c (draw_row_with_mouse_face):
8056 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 8057
eb3f6f01 8058 * w32console.c: Include window.h.
61b108cc
SM
8059 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8060 New functions.
eb3f6f01
EZ
8061 (initialize_w32_display): Initialize mouse-highlight data.
8062
53a63be6
EZ
8063 * w32inevt.c: Include termchar.h and window.h.
8064 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8065 moves, call note_mouse_highlight. If help_echo changed, call
8066 gen_help_event to produce help-echo message in the echo area.
8067 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8068 highlight info.
8069
4cfd81f6
PE
80702012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8071
8072 * lread.c (read1): Simplify slightly to avoid an overflow warning
8073 with GCC 4.7.0 on x86-64.
8074
4446092a
EZ
80752012-05-26 Eli Zaretskii <eliz@gnu.org>
8076
8077 * bidi.c (bidi_mirror_char): Revert last change: an int is
8078 definitely wide enough here.
8079
42b2a986 80802012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 8081
42b2a986 8082 Fix integer width and related bugs (Bug#9874).
eb106a49 8083 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
8084 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8085 (string_bytes, check_sblock, allocate_string_data):
8086 (compact_small_strings, Fmake_bool_vector, make_string)
8087 (make_unibyte_string, make_multibyte_string)
8088 (make_string_from_bytes, make_specified_string)
8089 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8090 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8091 (mark_vectorlike):
8092 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8093 (allocate_pseudovector):
8094 Use int, not EMACS_INT, where int is wide enough.
8095 (inhibit_garbage_collection, Fgarbage_collect):
8096 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8097 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8098 int might not be wide enough.
8099 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8100 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8101 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8102 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8103 (bidi_level_of_next_char, bidi_move_to_visually_next):
8104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8105 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8106 (Fkill_buffer, Fset_buffer_major_mode)
8107 (advance_to_char_boundary, Fbuffer_swap_text)
8108 (Fset_buffer_multibyte, overlays_at, overlays_in)
8109 (overlay_touches_p, struct sortvec, record_overlay_string)
8110 (overlay_strings, recenter_overlay_lists)
8111 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8112 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8113 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8114 (Foverlay_recenter, last_overlay_modification_hooks_used)
8115 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8116 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
8117 (validate_region): Omit unnecessary test for b <= e,
8118 since that's guaranteed by the previous test.
d311d28c
PE
8119 (adjust_overlays_for_delete): Avoid pos + length overflow.
8120 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8121 (report_overlay_modification):
8122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8123 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8124 Omit pointer cast, which isn't needed anyway, and doesn't work
8125 after the EMACS_INT -> ptrdiff_t change.
02481186 8126 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
8127 * buffer.h: Adjust decls to match defn changes elsewhere.
8128 (struct buffer_text, struct buffer):
8129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8130 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
8131 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8132 not int, to avoid needless 32-bit limit on 64-bit hosts.
8133 (exec_byte_code): Use tighter memory-full test, one that checks
8134 for alloca overflow. Don't compute the address of the object just
8135 before an array, as that's not portable. Use EMACS_INT, not
8136 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
8137 * callint.c (Fcall_interactively):
8138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8139 * callproc.c (call_process_kill, Fcall_process):
8140 Don't assume pid_t fits into an Emacs fixnum.
8141 (call_process_cleanup, Fcall_process, child_setup):
8142 Don't assume pid_t fits into int.
8143 (call_process_cleanup, Fcall_process, delete_temp_file)
8144 (Fcall_process_region):
8145 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8146 (Fcall_process): Simplify handling of volatile integers.
8147 Use int, not EMACS_INT, where int will do.
8148 * casefiddle.c (casify_object, casify_region, operate_on_word)
8149 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8151 (casify_object): Avoid integer overflow when overallocating buffer.
8152 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 8153 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
8154 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8155 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8156 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8157 integers are now checked earlier. All uses replaced with XINT.
8158 (ccl_driver):
8159 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8160 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
8161 (ccl_driver, Fregister_code_conversion_map):
8162 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
8163 (resolve_symbol_ccl_program): Check that vector header is in range.
8164 Always copy the vector, so that we can check its contents reliably
8165 now rather than having to recheck each instruction as it's being
8166 executed. Check that vector words fit in 'int'.
8167 (ccl_get_compiled_code, Fregister_ccl_program)
8168 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8169 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8170 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8171 contents are in range.
8172 (Fccl_execute_on_string): Check that status is in range.
8173 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8174 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8175 Accept and return EMACS_INT, not int, because callers can pass values
8176 out of 'int' range.
8177 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8178 (multibyte_chars_in_text, parse_str_as_multibyte)
8179 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8180 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8181 (string_escape_byte8, Fget_byte):
8182 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 8183 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
8184 avoid mishandling large integers.
8185 * character.h: Adjust decls to match defn changes elsewhere.
8186 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8187 (Ffind_charset_region):
8188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8189 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8190 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 8191 Don't assume fixnum fits in int.
d311d28c
PE
8192 (load_charset_map_from_vector, Fmap_charset_chars):
8193 Remove now-unnecessary CHECK_NATNUMs.
8194 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
8195 Don't rely on undefined behavior with signed left shift overflow.
8196 Don't assume unsigned int fits into fixnum, or that fixnum fits
8197 into unsigned int. Don't require max_code to be a valid fixnum;
8198 that's not true for gb10830 4-byte on a 32-bit host. Allow
8199 invalid_code to be a cons, for the same reason. Require code_offset
8200 to be a character. Avoid int overflow if max_char is close
8201 to INT_MAX.
8202 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8203 this is intended anyway and avoids some undefined behavior.
8204 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8205 INDEX_TO_CODE_POINT, as that's what it expects.
8206 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
8207 * charset.h (DECODE_CHAR): Return int, not unsigned;
8208 this is what was intended anyway, and it avoids undefined behavior.
8209 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8210 integer-overflow issues.
8211 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8212 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8213 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
8214 * chartab.c (Fmake_char_table, Fset_char_table_range)
8215 (uniprop_get_decoder, uniprop_get_encoder):
8216 Don't assume fixnum fits in int.
8217 * cmds.c (move_point): New function, that does the gist of
8218 Fforward_char and Fbackward_char, but does so while checking
8219 for integer overflow more accurately.
c96e5d6a 8220 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
8221 (Fforward_line, Fend_of_line, internal_self_insert)
8222 (internal_self_insert):
8223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8224 Fix a FIXME, by checking for integer overflow when calculating
8225 target_clm and actual_clm.
8226 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 8227 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
8228 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8229 (coding_alloc_by_making_gap, alloc_destination)
8230 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8231 (encode_coding_utf_16, detect_coding_emacs_mule)
8232 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8233 (detect_coding_iso_2022, decode_coding_iso_2022)
8234 (encode_invocation_designation, encode_designation_at_bol)
8235 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8236 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8237 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8238 (encode_coding_ccl, encode_coding_raw_text)
8239 (detect_coding_charset, decode_coding_charset)
8240 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8241 (produce_composition, produce_charset, produce_annotation)
8242 (decode_coding, handle_composition_annotation)
8243 (handle_charset_annotation, consume_chars, decode_coding_gap)
8244 (decode_coding_object, encode_coding_object, detect_coding_system)
8245 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8246 (code_convert_region, code_convert_string)
8f50130c
PE
8247 (Fdefine_coding_system_internal)
8248 (coding_set_source, coding_set_destination):
d311d28c
PE
8249 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8250 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8251 (Fdefine_coding_system_internal):
8252 Don't assume fixnums fit in int.
8253 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 8254 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
8255 (Funencodable_char_position, Fcheck_coding_systems_region)
8256 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 8257 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 8258 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 8259 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 8260 Don't access memory outside of the args array.
d311d28c 8261 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
8262 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8263 result of ENCODE_CHAR.
d311d28c
PE
8264 * coding.h: Adjust decls to match defn changes elsewhere.
8265 (struct coding_system):
8266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8267 * composite.c (get_composition_id, find_composition)
8268 (run_composition_function, update_compositions)
8269 (compose_text, composition_gstring_put_cache)
8270 (composition_gstring_p, composition_gstring_width)
8271 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8272 (composition_compute_stop_pos, composition_reseat_it)
8273 (composition_update_it, struct position_record)
8274 (find_automatic_composition, composition_adjust_point)
8275 (Fcomposition_get_gstring, Ffind_composition_internal):
8276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8277 (update_compositions):
8278 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8279 * composite.h: Adjust decls to match defn changes elsewhere.
8280 (struct composition):
8281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8282 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8283 Do not attempt to compute the address of the object just before a
8284 buffer; this is not portable.
8285 (Faref, Faset):
8286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8287 (Faset): Use int, not EMACS_INT, where int is wide enough.
8288 (Fstring_to_number): Don't assume fixnums fit in int.
8289 (Frem): Don't assume arg is nonnegative.
8290 * dbusbind.c (xd_append_arg): Check for integers out of range.
8291 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 8292 (extract_signed, extract_unsigned): New functions.
243e0530
PE
8293 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8294 (xd_get_connection_references): Return ptrdiff_t, not int.
8295 All uses changed.
8296 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8297 (xd_read_message_1):
8298 Use int, not unsigned, where the dbus API uses int.
8299 (Fdbus_message_internal): Don't overflow mtype.
8300 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
8301 * dired.c (directory_files_internal, file_name_completion, scmp)
8302 (file_name_completion_stat):
8303 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8304 (file_name_completion): Don't overflow matchcount.
8305 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8306 * dispextern.h: Adjust decls to match defn changes elsewhere.
8307 (struct text_pos, struct glyph, struct bidi_saved_info)
8308 (struct bidi_string_data, struct bidi_it, struct composition_it)
8309 (struct it):
8310 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8311 (struct display_pos, struct composition_it, struct it):
8312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8313 * dispnew.c (increment_matrix_positions)
8314 (increment_row_positions, mode_line_string)
8315 (marginal_area_string):
8316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 8317 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
8318 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8319 (duration_to_sec_usec): New function, to check for overflow better.
8320 (Fsleep_for, sit_for): Use it.
8321 * doc.c (get_doc_string, store_function_docstring):
8322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8323 (get_doc_string, Fsnarf_documentation):
8324 Use int, not EMACS_INT, where int is wide enough.
8325 (get_doc_string):
8326 Use SAFE_ALLOCA, not alloca.
8327 Check for overflow when converting EMACS_INT to off_t.
8328 * doprnt.c (doprnt):
8329 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8330 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8331 Don't assume uid_t fits into fixnum.
8332 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8333 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8334 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8335 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8336 (general_insert_function)
8337 (Finsert_char, make_buffer_string, make_buffer_string_both)
8338 (update_buffer_properties, Fbuffer_substring)
8339 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8340 (Fsubst_char_in_region, check_translation)
8341 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8342 (transpose_markers, Ftranspose_regions):
8343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8344 (clip_to_bounds): Move to lisp.h as an inline function).
8345 (Fconstrain_to_field): Don't assume integers are nonnegative.
8346 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8347 (Fsubst_char_in_region, Fsave_restriction):
8348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8349 (Femacs_pid): Don't assume pid_t fits into fixnum.
8350 (lo_time): Use int, not EMACS_INT, when int suffices.
8351 (lisp_time_argument): Check for usec out of range.
8352 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
8353 (Fuser_login_name, Fuser_full_name): Signal an error
8354 if a uid argument is out of range, rather than relying on
8355 undefined behavior.
c8d5c857
PE
8356 (Fformat_time_string): Remove now-unnecessary check.
8357 lisp_time_argument checks for out-of-range usec now.
243e0530 8358 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
8359 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8360 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8361 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8362 (init_cmdargs, Fdump_emacs):
8363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8364 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8365 the bottom (typically) 32 bits of the fixnum.
8366 * eval.c (specpdl_size, call_debugger):
8367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8368 (when_entered_debugger, Fbacktrace_debug):
8369 Don't assume fixnum can fit in int.
8370 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8371 the object just before a buffer; this is not portable.
8372 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8373 (grow_specpdl, unbind_to):
8374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8375 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8376 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 8377 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
8378 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8379 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8381 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8382 (a_write, e_write):
8383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8384 (Fcopy_file, non_regular_nbytes, read_non_regular)
8385 (Finsert_file_contents):
8386 Use int, not EMACS_INT, where int is wide enough.
8387 (READ_BUF_SIZE): Verify that it fits in int.
8388 (Finsert_file_contents): Check that counts are in proper range,
8389 rather than assuming fixnums fit into ptrdiff_t etc.
8390 Don't assume fixnums fit into int.
125b3835 8391 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
8392 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8393 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
8394 (string_char_to_byte, string_byte_to_char)
8395 (string_make_multibyte, string_to_multibyte)
8396 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8397 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8398 (substring_both, Fdelete, internal_equal, Ffillarray)
8399 (Fclear_string, mapcar1)
8400 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8401 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8402 (larger_vector, make_hash_table, maybe_resize_hash_table)
8403 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8404 (Fmaphash, secure_hash):
8405 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8406 (concat): Check for string index and length overflow.
8407 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8408 (Frequire):
8409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8410 (larger_vector): New API (vec, incr_min, size_max) replaces old
8411 one (vec, new_size, init). This catches size overflow.
8412 INIT was removed because it was always Qnil.
8413 All callers changed.
8414 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8415 the upper bound on a hash table index size.
8416 (make_hash_table, maybe_resize_hash_table): Use it.
8417 (secure_hash): Computer start_byte and end_byte only after
8418 they're known to be in ptrdiff_t range.
8419 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8420 (Ffont_get_glyphs, Ffont_at):
8421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8422 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8423 (Flist_fonts, Fopen_font):
8424 Don't assume fixnum can fit in int.
8425 (check_gstring): Don't assume index can fit in int.
8426 (font_match_p): Check that fixnum is a character, not a nonnegative
8427 fixnum, since the later code needs to stuff it into an int.
8428 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8429 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8430 conversion overflow issues.
8431 (Fopen_font): Check for integer out of range.
8432 (Ffont_get_glyphs): Don't assume index can fit in int.
8433 * font.h: Adjust decls to match defn changes elsewhere.
8434 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8435 integer overflow.
8436 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8437 printmax_t, where ptrdiff_t is wide enough.
8438 (Finternal_char_font):
8439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8440 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8441 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8442 (Fset_frame_position, x_set_frame_parameters)
8443 (x_set_line_spacing, x_set_border_width)
8444 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8445 Check that fixnums are in proper range for system types.
8446 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8448 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8449 Use SAFE_ALLOCA_LISP, not alloca.
8450 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8451 intptr_t is wide enough.
8452 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8453 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8454 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8455 Check for fixnum out of range.
8456 * ftfont.c (ftfont_list): Don't assume index fits in int.
8457 Check that fixnums are in proper range for system types.
8458 (ftfont_shape_by_flt):
8459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
8460 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8461 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8462 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8463 Check that fixnums are in proper range for system types.
8464 * gnutls.h: Adjust decls to match defn changes elsewhere.
8465 * gtkutil.c (xg_dialog_run):
8466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8467 (update_frame_tool_bar):
8468 Check that fixnums are in proper range for system types.
8469 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 8470 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
8471 * indent.c (last_known_column, last_known_column_point):
8472 (current_column_bol_cache):
8473 (skip_invisible, current_column, check_display_width):
8474 (check_display_width, scan_for_column, current_column_1)
8475 (Findent_to, Fcurrent_indentation, position_indentation)
8476 (indented_beyond_p, Fmove_to_column, compute_motion):
8477 (Fcompute_motion, Fvertical_motion):
8478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8479 (last_known_column_modified): Use EMACS_INT, not int.
8480 (check_display_width):
8481 (Fcompute_motion):
8482 Check that fixnums and floats are in proper range for system types.
8483 (compute_motion): Don't assume index or fixnum fits in int.
8484 (compute_motion, Fcompute_motion):
8485 Use int, not EMACS_INT, when it is wide enough.
8486 (vmotion): Omit local var start_hpos that is always 0; that way
8487 we don't need to worry about overflow in expressions involving it.
8488 * indent.h: Adjust decls to match defn changes elsewhere.
8489 (struct position):
8490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8491 Use int, not EMACS_INT, where int is wide enough.
8492 Remove unused members ovstring_chars_done and tab_offset;
8493 all uses removed.
8494 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8495 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8496 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8497 (make_gap, copy_text, insert, insert_and_inherit)
8498 (insert_before_markers, insert_before_markers_and_inherit)
8499 (insert_1, count_combining_before, count_combining_after)
8500 (insert_1_both, insert_from_string)
8501 (insert_from_string_before_markers, insert_from_string_1)
8502 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8503 (adjust_after_replace, adjust_after_insert, replace_range)
8504 (replace_range_2, del_range, del_range_1, del_range_byte)
8505 (del_range_both, del_range_2, modify_region)
8506 (prepare_to_modify_buffer, signal_before_change)
8507 (signal_after_change, Fcombine_after_change_execute):
8508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8509 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8510 (balance_an_interval, split_interval_right, split_interval_left)
8511 (find_interval, next_interval, update_interval)
8512 (adjust_intervals_for_insertion, delete_node, delete_interval)
8513 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8514 (static_offset_intervals, offset_intervals)
8515 (merge_interval_right, merge_interval_left, make_new_interval)
8516 (graft_intervals_into_buffer, temp_set_point_both)
8517 (temp_set_point, set_point, adjust_for_invis_intang)
8518 (set_point_both, move_if_not_intangible, get_property_and_range)
8519 (get_local_map, copy_intervals, copy_intervals_to_string)
8520 (compare_string_intervals, set_intervals_multibyte_1):
8521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8522 * intervals.h: Adjust decls to match defn changes elsewhere.
8523 (struct interval):
8524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8525 * keyboard.c (this_command_key_count, this_single_command_key_start)
8526 (before_command_key_count, before_command_echo_length, echo_now)
8527 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8528 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8529 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8530 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8532 (last_non_minibuf_size, last_point_position, echo_truncate)
8533 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8534 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8535 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8536 (stuff_buffered_input):
8537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8538 (last_auto_save, command_loop_1, read_char):
8539 Use EMACS_INT, not int, to avoid integer overflow.
8540 (record_char): Avoid overflow in total_keys computation.
8541 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8542 * keyboard.h: Adjust decls to match defn changes elsewhere.
8543 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8544 (Fkey_description, Fdescribe_vector, Flookup_key):
8545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8546 (click_position): New function, to check that positions are in range.
8547 (Fcurrent_active_maps):
8548 (describe_command):
8549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8550 (Faccessible_keymaps, Fkey_description):
8551 (preferred_sequence_p):
8552 Don't assume fixnum can fit into int.
8553 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8554 Check for integer overflow in size calculations.
8555 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8556 avoid mishandling large integers.
8557 * lisp.h: Adjust decls to match defn changes elsewhere.
8558 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8559 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8560 (struct Lisp_Marker):
8561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8562 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8563 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8564 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8565 All callers changed.
8566 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8567 Assume the arg has valid form, since it always does.
8568 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8569 unsigned integer system type.
8570 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8571 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8573 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8574 (duration_to_sec_usec): New decl.
8575 * lread.c (read_from_string_index, read_from_string_index_byte)
8576 (read_from_string_limit, readchar, unreadchar, openp)
8577 (read_internal_start, read1, oblookup):
8578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8579 (Fload, readevalloop, Feval_buffer, Feval_region):
8580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8581 (openp): Check for out-of-range argument to 'access'.
8582 (read1): Use int, not EMACS_INT, where int is wide enough.
8583 Don't assume fixnum fits into int.
6efdadfd 8584 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8585 (read_filtered_event): Use duration_to_sec_usec
8586 to do proper overflow checking on durations.
d311d28c
PE
8587 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8588 in size calculation.
8589 (Fexecute_kbd_macro):
8590 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8591 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8592 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8593 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8594 (set_marker_both, set_marker_restricted_both, marker_position)
8595 (marker_byte_position, Fbuffer_has_markers_at):
8596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8597 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8598 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8599 It now merely ensures that the menu is large enough, without
8600 necessarily growing it, as this avoids some integer overflow issues.
8601 All callers changed.
8602 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8603 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8604 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8605 Use SAFE_ALLOCA_LISP, not alloca.
8606 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8607 to EMACS_INT. Check that fixnums are in proper range for system types.
8608 * minibuf.c (minibuf_prompt_width, string_to_object)
8609 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8610 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8611 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8612 (get_minibuffer, read_minibuf_unwind):
8613 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8614 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8615 this simplifies overflow checking. All callers changed.
8616 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8617 (Ftest_completion):
8618 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8619 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8620 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8621 Check that fixnums are in proper range for system types.
8622 (Fx_create_frame, Fx_show_tip):
8623 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8624 * nsfont.m (ns_findfonts, nsfont_list_family):
8625 Don't assume fixnum fits in long.
8626 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8627 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8628 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8629 wide enough.
17fdb222 8630 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
8631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8632 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8633 (PRINTDECLARE, PRINTPREPARE):
8634 (strout, print_string):
8635 (print, print_preprocess, print_check_string_charset_prop)
8636 (print_object):
8637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8638 (PRINTDECLARE):
8639 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8640 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8641 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 8642 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 8643 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
8644 (print_error_message): Use SAFE_ALLOCA, not alloca.
8645 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
8646 (print_depth, new_backquote_output, print_number_index):
8647 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
8648 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8649 (Fset_process_window_size, Fformat_network_address)
8650 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 8651 (sigchld_handler):
d311d28c 8652 Check that fixnums are in proper range for system types.
d44287d4 8653 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
8654 Check for process-ids out of pid_t range rather than relying on
8655 undefined behavior.
e4d81efc 8656 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
8657 (Fformat_network_address, read_process_output, send_process)
8658 (Fprocess_send_region, status_notify):
8659 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8660 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8661 (wait_reading_process_output, read_process_output, exec_sentinel):
8662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8663 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8664 (Faccept_process_output): Use duration_to_sec_usec to do proper
8665 overflow checking on durations.
dde14581
PE
8666 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8667 Don't assume pid_t fits in int.
02481186
PE
8668 * process.h (struct Lisp_Process): Members tick and update_tick
8669 are now of type EMACS_INT, not int.
b62b53e8
PE
8670 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8671 configured --with-wide-int.
d311d28c
PE
8672 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8673 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8674 * search.c (looking_at_1, string_match_1):
8675 (fast_string_match, fast_c_string_match_ignore_case)
8676 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8677 (scan_newline, find_before_next_newline, search_command)
8678 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8679 (set_search_regs, wordify):
8680 (Freplace_match):
8681 (Fmatch_data):
8682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8683 (string_match_1, search_buffer, set_search_regs):
8684 (Fmatch_data):
8685 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8686 (wordify): Check for overflow in size calculation.
8687 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8688 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8689 Check that fixnums are in proper range for system types.
8690 * sound.c (struct sound_device)
8691 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8693 (Fplay_sound_internal):
8694 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 8695 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
8696 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8697 (Fparse_partial_sexp):
8698 Don't assume fixnums can fit in int.
8699 (struct lisp_parse_state, find_start_pos, find_start_value)
8700 (find_start_value_byte, find_start_begv)
8701 (update_syntax_table, char_quoted, dec_bytepos)
8702 (find_defun_start, prev_char_comend_first, back_comment):
8703 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8704 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8706 (Finternal_describe_syntax_value): Check that match_lisp is a
8707 character, not an integer, since the code stuffs it into int.
8708 (scan_words, scan_sexps_forward):
8709 Check that fixnums are in proper range for system types.
8710 (Fforward_word):
8711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8712 (scan_sexps_forward):
8713 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8714 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8715 * syntax.h: Adjust decls to match defn changes elsewhere.
8716 (struct gl_state_s):
8717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
8718 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8719 MOST_POSITIVE_FIXNUM.
d311d28c
PE
8720 * sysdep.c (wait_for_termination_1, wait_for_termination)
8721 (interruptible_wait_for_termination, mkdir):
8722 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8723 (emacs_read, emacs_write):
8724 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
8725 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8726 and double all fit in int.
d311d28c
PE
8727 * term.c (set_tty_color_mode):
8728 Check that fixnums are in proper range for system types.
8729 * termhooks.h (struct input_event):
8730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8731 * textprop.c (validate_interval_range, interval_of)
8732 (Fadd_text_properties, set_text_properties_1)
8733 (Fremove_text_properties, Fremove_list_of_text_properties)
8734 (Ftext_property_any, Ftext_property_not_all)
8735 (copy_text_properties, text_property_list, extend_property_ranges)
8736 (verify_interval_modification):
8737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8738 (Fnext_single_char_property_change)
8739 (Fprevious_single_char_property_change):
8740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
8741 (copy_text_properties):
8742 Check for integer overflow in index calculation.
d311d28c
PE
8743 * undo.c (last_boundary_position, record_point, record_insert)
8744 (record_delete, record_marker_adjustment, record_change)
8745 (record_property_change):
8746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8747 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8749 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8750 (Fx_hide_tip, Fx_file_dialog):
8751 * w32menu.c (set_frame_menubar):
8752 Use ptrdiff_t, not int, for consistency with rest of code.
8753 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8754 (select_window, Fdelete_other_windows_internal)
8755 (window_scroll_pixel_based, window_scroll_line_based)
8756 (Frecenter, Fset_window_configuration):
8757 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8758 (Fset_window_hscroll, run_window_configuration_change_hook)
8759 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 8760 (Fscroll_other_window, Frecenter):
d311d28c
PE
8761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8762 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8763 Don't assume fixnum fits in int.
8764 (Fset_window_scroll_bars):
8765 Check that fixnums are in proper range for system types.
8766 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8767 (string_pos, c_string_pos, number_of_chars, init_iterator)
8768 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8769 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8770 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
8771 (face_before_or_after_it_pos, handle_invisible_prop)
8772 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
8773 (display_prop_intangible_p, string_buffer_position_lim)
8774 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8775 (get_overlay_strings_1, get_overlay_strings)
8776 (iterate_out_of_display_property, forward_to_next_line_start)
8777 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8778 (get_next_display_element, set_iterator_to_next)
8779 (get_visually_first_element, compute_stop_pos_backwards)
8780 (handle_stop_backwards, next_element_from_buffer)
8781 (move_it_in_display_line_to, move_it_in_display_line)
8782 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8783 (add_to_log, message_dolog, message_log_check_duplicate)
8784 (message2, message2_nolog, message3, message3_nolog
8785 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8786 (current_message_1, truncate_echo_area, truncate_message_1)
8787 (set_message, set_message_1, store_mode_line_noprop)
8788 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8789 (text_outside_line_unchanged_p, check_point_in_composition)
8790 (reconsider_clip_changes)
8791 (redisplay_internal, set_cursor_from_row, try_scrolling)
8792 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8793 (redisplay_window, find_last_unchanged_at_beg_row)
8794 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8795 (trailing_whitespace_p, find_row_edges, display_line)
8796 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8797 (display_mode_element, store_mode_line_string)
8798 (pint2str, pint2hrstr, decode_mode_spec)
8799 (display_count_lines, display_string, draw_glyphs)
8800 (x_produce_glyphs, x_insert_glyphs)
8801 (rows_from_pos_range, mouse_face_from_buffer_pos)
8802 (fast_find_string_pos, mouse_face_from_string_pos)
8803 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8805 (safe_call, init_from_display_pos, handle_fontified_prop)
8806 (handle_single_display_spec, load_overlay_strings)
8807 (with_echo_area_buffer, setup_echo_area_for_printing)
8808 (display_echo_area, echo_area_display)
8809 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8810 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
8811 (redisplay_window, dump_glyph_row, display_mode_line)
8812 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 8813 (handle_display_spec, display_prop_string_p):
d311d28c
PE
8814 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8815 (handle_single_display_spec, build_desired_tool_bar_string)
8816 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8817 (get_specified_cursor_type):
8818 Check that fixnums are in proper range for system types.
8819 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8820 (Flookup_image_map):
8821 Don't assume fixnums fit in int.
8822 (compare_overlay_entries):
8823 Avoid mishandling comparisons due to subtraction overflow.
8824 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8825 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8826 (handle_tool_bar_click):
8827 Use int, not unsigned, since we prefer signed and the signedness
8828 doesn't matter here.
8829 (get_next_display_element, next_element_from_display_vector):
8830 Use int, not EMACS_INT, when int is wide enough.
8831 (start_hourglass): Use duration_to_sec_usec to do proper
8832 overflow checking on durations.
8833 * xfaces.c (Fbitmap_spec_p):
8834 Check that fixnums are in proper range for system types.
8835 (compare_fonts_by_sort_order):
8836 Avoid mishandling comparisons due to subtraction overflow.
8837 (Fx_family_fonts, realize_basic_faces):
8838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8839 (Fx_family_fonts):
8840 Don't assume fixnum fits in int.
8841 Use SAFE_ALLOCA_LISP, not alloca.
8842 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8843 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8844 (face_at_buffer_position, face_for_overlay_string)
8845 (face_at_string_position):
8846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8847 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8848 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8849 (Fx_show_tip):
8850 Check that fixnums are in proper range for system types.
8851 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8852 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8853 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8854 (Fx_change_window_property): Don't assume fixnums fit in int.
8855 * xfont.c (xfont_chars_supported):
8856 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8857 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8858 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8859 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8860 * xml.c (parse_region):
8861 * xrdb.c (magic_file_p):
8862 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8863 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8864 (x_get_local_selection, x_reply_selection_request)
8865 (x_handle_selection_request, wait_for_property_change):
8866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8867 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8868 short is wide enough.
8869 (x_send_client_event): Don't assume fixnum fits in int.
8870 * xterm.c (x_x_to_emacs_modifiers):
8871 Don't assume EMACS_INT overflows nicely into int.
8872 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8873 may come from Lisp.
8874 (handle_one_xevent): NATNUMP can eval its arg twice.
8875 (x_connection_closed):
8876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8877 * xterm.h: Adjust decls to match defn changes elsewhere.
8878 (struct scroll_bar): Use struct vectorlike_header
8879 rather than rolling our own approximation.
8880 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8881
c6574eb5
GM
88822012-05-25 Glenn Morris <rgm@gnu.org>
8883
8884 * lisp.mk (lisp): Update for more files being compiled now.
8885
e8d32c7e
SM
88862012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8887
48def666
SM
8888 * lread.c: Remove `read_pure' which makes no difference.
8889 (read_pure): Remove var.
8890 (unreadpure): Remove function.
8891 (readevalloop): Don't call read_list with -1 flag.
8892 (read1, read_vector): Don't test read_pure any more.
8893 (read_list): Simplify.
8894
e8d32c7e
SM
8895 * fileio.c, character.h: Minor style tweaks.
8896
4b2addb7
DA
88972012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8898
8899 * window.h (clip_changed): Remove useless declaration.
8900
584461b2
JB
89012012-05-22 Juanma Barranquero <lekktu@gmail.com>
8902
8903 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8904 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8905
34374650
PE
89062012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 Remove src/m/*.
8909 This directory predates autoconf and is no longer needed nowadays.
8910 Move its few remaining bits of functionality to where they're needed.
8911 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8912 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8913 * m/template.h: Remove.
8914 * Makefile.in (M_FILE): Remove. All uses removed.
8915 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8916 * lisp.h (USE_LSB_TAG):
8917 * mem-limits.h (EXCEEDS_LISP_PTR):
8918 Use VAL_MAX, not VALBITS, in #if.
8919 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8920 (EMACS_UINT): Define unconditionally now.
8921 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8922 (BITS_PER_EMACS_INT): New constants, replacing
8923 what used to be in config.h, but not useful in #if.
8924 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8925 define them any more.
8926 (VAL_MAX): New macro.
8927 (VALMASK): Use it.
8928 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8929 BITS_PER_EMACS_INT, in #if.
8930 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8931 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8932 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8933 * s/ms-w32.h (DATA_START):
8934 Move here from removed file m/intel386.h.
8935 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8936 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8937
261cb4bb
PE
89382012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8939
8940 Assume C89 or later.
8941 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8942 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8943 (xrealloc):
8944 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8945 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8946 * textprop.c, tparam.c (NULL): Remove.
8947 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8948 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8949 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8950 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8951 * xterm.c (input_signal_count): Assume volatile works.
8952
ff23cd9f
KB
89532012-05-21 Ken Brown <kbrown@cornell.edu>
8954
8955 * xgselect.c (xg_select): Fix first argument in call to 'select'
8956 (bug#11508).
8957
1b170bc6
KB
89582012-05-20 Ken Brown <kbrown@cornell.edu>
8959
8960 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 8961 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 8962
b2f4d39f
KB
89632012-05-19 Ken Brown <kbrown@cornell.edu>
8964
8965 * xfns.c (x_in_use): Remove `static' qualifier.
8966 * xterm.h (x_in_use): Declare.
8967 * xgselect.c: Include xterm.h.
8968 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8969 and `display_arg' (bug#9754).
8970
003fdae2
PE
89712012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8972
9232a6d9
PE
8973 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8974
003fdae2
PE
8975 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8976 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8977
784b56e2
EZ
89782012-05-18 Eli Zaretskii <eliz@gnu.org>
8979
8980 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8981
8982 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 8983 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
8984
8985 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8986 reference to image_cache->refcount.
8987 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8988
a0a79cde
JL
89892012-05-17 Juri Linkov <juri@jurta.org>
8990
8991 * search.c (Fword_search_regexp, Fword_search_backward)
8992 (Fword_search_forward, Fword_search_backward_lax)
8993 (Fword_search_forward_lax): Move functions to isearch.el
8994 (bug#10145, bug#11381).
8995
b0572523
PE
89962012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8997
8998 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8999
9660f5fc
SM
90002012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9001
9002 * lread.c (init_obarray): Declare Qt and Qnil as special.
9003
4374de83
GM
90042012-05-14 Glenn Morris <rgm@gnu.org>
9005
9006 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 9007 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 9008
dc44c39a
PE
90092012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9010
078c97cb
PE
9011 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9012
dc44c39a
PE
9013 * unexaix.c: Port to more-recent AIX compilers.
9014 (report_error, report_error_1, make_hdr, copy_sym)
9015 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9016 Make arguments const char *, not char *, to avoid violations of C
9017 standard and to fix some AIX warnings reported by Gilles Pion.
9018
e18afed7 90192012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
9020
9021 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9022 already have overlays loaded.
9023 (handle_single_display_spec): Before returning without displaying
9024 fringe bitmap, synchronize the bidi iterator with the main display
9025 iterator, by calling iterate_out_of_display_property.
9026 (iterate_out_of_display_property): Detect buffer iteration by
9027 testing that it->string is a Lisp string.
9028 (get_next_display_element): When the current object is exhausted,
9029 and there's something on it->stack, call set_iterator_to_next to
9030 proceed with what's on the stack, instead of returning zero.
9031 (set_iterator_to_next): If called at the end of a Lisp string,
9032 proceed to consider_string_end without incrementing string
9033 position. Don't increment display vector index past the end of
9034 the display vector. (Bug#11417)
c8fb9dc6
EZ
9035 (pos_visible_p): Don't report a position visible when move_it_to
9036 stopped at the last line of window, which happens to be scanned
9037 backwards by the bidi iteration. (Bug#11464)
ac268e67 9038
e18afed7 90392012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
9040
9041 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9042 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
9043 are on a TTY, and thus unable to display on the fringes.
9044 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
9045 so we need to signal to the caller that this is a "replacing"
9046 display spec. This fixes display when the spec is invalid or we
9047 are on a TTY.
9048
e18afed7 90492012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
9050
9051 * unexaix.c (make_hdr): Fix typo in prototype.
9052 This bug broke the build on AIX. Problem reported by Gilles Pion.
9053
9d0a235a
MA
90542012-05-14 Michael Albinus <michael.albinus@gmx.de>
9055
9056 * keyboard.c (kbd_buffer_get_event): Read special events also in
9057 batch mode. (Bug#11415)
9058
9e6b06ed
GM
90592012-05-12 Glenn Morris <rgm@gnu.org>
9060
9061 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9062
c1a1d7a3
EZ
90632012-05-12 Eli Zaretskii <eliz@gnu.org>
9064
9065 * lisp.mk (lisp): Add newcomment.elc.
9066
3fe7cdc8
GM
90672012-05-12 Glenn Morris <rgm@gnu.org>
9068
9069 * Makefile.in (MKDIR_P): New, set by configure.
9070 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9071
53f7d2c0
PE
90722012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9073
9074 Remove unused function hourglass_started.
9075 * dispextern.h (hourglass_started):
9076 * w32fns.c (hourglass_started):
9077 * xdisp.c (hourglass_started): Remove.
9078
75aafb17
JB
90792012-05-10 Juanma Barranquero <lekktu@gmail.com>
9080
9081 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9082 Update dependencies.
9083
12959e8e
PE
90842012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9085
97107e2e
PE
9086 * xgselect.c (xg_select): Put maxfds+1 into a var.
9087 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9088
12959e8e
PE
9089 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9090
836d29b3
DA
90912012-05-10 Dave Abrahams <dave@boostpro.com>
9092
9093 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9094 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9095
5cb67954
MA
90962012-05-09 Michael Albinus <michael.albinus@gmx.de>
9097
9098 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9099 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9100 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9101 Initialize xd_registered_buses.
9102
3478ec45
PE
91032012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9104
b263a6b0
PE
9105 Untag more efficiently if USE_LSB_TAG.
9106 This is based on a proposal by YAMAMOTO Mitsuharu in
9107 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9108 For an admittedly artificial (nth 8000 longlist) benchmark on
9109 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9110 Emacs's overall text size by 1%.
9111 * lisp.h (XUNTAG): New macro.
9112 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9113 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9114 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9115 * eval.c (Fautoload):
9116 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9117 * frame.h (XFRAME): Use XUNTAG.
9118
3478ec45
PE
9119 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9120 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9121 Remove unportable assumptions about print widths of types like
9122 dbus_uint32_t.
9123 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9124 intptr_t when converting between pointer and integer, to avoid GCC
9125 warnings about wrong width.
9126
666b903b 91272012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
9128
9129 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9130 stack for each reader_thread, instead of defaulting to 8MB
9131 determined by the linker. This avoids failures in creating
9132 subprocesses on Windows 7, see the discussion in this thread:
9133 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9134
b120cc17
JC
91352012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9136
9137 Fix up display of the *Minibuf-0* buffer in the mini window.
9138 * keyboard.c (read_char): Don't clear the echo area if there's no
9139 message to clear.
9140 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 9141 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 9142
9a4b36f8
MA
91432012-05-07 Michael Albinus <michael.albinus@gmx.de>
9144
9145 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9146 batch mode.
9147
e5f9458f
CY
91482012-05-06 Chong Yidong <cyd@gnu.org>
9149
9150 * lisp.mk (lisp): Update.
9151
eceeb5fc 91522012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
9153
9154 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9155
71873e2b
SM
91562012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9157
9158 * data.c (PUT_ERROR): New macro.
9159 (syms_of_data): Use it. Add new error type `user-error'.
9160 * undo.c (user_error): New function.
9161 (Fprimitive_undo): Use it.
9162 * print.c (print_error_message): Adjust print style for `user-error'.
9163 * keyboard.c (user_error): New function.
9164 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9165
ab0fa4e4
PE
91662012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9167
9168 Do not limit current-time-string to years 1000..9999.
9169 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9170 (Fcurrent_time_string): Support any year that is supported by the
9171 underlying localtime representation. Don't use asctime, as it
9172 has undefined behavior for years outside the range -999..9999.
9173
7ed806a7
PE
91742012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9175
9176 Fix race conditions involving setenv, gmtime, localtime, asctime.
9177 Without this fix, interrupts could mess up code that uses these
9178 nonreentrant functions, since setting TZ invalidates existing
9179 tm_zone or tzname values, and since most of these functions return
9180 pointers to static storage.
9181 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9182 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9183 Grow the critical sections to include not just invoking
9184 localtime/gmtime, but also accessing these functions' results
9185 including their tm_zone values if any, and any related TZ setting.
9186 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
9187 so that the struct tm is saved in the critical section.
9188 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
9189 motivated by the fact that memory allocation needs to be outside
9190 the critical section.
9191
0c16dfed
DA
91922012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9193
9194 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9195 with RESET_INTERVAL.
9196
9197 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9198 Remove duplicated buffer name initialization.
9199
3f83ace8
JM
92002012-05-02 Jim Meyering <jim@meyering.net>
9201
9202 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9203
c7b8541e
JM
9204 * xfns.c (x_window): Use xstrdup (Bug#11375).
9205
90207a15 92062012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
9207
9208 * xdisp.c (pos_visible_p): If already at a newline from the
9209 display string before the 'while' loop, don't walk back the glyphs
9210 from it3.glyph_row. Solves assertion violation when the display
9211 string begins with a newline (egg.el). (Bug#11367)
9212
b593d6a9
AH
92132012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9214
9215 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9216 Move to simple.el.
9217
4737362e
GM
92182012-05-01 Glenn Morris <rgm@gnu.org>
9219
99cf43f9
GM
9220 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9221 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9222 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9223 All were removed before 23.1.
9224
9311dcff
GM
9225 * dispnew.c: Remove HAVE_LIBNCURSES test;
9226 it is always true on relevant platforms.
9227
4d5c6349
GM
9228 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9229 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9230
4737362e
GM
9231 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9232
74dd3a6b
AS
92332012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9234
9235 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9236 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9237 Remove.
9238
13c379ee
PE
92392012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9240
9241 Do not avoid creating empty evaporating overlays (Bug#9642).
9242 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9243 That is, do not delete an evaporating overlay if it becomes
9244 empty after its bounds are adjusted to fit within its buffer.
9245 This fix caused other problems, and I'm reverting it until we get
9246 to the bottom of them.
9247
a8e7d6d7 92482012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
9249
9250 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9251
a8e7d6d7 92522012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
9253
9254 * xdisp.c (pos_visible_p): If the window start position is beyond
9255 ZV, start the display from buffer beginning. Prevents assertion
9256 violation in init_iterator when the minibuffer window is scrolled
9257 via the scroll bar.
9258
9259 * window.c (window_scroll_pixel_based): Likewise.
9260
a8e7d6d7 92612012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
9262
9263 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9264
a8e7d6d7 92652012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
9266
9267 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9268 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9269
a8e7d6d7 92702012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 9271
b593d6a9
AH
9272 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9273 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 9274
1c6900d9
EZ
92752012-04-26 Eli Zaretskii <eliz@gnu.org>
9276
4c3fa1d9
EZ
9277 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9278 display element, check also the underlying string or buffer
9279 character. (Bug#11341)
9280
1c6900d9
EZ
9281 * w32menu.c: Include w32heap.h.
9282 (add_menu_item): If the call to AppendMenuW (via
9283 unicode_append_menu) fails, disable Unicode menus only if we are
9284 running on Windows 9X/Me.
9285
42bf8205
AS
92862012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9287
9288 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9289 (xgetint): Add missing shift for LSB tags.
9290
b1bac16e
MR
92912012-04-24 Martin Rudalics <rudalics@gmx.at>
9292
9293 * keyboard.c (read_char): Don't wipe echo area for select window
9294 events: These might get delayed via `mouse-autoselect-window'
9295 (Bug#11304).
9296
d69621cc
JB
92972012-04-24 Juanma Barranquero <lekktu@gmail.com>
9298
9299 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9300 manipulation of :loaded-from data.
9301
02fd101b
JB
93022012-04-23 Juanma Barranquero <lekktu@gmail.com>
9303
9304 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9305 now a cons (bug#11311).
9306
888bec30
PE
93072012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9308
89a438bd
PE
9309 Do not create empty overlays with the evaporate property (Bug#9642).
9310 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9311 if it becomes empty after its bounds are adjusted to fit within
9312 its buffer. Without this fix, in a nonempty buffer (let ((o
9313 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9314 yields an empty overlay that has the evaporate property, which is
9315 not supposed to happen.
9316
1068fe4d
PE
9317 Fix minor GTK3 problems found by static checking.
9318 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9319 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9320 (struct _EmacsFixedClass, emacs_fixed_get_type):
9321 Move decls here from emacsgtkfixed.h, since they needn't be public.
9322 (emacs_fixed_get_type): Now static.
9323 (emacs_fixed_class_init): Omit unused local.
9324 (emacs_fixed_child_type): Remove; unused.
9325 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9326 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9327 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9328 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9329 (EMACS_FIXED_GET_CLASS): Remove; unused.
9330 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9331
888bec30
PE
9332 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9333 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9334
de85e130
PE
93352012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9336
d0baac98 9337 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 9338 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
9339 (__malloc_size_t, __malloc_ptrdiff_t):
9340 Remove. All uses removed, replaced by the definiens if needed,
9341 since we can assume C89 or better now.
9342 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9343 (protect_malloc_state, align, get_contiguous_space)
9344 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9345 (malloc_atfork_handler_child, malloc_enable_thread)
9346 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9347 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9348 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9349 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9350 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9351 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9352 Define using prototypes, not old style.
9353 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9354 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9355 (align): Don't assume that signed integer overflow wraps around.
9356 Omit unused local var.
9357 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9358 (_free_internal_nolock, memalign, mallochook, reallochook):
9359 Omit no-longer-needed casts.
9360 (valloc): Use getpagesize, not __getpagesize.
9361 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9362 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9363
de85e130
PE
9364 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9365
dcbf5805
MA
93662012-04-22 Michael Albinus <michael.albinus@gmx.de>
9367
9368 Move functions from C to Lisp. Make non-blocking method calls
9369 the default. Implement further D-Bus standard interfaces.
9370
9371 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9372 (QCdbus_request_name_allow_replacement)
9373 (QCdbus_request_name_replace_existing)
9374 (QCdbus_request_name_do_not_queue)
9375 (QCdbus_request_name_reply_primary_owner)
9376 (QCdbus_request_name_reply_in_queue)
9377 (QCdbus_request_name_reply_exists)
9378 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9379 (QCdbus_registered_serial, QCdbus_registered_method)
9380 (QCdbus_registered_signal): New Lisp objects.
9381 (XD_DEBUG_MESSAGE): Use sizeof.
9382 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9383 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9384 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9385 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9386 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9387 (xd_signature, xd_append_arg): Allow float for integer types.
9388 (xd_get_connection_references): New function.
b593d6a9
AH
9389 (xd_get_connection_address): Rename from xd_initialize.
9390 Return cached address.
dcbf5805
MA
9391 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9392 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9393 level.
9394 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 9395 Return number of refcounts.
dcbf5805
MA
9396 (Fdbus_get_unique_name): Make stronger parameter check.
9397 (Fdbus_message_internal): New defun.
9398 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9399 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9400 (Fdbus_send_signal, Fdbus_register_service)
9401 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9402 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9403 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9404 (Vdbus_compiled_version, Vdbus_runtime_version)
9405 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9406 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9407 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
9408 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9409 Adapt docstring.
dcbf5805 9410
52828e02
PE
94112012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9412
da05bc4c
PE
9413 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9414 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9415 Do not assume ptrdiff_t is the same width as 'int'.
9416
52828e02
PE
9417 * alloc.c: Handle unusual debugging option combinations.
9418 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9419 since the two debugging options are incompatible.
9420 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9421 is defined.
9422 (mem_init, mem_insert, mem_insert_fixup):
9423 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9424 (NEED_MEM_INSERT): Remove; no longer needed.
9425
f01769f9
LL
94262012-04-22 Leo Liu <sdl.web@gmail.com>
9427
9428 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9429
5790543d
PE
94302012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9431
9432 * sysdep.c [__FreeBSD__]: Minor cleanups.
9433 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9434 Use Emacs indenting style more consistently. Avoid some casts.
9435 Use 'double' consistently rather than mixing 'float' and 'double'.
9436
b91b7e4d
EW
94372012-04-21 Eduard Wiebe <usenet@pusto.de>
9438
b593d6a9
AH
9439 * sysdep.c (list_system_processes, system_process_attributes):
9440 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 9441
6114eb15
AS
94422012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9443
9444 * lisp.mk (lisp): Update.
9445
2f38dff7
PE
94462012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9447
9448 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9449 It is never used otherwise.
9450
4ae29f89
SM
94512012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9452
9453 * print.c (print_preprocess): Only check print_depth if print-circle
9454 is nil.
9455 (print_object): Check for cycles even when print-circle is nil and
9456 print-gensym is t, but only check print_depth if print-circle is nil.
9457
f30d612a
CY
94582012-04-20 Chong Yidong <cyd@gnu.org>
9459
9460 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9461 set the status to "failed" and ensure that sentinel is run.
9462
c07a4c0b 94632012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
9464
9465 * process.c (Fset_process_inherit_coding_system_flag)
9466 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 9467 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 9468
c07a4c0b 94692012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
9470
9471 * xdisp.c (string_buffer_position_lim): Limit starting position to
9472 BEGV.
9473 (set_cursor_from_row): If called for a mode-line or header-line
9474 row, return zero immediately.
9475 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
9476 farther than the first row after the header line, if any.
9477 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
9478 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9479
c07a4c0b 94802012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9481
4ae29f89
SM
9482 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9483 (bug#11238).
ad3a2b41 9484
c07a4c0b 94852012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 94862012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
9487
9488 configure: new option --enable-gcc-warnings (Bug#11207)
9489 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9490 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9491 (ALL_CFLAGS): Use new macros rather than old.
9492 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9493 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9494 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9495 -Wunused-result, -Wunused-variable. This should go away once
9496 the Emacs and Gnulib regex code is merged.
9497 (xmalloc, xrealloc): Now static.
9498
aba027e8
PE
94992012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9500
9501 * dired.c (Fsystem_groups): Remove unused local.
9502
e5a36063
GM
95032012-04-17 Glenn Morris <rgm@gnu.org>
9504
9505 * dired.c (Fsystem_users): Doc fix.
9506
316411f0
DA
95072012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9508
9509 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9510 (syms_of_dired): Add them.
9511
9426aba4
PE
95122012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9513
b62a57be
PE
9514 Fix minor alloc.c problems found by static checking.
9515 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9516 New extern decls, to avoid calling undeclared functions.
9517 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9518 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9519 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9520 (NEED_MEM_INSERT): New macro.
9521 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 9522 Remove one incorrect comment and fix another.
b62a57be 9523
3539f31f
PE
9524 Fix minor ralloc.c problems found by static checking.
9525 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9526 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9527 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9528 (r_alloc_sbrk): Now static.
9529
a041960a
PE
9530 Improve ralloc.c interface checking.
9531 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9532 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9533 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9534 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9535 [REL_ALLOC]: ... to here, to check interface.
9536 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9537 Remove decls. This fixes an "It stinks!".
9538
9426aba4
PE
9539 * alloc.c (which_symbols): Fix alignment issue / type clash.
9540
d55c12ed
AS
95412012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9542
9543 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9544 (struct Lisp_Misc_Any): Likewise.
9545 (struct Lisp_Free): Likewise.
9546 * alloc.c (union aligned_Lisp_Symbol): Define.
9547 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9548 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9549 (union aligned_Lisp_Misc): Define.
9550 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9551 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9552 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9553
b948ce8b
PE
95542012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9555
9556 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9557 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9558 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9559 * s/netbsd.h, s/sol2-6.h:
9560 Remove definition of GC_MARK_STACK, since the default now works.
9561 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9562 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9563 no longer the default.
9564 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9565
35dc09a1 95662012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9567
35dc09a1
GM
9568 * lread.c (lisp_file_lexically_bound_p):
9569 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9570
35dc09a1
GM
95712012-04-14 Eli Zaretskii <eliz@gnu.org>
9572
9573 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9574 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9575
95762012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9577
9578 * nsterm.m (constrainFrameRect): Always constrain when there is only
9579 one screen (Bug#10962).
9580
bcd86815
KB
95812012-04-13 Ken Brown <kbrown@cornell.edu>
9582
9583 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9584
c25df26e
RT
95852012-04-13 Reuben Thomas <rrt@sc3d.org>
9586
9587 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9588
0fc59f1e
DC
95892012-04-11 Daniel Colascione <dancol@dancol.org>
9590
9591 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9592 against is gone. It's better to use vfork now so that when Cygwin
9593 gains a new, working vfork, we use it automatically (bug#10398).
9594
de8c03dc
SM
95952012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9596
9597 * window.c (save_window_save): Obey window-point-insertion-type.
9598
2f097256
GM
95992012-04-11 Glenn Morris <rgm@gnu.org>
9600
9601 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9602
453b951e
SM
96032012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9604
9605 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9606
75f1671a 96072012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9608
9609 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9610 (force_quit_count): New var.
9611 (handle_interrupt): Use it.
9612
2a8ce227
JB
96132012-04-10 Juanma Barranquero <lekktu@gmail.com>
9614
9615 * w32.c (w32_delayed_load): Record the full path of the library
9616 being loaded (bug#10424).
9617
935396c0
GM
96182012-04-09 Glenn Morris <rgm@gnu.org>
9619
05920a43
GM
9620 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9621 not just in the obarray, before snarfing them. (Bug#11036)
9622
935396c0
GM
9623 * Makefile.in ($(leimdir)/leim-list.el):
9624 Pass EMACS rather than BUILT_EMACS.
9625
a18ecafa
TZ
96262012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9627
9628 * process.c (make_process):
9629 * process.h: Add integer `gnutls_handshakes_tried' member to
9630 process struct.
9631
6bbef4e5
JC
9632 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9633 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
9634
9635 * gnutls.c (gnutls_log_function2i): Convenience log function.
9636 (emacs_gnutls_read): Use new log functions,
9637 `gnutls_handshakes_tried' process member, and
9638 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9639 attempts per process (connection).
9640
b4d3bc10
CY
96412012-04-09 Chong Yidong <cyd@gnu.org>
9642
9643 * eval.c (Fuser_variable_p, user_variable_p_eh)
9644 (lisp_indirect_variable): Functions deleted.
9645 (Fdefvar): Caller changed.
9646
9647 * callint.c (Finteractive, Fcall_interactively):
9648 * minibuf.c (Fread_variable): Callers changed.
9649
70f4d973
EZ
96502012-04-09 Eli Zaretskii <eliz@gnu.org>
9651
9652 * xdisp.c (set_cursor_from_row): If the display string appears in
9653 the buffer at position that is closer to point than the position
9654 after the display string, display the cursor on the first glyph of
9655 the display string. Fixes cursor display when a 'display' text
9656 property immediately follows invisible text. (Bug#11094)
9657
cb3c2e3e
PE
96582012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9659
9660 composite.c: use 'double' consistently
9661 * composite.c (get_composition_id): Use 'double' consistently
9662 instead of converting 'float' to 'double' and vice versa; this is
9663 easier to understand and avoids a GCC warning.
9664
fd06db5d
GM
96652012-04-09 Glenn Morris <rgm@gnu.org>
9666
50fe702a
GM
9667 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9668 preparation for dumping it with emacs. (Bug#4789)
9669 (leimdir): New variable.
9670 ($(leimdir)/leim-list.el): New rule.
9671 (emacs$(EXEEXT)): Depend on leim-list.el.
9672
fd06db5d
GM
9673 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9674 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9675 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9676
55c131ee
AS
96772012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9678
9679 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9680 proper alignment.
9681
9209588f
JB
96822012-04-07 Juanma Barranquero <lekktu@gmail.com>
9683
9684 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9685 Remove unused local variable.
9686
e3fb2efb
PE
96872012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9690 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9691 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9692 objects, as mark_maybe_pointer will catch them otherwise.
9693 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9694 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9695
b5385551
PE
96962012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9697
9698 Fix typo that broke non-Windows builds.
9699 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9700
9078ead6
EZ
97012012-04-07 Eli Zaretskii <eliz@gnu.org>
9702
9703 Support building on MS-Windows with libxml2.
9704
9705 * makefile.w32-in (OBJ2): Add xml.$(O).
9706 (GLOBAL_SOURCES): Add xml.c.
9707 ($(BLD)/xml.$(O)): New dependency list.
9708
9709 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9710 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9711 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9712 [!WINDOWSNT]: New macros.
9713 (init_libxml2_functions, libxml2_loaded_p): New functions.
9714 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9715 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9716 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9717 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9718 linked in).
6bbef4e5
JC
9719 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9720 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
9721 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9722
9723 * emacs.c: Don't include libxml/parser.h.
9724 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9725 xmlCleanupParser directly.
9726
9727 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9728
3811fdf3
EZ
97292012-04-07 Eli Zaretskii <eliz@gnu.org>
9730
9731 * indent.c (Fvertical_motion): If there is a display string at
9732 point, use it.vpos to compute how many lines to backtrack after
9733 move_it_to point. (Bug#11133)
9734
2f8e16b2
EZ
97352012-04-06 Eli Zaretskii <eliz@gnu.org>
9736
9737 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9738 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9739 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9740 macros related to unification of CJK characters. For the details,
9741 see the discussion following the message here:
9742 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9743
3d439cd1
CY
97442012-04-04 Chong Yidong <cyd@gnu.org>
9745
9746 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9747
8bc53d00
EZ
97482012-04-01 Eli Zaretskii <eliz@gnu.org>
9749
9750 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9751 instead of alloca. (Bug#11138)
9752
3b0512a3
AS
97532012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9754
9755 * w32menu.c (is_simple_dialog): Properly check lisp types.
9756 (Bug#11141)
9757
8427ddd2
EZ
97582012-03-31 Eli Zaretskii <eliz@gnu.org>
9759
979022ef
EZ
9760 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9761 position we get to after a call to move_it_to fails the
9762 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9763 only if we wind up in a string from display property. (Bug#11063)
9764
a6b1c7cc
EZ
9765 * window.c (Fdelete_other_windows_internal): Invalidate the row
9766 and column information about mouse highlight, so that redisplay
9767 restores it after reallocating the glyph matrices. (Bug#7464)
9768
8427ddd2
EZ
9769 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9770 string comes from a `display' text property, use the buffer
9771 position of that property as if we actually saw that position in
9772 the row's glyphs.
697ba24b
EZ
9773 (move_it_by_lines): Remove the assertion that
9774 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9775 violated when there's a before-string at the beginning of a line.
9776 (Bug#11063)
8427ddd2 9777
65a0a738
EZ
97782012-03-30 Eli Zaretskii <eliz@gnu.org>
9779
9780 * xdisp.c (append_space_for_newline): If the default face was
9781 remapped, use the remapped face for the appended newline.
9782 (extend_face_to_end_of_line): Use the remapped default face for
9783 extending the face to the end of the line.
9784 (display_line): Call extend_face_to_end_of_line when the default
9785 face was remapped. (Bug#11068)
9786
581355cc
EZ
97872012-03-29 Eli Zaretskii <eliz@gnu.org>
9788
9789 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9790
e8fc049f
SM
97912012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9792
9793 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9794
4fb9a543
GM
97952012-03-27 Glenn Morris <rgm@gnu.org>
9796
9797 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9798 Doc fixes.
9799
679910f1
KH
98002012-03-26 Kenichi Handa <handa@m17n.org>
9801
9802 * dispextern.h (struct glyph): Fix previous change. Change the
9803 bit length of glyphless.ch to 25 (Bug#11082).
9804
90d49b7f
CY
98052012-03-26 Chong Yidong <cyd@gnu.org>
9806
9807 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9808 (command_loop_1): Use it; inhibit selection update for
9809 handle-select-window too (Bug#8996).
9810
f514f6f0
FP
98112012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9812
e8fc049f 9813 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 9814
bf43fa51
KH
98152012-03-25 Kenichi Handa <handa@m17n.org>
9816
9817 * dispextern.h (struct glyph): Change the bit length of
9818 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9819
8a0c01dd
EZ
98202012-03-24 Eli Zaretskii <eliz@gnu.org>
9821
9822 * s/ms-w32.h (tzname): Include time.h before redirecting to
9823 _tzname. Fixes the MSVC build. (Bug#9960)
9824
7d1c3a76
AS
98252012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9826
8ed79523
AS
9827 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9828 characters.
9829
7d1c3a76
AS
9830 * xterm.c (XTread_socket): Only modify handling_signal if
9831 !SYNC_INPUT. (Bug#11080)
9832
e99a9b8b
EZ
98332012-03-23 Eli Zaretskii <eliz@gnu.org>
9834
9835 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9836 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9837 when fetching a multibyte character consumes more bytes than
9838 CHAR_BYTES returns, due to unification of CJK characters in
9839 string_char. (Bug#11073)
9840
5063c0e1
TN
98412012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9842
9843 * process.c (wait_reading_process_output): Handle pty disconnect
9844 by refraining from sending oneself a SIGCHLD (bug#10933).
9845
9f851fbd
CY
98462012-03-22 Chong Yidong <cyd@gnu.org>
9847
9848 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9849
5063c0e1 9850 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
9851 Mark string as coming from a prefix property.
9852 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9853 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9854
fb5b8aca
CY
98552012-03-21 Chong Yidong <cyd@gnu.org>
9856
9857 * xfaces.c (Vface_remapping_alist): Doc fix.
9858
62356a1b
EZ
98592012-03-20 Eli Zaretskii <eliz@gnu.org>
9860
9861 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
9862 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9863 Doc fixes.
62356a1b 9864
025de85b
CY
98652012-03-20 Chong Yidong <cyd@gnu.org>
9866
9867 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9868 to reflect default non-nil value of redisplay-dont-pause.
9869
4827f94e
KH
98702012-03-19 Kenichi Handa <handa@m17n.org>
9871
9872 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9873 it fit in a valid range (Bug#11003).
9874
e50a24a2
EZ
98752012-03-18 Eli Zaretskii <eliz@gnu.org>
9876
9877 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9878 that is not from display property, accept the row as a "cursor
9879 row" if one of the string's character has a non-nil `cursor'
9880 property. Fixes cursor positioning when there are newlines in
9881 overlay strings, e.g. in icomplete.el. (Bug#11035)
9882
9af5ed87
PE
98832012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9884
9885 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9886
d1f55f16
CY
98872012-03-12 Chong Yidong <cyd@gnu.org>
9888
9889 * eval.c (inhibit_lisp_code): Rename from
9890 inhibit_window_configuration_change_hook; move from window.c.
9891
9892 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9893 * window.c (run_window_configuration_change_hook)
9894 (syms_of_window): Callers changed.
9895
66c5eebd
CY
98962012-03-11 Chong Yidong <cyd@gnu.org>
9897
413df973
CY
9898 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9899
66c5eebd
CY
9900 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9901
1de11f56
CY
99022012-03-10 Chong Yidong <cyd@gnu.org>
9903
9904 * frame.c (other_visible_frames): Don't assume the selected frame
9905 is visible (Bug#10955).
9906
cae07000
SM
99072012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9908
9909 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9910
89c94350
JD
99112012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9912
9913 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9914 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9915 zero (Bug#10954).
9916
999dd333
GM
99172012-03-03 Glenn Morris <rgm@gnu.org>
9918
01a6dcc8 9919 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 9920
de0100f2
EZ
99212012-03-02 Eli Zaretskii <eliz@gnu.org>
9922
9923 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9924 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
9925 (redisplay_window, next_element_from_string): Fix typos in
9926 comments.
3e441275
EZ
9927 (redisplay_window): Pass to move_it_vertically the margin in
9928 pixels, not in screen lines.
de0100f2 9929
96a72ee9
GM
99302012-03-02 Glenn Morris <rgm@gnu.org>
9931
9932 * buffer.c (buffer-list-update-hook): Doc fix.
9933
312508d7
EZ
99342012-02-29 Eli Zaretskii <eliz@gnu.org>
9935
9936 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9937 push_it before setting up the iterator for the first overlay
9938 string, even if we have an empty string loaded.
9939 (next_overlay_string): If there's an empty string on the iterator
9940 stack, pop the stack. (Bug#10903)
9941
27f3c637
PE
99422012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9943
9944 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9945 Suggested by Stefan Monnier in
9946 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9947 * alloc.c (widen_to_Lisp_Object): New static function.
9948 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9949 and widening them to Lisp_Objects. This would work even if
9950 USE_LSB_TAG is defined and wide integers are used, which might
9951 happen in a future version of Emacs.
9952
3c9dfce6
CY
99532012-02-25 Chong Yidong <cyd@gnu.org>
9954
fa74b241
CY
9955 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9956 Doc fix.
9957
3c9dfce6
CY
9958 * xselect.c (Fx_selection_exists_p): Doc fix.
9959 (x_clipboard_manager_save_all): Print an informative message
9960 before saving to clipboard manager.
9961
9486df08
CY
99622012-02-24 Chong Yidong <cyd@gnu.org>
9963
9964 * keyboard.c (process_special_events): Handle all X selection
9965 requests in kbd_buffer, not just the next one (Bug#8869).
9966
f01d3321
CY
99672012-02-23 Chong Yidong <cyd@gnu.org>
9968
9969 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9970 call when setting menu-bar-lines and tool-bar-lines parameters.
9971 (unwind_create_frame_1): New helper function.
9972
9973 * window.c (inhibit_window_configuration_change_hook): New var.
9974 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 9975 (syms_of_window): Initialize it.
f01d3321 9976
86b847b6
CY
99772012-02-22 Chong Yidong <cyd@gnu.org>
9978
9979 * xterm.c (x_draw_image_relief): Add missing type check for
9980 Vtool_bar_button_margin (Bug#10743).
9981
a59225b1
CY
99822012-02-21 Chong Yidong <cyd@gnu.org>
9983
9984 * fileio.c (Vfile_name_handler_alist): Doc fix.
9985
9986 * buffer.c (Fget_file_buffer): Protect against invalid file
9987 handler return value.
9988
310f5bd4
PE
99892012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9990
cb3a28cc
PE
9991 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9992 when computing $valmask.
9993
310f5bd4
PE
9994 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9995 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9996 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9997 It's useless in that case, and it can cause problems on hosts
9998 that allocate halves of EMACS_INT values separately.
9999 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10000 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10001 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10002 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10003 it avoids undefined behavior on hosts where shifting right by more
10004 than the word width has undefined behavior.
10005
2375c96a
CY
100062012-02-19 Chong Yidong <cyd@gnu.org>
10007
10008 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10009 (Funhandled_file_name_directory, Ffile_name_as_directory)
10010 (Fdirectory_file_name, Fexpand_file_name)
10011 (Fsubstitute_in_file_name): Protect against invalid file handler
10012 return values (Bug#10845).
10013
3eb49e71
EZ
100142012-02-18 Eli Zaretskii <eliz@gnu.org>
10015
10016 * .gdbinit (pitx): Fix incorrect references to fields of the
10017 iterator stack.
10018
7b926f3f
CY
100192012-02-17 Chong Yidong <cyd@gnu.org>
10020
10021 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10022
11273115
PE
100232012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10024
10025 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10026 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10027
c3a70e2b
CY
100282012-02-15 Chong Yidong <cyd@gnu.org>
10029
10030 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10031 marked as special. Also, starting docstrings with * is obsolete.
10032
0ca43699
AS
100332012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10034
10035 * gnutls.c (emacs_gnutls_write): Fix last change.
10036
2e8f3c56
LI
100372012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10038
10039 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10040 send_process.
10041
af70074f
SM
100422012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10043
10044 * keymap.c (Fsingle_key_description): Handle char ranges.
10045
95986d52
CY
100462012-02-12 Chong Yidong <cyd@gnu.org>
10047
afd83bd1
CY
10048 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10049 as that creates a dangerous corner case.
10050
95986d52
CY
10051 * window.c (Fdelete_window_internal): Invalidate the mouse
10052 highlight (Bug#9904).
10053
bd7da63e
GM
100542012-02-12 Glenn Morris <rgm@gnu.org>
10055
10056 * xselect.c (Fx_own_selection_internal)
10057 (Fx_get_selection_internal, Fx_disown_selection_internal)
10058 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10059 * nsselect.m (Fx_own_selection_internal)
10060 (Fx_disown_selection_internal, Fx_selection_exists_p)
10061 (Fx_selection_owner_p, Fx_get_selection_internal):
10062 Sync docs and argument specs with the xselect.c versions.
10063
77abcbc2
LI
100642012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10065
10066 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10067
90b671e2
EZ
100682012-02-11 Eli Zaretskii <eliz@gnu.org>
10069
1c0ca0b7
EZ
10070 * w32select.c (Fx_selection_exists_p): Sync doc string and
10071 argument list with xselect.c. (Bug#10783)
10072
10073 * w16select.c (Fx_selection_exists_p): Sync doc string and
10074 argument list with xselect.c. (Bug#10783)
90b671e2 10075
49241268
GM
100762012-02-10 Glenn Morris <rgm@gnu.org>
10077
10078 * fns.c (Fsecure_hash): Doc fix.
10079
f998bbe7 100802012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
10081
10082 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10083
0992bd9c
CY
100842012-02-07 Chong Yidong <cyd@gnu.org>
10085
10086 * buffer.c (Fbuffer_local_variables)
10087 (buffer_lisp_local_variables): Handle unbound vars correctly;
10088 don't let Qunbound leak into Lisp.
10089
af008560
GM
100902012-02-07 Glenn Morris <rgm@gnu.org>
10091
dd605cc4
GM
10092 * image.c (Fimagemagick_types): Doc fix.
10093
af008560
GM
10094 * image.c (imagemagick-render-type): Change it from a lisp object
10095 to an integer. Move the doc here from the lisp manual.
10096 Treat all values not equal to 0 the same.
10097
1449fa1d
CY
100982012-02-06 Chong Yidong <cyd@gnu.org>
10099
10100 * doc.c (store_function_docstring): Avoid applying docstring of
10101 alias to base function (Bug#2603).
10102
3723ec07
AS
101032012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10104
10105 * .gdbinit (pp1, pv1): Remove redundant defines.
10106 (pr): Use pp.
10107
79c1cc1e
CY
101082012-02-04 Chong Yidong <cyd@gnu.org>
10109
10110 * nsterm.m: Declare a global (Bug#10694).
10111
d7f29f8e
EZ
101122012-02-04 Eli Zaretskii <eliz@gnu.org>
10113
cae07000
SM
10114 * w32.c (get_emacs_configuration_options):
10115 Include --enable-checking, if specified, in the return value.
d7f29f8e 10116
3b95a6f9
MR
101172012-02-04 Martin Rudalics <rudalics@gmx.at>
10118
10119 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10120 after rounding frame sizes. (Bug#9723)
10121
d6fa96a6
EZ
101222012-02-04 Eli Zaretskii <eliz@gnu.org>
10123
10124 * keyboard.c (adjust_point_for_property): Don't position point
10125 before BEGV. (Bug#10696)
10126
df0b2940
PE
101272012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10128
10129 Handle overflow when computing char display width (Bug#9496).
10130 * character.c (char_width): Return EMACS_INT, not int.
10131 (char_width, c_string_width): Check for overflow when
10132 computing the width; this is possible now that individual
10133 characters can have unbounded width. Problem introduced
10134 by merge from Emacs 23 on 2012-01-19.
10135
6bee44d6
MA
101362012-02-02 Michael Albinus <michael.albinus@gmx.de>
10137
10138 * dbusbind.c (Fdbus_register_method): Mention the return value
10139 :ignore in the docstring.
10140
44f92739
GM
101412012-02-02 Glenn Morris <rgm@gnu.org>
10142
1b9f60cc
GM
10143 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10144
44f92739
GM
10145 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10146 Unconditionally set to t. (Bug#10673)
10147 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10148 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10149 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10150
c5d3843c
KH
101512012-02-02 Kenichi Handa <handa@m17n.org>
10152
10153 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10154 0, do not call append_composite_glyph.
10155
159462d4 101562012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
10157
10158 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10159 NULL (Bug#6988).
10160 (x_produce_glyphs): If the component of a composition is a null
10161 string, set it->pixel_width to 1 to avoid zero-width glyph.
10162
78cef877
EZ
101632012-02-01 Eli Zaretskii <eliz@gnu.org>
10164
10165 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10166 first 2 arguments are identical. This makes inserting large
10167 output from a subprocess an order of magnitude faster on
10168 MS-Windows, where all sbrk'ed memory is always contiguous.
10169
97897668
GM
101702012-01-31 Glenn Morris <rgm@gnu.org>
10171
10172 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 10173 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
10174 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10175
31fd3586
GM
101762012-01-29 Glenn Morris <rgm@gnu.org>
10177
10178 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10179
0e24a8b2
CY
101802012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10181
10182 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10183
cc0adcb0
CY
101842012-01-28 Chong Yidong <cyd@gnu.org>
10185
10186 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10187
acc28cb9
CY
101882012-01-26 Chong Yidong <cyd@gnu.org>
10189
9c69cfb7
CY
10190 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10191
acc28cb9
CY
10192 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10193 repeat counts (Bug#10507).
10194
48da7392
GM
101952012-01-26 Glenn Morris <rgm@gnu.org>
10196
10197 * lread.c (syms_of_lread): Doc fix.
10198
14af5f7f
CY
101992012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10200
10201 * coding.c (encode_designation_at_bol): Change return value to
10202 EMACS_INT.
10203
0b21c100
CY
102042012-01-25 Chong Yidong <cyd@gnu.org>
10205
10206 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10207
3c2907f7
CY
102082012-01-21 Chong Yidong <cyd@gnu.org>
10209
10210 * floatfns.c (Fcopysign): Make the second argument non-optional,
10211 since nil is not allowed anyway.
10212
959ad23f
AS
102132012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10214
10215 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10216 (send_process): Likewise.
10217
34a02f46
MR
102182012-01-19 Martin Rudalics <rudalics@gmx.at>
10219
10220 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
10221 (Vwindow_persistent_parameters): Do not use Qstate.
10222 Rewrite doc-strings.
34a02f46 10223
1259009a 102242012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
10225
10226 * character.c (char_width): New function.
70d4fdf6
GM
10227 (Fchar_width, c_string_width, lisp_string_width):
10228 Use char_width (Bug#9496).
25ed9e61 10229
6a6ee00d
MR
102302012-01-16 Martin Rudalics <rudalics@gmx.at>
10231
10232 * window.c (Vwindow_persistent_parameters): New variable.
10233 (Fset_window_configuration, save_window_save): Handle persistent
10234 window parameters.
10235
c85efaf7
EZ
102362012-01-14 Eli Zaretskii <eliz@gnu.org>
10237
10238 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10239 thrashing the stack of the thread. (Bug#9087)
10240
5944709e
PE
102412012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10242
10243 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10244
e71f5d99
EZ
102452012-01-11 Eli Zaretskii <eliz@gnu.org>
10246
10247 * xdisp.c (rows_from_pos_range): Handle the case where the
10248 highlight ends on a newline. (Bug#10464)
10249 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10250 he end column for display of highlight that ends on a newline
10251 before a R2L line.
10252
ce316182
GM
102532012-01-11 Glenn Morris <rgm@gnu.org>
10254
10255 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10256 from load-path also when installation-directory is nil. (Bug#10208)
10257
5b43da69
GM
102582012-01-10 Glenn Morris <rgm@gnu.org>
10259
74cc8ff9
GM
10260 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10261
7d8d6e4e
GM
10262 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10263 Update template values to be closer to their typical values these days.
5b43da69 10264
a0db8d43
EZ
102652012-01-09 Eli Zaretskii <eliz@gnu.org>
10266
10267 * xdisp.c (rows_from_pos_range): Accept additional argument
10268 DISP_STRING, and accept any glyph in a row whose object is that
10269 string as eligible for mouse highlight. Fixes mouse highlight of
10270 display strings from overlays. (Bug#10464)
10271
9a0115ab 102722012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 10273
b9110d6a 10274 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
10275 * fileio.c (auto_saving_dir_umask): New static var.
10276 (Fmake_directory_internal): Use it.
10277 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10278 creating the directory. The old code temporarily assigns
10279 too-generous permissions to the directory.
10280 (do_auto_save_eh): Clear it.
b9110d6a 10281 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
10282 that the var is always cleared.
10283
6c1bd3f3
EZ
102842012-01-07 Eli Zaretskii <eliz@gnu.org>
10285
10286 * search.c (scan_buffer): Pass character positions to
10287 know_region_cache, not byte positions. (Bug#6540)
10288
069d2b50
L
102892012-01-07 LynX <_LynX@bk.ru> (tiny change)
10290
10291 * w32.c (sys_rename): Report EXDEV when rename of a directory
10292 fails because the target is on another logical disk. (Bug#10284)
10293
75bf0d33
DB
102942012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10295
10296 * xterm.c (x_embed_request_focus): New function.
10297
10298 * xterm.h: Add prototype.
10299
10300 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10301
1c6e5a32
GM
103022012-01-05 Glenn Morris <rgm@gnu.org>
10303
10304 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10305
651e947e
EZ
103062012-01-01 Eli Zaretskii <eliz@gnu.org>
10307
10308 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10309 Load gnutls_transport_set_lowat only if GnuTLS version is below
10310 2.11.1.
10311 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10312 GnuTLS versions below 2.11.1.
10313
3778cdd8
AL
103142011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10315
10316 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10317 to the doc string advising against its use for altering the way
10318 windows are scrolled.
10319
0e5317f7
KH
103202011-12-28 Kenichi Handa <handa@m17n.org>
10321
10322 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10323 coding-system ASCII compatible only when it does not produce BOM
10324 on encoding (Bug#10383).
10325
93d5ca1f
JD
103262011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10327
10328 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10329 can scroll.
10330 (create_and_show_popup_menu): Always use menu_position_func for
10331 Gtk3 (Bug#10361).
10332
ca22b785
AS
103332011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10334
10335 * callint.c (Fcall_interactively): Don't truncate prompt string.
10336
d048e1e6
EZ
103372011-12-23 Eli Zaretskii <eliz@gnu.org>
10338
10339 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10340 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 10341 resumed from there (after widening). (Bug#10360)
d048e1e6 10342
5ccaba1f
JD
103432011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10344
10345 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10346
204ee57f
JD
103472011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10348
b81d40f0
JB
10349 * nsterm.m (x_free_frame_resources):
10350 Release f->output_data.ns->miniimage.
204ee57f
JD
10351 (ns_index_color): Fix indentation. Do not retain
10352 color_table->colors[i].
10353
10354 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10355 before returning.
10356
10357 * nsfns.m (x_set_background_color): Assign return value from
10358 ns_index_color to face-background instead of NSColor*.
10359 (ns_implicitly_set_icon_type): Fix indentation.
10360 Change assignment in for loop to comparison.
10361
10362 * emacs.c (ns_pool): New variable.
10363 (main): Assign ns_pool.
10364 (Fkill_emacs): Call ns_release_autorelease_pool.
10365
10366 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10367 autorelease fdesc, release fdAttrs and tdict.
10368 (ns_get_covering_families): Release charset.
10369 (ns_findfonts): Release NSFontDescriptor created with new.
10370 (ns_uni_to_glyphs): Fix indentation.
10371 (setString): Release attrStr before assigning new value.
10372
c803b2b7
JD
103732011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10374
678f4426
JD
10375 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10376 and NS_IMPL_COCOA.
10377 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10378 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10379
cd394be1 103802011-12-18 David Reitter <reitter@cmu.edu>
678f4426 10381
5fecd5fc
JD
10382 * nsterm.m (ns_term_init): Subscribe for notifications
10383 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10384 to method trackingNotification in EmacsMenu.
10385
10386 * nsmenu.m (trackingMenu): New variable.
3771cb17 10387 (trackingNotification): New method (from Aquamacs).
5fecd5fc 10388 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 10389 from Aquamacs (Bug#7030).
678f4426
JD
10390
103912011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 10392
c803b2b7
JD
10393 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10394 (symbol_to_nsstring): Fix indentation.
10395 (ns_symbol_to_pb): New function.
cae07000
SM
10396 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10397 (Fns_rotate_cut_buffers_internal): Remove.
10398 (Fns_store_selection_internal): Rename from
c803b2b7
JD
10399 Fns_store_cut_buffer_internal.
10400 (ns_get_foreign_selection, Fx_own_selection_internal)
10401 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
10402 (Fns_get_selection_internal, Fns_store_selection_internal):
10403 Use ns_symbol_to_pb and check if return value is nil.
10404 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10405 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
10406 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10407 renamed to Sns_store_selection_internal.
10408 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10409 and remove this function.
10410 (ns_handle_selection_clear): Remove, never used.
10411 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10412 here.
10413
e1b01a3a
KB
104142011-12-17 Ken Brown <kbrown@cornell.edu>
10415
10416 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10417 GID is unknown (Bug#10257).
10418
2adb6e85
PE
104192011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10420
10421 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10422 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10423 which caused a build failure on GNU/Linux IA-64. This problem was
10424 introduced by my 2011-10-07 patch.
10425
d1d7b339
JL
104262011-12-15 Juri Linkov <juri@jurta.org>
10427
10428 * image.c (imagemagick_error): New function. (Bug#10112)
10429 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10430 Use `imagemagick_error' where ImageMagick functions return
10431 `MagickFalse'.
10432 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10433 proper order.
10434
100d5755
KH
104352011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10436
10437 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10438 fill background (Bug#8992).
10439
454592a6
MR
104402011-12-13 Martin Rudalics <rudalics@gmx.at>
10441
10442 * window.c (Vwindow_combination_resize)
10443 (Vwindow_combination_limit): Use t instead of non-nil in
10444 doc-strings.
61d4b438
MR
10445 (Vrecenter_redisplay): Add first sentence of doc-string on
10446 separate line.
53524d93 10447 (Frecenter): Fix doc-string typo.
454592a6 10448
3633e3aa
KH
104492011-12-11 Kenichi Handa <handa@m17n.org>
10450
10451 * coding.c (Funencodable_char_position): Pay attention to the
10452 buffer text relocation (Bug#9389).
10453
7b9d523a 104542011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 10455
7b9d523a
JD
10456 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10457 gtk_init (Bug#10100).
10458
b73189c6
EZ
104592011-12-10 Eli Zaretskii <eliz@gnu.org>
10460
10461 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10462 IT->string is nil. (Bug#10263)
10463
f7dfe5d6
JD
104642011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10465
83faebb4
JD
10466 * nsterm.h (x_free_frame_resources): Declare.
10467
f7dfe5d6
JD
10468 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10469 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10470
10471 * nsterm.h (ns_get_defaults_value): Declare.
10472
10473 * nsterm.m (ns_default): Call ns_get_defaults_value.
10474
7cd4e72c
EZ
104752011-12-09 Eli Zaretskii <eliz@gnu.org>
10476
10477 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10478 (Bug#10170)
10479
b34d7317
YM
104802011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10481
10482 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10483 that where the value of an _OBJC_* symbol points to is in the .bss
10484 section (Bug#10240).
10485
76470ad1
KH
104862011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10487
10488 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 10489 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 10490
745fff94
KH
104912011-12-08 Kenichi Handa <handa@m17n.org>
10492
10493 * ftfont.c (get_adstyle_property): Fix previous change
10494 (Bug#10233).
10495
6e44397c
JB
104962011-12-07 Juanma Barranquero <lekktu@gmail.com>
10497
10498 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10499 dirs from the default value of EMACSLOADPATH (bug#10208).
10500
7efa6272
GM
105012011-12-07 Glenn Morris <rgm@gnu.org>
10502
10503 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10504 installation and source directories as well. (Bug#10208)
10505
f6fc4d87
CY
105062011-12-06 Chong Yidong <cyd@gnu.org>
10507
10508 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10509
2bf26180
GM
105102011-12-06 Glenn Morris <rgm@gnu.org>
10511
10512 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10513 as an error, not just -1. (Bug#10217)
10514
3a6ad4f0
CY
105152011-12-05 Chong Yidong <cyd@gnu.org>
10516
10517 * keyboard.c (process_special_events): New function.
10518 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10519
75a3b399
PE
105202011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10521
10522 * coding.c (encode_designation_at_bol): Don't use uninitialized
10523 local variable (Bug#9318).
10524
c3c9e25e
KH
105252011-12-05 Kenichi Handa <handa@m17n.org>
10526
10527 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10528 return Qnil (Bug#8046, Bug#10193).
10529
5eb05ea3
KH
105302011-12-05 Kenichi Handa <handa@m17n.org>
10531
10532 * coding.c (encode_designation_at_bol): New args charbuf_end and
10533 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10534 (coding_set_source): Return how many bytes coding->source was
10535 relocated.
10536 (coding_set_destination): Return how many bytes
10537 coding->destination was relocated.
10538 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10539 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10540
105412011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10542
10543 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10544 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10545 macro (Bug#9318).
10546
105472011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10548
10549 The following changes are to fix Bug#9318.
10550
a79703f5 10551 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10552 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10553 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10554 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10555
7dbda6df
JB
105562011-12-05 Juanma Barranquero <lekktu@gmail.com>
10557
10558 * lisp.h (process_quit_flag): Fix external declaration.
10559
6d5eb5b0
SM
105602011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10561
10562 Don't macro-inline non-performance-critical code.
10563 * eval.c (process_quit_flag): New function.
10564 * lisp.h (QUIT): Use it.
10565
a0c3fad0
JD
105662011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10567
10568 * nsfns.m (get_geometry_from_preferences): New function.
10569 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10570
6c07aac2
AS
105712011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10572
10573 * emacs.c (Qkill_emacs): Define.
10574 (syms_of_emacs): Initialize it.
10575 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10576 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10577 (quit_throw_to_read_char): Add parameter `from_signal'.
10578 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10579 * lisp.h (QUIT): Call Fkill_emacs if requested.
10580
c052ead4
JD
105812011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10582
10583 * widget.c (update_wm_hints): Return if wmshell is null.
10584 (widget_update_wm_size_hints): New function.
10585
10586 * widget.h (widget_update_wm_size_hints): Declare.
10587
10588 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10589 widget_update_wm_size_hints (Bug#10104).
10590
9e49252b
EZ
105912011-12-03 Eli Zaretskii <eliz@gnu.org>
10592
10593 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10594 before a newline, prepare the bidi iterator for consuming the
10595 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10596 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10597
02b16839
JL
105982011-12-02 Juri Linkov <juri@jurta.org>
10599
10600 * search.c (Fword_search_regexp): New Lisp function created from
10601 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10602 (Fword_search_backward, Fword_search_forward)
10603 (Fword_search_backward_lax, Fword_search_forward_lax):
10604 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10605 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10606
0068070e
SM
106072011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10608
10609 * fileio.c (Finsert_file_contents): Move after-change-function call
10610 to before the "handled:" label, since all "goto handled" appear in
10611 cases where the *-change-functions have already been properly called
10612 (bug#10117).
10613
3360a3fc
AS
106142011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10615
10616 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10617 waiting for input. (Bug#10169)
10618
73d6c093
EZ
106192011-11-30 Eli Zaretskii <eliz@gnu.org>
10620
10621 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10622 verifies glyph row's hash code--we have just reallocated the
10623 glyphs, so their contents can be complete garbage. (Bug#10164)
10624
febe6bea
JB
106252011-11-30 Juanma Barranquero <lekktu@gmail.com>
10626
10627 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10628
801a4313
EZ
106292011-11-30 Eli Zaretskii <eliz@gnu.org>
10630
10631 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10632 attributes are tested _before_ calling verify_row_hash, to protect
10633 against GCC re-ordering of the tests. (Bug#10164)
10634
2b56b87e
JD
106352011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10636
10637 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10638
10639 * xterm.c (handle_one_xevent): Only set async_visible and friends
10640 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 10641 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
10642 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10643
dbf31225
PE
106442011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10647 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10648 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10649 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10650 All uses changed to use GCPRO1 etc.
10651 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10652 Revert to old implementation (i.e., before 2011-03-11).
10653
1305621b
YM
106542011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10655
10656 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10657 of scroll runs so as to avoid assigning disabled bogus rows and
10658 unnecessary graphics copy operations.
10659
8c9afb46
EZ
106602011-11-27 Eli Zaretskii <eliz@gnu.org>
10661
10662 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10663 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10664 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10665 (malloc, free, realloc, calloc): Redirect to e_* only when
10666 compiling Emacs.
10667
10668 * lisp.h (GCTYPEBITS): Move before first use.
10669 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10670 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10671 this macro definition.
10672
10673 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10674 _MSC_VER.
10675
54e9e3bf
JD
106762011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10677
6d5eb5b0
SM
10678 * gtkutil.c (xg_create_frame_widgets):
10679 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
10680 present with Gtk+ 2.0.
10681
83aca1cb
PE
106822011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10683
10684 * fileio.c (Finsert_file_contents): Undo previous change; see
10685 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10686
5b76caa4
PE
106872011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10688
10689 Rename locals to avoid shadowing.
10690 * fileio.c (Finsert_file_contents):
10691 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10692 * process.c (wait_reading_process_output):
10693 Rename inner 'proc' to 'p' to avoid shadowing.
10694 Indent for consistency with usual Emacs style.
10695
8c535114
EZ
106962011-11-25 Eli Zaretskii <eliz@gnu.org>
10697
10698 * xdisp.c (redisplay_window): If cursor row is not fully visible
10699 after recentering, and scroll-conservatively is set to a large
10700 number, scroll window by a few more lines to make the cursor fully
10701 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
10702 (start_display): Don't move to the next line if the display should
10703 start at a newline that is part of a display vector or an overlay
10704 string. (Bug#10119)
8c535114 10705
fa4fdb5c
JL
107062011-11-24 Juri Linkov <juri@jurta.org>
10707
10708 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10709 after the `MagickPingImage' call. (Bug#10112)
10710
90ec88df
CY
107112011-11-23 Chong Yidong <cyd@gnu.org>
10712
10713 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10714
56e2e794
MR
107152011-11-23 Martin Rudalics <rudalics@gmx.at>
10716
10717 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10718 making another buffer current. (Bug#10114)
10719
b6e64c41
GM
107202011-11-23 Glenn Morris <rgm@gnu.org>
10721
10722 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10723
6b21de18
CY
107242011-11-23 Chong Yidong <cyd@gnu.org>
10725
10726 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10727 using it (Bug#5984).
10728
b12cd789
EZ
107292011-11-22 Eli Zaretskii <eliz@gnu.org>
10730
10731 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10732 and header-lines, as they don't have one computed for them.
10733 (Bug#10098)
10734
10735 * .gdbinit (prow): Make displayed values more self-explaining.
10736 Add row's hash code.
10737
261b6fd4
LMI
107382011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10739
10740 * process.c (wait_reading_process_output): Fix asynchrounous
10741 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 10742 (wait_reading_process_output): Add comment and URL.
261b6fd4 10743
e7cfd277
JD
107442011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10745
10746 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10747
a9b9b7f5
CY
107482011-11-21 Chong Yidong <cyd@gnu.org>
10749
10750 * window.c (Fnext_window, Fprevious_window): Doc fix.
10751
b0d15b4f
SM
107522011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10753
10754 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10755
fe7a3057
JB
107562011-11-20 Juanma Barranquero <lekktu@gmail.com>
10757
10758 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10759
d2999b1a
MR
107602011-11-20 Martin Rudalics <rudalics@gmx.at>
10761
10762 * window.c (Fset_window_combination_limit): Rename argument
10763 STATUS to LIMIT.
10764 (Vwindow_combination_limit): Remove "status" from doc-string.
10765
d5ff9cd0
AS
107662011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10767
10768 * m/ibms390.h: Remove.
10769 * m/ibms390x.h: Don't include "ibms390.h".
10770
a5bb9bd3
SM
107712011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10772
10773 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10774 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10775
cd1181db
JB
107762011-11-20 Juanma Barranquero <lekktu@gmail.com>
10777
10778 * casetab.c (Fset_case_table):
10779 * charset.c (Fcharset_after): Fix typos.
10780
615a3b8d 107812011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 10782
17e845af
PE
10783 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10784 Otherwise, valgrind does not work on some platforms.
10785 Problem reported by Andreas Schwab in
6a0bf43d
PE
10786 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10787 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10788 is set, removing the need for VIRT_ADDRESS_VARIES.
10789 (PURE_P): Use a more-efficient implementation that needs just one
10790 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10791 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10792 to 4 (xorl, subq, cmpq, setbe).
10793 * alloc.c (pure): Always extern now, since that's the
10794 VIRT_ADDR_VARIES behavior.
10795 (PURE_POINTER_P): Use a single comparison, not two, for
10796 consistency with the new puresize.h.
10797 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10798 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10799 Remove VIRT_ADDR_VARIES no longer needed.
10800
f8fe6f96
EZ
108012011-11-19 Eli Zaretskii <eliz@gnu.org>
10802
10803 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10804 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10805 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10806 behave as if the cursor position were at the window margin.
10807
10808 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10809 and the cursor position is out of bounds, behave as if the cursor
10810 position were at the window margin. (Bug#10075)
10811
df05a53c
CY
108122011-11-18 Chong Yidong <cyd@gnu.org>
10813
10814 * window.c (Fwindow_combination_limit): Make first argument
10815 non-optional, since it is meaningless for live windows like the
10816 selected window.
61ccba97 10817
2071918e
DA
108182011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10819
10820 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10821
b50a28de
SM
108222011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10823
10824 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10825 (graft_intervals_into_buffer): Simplify.
10826
015137db
EZ
108272011-11-18 Eli Zaretskii <eliz@gnu.org>
10828
10829 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10830 hash values of the two rows.
10831 (copy_row_except_pointers): Preserve the used[] arrays and the
10832 hash values of the two rows. (Bug#10035)
68c95424 10833 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
10834
10835 * xdisp.c (row_hash): New function, body extracted from
10836 compute_line_metrics.
10837 (compute_line_metrics): Call row_hash, instead of computing the
10838 hash code inline.
10839
10840 * dispnew.c (verify_row_hash): Call row_hash for computing the
10841 hash code of a row, instead of duplicating code from xdisp.c.
10842
10843 * dispextern.h (row_hash): Add prototype.
10844
a2addb04
TH
108452011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10846
10847 * frame.c (delete_frame): Don't delete the terminal when the last
10848 X frame is closed if emacs is built with GTK toolkit.
10849
df85d315
JB
108502011-11-17 Juanma Barranquero <lekktu@gmail.com>
10851
10852 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10853
a0c2d0ae
MR
108542011-11-17 Martin Rudalics <rudalics@gmx.at>
10855
10856 * window.c (Vwindow_splits): Rename to
10857 Vwindow_combination_resize. Suggested by Juri Linkov.
10858 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10859 of Vwindow_splits.
10860
58179cce
JB
108612011-11-16 Juanma Barranquero <lekktu@gmail.com>
10862
7877f373
JB
10863 * nsfns.m (Fns_font_name):
10864 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 10865
b6f67890
MR
108662011-11-16 Martin Rudalics <rudalics@gmx.at>
10867
10868 * window.h (window): Rename slot "nest" to "combination_limit".
10869 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10870 (Fset_window_nest): Rename to Fset_window_combination_limit.
10871 (Vwindow_nest): Rename to Vwindow_combination_limit.
10872 (recombine_windows, make_parent_window, make_window)
10873 (Fsplit_window_internal, saved_window)
10874 (Fset_window_configuration, save_window_save): Rename all
10875 occurrences of window_nest to window_combination_limit.
10876
c7015153
JB
108772011-11-15 Juanma Barranquero <lekktu@gmail.com>
10878
10879 * image.c (imagemagick_load_image): Fix typo.
10880
322ad6ec
EZ
108812011-11-14 Eli Zaretskii <eliz@gnu.org>
10882
10883 * xdisp.c (display_line): Move the call to
10884 highlight_trailing_whitespace before the call to
10885 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
10886 faces of all the glyphs to compute ROW's hash value.
10887 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 10888
f067b8ec
JB
108892011-11-14 Juanma Barranquero <lekktu@gmail.com>
10890
10891 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10892 just return (bug#10044).
10893
1e5b2111
EZ
108942011-11-12 Eli Zaretskii <eliz@gnu.org>
10895
7ef3cbd5
EZ
10896 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10897 with user-defined heap size. Bump the default size of the temacs
10898 heap to 27MB, to avoid memory warning when running temacs.
10899 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10900
1e5b2111
EZ
10901 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10902 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
10903 (verify_row_hash) [XASSERTS]: New function.
10904 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10905 that the hash value of glyph rows is correct.
1e5b2111 10906
89d61221
MR
109072011-11-12 Martin Rudalics <rudalics@gmx.at>
10908
10909 * window.h (window): Remove splits slot.
10910 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10911 (Fdelete_other_windows_internal, make_parent_window)
10912 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10913 (Fset_window_configuration, save_window_save): Don't deal with
10914 split status of windows.
10915 (saved_window): Remove splits slot.
10916 (Vwindow_splits): Rewrite doc-string.
10917
97f18cc8
JD
109182011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10919
10920 * xfns.c (unwind_create_frame):
10921 * nsfns.m (unwind_create_frame):
10922 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10923 Vframe_list (Bug#9999).
10924
22a648b4
DA
109252011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10926
0b381c7e 10927 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 10928
659afede
KH
109292011-11-11 Kenichi Handa <handa@m17n.org>
10930
10931 * callproc.c (Fcall_process): Set the member dst_multibyte of
10932 process_coding.
10933
9ac0394b
KH
109342011-11-11 Johan Bockgård <bojohan@gnu.org>
10935
10936 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10937 avoid a crash (bug#9496).
10938
2fbdc249
CY
109392011-11-09 Chong Yidong <cyd@gnu.org>
10940
10941 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10942 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10943
ac6b1f81
PE
109442011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10945
10946 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10947
09db192c
PE
109482011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10949
10950 Avoid some portability problems by eschewing 'extern inline' functions.
10951 The trivial performance wins aren't worth the portability hassles; see
10952 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10953 et seq.
10954 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10955 (window_box_width, window_box_left, window_box_left_offset)
10956 (window_box_right, window_box_right_offset): Undo previous change,
10957 by removing the "extern"s.
10958 * intervals.c (adjust_intervals_for_insertion)
10959 (adjust_intervals_for_deletion): Undo previous change,
10960 making these static again.
10961 (offset_intervals, temp_set_point_both, temp_set_point)
10962 (copy_intervals_to_string): No longer inline.
10963 * xdisp.c (window_text_bottom_y, window_box_width)
10964 (window_box_height, window_box_left_offset)
10965 (window_box_right_offset, window_box_left, window_box_right)
10966 (window_box): No longer inline.
10967
105216ed
CY
109682011-11-08 Chong Yidong <cyd@gnu.org>
10969
10970 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
10971 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10972 Signal an error if not a live window.
105216ed
CY
10973 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10974 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10975
ae9e237f
JB
109762011-11-07 Juanma Barranquero <lekktu@gmail.com>
10977
10978 * lisp.h (syms_of_abbrev): Remove declaration.
10979 Reported by CHENG Gao <chenggao@royau.me>.
10980
c7aa8333
EZ
109812011-11-07 Eli Zaretskii <eliz@gnu.org>
10982
10983 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10984 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10985 of temacs in GUI mode.
10986
be7f5545
MR
109872011-11-07 Martin Rudalics <rudalics@gmx.at>
10988
10989 * window.h: Declare delete_all_child_windows instead of
10990 delete_all_subwindows.
10991 * window.c (Fwindow_nest, Fset_window_nest)
10992 (Fset_window_new_total, Fset_window_new_normal)
10993 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10994 (delete_all_subwindows): Rename to delete_all_child_windows.
10995 (Fdelete_other_windows_internal, Fset_window_configuration):
10996 Call delete_all_child_windows instead of delete_all_subwindows.
10997 * frame.c (delete_frame): Call delete_all_child_windows instead
10998 of delete_all_subwindows.
10999
ca78dc43
PE
110002011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11001
11002 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11003 This is also needed for porting to any host where GC_MARK_STACK is
11004 not GC_MAKE_GCPROS_NOOPS.
11005 (which_symbols): Use it.
11006
a0241d01
KH
110072011-11-07 Kenichi Handa <handa@m17n.org>
11008
11009 * coding.c (coding_set_destination): Check coding->src_pos only
11010 when coding->src_object is a buffer (bug#9910).
11011
11012 * process.c (send_process): Set the member src_multibyte of coding
11013 to 0 (bug#9911) when sending a unibyte text.
11014
11015 * callproc.c (Fcall_process): Set the member src_multibyte of
11016 process_coding to 0 (bug#9912).
11017
a64bfdfa 110182011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
11019
11020 * xmenu.c (cleanup_widget_value_tree): New function.
11021 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11022 calling free_menubar_widget_value_tree directly (Bug#9830).
11023
cb41b32a
PE
110242011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11025
11026 Fix some portability problems with 'inline'.
11027 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11028 (window_box_width, window_box_left, window_box_left_offset)
11029 (window_box_right, window_box_right_offset): Declare extern.
11030 Otherwise, these inline functions do not conform to C99 and
11031 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11032 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11033 * intervals.c (adjust_intervals_for_insertion)
11034 (adjust_intervals_for_deletion): Now extern, because otherwise the
11035 extern inline functions 'offset_intervals' couldn't refer to it.
11036 (static_offset_intervals): Remove.
11037 (offset_intervals): Rewrite using the old contents of
11038 static_offset_intervals. The old version didn't conform to C99
11039 because an extern inline function contained a reference to an
11040 identifier with static linkage.
11041
b7041366
AS
110422011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11043
11044 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11045 GC.
11046
88a37c4d
EZ
110472011-11-06 Eli Zaretskii <eliz@gnu.org>
11048
11049 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11050 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11051 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11052 return Qleft_to_right.
11053
49745b39
CY
110542011-11-06 Chong Yidong <cyd@gnu.org>
11055
11056 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11057 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11058 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11059 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11060 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11061 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11062 (Fwindow_vscroll): Doc fix.
11063 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11064 argument, since it makes no sense to pass a live window and for
11065 consistency with window-child.
11066
1f05cd82
CS
110672011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11068
11069 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11070 support MSVC.
11071
22610910
JR
110722011-11-05 Jason Rumney <jasonr@gnu.org>
11073
11074 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11075 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11076 fonts (Bug#6029).
11077 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11078 bitwise arithmetic preventing use of unicode-sip and non-truetype
11079 opentype fonts.
11080
a06776b2
EZ
110812011-11-05 Eli Zaretskii <eliz@gnu.org>
11082
3ad924ba
EZ
11083 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11084 "emacs"-only part.
11085
a06776b2
EZ
11086 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11087 initialization code to keep similarity to xfns.c after changes
11088 from 2011-11-05.
11089
c9e7db78
JD
110902011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11091
a97f8f3f
JD
11092 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11093 (unwind_create_frame): New function (Bug#9943).
11094 (Fx_create_frame): Restructure code to be more similar to the one in
11095 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11096 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11097 Move terminal->reference_count++ just before making the frame official
11098 (Bug#9943).
11099
11100 * nsterm.m (x_free_frame_resources): New function.
11101 (x_destroy_window): Move code to x_free_frame_resources.
11102
c9e7db78 11103 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
11104 (Fx_create_frame, x_create_tip_frame):
11105 Move terminal->reference_count++ just before making the frame
75f1671a 11106 official. Move initialization of image_cache_refcount and
c9e7db78
JD
11107 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11108
a6fc3b5c
EZ
111092011-11-05 Eli Zaretskii <eliz@gnu.org>
11110
11111 Support MSVC build with newer versions of Visual Studio.
11112 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11113 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11114 nt/gmake.defs.
11115
11116 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11117 which are not supported by MSVC.
11118 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11119 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11120 bitfields.
11121 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11122 types in bitfields.
11123 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11124
11125 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11126
58179cce 111272011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
11128
11129 Support MSVC build with newer versions of Visual Studio.
11130 * w32.c: Don't include w32api.h for MSVC.
11131 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11132
11133 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11134 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11135 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11136 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11137 e_* cousins.
11138 (alloca) [_MSC_VER]: Define to _alloca.
11139
11140 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11141
11142 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11143
a58c13ed
EZ
111442011-11-04 Eli Zaretskii <eliz@gnu.org>
11145
11146 * xdisp.c (note_mouse_highlight): If either of
11147 previous/next-single-property-change returns nil, treat that as
11148 the beginning or the end of the buffer. (Bug#9955)
11149
fe0b6370
JD
111502011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11151
a58c13ed 11152 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
11153 label is not null (Bug#9951).
11154 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11155 may be NULL.
11156
89bd5ee1
EZ
111572011-11-04 Eli Zaretskii <eliz@gnu.org>
11158
11159 * window.c (Fwindow_body_size): Mention in the doc string that the
11160 return value is in frame's canonical units. (Bug#9949)
11161
84c3edb9
EZ
111622011-11-03 Eli Zaretskii <eliz@gnu.org>
11163
4e2fb5c7
EZ
11164 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11165
84c3edb9 11166 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 11167 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 11168 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 11169
bc17a887
EZ
111702011-11-01 Eli Zaretskii <eliz@gnu.org>
11171
11172 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11173 Don't stop backward scan on the continuation glyph, even though
11174 its CHARPOS is positive.
6d5eb5b0
SM
11175 (mouse_face_from_buffer_pos, note_mouse_highlight):
11176 Rename cover_string to disp_string.
bc17a887 11177
4ee88440
MR
111782011-11-01 Martin Rudalics <rudalics@gmx.at>
11179
11180 * window.c (temp_output_buffer_show): Don't use
11181 Vtemp_buffer_show_specifiers.
11182 (Vtemp_buffer_show_specifiers): Remove unused variable.
11183
c2ff3c02
EZ
111842011-10-30 Eli Zaretskii <eliz@gnu.org>
11185
11186 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11187 past the beginning of the current glyph matrix.
11188
58179cce 111892011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
11190
11191 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11192 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11193 HAVE_GTK3 (Bug#9869).
b77a6a7f 11194
3b574623
JD
11195 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11196 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11197
b77a6a7f
JD
11198 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11199
11200 * xterm.c: Declare x_handle_net_wm_state to return int.
11201 (handle_one_xevent): Check if we are iconified but don't have
11202 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11203 (get_current_wm_state): Return non-zero if not hidden,
11204 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11205 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11206 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11207 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11208
196e41e4
PE
112092011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11210
11211 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11212 so that this new function doesn't get optimized away by a
11213 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11214
021f2e1a
AS
112152011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11216
11217 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11218
8b058d44
EZ
112192011-10-29 Eli Zaretskii <eliz@gnu.org>
11220
11221 Fix the `xbytecode' command.
11222 * .gdbinit (xprintbytestr): New command.
b50a28de 11223 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
11224 (xbytecode): Print the byte-code string as well.
11225
4452fb80
EZ
112262011-10-29 Kim Storm <storm@cua.dk>
11227
8b058d44
EZ
11228 * alloc.c (which_symbols): New function.
11229
21b72067
AS
112302011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11231
11232 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11233 line. (Bug#9903)
11234
83ed7b5c
GM
112352011-10-29 Glenn Morris <rgm@gnu.org>
11236
11237 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11238 Not clear what it was for, and it causes various bugs. (Bug#9839)
11239
5a7a728b
EZ
112402011-10-28 Eli Zaretskii <eliz@gnu.org>
11241
11242 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11243 possible random value that matches one of those tested as
11244 condition to clear the mouse face.
11245
d3d0842f
CY
112462011-10-28 Chong Yidong <cyd@gnu.org>
11247
11248 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11249
31b39d13
DN
112502011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11251
11252 * window.c (make_window): Initialize phys_cursor_on_p.
11253
9aba6043
SM
112542011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11255
11256 * lisp.h (struct Lisp_Symbol): Update comments.
11257
c20992f4
JB
112582011-10-28 Juanma Barranquero <lekktu@gmail.com>
11259
11260 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11261
db4f02f2
EZ
112622011-10-28 Eli Zaretskii <eliz@gnu.org>
11263
11264 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11265 <oslsachem@gmail.com> for helping to debug this.
11266
11267 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11268 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11269 (g_b_init_get_glyph_outline_w): New static variables.
11270 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11271 (GetGlyphOutlineW_Proc): New typedefs.
11272 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
11273 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11274 New functions.
11275 (w32font_open_internal, compute_metrics):
11276 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
11277 instead of calling the "wide" APIs directly.
11278
11279 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11280
11281 * w32.h (syms_of_w32font): Add prototype.
11282
87e68db4
JB
112832011-10-27 Juanma Barranquero <lekktu@gmail.com>
11284
11285 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11286 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11287 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11288 (Fmove_to_window_line): Doc fix.
11289
435c1d67
CY
112902011-10-27 Chong Yidong <cyd@gnu.org>
11291
11292 * process.c (make_process): Set gnutls_state to NULL.
11293
11294 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11295 non-NULL, regardless of GNUTLS_INITSTAGE.
11296 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11297 an error. Set process slots as soon as we allocate them.
11298
11299 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11300
9c6c6f49
CY
113012011-10-27 Chong Yidong <cyd@gnu.org>
11302
9aba6043
SM
11303 * gnutls.c (emacs_gnutls_deinit): New function.
11304 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
11305 (Fgnutls_deinit, Fgnutls_boot): Use it.
11306
11307 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11308 (deactivate_process): Call emacs_gnutls_deinit.
11309
657d08d3
JB
113102011-10-27 Juanma Barranquero <lekktu@gmail.com>
11311
11312 * image.c (x_create_x_image_and_pixmap):
11313 * w32.c (sys_rename, w32_delayed_load):
11314 * w32font.c (fill_in_logfont):
11315 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11316
5430d399
JB
113172011-10-26 Juanma Barranquero <lekktu@gmail.com>
11318
11319 * w32fns.c (w32_default_color_map): New function,
11320 extracted from Fw32_default_color_map.
a7ef684b 11321 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 11322
fe0055fa
PE
113232011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11324
11325 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11326
e6346438
SM
113272011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11328
11329 * keyboard.c (test_undefined): New function (bug#9751).
11330 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11331
e112cc37
ET
113322011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11333
11334 * sysdep.c (init_sys_modes): Fix the check for the controlling
11335 terminal (Bug#6649).
11336
7b5d6677
EZ
113372011-10-20 Eli Zaretskii <eliz@gnu.org>
11338
11339 * dispextern.h (struct bidi_it): New member next_en_type.
11340
11341 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11342 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11343 current character, check also for next_en_type being WEAK_EN.
11344 (bidi_resolve_weak): Don't enter the expensive loop if the current
11345 position is before next_en_pos. Record the bidi type of the first
11346 non-ET, non-BN character we find, in addition to its position.
11347 (bidi_level_of_next_char): Invalidate next_en_type when
11348 next_en_pos is over-stepped.
11349
7da0b018
PE
113502011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11351
11352 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11353 * editfns.c: Rewrite current-time-zone so that it invokes
11354 the equivalent of (format-time-string "%Z") to get the time zone name.
11355 This fixes a bug when the time zone name contains characters that
11356 need converting from the system time locale to Emacs internal format.
11357 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11358 that patch fixed format-time-string to do the conversion, but
11359 I forgot to fix current-time-zone.
11360 (format_time_string): New function, containing most of
11361 what Fformat_time_string used to contain.
11362 (Fformat_time_string): Rewrite in terms of format_time_string.
11363 This doesn't change this function's behavior.
11364 (current-time-zone): Rewrite to use format_time_string.
11365 This fixes the bug reported by Michael Schierl in
11366 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11367 Jason Rumney's 2007-06-07 change worked around this bug, but
11368 didn't fix it.
11369 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11370
8547b010
EZ
113712011-10-19 Eli Zaretskii <eliz@gnu.org>
11372
11373 * xdisp.c (start_display): If the character at POS is displayed
11374 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
11375 (try_window_reusing_current_matrix): If a line ends in a display
11376 vector or the next line starts in a display vector, continue
11377 redrawing the window even though the character position of
11378 start_row was reached.
8547b010
EZ
11379 (Bug#9771, part 2)
11380
4e948d15
CY
113812011-10-18 Chong Yidong <cyd@gnu.org>
11382
11383 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11384 with nobreak-char-display too.
11385
4787455f
EZ
113862011-10-18 Eli Zaretskii <eliz@gnu.org>
11387
11388 Fix part 3 of bug#9771.
11389 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11390 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11391 non-neutral characters if the current character is a paragraph
11392 separator (a.k.a. Newline). This avoids running the same
11393 expensive loop twice, once when we consume the preceding newline
11394 and the other time when the line actually needs to be displayed.
11395 Avoid the loop when we see neutrals on the base embedding level
11396 following a character whose directionality is the same as the
11397 paragraph's. This avoids running the expensive loop when a line
11398 ends in a long sequence of neutrals, like control characters.
11399 Add assertion against STRONG_AL type. Slightly rearrange code
11400 that determines the type of a neutral given the first non-neutral
11401 that follows it.
11402 (bidi_level_of_next_char): Set next_en_pos to zero when
11403 invalidating its info.
11404
2c91f553
EZ
114052011-10-17 Eli Zaretskii <eliz@gnu.org>
11406
11407 * xdisp.c (push_display_prop): Determine whether to record string
11408 or buffer position by IT->string, not by IT->method. Allow
11409 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
11410 (move_it_vertically_backward): Don't look for character position
11411 immediately after the newline when in a continuation line.
11412 (Bug#9771, part 1)
2c91f553 11413
c7b08b0d
MR
114142011-10-15 Martin Rudalics <rudalics@gmx.at>
11415
11416 * window.c (coordinates_in_window): Rewrite and delabelize
11417 vertical border check. (Bug#5357) (Bug#9618)
11418
6b02f655
SM
114192011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11420
11421 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11422 errors in XSetWindowBorder (bug#9310).
11423
81d40c92
DA
114242011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11425
11426 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11427 avoid crash when xmalloc overrun checking is enabled.
11428
d4172c3b
EZ
114292011-10-13 Eli Zaretskii <eliz@gnu.org>
11430
11431 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11432 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11433 cursor motion with <left> and <right> arrow keys.
11434
11435 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11436 some callers set that themselves.
11437
b00eea75
EZ
114382011-10-12 Eli Zaretskii <eliz@gnu.org>
11439
11440 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11441 display string and the previous row comes from the same string and
11442 is empty. (Bug#9739) (Bug#9738)
11443
8fe012c4
SM
114442011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11445
11446 * doc.c (get_doc_string): Encode file name (bug#9735).
11447
0074aef2
EZ
114482011-10-12 Eli Zaretskii <eliz@gnu.org>
11449
79beb178
EZ
11450 * bidi.c (bidi_level_of_next_char):
11451 * xdisp.c (get_visually_first_element): Remove old incorrect
11452 comments regarding the Unicode Line Separator character.
11453
0074aef2
EZ
11454 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11455
6e4b3fbe
DA
114562011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11457
11458 * alloc.c (Fgc_status): Do not access beyond zombies array
11459 boundary if nzombies > MAX_ZOMBIES.
11460 * alloc.c (dump_zombies): Add missing format specifier.
11461
0324f3af
PE
114622011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11463
b5525cac
PE
11464 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11465 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11466
0324f3af
PE
11467 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11468 Some packages use them to denote characters with modifiers.
11469
e9b5f888
AS
114702011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11471
11472 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11473 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11474 matching a pp-number. Rename parameter var to var1.
11475
127827c0
SM
114762011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11477
11478 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11479
c8fd3bd0
GM
114802011-10-08 Glenn Morris <rgm@gnu.org>
11481
11482 * callint.c (Fcall_interactively): Give a more explicit error for the
11483 'c' case with a non-character input. (Bug#8479)
11484
352ec8ff
EZ
114852011-10-08 Eli Zaretskii <eliz@gnu.org>
11486
03669ccb
EZ
11487 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11488 lines.
7061c986
EZ
11489 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11490 lines that are hscrolled on the left.
03669ccb 11491
352ec8ff
EZ
11492 * dispnew.c (buffer_posn_from_coords): Account for a possible
11493 presence of header-line. (Bug#4426)
11494
a66cfb1c
SM
114952011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11496
6b02f655
SM
11497 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11498 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 11499
7c5ee88e
PE
115002011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11501
11502 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11503 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11504 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11505 this makes Emacs dump core during garbage collection on rare
11506 occasions. sizeof is obviously inferior to offsetof here, so
11507 stick with offsetof.
11508 (GC_POINTER_ALIGNMENT): New macro.
11509 (mark_memory): Omit 3rd (offset) arg; caller changed.
11510 Don't assume EMACS_INT alignment is the same as pointer alignment.
11511
df1bbe5b
SM
115122011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11513
11514 * keyboard.c (read_key_sequence_remapped): New var.
11515 (read_key_sequence): Compute remapping in the right buffer.
11516 (command_loop_1): Use read_key_sequence's remapping directly.
11517
51553db6
SM
115182011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11519
32c1fffd
SM
11520 * dired.c (file_name_completion): Don't expand file name.
11521 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11522 before checking file name handler.
11523
51553db6
SM
11524 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11525 they've been requested explicitly (bug#9591).
11526
b6bd1599 115272011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
11528
11529 * keymap.c (Fsingle_key_description): Use make_specified_string
11530 instead of build_string to build string from push_key_description.
11531 (Bug#5193)
11532
f701dc2a
PE
115332011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11534
4222c55d
PE
11535 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11536 This fixes a Y2038 bug on 64-bit hosts.
11537 * buffer.c (reset_buffer):
11538 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11539 (Fclear_buffer_auto_save_failure):
11540 Use 0, not -1, to represent an unset failure time, since time_t
11541 might not be signed.
11542
f701dc2a
PE
11543 Remove dependency on glibc malloc internals.
11544 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11545 Move back here from lisp.h, but with their new implementations.
11546 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11547 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11548 * charset.c (charset_table_init): New static var.
11549 (syms_of_charset): Use it instead of xmalloc. This removes a
11550 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11551 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11552 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11553 Move back to alloc.c.
11554 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11555 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11556
9ceebf39
JD
115572011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11558
11559 * nsterm.m (windowDidResize): Call x_set_window_size only when
11560 ns_in_resize is true. Otherwise set pixelwidth/height and
11561 call change_frame_size (Bug#9628).
11562
cb993c58
PE
115632011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11564
3930c88b
PE
11565 Port --enable-checking=all to Fedora 14 x86-64.
11566 * charset.c (syms_of_charset): Also account for glibc malloc's
11567 internal overhead when calculating the initial malloc maximum.
11568
cb993c58
PE
11569 Port --enable-checking=all to Fedora 14 x86.
11570 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11571 Move to lisp.h.
11572 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11573 (overrun_check_realloc, overrun_check_free):
11574 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11575 That way, xmalloc returns a properly-aligned pointer even if
11576 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11577 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11578 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11579 into account when calculating the initial malloc maximum.
11580 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11581 Move here from alloc.c, so that charset.c can use it too.
11582 Properly align; the old code wasn't right for common 32-bit hosts
11583 when configured with --enable-checking=all.
11584 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11585 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11586
31bed486
EZ
115872011-09-29 Eli Zaretskii <eliz@gnu.org>
11588
04c70788 11589 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11590 use EDOM.
11591
fbcaa2f3
EZ
115922011-09-28 Eli Zaretskii <eliz@gnu.org>
11593
11594 * xdisp.c (compute_display_string_end): If there's no display
11595 string at CHARPOS, return -1.
11596
11597 * bidi.c (bidi_fetch_char): When compute_display_string_end
11598 returns a negative value, treat the character as a normal
11599 character not covered by a display string. (Bug#9624)
11600
a239d4e9
JB
116012011-09-28 Juanma Barranquero <lekktu@gmail.com>
11602
11603 * lread.c (Fread_from_string): Fix typo in docstring.
11604
88652fd5
EZ
116052011-09-27 Eli Zaretskii <eliz@gnu.org>
11606
11607 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11608 newline, reseat the iterator instead of bidi-iterating there one
11609 character at a time. (Bug#9610)
32c1fffd
SM
11610 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11611 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11612
ed497dd4
AS
116132011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11614
11615 * lread.c (readevalloop): Use correct code for NBSP.
11616 (read1): Likewise. (Bug#9608)
11617
b2bf61aa
MA
116182011-09-25 Michael Albinus <michael.albinus@gmx.de>
11619
11620 * dbusbind.c (Fdbus_register_signal): When service is not
11621 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11622
32bbb17c
GM
116232011-09-25 Glenn Morris <rgm@gnu.org>
11624
11625 * buffer.c (truncate-lines): Doc fix.
11626
94e0933e
CY
116272011-09-24 Chong Yidong <cyd@stupidchicken.com>
11628
11629 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11630 (Fset_window_next_buffers): Doc fix.
11631
cddde921
GM
116322011-09-24 Glenn Morris <rgm@gnu.org>
11633
11634 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11635
1260aef1
PE
116362011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11637
25b4bfa0
PE
11638 Fix minor problems found by static checking.
11639 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
11640 * indent.c (Fvertical_motion): Fix == vs = typo.
11641
e3cbd34b
EZ
116422011-09-24 Eli Zaretskii <eliz@gnu.org>
11643
a66cfb1c
SM
11644 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11645 Default value is now t. Doc fix.
6bf7006f 11646
e3cbd34b 11647 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 11648 logic when moving up, not only when moving down. Fix the
e3cbd34b 11649 confusing name and values of the it_overshoot_expected variable;
32c1fffd 11650 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
11651
11652 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11653 CHARPOS is covered by a display string which includes newlines.
11654 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11655 is covered by a display string with embedded newlines.
11656
a3de0cbd
MA
116572011-09-24 Michael Albinus <michael.albinus@gmx.de>
11658
11659 * dbusbind.c (Fdbus_register_signal): Add match rule to
11660 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
11661 (Fdbus_register_method, Vdbus_registered_objects_table):
11662 Fix docstring.
a3de0cbd 11663
b260039d
JM
116642011-09-24 Jim Meyering <meyering@redhat.com>
11665
32c1fffd 11666 do not ignore write error for any output size
b260039d
JM
11667 The previous change was incomplete.
11668 While it makes emacs --batch detect the vast majority of stdout
11669 write failures, errors were still ignored whenever the output size is
11670 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11671 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11672 && echo FAIL: ignored write error
11673 FAIL: ignored write error
11674 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11675 && echo FAIL: ignored write error
11676 FAIL: ignored write error
11677 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11678
8eca8a7c
AS
116792011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11680
11681 * emacs.c (Fkill_emacs): In noninteractive mode exit
11682 non-successfully if a write error occurred on stdout. (Bug#9574)
11683
3341db62
EZ
116842011-09-21 Eli Zaretskii <eliz@gnu.org>
11685
11686 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11687 the xassert test.
11688
11689 * dispextern.h (struct it): Update the comment documenting what
11690 can it->OBJECT be.
11691
8c203dbf
EZ
116922011-09-20 Eli Zaretskii <eliz@gnu.org>
11693
11694 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11695 a display string, extend search for cursor position to end of row.
11696 (find_row_edges): If the row ends in a newline from a display
11697 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11698 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
11699 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11700 non-empty line. Fixes confusing cursor motion with arrow keys at
11701 the beginning of a line that starts with whitespace.
8c203dbf 11702
a4824228
LMI
117032011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11704
11705 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11706 (bug#9493).
11707
33ed493b
CY
117082011-09-18 Chong Yidong <cyd@stupidchicken.com>
11709
11710 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11711 boolean (Bug#9154).
11712
56cd55c8
EZ
117132011-09-18 Eli Zaretskii <eliz@gnu.org>
11714
11715 * xdisp.c (display_line): Record maximum and minimum buffer
11716 positions even if no glyphs were produced (e.g., by a zero-width
11717 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11718 buffer positions that will be removed from the glyph row because
11719 they don't fit.
c02dcedf
EZ
11720 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11721 column is beyond frame width: don't subtract 1 "pixel" when
11722 computing width of the stretch.
3e62b7e0
EZ
11723 (reseat_at_next_visible_line_start): Undo the change made on
11724 2011-09-17 that saved paragraph information and restored it after
11725 the call to `reseat'. (Bug#9545)
56cd55c8 11726
5ed99d36 117272011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
11728
11729 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11730 and turn window cursor on if cleared (Bug#9415).
11731
5ed99d36 117322011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
11733
11734 * search.c (boyer_moore): Take unibyte characters from pattern
11735 literally. (Bug#9458)
11736
9bade7b2
EZ
117372011-09-18 Eli Zaretskii <eliz@gnu.org>
11738
11739 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11740
e5e9d610
PE
117412011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11742
87e4427a
PE
11743 Fix minor problem found by static checking.
11744 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11745 initialized, to pacify gcc -Wuninitialized.
11746
e5e9d610
PE
11747 * fileio.c: Report proper errno when syscall falls.
11748 (Finsert_file_contents): Save and restore errno,
11749 so that report_file_error outputs the correct diagnostic.
11750 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11751
a1674f0b
EZ
117522011-09-18 Eli Zaretskii <eliz@gnu.org>
11753
11754 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11755
fbfb6dd4
EZ
117562011-09-17 Eli Zaretskii <eliz@gnu.org>
11757
11758 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11759 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11760
bb187662
EZ
117612011-09-17 Eli Zaretskii <eliz@gnu.org>
11762
1137e8b8 11763 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 11764 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
11765
11766 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11767 (bidi_find_paragraph_start): Search back for paragraph beginning
11768 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11769 (bidi_move_to_visually_next): Only trigger paragraph-related
11770 computations when the last character is a newline or at EOB, not
11771 just any NEUTRAL_B. (Bug#9470)
11772
bb187662
EZ
11773 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11774 truncated lines if point is covered by a display string. (Bug#9524)
11775
2e621251
PE
117762011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11777
11778 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11779 (cons_to_x_long): New function.
11780 (lisp_data_to_selection_data): Use it. Correct the test for
11781 short-versus-long data; it was negated. Break out of vector
11782 loop, for efficiency, when a long datum is discovered.
11783
91a15bc6
SM
117842011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11785
11786 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11787
b41c3a35
EZ
117882011-09-16 Eli Zaretskii <eliz@gnu.org>
11789
11790 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11791 GCC PR/17406) by declaring this function with external scope.
11792
7812ba2d
PE
117932011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11794
11795 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11796 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11797
cf7edc2a
AS
117982011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11799
11800 * editfns.c (Fformat): Correctly handle text properties on "%%".
11801
bd01620e
EZ
118022011-09-15 Eli Zaretskii <eliz@gnu.org>
11803
11804 * xterm.c (x_draw_composite_glyph_string_foreground):
11805 * w32term.c (x_draw_composite_glyph_string_foreground):
11806 * term.c (encode_terminal_code):
11807 * composite.c (composition_update_it, get_composition_id):
11808 * xdisp.c (get_next_display_element)
11809 (fill_composite_glyph_string): Add comments about special meaning
11810 of TAB characters in a composition.
11811
a02719a3
PE
118122011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11813
11814 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
11815 This occurs when processing a multibyte format.
11816 Problem reported by Wolfgang Jenker.
a02719a3 11817
72589a3c
JB
118182011-09-15 Johan Bockgård <bojohan@gnu.org>
11819
11820 * xdisp.c (try_cursor_movement): Only check for exact match if
11821 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11822
1c14176c
PE
118232011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 Remove unused external symbols.
11826 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11827 * xdisp.c (calc_pixel_width_or_height): Now static.
11828 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11829 * indent.c (check_display_width):
11830 * w32term.c: Fix comment to match code.
11831 * xterm.c, xterm.h (x_catching_errors): Remove.
11832
d2eea5b5
PE
118332011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11834
11835 * xselect.c: Use signed conversions more consistently (Bug#9498).
11836 (selection_data_to_lisp_data): Assume incoming selection data are
11837 signed integers, not unsigned. This is to be consistent with
11838 outgoing selection data, which was modified to use signed integers
11839 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11840 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11841 expects long, not unsigned long.
11842
46888499
EZ
118432011-09-14 Eli Zaretskii <eliz@gnu.org>
11844
11845 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11846 computation of loop end. Reported by Johan Bockgård
11847 <bojohan@gnu.org>.
11848
ef8ef9fb
CY
118492011-09-13 Chong Yidong <cyd@stupidchicken.com>
11850
11851 * frame.c (Fother_visible_frames_p): Function deleted.
11852
fa819fed
EZ
118532011-09-12 Eli Zaretskii <eliz@gnu.org>
11854
11855 * indent.c (compute_motion): Process display vector front to back
11856 rather than the other way around. (Bug#2496)
11857
2ba8e008
SM
118582011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11859
11860 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11861
20f53c69
CY
118622011-09-11 Chong Yidong <cyd@stupidchicken.com>
11863
11864 * minibuf.c (Fread_from_minibuffer): Doc fix.
11865
d562d7a4
EZ
118662011-09-11 Eli Zaretskii <eliz@gnu.org>
11867
11868 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11869 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11870
1c4d7f3d
LMI
118712011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11872
11873 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11874 value for non-existent files.
11875
b885bf36
EZ
118762011-09-11 Eli Zaretskii <eliz@gnu.org>
11877
11878 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11879 set its "size" to -1. This will set the modtime_size field of
11880 the corresponding buffer to -1, which is what
11881 verify-visited-file-modtime expects for files that do not exist.
11882 (Bug#9139)
11883
6612f0bf
PE
118842011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11885
11886 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11887 here ...
11888 * lisp.h: ... from here. push_key_description is no longer
11889 defined in keyboard.c, so its declaration should not be in
11890 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11891 logically belongs with push_key_description.
11892
dfb3f755
PE
118932011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11894
11895 * buffer.h: Include <sys/types.h> instead of <time.h>.
11896 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11897 Problem reported by Herbert J. Skuhra.
11898
3134906c
LMI
118992011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11900
11901 * xml.c (parse_region): Make the parsing work for
11902 non-comment-starting XML files again (bug#9144).
11903
8d903f4e
AS
119042011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11905
11906 * image.c (gif_load): Fix calculation of bottom and right corner.
11907 (Bug#9468)
11908
80ad64f4
EZ
119092011-09-10 Eli Zaretskii <eliz@gnu.org>
11910
11911 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11912 redisplay in small windows.
11913
208a048d
EZ
119142011-09-09 Eli Zaretskii <eliz@gnu.org>
11915
11916 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11917
9b1c252e
MR
119182011-09-08 Martin Rudalics <rudalics@gmx.at>
11919
11920 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11921 Operate on live windows only.
11922
2949f33b
JB
119232011-09-08 Juanma Barranquero <lekktu@gmail.com>
11924
11925 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11926
e08dcafd
EZ
119272011-09-07 Eli Zaretskii <eliz@gnu.org>
11928
11929 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11930 only under bidi iteration.
11931
115b96bd
JD
119322011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11933
11934 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11935
c8199d0f
PE
119362011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11937
11938 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11939 Without this fix, the command to link temacs failed due to an
11940 undefined symbol __builtin_isnan. This is because
11941 /usr/include/iso/math_c99.h #defines isnan(x) to
11942 __builtin_isnan(x), but the bundled gcc, which identifies itself
11943 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11944 a __builtin_isnan.
11945 * floatfns.c (isnan): #undef, and then #define to a clone of
11946 what's in data.c.
11947 (Fisnan): Always define, since it's always available now.
11948 (syms_of_floatfns): Always define isnan at the Lisp level.
11949
e39b275c 119502011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
11951
11952 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11953
b2db44d9 119542011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 11955
f4af5137 11956 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
11957 The previous code assumed that file offsets (off_t values) fit in
11958 EMACS_INT variables, which is not true on typical 32-bit hosts.
11959 The code messed up by falsely reporting buffer overflow in cases
11960 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11961 when "big" contains more than 2**29 bytes, even though this
11962 inserts just one byte and does not overflow the buffer.
11963 (Finsert_file_contents): Store file offsets as off_t
11964 values, not as EMACS_INT values. Check for overflow when
11965 converting between EMACS_INT and off_t. When checking for
11966 buffer overflow or for overlap, take the offsets into account.
11967 Don't use EMACS_INT for small values where int suffices.
11968 When checking for overlap, fix a typo: ZV was used where
11969 ZV_BYTE was intended.
11970 (Fwrite_region): Don't assume off_t fits into 'long'.
11971 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11972
ecfc0a49
MA
119732011-09-05 Michael Albinus <michael.albinus@gmx.de>
11974
11975 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11976
6511acf2 119772011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 11978
0999621a 11979 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
11980
11981 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 11982 (esprintf, exprintf, evxprintf): New functions.
62f19c19 11983 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 11984 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
11985 (modify_event_symbol): Do not assume that the length of
11986 name_alist_or_stem is safe to alloca and fits in int.
11987 (Fexecute_extended_command): Likewise for function name and binding.
11988 (Frecursion_depth): Wrap around reliably on integer overflow.
11989 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11990 since some callers pass EMACS_INT values.
11991 (Fsingle_key_description): Don't crash if symbol name contains more
11992 than MAX_ALLOCA bytes.
11993 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11994 (get_minibuffer): Arg is now EMACS_INT, not int.
11995 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 11996 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
11997 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11998
2be7d702
PE
11999 * dbusbind.c (signature_cat): New function.
12000 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
12001 Do not overrun buffer; instead, report string overflow.
12002
9d1df220
PE
12003 * dispnew.c (add_window_display_history): Don't overrun buffer.
12004 Truncate instead; this is OK since it's just a log.
12005
33ef5c64
PE
12006 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12007 even if the time zone offset is outlandishly large.
12008 Don't mishandle offset == INT_MIN.
12009
66c6fdd5
PE
12010 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12011 when creating daemon; the previous buffer-overflow check was incorrect.
12012
d749b01b
PE
12013 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12014 which has the guts of the old verror function.
12015
b5cd1905
PE
12016 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12017 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12018
6e1a67fb
PE
12019 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12020 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 12021 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 12022 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
12023 length of string rather than counting it via multiple sprintfs;
12024 that's simpler and more reliable.
c21721cc
PE
12025 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12026 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12027 sprintf, in case result does not fit in int.
12028
c57b67fc
PE
12029 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12030 (fontset_from_font): Print it.
12031
8a401434
PE
12032 * frame.c (tty_frame_count): Now printmax_t, not int.
12033 (make_terminal_frame, set_term_frame_name): Print it.
12034 (x_report_frame_params): In X, window IDs are unsigned long,
12035 not signed long, so print them as unsigned.
12036 (validate_x_resource_name): Check for implausibly long names,
12037 and don't assume name length fits in 'int'.
12038 (x_get_resource_string): Don't blindly alloca invocation name;
12039 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12040 not fit in int.
12041
6e1a67fb
PE
12042 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12043 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
12044 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12045
0df02bf3
PE
12046 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12047 Use esprintf, not sprintf, in case result does not fit in int.
12048
48e30793
PE
12049 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12050 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12051 it as a large positive number.
12052 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12053 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12054
a66ff6d8
PE
12055 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12056 in case result does not fit in int.
12057
aca216ff
PE
12058 * print.c (float_to_string): Detect width overflow more reliably.
12059 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12060 buffer overrun. Don't assume list length fits in 'int'. Treat
12061 print length of 0 as 0, not as infinity; to be consistent with other
12062 uses of print length in this function. Don't overflow print length
12063 index. Don't assume hash table size fits in 'long', or that
12064 vectorlike size fits in 'unsigned long'.
12065
31c286f7
PE
12066 * process.c (make_process): Use printmax_t, not int, to format
12067 process-name gensyms.
12068
55e5faa1
PE
12069 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12070
80f2e268
PE
12071 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12072 to avoid potential buffer overrun.
12073
670741ab
PE
12074 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12075 if X resource line is longer than 512 bytes.
12076
b7163a50
PE
12077 * xfns.c (x_window): Make sprintf buffer a bit bigger
12078 to avoid potential buffer overrun.
12079
ae58ff1f
PE
12080 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12081
c43c8a6a
PE
12082 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12083
3f8236f4
PE
120842011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12085
53e9fe90 12086 Integer overflow fixes for scrolling, etc.
6511acf2
PE
12087 Without these, Emacs silently mishandles large integers sometimes.
12088 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
12089 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12090
6511acf2
PE
12091 * xdisp.c (try_window_id): Check Emacs fixnum range before
12092 converting to 'int'.
806add1d 12093
6511acf2 12094 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
12095 Check that an Emacs fixnum is in range before assigning it to 'int'.
12096 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12097 values converted from Emacs fixnums.
12098 (Frecenter): Don't wrap around a line count if it is out of 'int'
12099 range; instead, treat it as an extreme value.
12100 (Fset_window_configuration, compare_window_configurations):
12101 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12102
6511acf2
PE
12103 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12104 that can exceed INT_MAX. Check that EMACS_INT value is in range
12105 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
12106 (match_limit): Don't assume that a fixnum can fit in 'int'.
12107
6511acf2 12108 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
12109 exceed INT_MAX.
12110
6511acf2 12111 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
12112 (Fvertical_motion): Don't wrap around LINES values that don't fit
12113 in 'int'. Instead, treat them as extreme values. This is good
12114 enough for windows, which can't have more than INT_MAX lines anyway.
12115
fcb901a7
LMI
121162011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12117
0f2f6b6d
LMI
12118 * Require libxml/parser.h to avoid compilation warning.
12119
fcb901a7
LMI
12120 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12121
12122 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12123 since this reportedly can destroy thread storage.
12124
6e20a0d4
CY
121252011-08-30 Chong Yidong <cyd@stupidchicken.com>
12126
12127 * syntax.c (find_defun_start): Update all cache variables if
12128 exiting early (Bug#9401).
12129
148ae00e
EZ
121302011-08-30 Eli Zaretskii <eliz@gnu.org>
12131
f6cfbd8f
EZ
12132 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12133
148ae00e
EZ
12134 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12135 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12136 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12137
12138 * term.c (tty_append_glyph): New function.
12139 (produce_stretch_glyph): Static function and its prototype deleted.
12140
a66cfb1c
SM
12141 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12142 Add prototypes.
148ae00e 12143
c4a07a4c
PE
121442011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12145
12146 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12147 when checking :margin (Bug#9390).
12148 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 12149 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
12150 so that the name doesn't mislead. All uses changed.
12151
6bc8cd65
JB
121522011-08-28 Johan Bockgård <bojohan@gnu.org>
12153
12154 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12155 set_tty_hooks.
12156
dca4927e
EZ
121572011-08-27 Eli Zaretskii <eliz@gnu.org>
12158
12159 * xdisp.c (move_it_to): Don't bail out early when reaching
12160 position beyond to_charpos, if we are scanning backwards.
12161 (move_it_vertically_backward): When DY == 0, make sure we get to
12162 the first character in the line after the newline.
12163
f2cad773
PE
121642011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12165
12166 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12167 (ccl_driver): Do not generate an out-of-range pointer.
12168 (Fccl_execute_on_string): Remove unnecessary check for
12169 integer overflow, noted by Stefan Monnier in
12170 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12171 Remove a FIXME that didn't need fixing.
12172 Simplify the newly-introduced buffer reallocation code.
12173
0cae2cdb
JB
121742011-08-27 Juanma Barranquero <lekktu@gmail.com>
12175
12176 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12177
5fc295a4 121782011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 12179
70c60eb2 12180 Integer and memory overflow issues (Bug#9196).
726e0ab1 12181
d31850da
PE
12182 * doc.c (get_doc_string): Rework so that
12183 get_doc_string_buffer_size is the actual buffer size, rather than
12184 being 1 less than the actual buffer size; this makes xpalloc more
12185 convenient.
12186
a69fbedb
PE
12187 * image.c (x_allocate_bitmap_record, cache_image):
12188 * xselect.c (Fx_register_dnd_atom):
12189 Simplify previous changes by using xpalloc.
12190
fe5c5d37
PE
12191 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12192 since either will do and ptrdiff_t is convenient with xpalloc.
12193
0065d054
PE
12194 * charset.c (charset_table_size)
12195 (struct charset_sort_data.priority): Now ptrdiff_t.
12196 (charset_compare): Don't overflow if priorities differ greatly.
12197 (Fsort_charsets): Don't assume list length fits in int.
12198 Check for size-calculation overflow when allocating sort data.
12199 (syms_of_charset): Allocate an initial charset table that is
12200 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12201
12202 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12203
12204 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12205 The actual value is always <= INT_MAX, and leaving it unsigned made
12206 overflow checking harder.
12207
12208 * dispextern.h (struct glyph_matrix.rows_allocated)
12209 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12210 with xpalloc. The values are still always <= INT_MAX.
12211
12212 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12213
12214 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12215 (SAFE_NALLOCA): New macro.
12216
12217 * region-cache.c (struct boundary.pos, find_cache_boundary)
12218 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12219 (set_cache_region, invalidate_region_cache)
12220 (revalidate_region_cache, know_region_cache, region_cache_forward)
12221 (region_cache_backward, pp_cache):
12222 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12223 so that ptrdiff_t * can be passed to xpalloc.
12224 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12225 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12226 (pp_cache): Don't assume cache_len fits in int.
12227 * region-cache.h: Adjust extern decls to match.
12228
12229 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12230 EMACS_INT, since either will do, for xpalloc.
12231
12232 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12233 (xnmalloc, xnrealloc, xpalloc): New functions.
12234
726e0ab1
PE
12235 * bidi.c (bidi_shelve_header_size): New constant.
12236 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12237 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12238
51f30bc5 12239 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
12240 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12241 (overlay_strings):
12242 Don't update size of array until after memory allocation succeeds,
12243 because xmalloc/xrealloc may not return.
0065d054
PE
12244 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12245 now that we have proper integer overflow checking.
12246 (record_overlay_string, overlay_strings): Catch overflows when
12247 calculating size of overlay_str_buf.
726e0ab1 12248
0065d054
PE
12249 * callproc.c (Fcall_process): Check for size overflow when
12250 calculating size of args2.
12251 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12252 Normally we prefer signed values, but sticking with ptrdiff_t would
12253 require adding more-complicated checks.
726e0ab1
PE
12254
12255 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12256 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12257 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 12258 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
12259
12260 * character.c (Fstring): Check for size-calculation overflow.
12261
12262 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12263 unnecessary integer overflow. Check for size overflow.
12264 (encode_coding_object): Don't update size until xmalloc succeeds.
12265
12266 * composite.c (get_composition_id): Check for overflow in glyph
12267 length calculations.
12268
12269 Integer and memory overflow fixes for display code.
12270 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12271 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12272 (scrolling_window): Check for overflow in size calculations.
12273 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12274 Don't assume glyph table len fits in int.
12275 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12276 (row_table_size): Now ptrdiff_t, not int.
12277 (scrolling_window): Avoid overflow in size calculations.
12278 Don't update size until allocation succeeds.
12279 * fns.c (concat): Check for overflow in size calculations.
12280 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12281 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12282 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12283
12284 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12285 (get_doc_string): Check for size calculation overflow.
12286 Don't update size until allocation succeeds.
12287 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12288 EMACS_INT, where ptrdiff_t will do.
12289 (Fsubstitute_command_keys): Check for string overflow.
12290
12291 * editfns.c (set_time_zone_rule): Don't assume environment length
12292 fits in int.
12293 (message_length): Now ptrdiff_t, not int.
12294 (Fmessage_box): Don't update size until allocation succeeds.
12295 Don't assume message length fits in int.
12296 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12297
0065d054
PE
12298 * emacs.c (main): Do not reallocate argv, since there is a null at
12299 the end that can be overwritten, and this way there's no need to
12300 worry about size-calculation overflow.
12301 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
12302
12303 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12304 alloc succeeds.
12305 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12306
12307 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12308 (x_set_scroll_bar_width, x_figure_window_size):
12309 Check for integer overflow.
12310 (x_set_alpha): Do not assume XINT fits in int.
12311
12312 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12313 This is for the members text_lines, text_cols, total_lines, total_cols,
12314 where the system imposes an 'int' limit.
12315
12316 * fringe.c (Fdefine_fringe_bitmap):
12317 Don't update size until alloc works.
12318
12319 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12320 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12321
12322 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12323 Check for size-calculation overflow.
12324 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12325 do, as we prefer signed integers.
12326 (id_to_widget.max_size, id_to_widget.used)
12327 (xg_store_widget_in_map, xg_remove_widget_from_map)
12328 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12329 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12330 Use and return ptrdiff_t, not int.
12331 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12332 * gtkutil.h: Change prototypes to match the above.
12333
12334 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12335 are duplicate now that they've been promoted to lisp.h.
12336 (x_allocate_bitmap_record, x_alloc_image_color)
12337 (make_image_cache, cache_image, xpm_load):
12338 Don't update size until alloc is done.
12339 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12340 (x_detect_edges):
3256efce 12341 Check for size calculation overflow.
726e0ab1
PE
12342 (ct_colors_allocated_max): New constant.
12343 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12344 overflow.
3256efce 12345
726e0ab1
PE
12346 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12347 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12348 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12349 Use ptrdiff_t, not int, to count maps.
12350 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
12351 calculations. Don't update size until allocation succeeds.
12352 Redo calculations to avoid overflow.
726e0ab1
PE
12353 * keyboard.h: Change prototypes to match the above.
12354
12355 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12356 to count maps.
12357 (current_minor_maps): Check for size calculation overflow.
12358 * keymap.h: Change prototypes to match the above.
12359
12360 * lread.c (read1, init_obarray): Don't update size until alloc done.
12361
12362 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12363 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12364
726e0ab1
PE
12365 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12366 Now ptrdiff_t, not int.
12367 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12368 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12369
12370 * process.c (Fnetwork_interface_list): Check for overflow
12371 in size calculation.
12372
12373 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12374
12375 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12376 overflow. Don't bother calling xmalloc when xrealloc will do.
12377
12378 * search.c (Freplace_match): Check for size calculation overflow.
12379 (Fset_match_data): Don't assume list lengths fit in 'int'.
12380
12381 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12382 for command line length. Do not attempt to address one before the
12383 beginning of an array, as that's not portable.
12384
12385 * term.c (max_frame_lines): Remove; unused.
12386 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12387 not int.
12388 (encode_terminal_code, calculate_costs): Check for size
12389 calculation overflow.
12390 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12391 table lengths and related sizes. Don't update size until alloc
12392 done. Redo calculations to avoid overflow.
12393 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12394
12395 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12396 subtracting pointers.
12397 (gobble_line): Check for overflow more carefully. Don't update size
12398 until alloc done.
12399
12400 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12401 Don't update size until alloc done.
12402 Redo size calculations to avoid overflow.
12403 Check for size calculation overflow.
0065d054 12404 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
12405
12406 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12407 Use ptrdiff_t, not int, for sizes.
12408 (store_mode_line_noprop_char): Don't update size until alloc done.
12409
0065d054
PE
12410 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12411 Use ptrdiff_t, not int, for sizes.
12412 (Finternal_make_lisp_face, cache_face):
12413 Check for size calculation overflow.
12414 (cache_face): Treat size calculation overflows as if they were
12415 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
12416
12417 * xfns.c (x_encode_text, x_set_name_internal)
12418 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12419 sizes, since they can exceed INT_MAX in size. Check for size
12420 calculation overflow.
12421
0065d054
PE
12422 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12423 (xg_select): Check for size calculation overflow.
726e0ab1
PE
12424 Don't update size until alloc done.
12425
0065d054 12426 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 12427 as sprintf is limited to int lengths.
1d526e2f 12428
252c5ee1
PE
12429 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12430 (X_LONG_MIN): New macros.
864d7ce7
PE
12431 Use them to make the following changes clearer.
12432 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12433 This change doesn't affect the value now, but it may help remind
12434 future maintainers not to raise the value too much later.
12435 (SELECTION_QUANTUM): Remove, replacing with ...
12436 (selection_quantum): ... new function, which avoids overflow.
12437 All uses changed.
12438 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12439 assumption that selection length fits in 'int'.
12440 (x_reply_selection_request, x_handle_selection_request)
12441 (x_get_window_property, receive_incremental_selection)
12442 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12443 (lisp_data_to_selection_data, clean_local_selection_data):
12444 Use ptrdiff_t, not int, to record length of selection.
12445 (x_reply_selection_request, x_get_window_property)
12446 (receive_incremental_selection, x_property_data_to_lisp):
12447 Redo calculations to avoid overflow.
12448 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 12449 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
12450 something.
12451 (x_get_window_property, receive_incremental_selection)
12452 (lisp_data_to_selection_data, x_property_data_to_lisp):
12453 Check for size-calculation overflow.
12454 (x_get_window_property, receive_incremental_selection)
12455 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12456 Don't store size until memory allocation succeeds.
12457 (x_get_window_property): Plug memory leak on memory exhaustion.
12458 Don't double-block input; malloc is safe here. Don't assume 2**34
12459 - 4 fits in unsigned long. Add an xassert to check
12460 XGetWindowProperty overflow. Be more careful about overflow
12461 calculations, and distinguish size from memory overflow better.
12462 (receive_incremental_selection): When tracing, don't assume
12463 unsigned int is less than INT_MAX.
12464 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12465 harmful) conversions of unsigned short to int.
12466 (lisp_data_to_selection_data): Don't assume that integers
12467 in the range -65535 through -1 fit in an X unsigned short.
12468 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12469 result parameters unless successful. Rely on cons_to_unsigned
12470 to report problems with elements; the old code wasn't right anyway.
12471 (x_check_property_data): Check for int overflow; we cannot use
12472 a wider type due to X limits.
12473 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12474
726e0ab1 12475 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 12476
0065d054
PE
12477 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12478 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
12479 (x_color_cells): Don't store size until memory allocation succeeds.
12480 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 12481 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
12482 (x_term_init): Don't assume length fits in int (sprintf is limited
12483 to int size).
bc18e09d 12484
ebfa62c0
PE
12485 Use ptrdiff_t for composition IDs.
12486 * character.c (lisp_string_width):
12487 * composite.c (composition_table_size, n_compositions)
12488 (get_composition_id, composition_gstring_from_id):
12489 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12490 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12491 * window.c (Frecenter):
12492 Use ptrdiff_t, not int, for composition IDs.
12493 * composite.c (get_composition_id): Check for integer overflow.
12494 * composite.h: Adjust prototypes to match the above changes.
12495
d3411f89
PE
12496 Use ptrdiff_t for hash table indexes.
12497 * category.c (hash_get_category_set):
12498 * ccl.c (ccl_driver):
12499 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12500 * coding.c (coding_system_charset_list, detect_coding_system):
12501 * coding.h (struct coding_system.id):
12502 * composite.c (get_composition_id, gstring_lookup_cache):
12503 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12504 * image.c (xpm_get_color_table_h):
12505 * lisp.h (hash_lookup, hash_put):
12506 * minibuf.c (Ftest_completion):
12507 Use ptrdiff_t for hash table indexes, not int (which is too
12508 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12509 32-bit --with-wide-int hosts).
12510
e097a6fa
PE
12511 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12512 Add a FIXME comment about memory leaks.
12513 (syms_of_charset): Don't assume xmalloc returns.
12514
5637687f
PE
12515 Don't assume that stated character widths fit in int.
12516 * character.c (Fchar_width, c_string_width, lisp_string_width):
12517 * character.h (CHAR_WIDTH):
12518 * indent.c (MULTIBYTE_BYTES_WIDTH):
12519 Use sanitize_char_width to avoid undefined and/or bad behavior
12520 with outlandish widths.
a66cfb1c 12521 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
12522 now that we have two such functions. All uses changed.
12523 (sanitize_char_width): New inline function.
12524
a2271ba2
PE
12525 Don't assume that tab-width fits in int.
12526 * character.h (sanitize_width): New inline function.
12527 (SANE_TAB_WIDTH): New macro.
12528 (ASCII_CHAR_WIDTH): Use it.
12529 * indent.c (sane_tab_width): Remove. All uses replaced by
12530 SANE_TAB_WIDTH (current_buffer).
12531 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12532
18c52557
PE
12533 * fileio.c: Integer overflow issues with file modes.
12534 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12535
caeeedc1
PE
12536 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12537 Remove unreachable code.
12538 (read_hex, load_charset_map_from_file): Check for integer overflow.
12539
6df6ae42 12540 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12541 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12542 (x_send_scroll_bar_event): Likewise. Check that the size does not
12543 exceed limits imposed by XClientMessageEvent, as well as the usual
12544 ptrdiff_t and size_t limits.
12545
b13995db
PE
12546 * keyboard.c: Overflow, signedness and related fixes.
12547 (make_lispy_movement): Use same integer type in forward decl
12548 that is used in the definition.
12549 (read_key_sequence, keyremap_step):
12550 Change bufsize argument back to int, undoing my 2011-03-30 change.
12551 We prefer signed types, and int is wide enough here.
12552 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12553 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12554 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12555 length, not size_t. Use ptrdiff_t for index, not int.
12556 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12557 possibility of integer overflow.
12558
13464394
PE
12559 Overflow, signedness and related fixes for images.
12560
12561 * dispextern.h (struct it.stack[0].u.image.image_id)
12562 (struct_it.image_id, struct image.id, struct image_cache.size)
12563 (struct image_cache.used, struct image_cache.ref_count):
12564 * gtkutil.c (update_frame_tool_bar):
12565 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12566 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12567 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12568 * nsmenu.m (update_frame_tool_bar):
12569 * xdisp.c (calc_pixel_width_or_height):
12570 * xfns.c (image_cache_refcount):
12571 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12572 on typical 64-bit hosts.
12573
12574 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12575 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12576 Omit unnecessary casts to int.
12577 (parse_image_spec): Check that integers fall into 'int' range
12578 when the callers expect that.
12579 (image_ascent): Redo ascent calculation to avoid int overflow.
12580 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12581 (lookup_image): Remove unnecessary tests.
12582 (xbm_image_p): Locals are now of int, not EMACS_INT,
12583 since parse_image_check makes sure they fit into int.
12584 (png_load, gif_load, svg_load_image):
12585 Prefer int to unsigned where either will do.
12586 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12587 old tiff_error_handler and tiff_warning_handler.
12588 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12589 stack buffer overflows. It uses only the features of vsnprintf
12590 that are common to both POSIX and native Microsoft.
12591 (tiff_error_handler, tiff_warning_handler): Use it.
12592 (tiff_load, gif_load, imagemagick_load_image):
12593 Don't assume :index value fits in 'int'.
12594 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12595 (imagemagick_load_image): Check that crop parameters fit into
12596 the integer types that MagickCropImage accepts. Don't assume
12597 Vimagemagick_render_type has a nonnegative value. Don't assume
12598 size_t fits in 'long'.
12599 (gs_load): Use printmax_t to print the widest integers possible.
12600 Check for integer overflow when computing image height and width.
12601
c11821d4
EZ
126022011-08-26 Eli Zaretskii <eliz@gnu.org>
12603
12604 * xdisp.c (redisplay_window): Don't force window start if point
12605 will be invisible in the resulting window. (Bug#9324)
12606
0c95fcf7
EZ
126072011-08-25 Eli Zaretskii <eliz@gnu.org>
12608
12609 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12610 the display spec is of the form `(space ...)'.
12611 (handle_display_spec): Return the value returned by
12612 handle_single_display_spec, not just 1 or zero.
12613 (handle_single_display_spec): If the display spec is of the form
12614 `(space ...)', and specifies display in the text area, return 2
12615 rather than 1.
fee65a97 12616 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
12617 accurately, and prefer exact match for point under bidi.
12618 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
12619
12620 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12621 into disp_prop; all users changed.
12622
12623 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12624 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12625 for the text covered by the display property.
12626
e4ed06f1
CY
126272011-08-25 Chong Yidong <cyd@stupidchicken.com>
12628
12629 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12630 Change return value to nil.
12631 (Frecord_buffer): Delete unused function.
12632
f67cdd7f
EZ
126332011-08-24 Eli Zaretskii <eliz@gnu.org>
12634
5980d4c6
EZ
12635 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12636 buffers, return left-to-right.
8610fe8b
EZ
12637 (set_cursor_from_row): Consider candidate row a win if its glyph
12638 represents a newline and point is on that newline. Fixes cursor
12639 positioning on the newline at EOL of R2L text within L2R
12640 paragraph, and vice versa.
12641 (try_cursor_movement): Check continued rows, in addition to
12642 continuation rows. Fixes unwarranted scroll when point enters a
12643 continued line of R2L text within an L2R paragraph, or vice versa.
12644 (cursor_row_p): Consider the case of point being equal to
12645 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12646 from the end of a short line to the beginning of a continued line
12647 of R2L text within L2R paragraph.
12648 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12649 composed characters.
5980d4c6 12650
f67cdd7f
EZ
12651 * bidi.c (bidi_check_type): Use xassert.
12652 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12653 members.
12654
bca633fb
EZ
126552011-08-23 Eli Zaretskii <eliz@gnu.org>
12656
12657 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12658 a character.
12659
4a5885a7
CY
126602011-08-23 Chong Yidong <cyd@stupidchicken.com>
12661
12662 * nsfont.m (ns_otf_to_script): Fix typo.
12663
0902a04e
KH
126642011-08-22 Kenichi Handa <handa@m17n.org>
12665
12666 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12667 extra slot even if the purpose is char-code-property-table.
12668
1a2e6670
EZ
126692011-08-23 Eli Zaretskii <eliz@gnu.org>
12670
8ddde651
EZ
12671 * xdisp.c (redisplay_window): When computing centering_position,
12672 account for the height of the header line. (Bug#8874)
12673
425cc014
EZ
12674 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12675 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12676 candidate is selected by the mouse, and that candidate has a
12677 composed character under the mouse.
12678
1a2e6670
EZ
12679 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12680 coordinates reported by pos-visible-in-window-p for a composed
12681 character in column zero.
12682
8b76d6f8
SM
126832011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12684
12685 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12686
dac347dd
EZ
126872011-08-22 Eli Zaretskii <eliz@gnu.org>
12688
12689 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12690 consider it a hit if to_charpos is anywhere in the range of the
12691 composed buffer positions.
12692
e013fb34
CY
126932011-08-22 Chong Yidong <cyd@stupidchicken.com>
12694
12695 * image.c (gif_load): Don't assume that each subimage has the same
12696 dimensions as the base image. Handle disposal method that is
12697 "undefined" by the gif spec (Bug#9335).
12698
bd1ba3e8
CY
126992011-08-20 Chong Yidong <cyd@stupidchicken.com>
12700
12701 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 12702 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 12703
54a1215b
EZ
127042011-08-19 Eli Zaretskii <eliz@gnu.org>
12705
823564e5
EZ
12706 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12707 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12708 from an Org mode buffer to a Speedbar frame.
12709
54a1215b
EZ
12710 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12711 a composition, take its buffer position from IT->cmp_it.charpos.
12712 Fixes cursor positioning at the beginning of a line that begins
12713 with a composed character.
12714
9778ebcc
EZ
127152011-08-18 Eli Zaretskii <eliz@gnu.org>
12716
0be6ee06
EZ
12717 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12718 character bidirectional type, use STRONG_L instead. Fixes crashes
12719 in a buffer produced by `describe-categories'.
12720
9778ebcc
EZ
12721 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12722 members before the level stack, so they would be saved and
12723 restored when copying iterator state. Fixes incorrect reordering
12724 around TABs covered by display properties.
12725
156bffbe
AS
127262011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12727
6b02f655 12728 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 12729
72ad093b
CY
127302011-08-17 Chong Yidong <cyd@stupidchicken.com>
12731
12732 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
12733 (internal_condition_case_2, internal_condition_case_n):
12734 Remove unnecessary aborts (Bug#9081).
72ad093b 12735
35774242
EZ
127362011-08-17 Eli Zaretskii <eliz@gnu.org>
12737
12738 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12739 has no `load' handler, try opening the file locally. (Bug#9311)
12740
db76dd85
KB
127412011-08-16 Ken Brown <kbrown@cornell.edu>
12742
12743 * gmalloc.c: Expand comment.
12744
b215eee5
EZ
127452011-08-16 Eli Zaretskii <eliz@gnu.org>
12746
12747 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12748 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12749
a4579d33
KB
127502011-08-16 Ken Brown <kbrown@cornell.edu>
12751
12752 Fix memory allocation problems in Cygwin build (Bug#9273).
12753
12754 * unexcw.c ( __malloc_initialized): Declare external variable.
12755 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12756
8b76d6f8
SM
12757 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12758 New variables.
a4579d33
KB
12759 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12760 dumped emacs.
12761 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12762 in the static heap.
12763 [CYGWIN] (special_realloc): New function.
12764 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12765 requests to realloc storage in the static heap.
12766
3ebec551
PE
127672011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12768
12769 * bidi.c (bidi_initialize): Remove unused local.
12770
9fd8be00
EZ
127712011-08-15 Eli Zaretskii <eliz@gnu.org>
12772
6b02f655
SM
12773 * bidimirror.h:
12774 * biditype.h: Remove file.
12775 * makefile.w32-in ($(BLD)/bidi.$(O)):
12776 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
12777
12778 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12779
12780 * chartab.c: Improve commentary for the uniprop_table API.
12781
32413314
EZ
12782 * bidi.c (bidi_paragraph_init): Support zero value of
12783 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
12784 (bidi_initialize): Use uniprop_table instead of including
12785 biditype.h and bidimirror.h.
32413314 12786
9fd8be00
EZ
12787 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12788 coordinates of the iterator when restoring from ppos_it.
12789 (Bug#9296)
12790
5cf2b69b
KH
127912011-08-14 Kenichi Handa <handa@m17n.org>
12792
12793 * process.c (create_process): Call setup_process_coding_systems
72ad093b 12794 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 12795
daf17d00
EZ
127962011-08-14 Eli Zaretskii <eliz@gnu.org>
12797
12798 * xdisp.c (move_it_in_display_line_to): Don't invoke
12799 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12800 ppos_it. Fixes vertical cursor motion when line beginning is
12801 covered by an image. (Bug#9296)
12802
08e3161a
JD
128032011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12804
12805 * nsterm.h (ns_run_ascript): Declare.
12806 (NSAPP_DATA2_RUNASSCRIPT): Define.
12807
12808 * nsfns.m (as_script, as_result, as_status): New static variables.
12809 (ns_run_ascript): New function.
5e617bc2 12810 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
12811 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12812 the event loop. Get status from as_status (Bug#7276).
12813
12814 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12815 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12816 the event loop (Bug#7276).
12817
a3720aa2
AS
128182011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12819
12820 * gnutls.c (QCgnutls_bootprop_priority)
12821 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12822 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12823 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12824 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12825 (QCgnutls_bootprop_verify_hostname_error)
12826 (QCgnutls_bootprop_callbacks_verify): Rename from
12827 Qgnutls_bootprop_..., all uses changed.
12828
12829 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12830 uses changed.
12831
0a0d27fb
PE
128322011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12833
19d5c50c
PE
12834 * xfaces.c (Qframe_set_background_mode): Now static.
12835 * dispextern.h (Qframe_set_background_mode): Remove decl.
12836
0a0d27fb
PE
12837 * process.c (Fnetwork_interface_info): Declare local only if needed.
12838
377538cb
JD
128392011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12840
12841 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12842 (Fnetwork_interface_list): Allocate in increments of bytes instead
12843 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12844 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12845 sockaddr.
12846 (struct ifflag_def): notrailers is smart on OSX.
12847 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12848 Get hardware address with getifaddrs if available.
12849
08fff70c
EZ
128502011-08-12 Eli Zaretskii <eliz@gnu.org>
12851
12852 * xdisp.c (iterate_out_of_display_property): xassert that
12853 IT->position is set to within IT->object's boundaries. Break from
12854 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
12855 when IT->position is set up wrongly due to some bug.
12856 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
12857 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12858 entry. Force push_it to save on the stack the current
12859 buffer/string position, to be restored by pop_it. Fix flags in
12860 the iterator structure wrt the object coming from a display
12861 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12862 properties. (Bug#9284)
12863
7be1c708 128642011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 12865
7be1c708
CY
12866 * fontset.c (fontset_get_font_group): Add proper type checks.
12867 (Bug#9172)
aac0c6e3 12868
7be1c708 128692011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 12870
7be1c708
CY
12871 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12872 and LC_VERSION_MIN_MACOSX.
12873 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12874 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 12875
97bb72a6
EZ
128762011-08-08 Eli Zaretskii <eliz@gnu.org>
12877
12878 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
12879 no-display-properties-and-no-overlays under bidi display.
12880 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 12881 properties and overlays.
97bb72a6 12882
d5617611
CY
128832011-08-08 Chong Yidong <cyd@stupidchicken.com>
12884
37e11a63
CY
12885 * editfns.c (Fset_time_zone_rule): Document relationship with the
12886 setenv function.
12887
d5617611
CY
12888 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12889 the font entity extracted from the cache (Bug#8109).
12890
58872834
CY
128912011-08-07 Chong Yidong <cyd@stupidchicken.com>
12892
12893 * composite.c (autocmp_chars): Don't reset point. That is done by
12894 restore_point_unwind (Bug#5984).
12895
75bfc667
JL
128962011-08-07 Juri Linkov <juri@jurta.org>
12897
12898 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12899 to show the arg `TIME' instead of `TIMEVAL'.
12900
d1410150
EZ
129012011-08-06 Eli Zaretskii <eliz@gnu.org>
12902
12903 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12904 display property strides EOL and includes a newline, as in
12905 longlines-mode. (Bug#9254)
75b771e4
EZ
12906 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12907 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
12908
12909 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12910 is non-zero, even if the data buffer is NULL. Fixes a crash in
12911 vertical-motion with longlines-mode. (Bug#9254)
12912
35928349
EZ
129132011-08-05 Eli Zaretskii <eliz@gnu.org>
12914
ec7cc85b
EZ
12915 * bidi.c <bidi_cache_total_alloc>: Now static.
12916 (bidi_initialize): Initialize bidi_cache_total_alloc.
12917
8b76d6f8 12918 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
12919 cache. (Bug#9221)
12920
12921 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12922 amount allocated this far in `bidi_cache_total_alloc'.
12923 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12924 non-zero, only free the data buffer without restoring the cache
12925 contents. All callers changed.
12926
12927 * dispextern.h (bidi_unshelve_cache): Update prototype.
12928
12929 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12930 (move_it_in_display_line, move_it_to)
12931 (move_it_vertically_backward, move_it_by_lines): Replace the call
12932 to xfree to an equivalent call to bidi_unshelve_cache.
12933 (move_it_in_display_line_to): Fix logic of returning
412b6358 12934 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 12935
e2e2423b
EZ
129362011-08-05 Eli Zaretskii <eliz@gnu.org>
12937
12938 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12939 came from a string character with a `cursor' property. (Bug#9229)
12940
ae9e757a
JD
129412011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12942
12943 * Makefile.in (LIB_PTHREAD): New variable.
12944 (LIBES): Add LIB_PTHREAD (Bug#9216).
12945
12946 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12947 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12948
213bd7f2
AS
129492011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12950
6b02f655 12951 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 12952
99aaf75f
JD
129532011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12954
12955 * xterm.c (x_find_topmost_parent): New function.
12956 (x_set_frame_alpha): Find topmost parent window with
12957 x_find_topmost_parent and set the property there also (bug#9181).
12958 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12959
c74e9d86
PE
129602011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12961
12962 * callproc.c (Fcall_process): Avoid vfork clobbering
12963 the local vars buffer, coding_systems, current_dir.
12964
640c8776
SM
129652011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12966
12967 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12968
f26d0e4c
PE
129692011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12970
8a10d76c
PE
12971 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12972 so that it is not optimized away.
12973
f26d0e4c
PE
12974 * xdisp.c (compute_display_string_pos): Remove unused local.
12975
55439c61
EZ
129762011-08-02 Eli Zaretskii <eliz@gnu.org>
12977
12978 Fix slow cursor motion and scrolling in large buffers with
12979 selective display, like Org Mode buffers. (Bug#9218)
12980
12981 * dispextern.h (struct bidi_it): New member disp_prop_p.
12982
12983 * xdisp.c: Remove one-slot cache of display string positions.
12984 (compute_display_string_pos): Accept an additional argument
5e617bc2 12985 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
12986 for a display string or property. If found, set DISP_PROP_P
12987 non-zero.
12988
12989 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
12990 DISP_PROP_P, and pass it to compute_display_string_pos.
12991 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
12992 non-zero. All callers of bidi_fetch_char changed.
12993
fb33fa43
SM
129942011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12995
12996 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12997
b099e063
DM
129982010-12-03 Don March <don@ohspite.net>
12999
13000 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13001 last character M-[char] is translated to ESC [char] (bug#7541).
13002
5cc7f7af
KH
130032011-08-02 Kenichi Handa <handa@m17n.org>
13004
d0fffa3f 13005 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
13006
13007 * chartab.c (uniprop_table): Make it non-static.
13008
525d5e6e
EZ
130092011-08-01 Eli Zaretskii <eliz@gnu.org>
13010
13011 * xdisp.c (forward_to_next_line_start): Accept additional argument
13012 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13013 on the newline.
13014 (reseat_at_next_visible_line_start): Use the bidi iterator state
13015 returned by forward_to_next_line_start to restore the state of
13016 it->bidi_it after backing up to previous newline. (Bug#9212)
13017
31011111
AS
130182011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13019
13020 * regex.c (re_comp): Protoize.
13021 (re_exec): Fix return type.
13022 (regexec): Fix type of `ret'. (Bug#9203)
13023
476371c4
PE
130242011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13025
e5d76069
PE
13026 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13027 This is needed if max-image-size is a floating-point number.
13028
9a79b20c
AS
130292011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13030
13031 * print.c (print_object): Print empty symbol as ##.
13032
13033 * lread.c (read1): Read ## as empty symbol.
13034
d8c2fa78
AA
130352011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13036
13037 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13038 setting frame foreground color (Bug#9175).
13039 (x_set_background_color): Likewise.
13040
ffe57a7a
AA
13041 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13042 contents (Bug#9176).
13043 (EmacsTooltip -init): Remove bezels and add shadows to
13044 tooltip windows.
13045
bf3492a5
AA
13046 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13047 or scroll bar (Bug#8470).
13048
d55e9c53
AA
13049 * nsfont.m (nsfont_open): Remove assignment to voffset and
13050 unnecessary vars hshink, expand, hd, full_height, min_height.
13051 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13052
13053 * nsterm.h (nsfont_info): Remove voffset field.
13054
d8c2fa78 130552011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
13056
13057 Implement strike-through and overline on NextStep (Bug#8863).
13058
13059 * nsfont.m (nsfont_open): Use underline position provided by font,
13060 instead of hard-coded value of 2.
13061 (nsfont_draw): Call ns_draw_text_decoration instead.
13062
13063 * nsterm.h: Add declaration for ns_draw_text_decoration.
13064
13065 * nsterm.m (ns_draw_text_decoration): New function for drawing
13066 underline, overline, and strike-through.
13067 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13068 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 13069 accommodate underlining, etc.
4843aac3 13070
4cc60b9b
EZ
130712011-07-28 Eli Zaretskii <eliz@gnu.org>
13072
bc7ece87
EZ
13073 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13074 default.
4cc60b9b 13075
476371c4
PE
130762011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13077
66606eea
PE
13078 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13079 Without this fix, if a signal arrives just after memory fills up,
13080 'malloc' might be invoked reentrantly.
13081
476371c4
PE
13082 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13083 In other words, assume that every image size is allowed, on non-X
13084 hosts. This assumption is probably wrong, but it lets Emacs compile.
13085
f3fcc40d
AS
130862011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13087
13088 * regex.c (re_iswctype): Convert return values to boolean.
13089
350c992f
EZ
130902011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13091
13092 * xdisp.c (compute_display_string_pos): Don't use cached display
13093 string position if the buffer had its restriction changed.
13094 (Bug#9184)
13095
5266b4bb
PE
130962011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13097
13098 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13099
2573a837 131002011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 13101
41f55ccd 13102 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 13103
39e378da
PE
13104 * bidi.c: Integer size and overflow fixes.
13105 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13106 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13107 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13108 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13109 (bidi_find_other_level_edge):
13110 Use ptrdiff_t instead of EMACS_INT where either will do.
13111 This works better on 32-bit hosts configured --with-wide-int.
13112 (bidi_cache_ensure_space): Check for size-calculation overflow.
13113 Use % rather than repeated addition, for better worst-case speed.
13114 Don't set bidi_cache_size until after xrealloc returns, because it
13115 might not return.
13116 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
13117 (bidi_cache_ensure_space): Also check that the bidi cache size
13118 does not exceed that of the largest Lisp string or buffer. See Eli
13119 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 13120
5e927815
PE
13121 * alloc.c (__malloc_size_t): Remove.
13122 All uses replaced by size_t. See Andreas Schwab's note
13123 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13124
ca4aa935
PE
13125 * image.c: Improve checking for integer overflow.
13126 (check_image_size): Assume that f is nonnull, since
13127 it is always nonnull in practice. This is one less thing to
13128 worry about when checking for integer overflow later.
13129 (x_check_image_size): New function, which checks for integer
13130 overflow issues inside X.
13131 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13132 This removes the need for a memory_full check.
13133 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13134 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13135 (xbm_read_bitmap_data): Change locals back to 'int', since
13136 their values must fit in 'int'.
13137 (xpm_load_image, png_load, tiff_load):
13138 Invoke x_create_x_image_and_pixmap earlier,
13139 to avoid much needless work if the image is too large.
13140 (tiff_load): Treat overly large images as if
13141 x_create_x_image_and_pixmap failed, not as malloc failures.
13142 (gs_load): Use x_check_image_size.
13143
5f8f9cc2
PE
13144 * gtkutil.c: Omit integer casts.
13145 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13146 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13147
5adf60bc
PE
13148 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13149
c8907a93
PE
13150 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13151 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13152 would wrongly return t on a 64-bit host.
13153
e3c25c68
PE
13154 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13155 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13156 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13157 and therefore cause GCC to emit a bogus diagnostic in some cases.
13158
3f791afe
PE
13159 * image.c: Integer signedness and overflow and related fixes.
13160 This is not an exhaustive set of fixes, but it's time to
13161 record what I've got.
13162 (lookup_pixel_color, check_image_size): Remove redundant decls.
13163 (check_image_size): Don't assume that arbitrary EMACS_INT values
13164 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13165 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13166 (tiff_load, imagemagick_load_image):
13167 Check for overflow in size calculations.
13168 (x_create_x_image_and_pixmap): Remove unnecessary test for
13169 xmalloc returning NULL; that can't happen.
13170 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13171 (xpm_color_bucket): Use better integer hashing function.
13172 (xpm_cache_color): Don't possibly over-allocate memory.
13173 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13174 (gif_memory_source):
13175 Use ptrdiff_t, not int or size_t, to record sizes.
13176 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13177 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13178 either works, as we prefer signed integers.
13179 (tiff_read_from_memory, tiff_write_from_memory):
13180 Return tsize_t, not size_t, since that's what the TIFF API wants.
13181 (tiff_read_from_memory): Don't fail simply because the read would
13182 go past EOF; instead, return a short read.
13183 (tiff_load): Omit no-longer-needed casts.
13184 (Fimagemagick_types): Don't assume size fits into 'int'.
13185
3cc5a532
PE
13186 Improve hashing quality when configured --with-wide-int.
13187 * fns.c (hash_string): New function, taken from sxhash_string.
13188 Do not discard information about ASCII character case; this
13189 discarding is no longer needed.
13190 (sxhash-string): Use it. Change sig to match it. Caller changed.
13191 * lisp.h: Declare it.
13192 * lread.c (hash_string): Remove, since we now use fns.c's version.
13193 The fns.c version returns a wider integer if --with-wide-int is
13194 specified, so this should help the quality of the hashing a bit.
13195
b312a492
PE
13196 * emacs.c: Integer overflow minor fix.
13197 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13198 Define only if GNU_LINUX.
13199 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13200
dfd153ae
PE
13201 * dispnew.c: Integer signedness and overflow fixes.
13202 Remove unnecessary forward decls, that were a maintenance hassle.
13203 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13204 All uses changed.
13205 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13206 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13207 (prepare_desired_row, line_draw_cost):
13208 Use int, not unsigned, where either works.
13209 (save_current_matrix, restore_current_matrix):
13210 Use ptrdiff_t, not size_t, where either works.
13211 (init_display): Check for overflow more accurately, and without
13212 relying on undefined behavior.
13213
a81d11a3
PE
13214 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13215 Remove, replacing with the new symbols in lisp.h. All uses changed.
13216 * fileio.c (make_temp_name):
13217 * filelock.c (lock_file_1, lock_file):
13218 * xdisp.c (message_dolog):
13219 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13220 Use pMd etc. instead.
13221 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13222 replacing the pWIDE etc. symbols removed from editfns.c.
13223
3300e6fd
PE
13224 * keyboard.h (num_input_events): Now uintmax_t.
13225 This is (very slightly) less likely to mess up due to wraparound.
13226 All uses changed.
13227
fd05c7e9
PE
13228 * buffer.c: Integer signedness fixes.
13229 (alloc_buffer_text, enlarge_buffer_text):
13230 Use ptrdiff_t rather than size_t when either will do, as we prefer
13231 signed integers.
13232
903fe15d
PE
13233 * alloc.c: Integer signedness and overflow fixes.
13234 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13235 (__malloc_size_t): Default to size_t, not to int.
13236 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13237 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13238 Prefer ptrdiff_t to size_t when either would do, as we prefer
13239 signed integers.
13240 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13241 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13242 Now const. Initialize with values that are in range even if char
13243 is signed.
13244 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13245 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13246 These functions do the right thing with sizes > 2**32.
13247 (check_depth): Now ptrdiff_t, not int.
13248 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13249 Adjust to new way of storing sizes. Check for size overflow bugs
13250 in rest of code.
13251 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13252 slightly wrong anyway, as it missed one instance of
13253 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13254 (refill_memory_reserve): Omit needless cast to size_t.
13255 (mark_object_loop_halt): Mark as externally visible.
13256
ac82cc6a
PE
13257 * xselect.c: Integer signedness and overflow fixes.
13258 (Fx_register_dnd_atom, x_handle_dnd_message):
13259 Use ptrdiff_t, not size_t, since we prefer signed.
13260 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13261 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13262 x_dnd_atoms_size and x_dnd_atoms_length.
13263
c2d1e36d
PE
13264 * doprnt.c: Prefer signed to unsigned when either works.
13265 * eval.c (verror):
13266 * doprnt.c (doprnt):
13267 * lisp.h (doprnt):
13268 * xdisp.c (vmessage):
13269 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13270 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13271 prefer signed arithmetic to avoid comparison confusion.
13272 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13273 but is a bit tricky.
13274
0e926e56
PE
13275 Assume freestanding C89 headers, string.h, stdlib.h.
13276 * data.c, doprnt.c, floatfns.c, print.c:
13277 Include float.h unconditionally.
13278 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13279 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13280 * regex.c: Likewise for stddef.h, string.h.
13281 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13282 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13283 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13284 (STDC_HEADERS): Remove obsolete defines.
13285 * sysdep.c: Include limits.h unconditionally.
13286
9cfdb3ec
PE
13287 Assume support for memcmp, memcpy, memmove, memset.
13288 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13289 * regex.c (memcmp, memcpy):
13290 Remove; we assume C89 now.
13291
13292 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13293 (__malloc_safe_bcopy): Remove; no longer needed.
13294
cf950e6b 13295 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
13296 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13297 well either way, and we prefer signed to unsigned.
13298
dbf38e02
LMI
132992011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13300
13301 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13302 closes the connection while we're reading (bug#9182).
13303
d6f0886c 133042011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 13305
d6f0886c
JD
13306 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13307 are specified (Bug#9168).
24e0f6b1 13308
2eb1f9e6
PE
133092011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13310
13311 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13312 Found by GCC static checking and --with-wide-int on a 32-bit host.
13313
22381272 133142011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
13315
13316 * xdisp.c (compute_display_string_pos): Fix logic of caching
13317 previous display string position. Initialize cached_prev_pos to
13318 -1. Fixes slow-down at the beginning of a buffer.
13319
f25e39b4
EZ
133202011-07-24 Eli Zaretskii <eliz@gnu.org>
13321
13322 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13323 for attrs[LFACE_FONTSET_INDEX].
13324
04c4b52e
PE
133252011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13326
13327 * xml.c (parse_region): Remove unused local
13328 that was recently introduced.
13329
c1734fbd
EZ
133302011-07-23 Eli Zaretskii <eliz@gnu.org>
13331
be18c5a5
EZ
13332 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13333 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13334
c1734fbd
EZ
13335 * xdisp.c (move_it_in_display_line_to): Record the best matching
13336 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
13337 exit if none of the characters scanned was an exact match.
13338 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
13339 when exact match is impossible due to invisible text, and the
13340 lines are truncated.
13341
a258d627
JD
133422011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13343
13344 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13345 for OSX >= 10.7.
13346
b6d5a689
EZ
133472011-07-22 Eli Zaretskii <eliz@gnu.org>
13348
0f74f785
EZ
13349 Fix a significant slow-down of cursor motion with C-n, C-p,
13350 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13351 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 13352 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
13353 (next_element_from_buffer): Call compute_stop_pos_backwards to
13354 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
13355 base_level_stop.
13356 (reseat): Don't look for prev_stop, as that could mean a very long
13357 run.
13358 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13359 <cached_disp_overlay_modiff>: Cache for last found display string
13360 position.
551918c1 13361 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
13362 about the same buffer in the same area of character positions, and
13363 the buffer wasn't changed since the time the display string
13364 position was cached.
551918c1 13365
b2d0c91a
EZ
133662011-07-22 Eli Zaretskii <eliz@gnu.org>
13367
13368 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13369 is an integer, which is important for empty lines. (Bug#9149)
13370
043604ee
CY
133712011-07-22 Chong Yidong <cyd@stupidchicken.com>
13372
13373 * frame.c (Fmodify_frame_parameters): In tty case, update the
13374 default face if necessary (Bug#4238).
13375
da4adb04
CY
133762011-07-21 Chong Yidong <cyd@stupidchicken.com>
13377
13378 * editfns.c (Fstring_to_char): No need to explain what a character
13379 is in the docstring (Bug#6576).
13380
9abd0532
LMI
133812011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13382
13383 * xml.c (parse_region): Make sure we always return a tree.
13384
36881d16
HK
133852011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13386
13387 * xml.c (parse_region): If a document contains only comments,
13388 return that, too.
13389
1e98674d
LMI
133902011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13391
13392 * xml.c (make_dom): Return comments, too.
13393
590bd467
PE
133942011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13395
13396 Port to OpenBSD.
13397 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13398 and the surrounding thread.
13399 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13400 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13401 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13402 timer goes off.
13403 * s/openbsd.h (BROKEN_SIGIO): Define.
13404 * unexelf.c (unexec) [__OpenBSD__]:
13405 Don't update the .mdebug section of the Alpha COFF symbol table.
13406
f41628b2
LMI
134072011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13408
13409 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13410 (bug#8460).
13411
b59b67c5
PE
134122011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13413
15e3a074
PE
13414 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13415 This fixes some race conditions on the permissions of any newly
13416 created file.
13417
41bed37d
PE
13418 * alloc.c (valid_pointer_p): Use pipe, not open.
13419 This fixes some permissions issues when debugging.
13420
b59b67c5
PE
13421 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13422 If fchown fails to set both uid and gid, try to set just gid,
13423 as that is sometimes allowed. Adjust the file's mode to eliminate
13424 setuid or setgid bits that are inappropriate if fchown fails.
13425
925a6be7
SM
134262011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13427
13428 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13429 to compare Lisp_Objects.
13430 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13431 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13432 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13433
52968808
AS
134342011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13435
0a6a104b
AS
13436 * lread.c (read_integer): Unread even EOF character.
13437 (read1): Likewise. Properly record start position of symbol.
13438
52968808
AS
13439 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13440 symbol character follows.
13441
9e381cdd
PE
134422011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13443
13444 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13445 This works around a problem with the previous change to Fcopy_file.
13446 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13447 and without this change, GCC might complain about discarding
13448 fchown's return value.
13449
b5641435
JB
134502011-07-16 Juanma Barranquero <lekktu@gmail.com>
13451
13452 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13453
a8031457
PE
134542011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13455
13456 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13457
dd889327
LMI
134582011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13459
750c33f7
LMI
13460 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13461 it's used from the C level.
13462
dd889327
LMI
13463 * process.c: Use the same condition for POLL_FOR_INPUT in both
13464 keyboard.c and process.c (bug#1858).
13465
87e86684
LM
134662011-07-09 Lawrence Mitchell <wence@gmx.li>
13467
13468 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13469 (Fgnutls_boot): Use it.
13470
64348f40
AS
134712011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13472
13473 * doc.c (Fsubstitute_command_keys): Revert last change.
13474
1d698799
LMI
134752011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13476
f863868c
LMI
13477 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13478 quotes the next character, and doesn't affect other longer
13479 sequences (bug#8935).
13480
1d698799
LMI
13481 * lread.c (syms_of_lread): Clarify that is isn't only
13482 `eval-buffer' and `eval-defun' that's affected by
13483 `lexical-binding' (bug#8460).
13484
aa4b6df6
EZ
134852011-07-15 Eli Zaretskii <eliz@gnu.org>
13486
13487 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 13488 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 13489
5d856da6
PE
134902011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13491
ad6042bb
PE
13492 Fix minor problems found by static checking.
13493 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13494 (elsz): Now a signed constant, not a size_t var. We prefer signed
13495 types to unsigned, to avoid integer comparison confusion. Without
13496 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13497 "cannot optimize loop, the loop counter may overflow", a symptom
13498 of the confusion.
f00bbb22 13499 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
13500 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13501
6468f31c
LMI
135022011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13503
49080b10
LMI
13504 * search.c (Fre_search_backward): Mention `case-fold-search' in
13505 all the re_search_* functions (bug#8138).
13506
6468f31c
LMI
13507 * keyboard.c (Fopen_dribble_file): Document when the file is
13508 closed (bug#8056).
13509
c965adc5
EZ
135102011-07-14 Eli Zaretskii <eliz@gnu.org>
13511
df9733bf
EZ
13512 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13513 bidi_cache_idx.
13514
0bb23927
EZ
13515 Support bidi reordering of display and overlay strings.
13516 * xdisp.c (compute_display_string_pos)
13517 (compute_display_string_end): Accept additional argument STRING.
13518 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13519 (reseat_to_string): Initialize bidi_it->string.s and
13520 bidi_it->string.schars.
13521 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
13522 NULL (avoids a crash in bidi_paragraph_init).
13523 Initialize itb.string.lstring.
0bb23927
EZ
13524 (init_iterator): Call bidi_init_it only of a valid
13525 buffer position was specified. Initialize paragraph_embedding to
13526 L2R.
13527 (reseat_to_string): Initialize the bidi iterator.
13528 (display_string): If we need to ignore text properties of
13529 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13530 original value of -1 will not work with bidi.)
13531 (compute_display_string_pos): First arg is now struct
13532 `text_pos *'; all callers changed. Support display properties on
13533 Lisp strings.
13534 (compute_display_string_end): Support display properties on Lisp
13535 strings.
13536 (init_iterator, reseat_1, reseat_to_string): Initialize the
13537 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13538 when iterating on a string not from display properties).
640c8776
SM
13539 (compute_display_string_pos, compute_display_string_end):
13540 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13541 arrow keys.
13542 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13543 base_level_stop; instead, set base_level_stop to BEGV.
13544 Fixes crashes in vertical-motion.
0bb23927
EZ
13545 (next_element_from_buffer): Improve commentary for when
13546 the iterator is before prev_stop.
13547 (init_iterator): Initialize bidi_p from the default value of
13548 bidi-display-reordering, not from buffer-local value. Use the
13549 buffer-local value only if initializing for buffer iteration.
13550 (handle_invisible_prop): Support invisible properties on strings
13551 that are being bidi-reordered.
13552 (set_iterator_to_next): Support bidi reordering of C strings and
13553 Lisp strings.
13554 (next_element_from_string): Support bidi reordering of Lisp
13555 strings.
13556 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13557 (display_string): Support display of R2L glyph rows.
13558 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13559 (init_iterator): Don't initialize it->bidi_p for strings
13560 here.
13561 (reseat_to_string): Initialize it->bidi_p for strings here.
13562 (next_element_from_string, next_element_from_c_string)
13563 (next_element_from_buffer): Add xassert's for correspondence
13564 between IT's object being iterated and it->bidi_it.string
13565 structure.
13566 (face_before_or_after_it_pos): Support bidi iteration.
13567 (next_element_from_c_string): Handle the case of the first string
13568 character that is not the first one in the visual order.
13569 (get_visually_first_element): New function, refactored from common
13570 parts of next_element_from_buffer, next_element_from_string, and
13571 next_element_from_c_string.
13572 (tool_bar_lines_needed, redisplay_tool_bar)
13573 (display_menu_bar): Force left-to-right direction. Add a FIXME
13574 comment for making that be controlled by a user option.
13575 (push_it, pop_it): Save and restore the state of the
13576 bidi iterator. Save and restore the bidi_p flag.
13577 (pop_it): Iterate out of display property for string iteration as
13578 well.
13579 (iterate_out_of_display_property): Support iteration over strings.
13580 (handle_single_display_spec): Set up it->bidi_it for iteration
13581 over a display string, and call bidi_init_it.
13582 (handle_single_display_spec, next_overlay_string)
13583 (get_overlay_strings_1, push_display_prop): Set up the bidi
13584 iterator for displaying display or overlay strings.
13585 (forward_to_next_line_start): Don't use the shortcut if
13586 bidi-iterating.
13587 (back_to_previous_visible_line_start): If handle_display_prop
13588 pushed the iterator stack, restore the internal state of the bidi
13589 iterator by calling bidi_pop_it same number of times.
13590 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13591 and we are bidi-iterating, don't decrement the iterator position;
13592 instead, set the first_elt flag in the bidi iterator, to produce
13593 the same effect.
13594 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13595 (push_display_prop): xassert that we are iterating a buffer.
13596 (push_it, pop_it): Save and restore paragraph_embedding member.
13597 (handle_single_display_spec, next_overlay_string)
13598 (get_overlay_strings_1, reseat_1, reseat_to_string)
13599 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13600 correctly. Don't assume unibyte strings are not bidi-reordered.
13601 (compute_display_string_pos)
13602 (compute_display_string_end): Fix handling the case of C string.
13603 (push_it, pop_it): Save and restore from_disp_prop_p.
13604 (handle_single_display_spec, push_display_prop): Set the
13605 from_disp_prop_p flag.
13606 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13607 (pop_it): Call iterate_out_of_display_property only if we are
13608 popping after iteration over a string that came from a display
13609 property. Fix a typo in popping stretch info. Add an assertion
13610 for verifying that the iterator position is in sync with the bidi
13611 iterator.
13612 (handle_single_display_spec, get_overlay_strings_1)
13613 (push_display_prop): Fix initialization of paragraph direction for
13614 string when that of the parent object is not yet determined.
13615 (reseat_1): Call bidi_init_it to resync the bidi
13616 iterator with IT's position. (Bug#7616)
13617 (find_row_edges): If ROW->start.pos gives position
13618 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13619 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13620 Reset the from_disp_prop_p flag.
13621 (SAVE_IT, RESTORE_IT): New macros.
13622 (pos_visible_p, face_before_or_after_it_pos)
13623 (back_to_previous_visible_line_start)
13624 (move_it_in_display_line_to, move_it_in_display_line)
13625 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13626 (try_scrolling, redisplay_window, display_line): Use them when
13627 saving a temporary copy of the iterator and restoring it back.
13628 (back_to_previous_visible_line_start, reseat_1)
13629 (init_iterator): Empty the bidi cache "stack".
13630 (move_it_in_display_line_to): If iterator ended up at
13631 EOL, but we never saw any buffer positions smaller than
13632 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13633 motion in bidi-reordered lines.
13634 (move_it_in_display_line_to): Record prev_method and prev_pos
13635 immediately before the call to set_iterator_to_next. Fixes cursor
13636 motion in bidi-reordered lines with stretch glyphs and strings
13637 displayed in margins. (Bug#8133) (Bug#8867)
13638 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13639 TO_CHARPOS.
640c8776
SM
13640 (pos_visible_p): Support positions in bidi-reordered lines.
13641 Save and restore bidi cache.
0bb23927
EZ
13642
13643 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13644 (bidi_paragraph_info): Delete unused struct.
13645 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13646 (bidi_cache_start): New variable.
13647 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13648 to zero.
13649 (bidi_cache_fetch_state, bidi_cache_search)
13650 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13651 (bidi_cache_find, bidi_peek_at_next_level)
13652 (bidi_level_of_next_char, bidi_find_other_level_edge)
13653 (bidi_move_to_visually_next): Compare cache index with
13654 bidi_cache_start rather than with zero.
13655 (bidi_fetch_char): Accept new argument STRING; all callers
13656 changed. Support iteration over a string. Support strings with
13657 display properties. Support unibyte strings. Fix the type of
13658 `len' according to what STRING_CHAR_AND_LENGTH expects.
13659 (bidi_paragraph_init, bidi_resolve_explicit_1)
13660 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
13661 (bidi_level_of_next_char, bidi_move_to_visually_next):
13662 Support iteration over a string.
0bb23927
EZ
13663 (bidi_set_sor_type, bidi_resolve_explicit_1)
13664 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13665 can now be zero (for strings); special values 0 and -1 were
13666 changed to -1 and -2, respectively.
13667 (bidi_char_at_pos): New function.
13668 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13669 Call it instead of FETCH_MULTIBYTE_CHAR.
13670 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13671 initialized to valid values.
13672 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13673 values.
13674 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13675 the test for valid cached positions. Fix the logic for looking up
13676 the sentinel state in the cache. GCPRO the Lisp string we are
13677 iterating.
13678 (bidi_push_it, bidi_pop_it): New functions.
13679 (bidi_initialize): Initialize the bidi cache start stack pointer.
13680 (bidi_cache_ensure_space): New function, refactored from part of
13681 bidi_cache_iterator_state. Don't assume the required size is just
13682 one BIDI_CACHE_CHUNK away.
13683 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13684 (bidi_count_bytes, bidi_char_at_pos): New functions.
13685 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13686 always valid if bidi_cache_idx is valid.
13687 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13688 is valid if it's going to be used.
13689 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13690 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
13691 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13692 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
13693 (bidi_find_other_level_edge, bidi_cache_start_stack):
13694 All variables related to cache indices are now EMACS_INT.
c965adc5 13695
0bb23927
EZ
13696 * dispextern.h (struct bidi_string_data): New structure.
13697 (struct bidi_it): New member `string'. Make flag members be 1-bit
13698 fields, and put them last in the struct.
640c8776
SM
13699 (compute_display_string_pos, compute_display_string_end):
13700 Update prototypes.
0bb23927
EZ
13701 (bidi_push_it, bidi_pop_it): Add prototypes.
13702 (struct iterator_stack_entry): New members bidi_p,
13703 paragraph_embedding, and from_disp_prop_p.
13704 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
13705 (bidi_shelve_cache, bidi_unshelve_cache):
13706 Declare prototypes.
0bb23927
EZ
13707
13708 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13709 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13710 and vector-like objects.
13711
13712 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13713 cache around display iteration.
13714
13715 * window.c (Fwindow_end, window_scroll_pixel_based)
13716 (displayed_window_lines, Frecenter): Save and restore the bidi
13717 cache around display iteration.
13718
3bbd2265
LMI
137192011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13720
13721 * editfns.c (Fdelete_region): Clarify the use of the named
13722 parameters (bug#6788).
13723
adc47434
MR
137242011-07-14 Martin Rudalics <rudalics@gmx.at>
13725
13726 * indent.c (Fvertical_motion): Set and restore w->pointm when
13727 saving and restoring the window's buffer (Bug#9006).
13728
837c31f8
LMI
137292011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13730
13731 * editfns.c (Fstring_to_char): Clarify just what is returned
13732 (bug#6576). Text by Eli Zaretskii.
13733
ac389d0c
JB
137342011-07-13 Juanma Barranquero <lekktu@gmail.com>
13735
13736 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13737
0be0ce47
EZ
137382011-07-13 Eli Zaretskii <eliz@gnu.org>
13739
13740 * buffer.c (mmap_find): Fix a typo.
13741
cd18e7e3
JB
137422011-07-13 Johan Bockgård <bojohan@gnu.org>
13743
13744 Fix execution of x selection hooks.
13745 * xselect.c (Qx_lost_selection_functions)
13746 (Qx_sent_selection_functions): New vars.
13747 (syms_of_xselect): DEFSYM them.
13748 (x_handle_selection_request): Pass Qx_sent_selection_functions
13749 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13750 (x_handle_selection_clear,x_clear_frame_selections):
13751 Pass Qx_lost_selection_functions rather than
13752 Vx_lost_selection_functions to Frun_hook_with_args.
13753
47ea7f44
PE
137542011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13755
ac389d0c 13756 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
13757 The old code sometimes used this field without initializing it.
13758
47ea7f44
PE
13759 * alloc.c (gc_sweep): Don't read past end of array.
13760 In theory, the old code could also have corrupted Emacs internals,
13761 though it'd be very unlikely.
13762
bc985c87
AS
137632011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13764
13765 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 13766 argument. (Bug#4026)
bc985c87 13767
0cf34688
LMI
137682011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13769
b3dadd76
LMI
13770 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13771 key" (bug#4257).
13772
0cf34688
LMI
13773 * window.c (Fset_window_start): Doc fix (bug#4199).
13774 (Fset_window_hscroll): Ditto.
13775
270768cd
PE
137762011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13777
077e3dda 13778 Fix minor new problems caught by GCC 4.6.1.
270768cd 13779 * term.c (init_tty): Remove unused local.
490011a6 13780 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 13781 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 13782 not used otherwise.
270768cd 13783
b1f58454
CY
137842011-07-12 Chong Yidong <cyd@stupidchicken.com>
13785
13786 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13787
22b9578d
LMI
137882011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13789
6e70ab07
LMI
13790 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13791 are the mini-buffer and the echo area (bug#3320).
13792
22b9578d
LMI
13793 * term.c (init_tty): Remove support for supdup, c10 and perq
13794 terminals, which are no longer supported (bug#1482).
13795
8974cc9f
JB
137962011-07-10 Johan Bockgård <bojohan@gnu.org>
13797
13798 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13799
a560d974
JD
138002011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13801
13802 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13803 for non-popups (Bug#3642).
13804
1dae0f0a
AS
138052011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13806
268c2c36 13807 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 13808 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
13809 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13810 * cm.c (losecursor): Likewise.
1dae0f0a
AS
13811 * data.c (fmod): Likewise.
13812 * dispnew.c (swap_glyphs_in_rows): Likewise.
13813 * emacs.c (memory_warning_signal): Likewise.
13814 * floatfns.c (float_error): Likewise.
13815 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13816 (otf_open, font_otf_capability, generate_otf_features)
13817 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13818 Likewise.
13819 * image.c (pbm_read_file): Likewise.
13820 * indent.c (string_display_width): Likewise.
13821 * intervals.c (check_for_interval, search_for_interval)
13822 (inc_interval_count, count_intervals, root_interval)
13823 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13824 * lread.c (defalias): Likewise.
268c2c36 13825 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
13826 * regex.c (set_image_of_range_1, set_image_of_range)
13827 (regex_grow_registers): Likewise.
13828 * sysdep.c (strerror): Likewise.
13829 * termcap.c (valid_filename_p, tprint, main): Likewise.
13830 * tparam.c (main): Likewise.
13831 * unexhp9k800.c (run_time_remap, save_data_space)
13832 (update_file_ptrs, read_header, write_header, calculate_checksum)
13833 (copy_file, copy_rest, display_header): Likewise.
13834 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13835 Likewise.
13836 * xdisp.c (check_it): Likewise.
13837 * xfaces.c (register_color, unregister_color, unregister_colors):
13838 Likewise.
13839 * xfns.c (print_fontset_result): Likewise.
13840 * xrdb.c (member, fatal, main): Likewise.
13841
99033785
PE
138422011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13843
13844 Fix minor problems found by static checking (Bug#9031).
13845 * chartab.c (char_table_set_range, map_sub_char_table):
13846 Remove unused locals.
13847 (uniprop_table): Now static.
13848 * composite.c (_work_char): Remove unused static var.
13849
9cb2ac56
JB
138502011-07-09 Juanma Barranquero <lekktu@gmail.com>
13851
13852 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13853
f25661f0
JD
138542011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13855
13856 * gtkutil.c (qttip_cb): Remove code without function.
13857
8278c4fe
EZ
138582011-07-09 Eli Zaretskii <eliz@gnu.org>
13859
13860 * w32.c (pthread_sigmask): New stub.
13861
1692ae2d 138622011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 13863
8a6ebd58 13864 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
13865 sigprocmask is portable only for single-threaded applications, and
13866 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
13867 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13868 (LIBES): Use it.
13869 * callproc.c (Fcall_process):
13870 * process.c (create_process):
13871 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13872 Use pthread_sigmask, not sigprocmask.
123403e4 13873
1b854618
JD
138742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13875
13876 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13877 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13878 wrong (Bug#8591).
13879
3fe4b549
JD
138802011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13881
0ce7e563
JD
13882 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13883 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13884 (xg_hide_tooltip): Fix comment.
13885
3fe4b549
JD
13886 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13887 in registerServicesMenuSendTypes.
13888 (validRequestorForSendType): Don't check ns_return_types.
13889
13890 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13891 ns_return_type.
13892
5df75e47
JR
138932011-07-08 Jason Rumney <jasonr@gnu.org>
13894
22610910
JR
13895 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13896 SH_SHOW for hidden windows (Bug#5482).
13897
5df75e47
JR
13898 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13899 frame struct members of non-existent frames (Bug#6284).
13900
699c10bd
JD
139012011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13902
4393663b
JD
13903 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13904 variable firstTime not needed on OSX >= 10.6.
13905 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13906 >= 10.5. Use setKnobProportion, setDoubleValue.
13907
13908 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13909 (MAC_OS_X_VERSION_10_5): Define if not defined.
13910 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13911 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13912 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13913
13914 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 13915 cString and lossyCString on OSX >= 10.4.
4393663b 13916
58179cce 13917 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
13918 sizeToFit on OSX >= 10.2.
13919
13920 * nsimage.m (allocInitFromFile): Don't use deprecated method
13921 bestRepresentationForDevice on OSX >= 10.6.
13922
13923 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13924 to avoid warning.
13925
13926 * emacs.c: Declare unexec_init_emacs_zone.
13927
a63e0781
JD
13928 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13929
699c10bd
JD
13930 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13931
13932 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13933 on svcsMenu (Bug#8842).
13934
13935 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13936 ns_return_types.
13937 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13938
13939 * nsterm.m (QUTF8_STRING): Declare.
13940 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13941 (validRequestorForSendType): Return type is (id).
13942 Change indexOfObjectIdenticalTo to indexOfObject.
13943 Check if we have local selection before returning self (Bug#8842).
13944 (writeSelectionToPasteboard): Put local selection into paste board
13945 if we have a local selection (Bug#8842).
13946 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13947
13948 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13949 (ns_get_local_selection): Declare.
13950
54e10184
LMI
139512011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13952
9888ff71
LMI
13953 * keymap.c (describe_map_tree): Don't insert a double newline at
13954 the end of the buffer (bug#1169) and return whether we inserted
13955 something.
13956
54e10184
LMI
13957 * callint.c (Fcall_interactively): Change "reading args" to
13958 "providing args" to try to clarify what it does (bug#1010).
13959
15fa4783
KH
139602011-07-07 Kenichi Handa <handa@m17n.org>
13961
13962 * composite.c (composition_compute_stop_pos): Ignore a static
13963 composition starting before CHARPOS (Bug#8915).
13964
13965 * xdisp.c (handle_composition_prop): Likewise.
13966
a8815b00
EZ
139672011-07-07 Eli Zaretskii <eliz@gnu.org>
13968
13969 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13970 (Bug#9015)
13971
ef7b981d 139722011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
13973
13974 * character.h (unicode_category_t): New enum type.
13975
13976 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13977 (Qchar_code_property_table): New variable.
13978 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13979 (UNIPROP_COMPRESSED_FORM_P): New macros.
13980 (char_table_ascii): Uncompress the compressed values.
13981 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13982 Uncompress the compressed values.
ac389d0c 13983 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
13984 (char_table_ref_and_range): Uncompress the compressed values.
13985 (sub_char_table_set): New arg is_uniprop. Callers changed.
13986 Uncompress the compressed values.
13987 (sub_char_table_set_range): Args changed. Callers changed.
13988 (char_table_set_range): Adjuted for the above change.
13989 (map_sub_char_table): Delete args default_val and parent. Add arg
13990 top. Give decoded values to a Lisp function.
640c8776 13991 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
13992 values to a Lisp function. Gcpro more variables.
13993 (uniprop_table_uncompress)
13994 (uniprop_decode_value_run_length): New functions.
13995 (uniprop_decoder, uniprop_decoder_count): New variables.
13996 (uniprop_get_decoder, uniprop_encode_value_character)
13997 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13998 New functions.
13999 (uniprop_encoder, uniprop_encoder_count): New variables.
14000 (uniprop_get_encoder, uniprop_table)
14001 (Funicode_property_table_internal, Fget_unicode_property_internal)
14002 (Fput_unicode_property_internal): New functions.
14003 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14004 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 14005 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
14006 char-code-property-alist.
14007
640c8776 14008 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
14009 Vunicode_category_table.
14010
640c8776 14011 * font.c (font_range): Adjust for the change of
c805dec0
KH
14012 Vunicode_category_table.
14013
76b397fb
DN
140142011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14015
14016 * m/iris4d.h: Remove file, move contents ...
14017 * s/irix6-5.h: ... here.
14018
22b4128e
PE
140192011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14020
14021 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
14022 * alloc.c (mark_buffer):
14023 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14024 (clone_per_buffer_values): Don't assume that
22b4128e
PE
14025 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14026 This isn't true in general, and it's particularly not true
14027 if Emacs is configured with --with-wide-int.
14028 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14029 New macros, used in the buffer.c change.
14030
869795d6
JD
140312011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14032
14033 * xsettings.c: Use both GConf and GSettings if both are available.
14034 (store_config_changed_event): Add comment.
14035 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14036 (store_tool_bar_style_changed): New functions.
5e617bc2 14037 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
14038 (struct xsettings): Move font inside HAVE_XFT.
14039 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 14040 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 14041 Move inside HAVE_XFT.
640c8776 14042 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
14043 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14044 also.
14045 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 14046 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 14047 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
14048 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14049 (parse_settings): Move check for font inside HAVE_XFT.
14050 (read_settings, apply_xft_settings): Add comment.
14051 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14052 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14053 call store_font_name_changed.
14054 (xft_settings_event): Add comment.
14055 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14056 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14057 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14058 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14059 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
14060 (xsettings_get_system_font, xsettings_get_system_normal_font):
14061 Add comment.
869795d6 14062
d8ed26bd
PE
140632011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14064
14065 Random fixes. E.g., (random) never returned negative values.
14066 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14067 subseconds part to the entropy, as that's a bit more random.
14068 Prefer signed to unsigned, since the signedness doesn't matter and
14069 in general we prefer signed. When given a limit, use a
14070 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14071 latter isn't right if USE_2_TAGS_FOR_INTS.
14072 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14073 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14074
cabf1cac
SM
140752011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14076
14077 * textprop.c (text_property_stickiness):
14078 Obey Vtext_property_default_nonsticky.
14079 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14080 * w32fns.c (syms_of_w32fns):
14081 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14082
6e9b2be9
PE
140832011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14084
14085 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14086 This is more efficient than Ffile_directory_p and avoids a minor race.
14087
90186c68
LMI
140882011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14089
7c301272
LMI
14090 * buffer.c (Foverlay_put): Say what the return value is
14091 (bug#7835).
14092
c4f2d8d4
LMI
14093 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14094 is a directory before asking whether to use the file name
14095 (bug#7564).
ad637907
LMI
14096 (barf_or_query_if_file_exists): Make the "File is a directory"
14097 error be more correct.
c4f2d8d4 14098
90186c68
LMI
14099 * fns.c (Frequire): Remove the mention of the .gz files, since
14100 that's installation-specific, but keep the mention of
14101 `get-load-suffixes'.
14102
da64016e
PE
141032011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14104
14105 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14106 Report string overflow if the output is too long.
14107
7d47b580
JB
141082011-07-04 Juanma Barranquero <lekktu@gmail.com>
14109
a555cb87
JB
14110 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14111 (syms_of_gnutls): Remove duplicate DEFSYM for
14112 Qgnutls_bootprop_verify_hostname_error, an error for
14113 Qgnutls_bootprop_verify_error (which is no longer used).
14114
7d47b580
JB
14115 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14116 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14117 Also (re)move comments that are misplaced or no longer relevant.
14118
1e49bfab
LMI
141192011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14120
14121 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14122
1485f4c0
CY
141232011-07-03 Chong Yidong <cyd@stupidchicken.com>
14124
14125 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14126 and background color parameters if they have been changed.
14127
a9ab721e
LMI
141282011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14129
14130 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14131
cf7cff57
PE
141322011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14133
2e13213d
PE
14134 * xsettings.c (SYSTEM_FONT): Define only when used.
14135 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14136
cf7cff57
PE
14137 * keymap.c (access_keymap_1): Now static.
14138
7a8e04f7
CY
141392011-07-02 Chong Yidong <cyd@stupidchicken.com>
14140
14141 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14142 leave any prefix arg for the up event (Bug#1586).
14143
61352f62
LMI
141442011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14145
69bb1ef7
LMI
14146 * lread.c (syms_of_lread): Mention single symbols defined by
14147 `defvar' or `defconst' (bug#7154).
14148
61352f62 14149 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 14150 (Frequire): Mention get-load-suffixes.
61352f62 14151
28545e04
MR
141522011-07-02 Martin Rudalics <rudalics@gmx.at>
14153
14154 * window.h (window): Remove clone_number slot.
14155 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14156 Remove.
14157 (make_parent_window, make_window, saved_window)
14158 (Fset_window_configuration, save_window_save): Don't deal with
14159 clone numbers.
14160 * buffer.c (Qclone_number): Remove declaration.
14161 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14162
3349e122
SM
141632011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14164
14165 Add multiple inheritance to keymaps.
14166 * keymap.c (Fmake_composed_keymap): New function.
14167 (Fset_keymap_parent): Simplify.
14168 (fix_submap_inheritance): Remove.
14169 (access_keymap_1): New function extracted from access_keymap to handle
14170 embedded parents and handle lists of maps.
14171 (access_keymap): Use it.
14172 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14173 (Fcopy_keymap): Handle embedded parents.
14174 (Fcommand_remapping, define_as_prefix): Simplify.
14175 (Fkey_binding): Simplify.
14176 (syms_of_keymap): Move minibuffer-local-completion-map,
14177 minibuffer-local-filename-completion-map,
14178 minibuffer-local-must-match-map, and
14179 minibuffer-local-filename-must-match-map to Elisp.
14180 (syms_of_keymap): Defsubr make-composed-keymap.
14181 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14182 (parse_menu_item): Trivial simplification.
14183
3279eb87
GM
141842011-07-01 Glenn Morris <rgm@gnu.org>
14185
14186 * Makefile.in (SETTINGS_LIBS): Fix typo.
14187
39cb9e56 141882011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
14189
14190 * coding.c (Fencode_coding_string): Record the last coding system
14191 used, as the function doc string says (bug#8738).
14192
0949d2b6
JD
141932011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14194
14195 * xsettings.c (store_monospaced_changed): Take new font as arg and
14196 check for change against current_mono_font.
14197 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14198 (emacs_settings_constructor, emacs_settings_get_property)
14199 (emacs_settings_set_property, emacs_settings_class_init)
14200 (emacs_settings_init, gsettings_obj): Remove.
14201 (something_changedCB): New function for HAVE_GSETTINGS.
14202 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14203 with value as argument.
14204 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14205 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 14206 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
14207 "changed".
14208
14209 * xgselect.c: Add defined (HAVE_GSETTINGS).
14210 (xgselect_initialize): Ditto.
14211
14212 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14213 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14214 xg_select.
14215
bbc6b304
PE
142162011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14217
14218 * eval.c (struct backtrace): Simplify and port the data structure.
14219 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14220 signed bit field, as this assumption is not portable and it makes
14221 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14222 "char debug_on_exit : 1" as this is not portable either; instead,
14223 use the portable "unsigned int debug_on_exit : 1". Remove unused
14224 member evalargs. Remove obsolete comments about cc bombing out.
14225
9851bfc5
JD
142262011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14227
51bb811f 14228 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
14229 Let HAVE_GSETTINGS override HAVE_GCONF.
14230 (store_monospaced_changed): New function.
14231 (EMACS_SETTINGS): A new type derived from GObject to handle
14232 GSettings notifications.
14233 (emacs_settings_constructor, emacs_settings_get_property)
14234 (emacs_settings_set_property, emacs_settings_class_init):
14235 New functions.
14236 (gsettings_client, gsettings_obj): New variables.
14237 (GSETTINGS_SCHEMA): New define.
14238 (something_changedCB): Call store_monospaced_changed.
14239 (init_gsettings): New function.
14240 (xsettings_initialize): Call init_gsettings.
14241 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14242 to NULL.
14243
640c8776 14244 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
14245 GCONF_CFLAGS/LIBS.
14246
5386012d
MR
142472011-06-29 Martin Rudalics <rudalics@gmx.at>
14248
14249 * window.c (resize_root_window, grow_mini_window)
14250 (shrink_mini_window): Rename Qresize_root_window to
14251 Qwindow_resize_root_window and Qresize_root_window_vertically to
14252 Qwindow_resize_root_window_vertically.
14253
f13e0b08
PE
142542011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14255
14256 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14257
94515237
JB
142582011-06-27 Juanma Barranquero <lekktu@gmail.com>
14259
14260 * makefile.w32-in: Redesign dependencies so they reflect more
14261 clearly which files are directly included by each source file,
14262 and not through other includes.
14263
e43b6e43
MR
142642011-06-27 Martin Rudalics <rudalics@gmx.at>
14265
14266 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14267 (sort_overlays, overlay_strings): When an overlay's clone number
14268 matches the window's clone number process the overlay even if
14269 the overlay's window property doesn't match the current window.
14270
d68443dc
MR
14271 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14272 (Fwindow_hchild): Rename to Fwindow_left_child.
14273 (Fwindow_next): Rename to Fwindow_next_sibling.
14274 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
14275 (resize_window_check): Rename to window_resize_check.
14276 (resize_window_apply): Rename to window_resize_apply.
14277 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14278 (Fdelete_other_windows_internal, resize_frame_windows)
14279 (Fsplit_window_internal, Fdelete_window_internal)
14280 (grow_mini_window, shrink_mini_window)
14281 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 14282
c7e73be5
JD
142832011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14284
14285 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14286 (emacs_fixed_set_min_size): Remove.
14287 (emacs_fixed_new): Take frame as argument.
14288
14289 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14290 (_EmacsFixedPrivate): Remove minwidth/height.
14291 Add struct frame *f.
14292 (emacs_fixed_init): Initialize priv->f.
14293 (get_parent_class, emacs_fixed_set_min_size): Remove.
14294 (emacs_fixed_new): Set priv->f to argument.
14295 (emacs_fixed_get_preferred_width)
14296 (emacs_fixed_get_preferred_height): Use min_width/height from
14297 frames size_hint to set minimum and natural (Bug#8919).
14298 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14299 and use min_width/height from frames size_hint to set
14300 min_width/height (Bug#8919).
14301
14302 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
14303 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14304 Fix indentation.
c7e73be5 14305
cf99dcf8
EZ
143062011-06-26 Eli Zaretskii <eliz@gnu.org>
14307
14308 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14309 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14310 called at ZV.
14311
029529ac
CY
143122011-06-26 Chong Yidong <cyd@stupidchicken.com>
14313
14314 * process.c (wait_reading_process_output): Bypass select if
14315 waiting for a cell while ignoring keyboard input, and input is
14316 pending. Suggested by Jan Djärv (Bug#8869).
14317
7a7ef429
PE
143182011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14319
14320 Use gnulib's dup2 module instead of rolling our own.
14321 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14322
11fdef7d 143232011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
14324
14325 * dispnew.c (scrolling_window): Before scrolling, turn off a
14326 mouse-highlight in the window being scrolled.
14327
cd3520a4
JB
143282011-06-24 Juanma Barranquero <lekktu@gmail.com>
14329
14330 Move DEFSYM to lisp.h and use everywhere.
14331
14332 * character.h (DEFSYM): Move declaration...
14333 * lisp.h (DEFSYM): ...here.
14334
14335 * gnutls.c:
14336 * minibuf.c:
14337 * w32menu.c:
14338 * w32proc.c:
14339 * w32select.c: Don't include character.h.
14340
14341 * alloc.c (syms_of_alloc):
14342 * buffer.c (syms_of_buffer):
14343 * bytecode.c (syms_of_bytecode):
14344 * callint.c (syms_of_callint):
14345 * casefiddle.c (syms_of_casefiddle):
14346 * casetab.c (init_casetab_once):
14347 * category.c (init_category_once, syms_of_category):
14348 * ccl.c (syms_of_ccl):
14349 * cmds.c (syms_of_cmds):
14350 * composite.c (syms_of_composite):
14351 * dbusbind.c (syms_of_dbusbind):
14352 * dired.c (syms_of_dired):
14353 * dispnew.c (syms_of_display):
14354 * doc.c (syms_of_doc):
14355 * editfns.c (syms_of_editfns):
14356 * emacs.c (syms_of_emacs):
14357 * eval.c (syms_of_eval):
14358 * fileio.c (syms_of_fileio):
14359 * fns.c (syms_of_fns):
14360 * frame.c (syms_of_frame):
14361 * fringe.c (syms_of_fringe):
14362 * insdel.c (syms_of_insdel):
14363 * keymap.c (syms_of_keymap):
14364 * lread.c (init_obarray, syms_of_lread):
14365 * macros.c (syms_of_macros):
14366 * msdos.c (syms_of_msdos):
14367 * print.c (syms_of_print):
14368 * process.c (syms_of_process):
14369 * search.c (syms_of_search):
14370 * sound.c (syms_of_sound):
14371 * syntax.c (init_syntax_once, syms_of_syntax):
14372 * terminal.c (syms_of_terminal):
14373 * textprop.c (syms_of_textprop):
14374 * undo.c (syms_of_undo):
14375 * w32.c (globals_of_w32):
14376 * window.c (syms_of_window):
14377 * xdisp.c (syms_of_xdisp):
14378 * xfaces.c (syms_of_xfaces):
14379 * xfns.c (syms_of_xfns):
14380 * xmenu.c (syms_of_xmenu):
14381 * xsettings.c (syms_of_xsettings):
14382 * xterm.c (syms_of_xterm): Use DEFSYM.
14383
4228cf16
TZ
143842011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14385
cd3520a4 14386 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 14387
7fcccf1e
PE
143882011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14389
7efb4e0e
PE
14390 Integer and buffer overflow fixes (Bug#8873).
14391
ff5844ad
PE
14392 * print.c (printchar, strout): Check for string overflow.
14393 (PRINTPREPARE, printchar, strout):
14394 Don't set size unless allocation succeeds.
14395
90532f02
PE
14396 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14397 for sizes. Check for string overflow more accurately.
14398 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14399
6d84508d
PE
14400 * macros.c: Integer and buffer overflow fixes.
14401 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14402 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14403 Use ptrdiff_t, not int, for sizes.
14404 Don't increment bufsize until after realloc succeeds.
14405 Check for size-calculation overflow.
14406 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14407
437b2cb4
PE
14408 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14409
8b9ac8b4
PE
14410 * lread.c: Integer overflow fixes.
14411 (read_integer): Radix is now EMACS_INT, not int,
14412 to improve quality of diagnostics for out-of-range radices.
14413 Calculate buffer size correctly for out-of-range radices.
14414 (read1): Check for integer overflow in radices, and in
14415 read-circle numbers.
82cb60d3
PE
14416 (read_escape): Avoid int overflow.
14417 (Fload, openp, read_buffer_size, read1)
14418 (substitute_object_recurse, read_vector, read_list, map_obarray):
14419 Use ptrdiff_t, not int, for sizes.
14420 (read1): Use EMACS_INT, not int, for sizes.
20270765 14421 Check for size overflow.
8b9ac8b4 14422
7fcccf1e
PE
14423 * image.c (cache_image): Check for size arithmetic overflow.
14424
bfbbd7e7
PE
14425 * lread.c: Integer overflow issues.
14426 (saved_doc_string_size, saved_doc_string_length)
14427 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14428 Now ptrdiff_t, not int.
14429 (read1): Don't assume doc string length fits in int. Check for
14430 out-of-range doc string lengths.
14431 (read_list): Don't assume file position fits in int.
39019e54 14432 (read_escape): Check for hex character overflow.
bfbbd7e7 14433
4e323265
LL
144342011-06-22 Leo Liu <sdl.web@gmail.com>
14435
14436 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14437 Move to minibuffer.el.
14438
85fece3e
PE
144392011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14440
20b84ce9 14441 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
14442 The following patches are for when GLYPH_DEBUG && !XASSERT.
14443 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14444 * dispnew.c (flush_stdout):
14445 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14446 Mark as externally visible.
14447 * dispnew.c (check_window_matrix_pointers): Now static.
14448 * dispnew.c (window_to_frame_vpos):
14449 * xfns.c (unwind_create_frame):
14450 * xterm.c (x_check_font): Remove unused local.
14451 * scroll.c (CHECK_BOUNDS):
14452 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14453 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14454 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14455 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14456 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14457 Now static.
14458 (debug_method_add): Use va_list and vsprintf rather than relying
14459 on undefined behavior with wrong number of arguments.
14460 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14461 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14462 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14463 since we're not interested in debugging glyphs with old libraries.
14464 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14465 GCC 4.6.0's static checking.
14466
0766b489
PE
144672011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14468
31fd4b32
PE
14469 Integer overflow and signedness fixes (Bug#8873).
14470 A few related buffer overrun fixes, too.
14471
b79e8648
PE
14472 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14473
0766b489
PE
14474 * dispextern.h (struct face.stipple):
14475 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14476 (x_bitmap_mask, x_allocate_bitmap_record)
14477 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14478 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14479 (x_create_bitmap_from_xpm_data):
14480 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14481 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14482 (.bitmaps_last):
14483 * xfaces.c (load_pixmap):
14484 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14485 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14486 (.bitmaps_last, struct x_output.icon_bitmap):
14487 Use ptrdiff_t, not int, for bitmap indexes.
14488 (x_allocate_bitmap_record): Check for size overflow.
14489 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14490
b081724f
PE
14491 Use ptrdiff_t, not int, for overlay counts.
14492 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14493 * editfns.c (overlays_around, get_pos_property):
14494 * textprop.c (get_char_property_and_overlay):
14495 * xdisp.c (next_overlay_change, note_mouse_highlight):
14496 * xfaces.c (face_at_buffer_position):
21514da7
PE
14497 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14498 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14499 (Fnext_overlay_change, Fprevious_overlay_change)
14500 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 14501 Use ptrdiff_t, not int, for sizes.
21514da7 14502 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 14503
3de73e5e
PE
14504 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14505
2606c57b
PE
14506 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14507 (x_session_initialize): Do not assume string length fits in int.
14508
aaafe47a
PE
14509 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14510 This is unlikely, but can occur if DPI is outlandish.
14511
2674ddc8 14512 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
14513 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14514
28154962
PE
14515 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14516 * xrdb.c (magic_file_p, search_magic_path):
14517 Omit last arg SUFFIX; it was always 0. All callers changed.
14518 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14519
7de51af5
PE
14520 * xfont.c (xfont_match): Avoid need for strlen.
14521
25ed6cc3
PE
14522 * xfns.c: Don't assume strlen fits in int.
14523 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14524
4eab31dd
PE
14525 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14526 not unsigned long, as we prefer signed integers. All callers changed.
14527 Detect integer overflow in repeat count.
14528 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14529 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14530
171e2a58
PE
14531 * termcap.c: Don't assume sizes fit in int and never overflow.
14532 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14533 (gobble_line): Check for size-calculation overflow.
14534
ad39faca 14535 * minibuf.c (Fread_buffer):
6e5bb2dc 14536 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14537 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14538 Don't assume string length fits in int.
14539
52c61c22 14540 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14541 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14542
b5b8c9e5
PE
14543 * font.c: Don't assume string length fits in int.
14544 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14545 Use ptrdiff_t, not int.
ccd6111c
PE
14546 (font_intern_prop): Don't assume string length fits in int.
14547 Don't assume integer property fits in fixnum.
14548 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14549
882f0d81 14550 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14551 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14552 Reformulate so as not to need the command string.
14553 Invoke gzip -cd rather than gunzip, as it's more portable.
14554 (lock_info_type, lock_file_1, lock_file):
14555 Don't assume pid_t and time_t fit in unsigned long.
14556 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14557 (current_lock_owner): Prefer signed type for sizes.
14558 Use memcpy, not strncpy, where memcpy is what is really wanted.
14559 Don't assume (via atoi) that time_t and pid_t fit in int.
14560 Check for time_t and/or pid_t out of range, e.g., via a network share.
14561 Don't alloca where an auto var works fine.
14562
93f4cf88
PE
14563 * fileio.c: Fix some integer overflow issues.
14564 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14565 Don't assume string length fits in int.
14566 (directory_file_name): Don't assume string length fits in long.
14567 (make_temp_name): Don't assume pid fits in int, or that its print
14568 length is less than 20.
14569
f3e92b69
PE
14570 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14571
1bfdaf10
PE
14572 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14573
35016e9a
PE
14574 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14575
3d1e65a1
PE
14576 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14577 We prefer signed integers, even for size calculations.
14578
0b963a93
PE
14579 * emacs.c: Don't assume string length fits in 'int'.
14580 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14581 (main): Don't invoke strlen when not needed.
14582
573f4b54
PE
14583 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14584 (XD_DEBUG_MESSAGE): Don't waste a byte.
14585
989f33ba
PE
14586 * callproc.c (getenv_internal_1, getenv_internal)
14587 (Fgetenv_internal):
965d34eb
PE
14588 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14589
e4d29b33
PE
14590 * lread.c (invalid_syntax): Omit length argument.
14591 All uses changed. This doesn't fix a bug, but it simplifies the
14592 code away from its former Hollerith-constant appearance, and it's
14593 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14594 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14595
eb49b136
PE
14596 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14597 This didn't break anything, but it didn't help either.
14598 It's confusing to put a bogus integer in a place where the actual
14599 value does not matter.
9f62aeb1 14600 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14601 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14602
15375a22
PE
14603 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14604 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14605 implementation.
b61cc01c
PE
14606 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14607 We prefer signed types, and the value cannot exceed the EMACS_INT
14608 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14609 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14610 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14611 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14612
53b2623d
PE
14613 * indent.c (sane_tab_width): New function.
14614 (current_column, scan_for_column, Findent_to, position_indentation)
14615 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 14616 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 14617
51cab52b 14618 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 14619
f2ed8a70
PE
14620 * lisp.h (lint_assume): New macro.
14621 * composite.c (composition_gstring_put_cache):
14622 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14623
abe80cc6
PE
14624 * editfns.c, insdel.c:
14625 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 14626
b02c740e
PE
14627 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14628
ebc96716
PE
14629 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14630
b4e50fa0 14631 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 14632 Use much-faster test for byte-length change.
311d5d7c 14633 Don't assume string byte-length fits in 'int'.
a4cf38e4 14634 Check that character arg fits in 'int'.
85461888 14635 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 14636
c0c1ee9f
PE
14637 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14638
a498d7f4
PE
14639 * fns.c (concat): Catch string overflow earlier.
14640 Do not rely on integer wraparound.
14641
51cab52b
PE
14642 * dispextern.h (struct it.overlay_strings_charpos)
14643 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
14644 * xdisp.c (forward_to_next_line_start)
14645 (back_to_previous_visible_line_start)
14646 (reseat_at_next_visible_line_start, next_element_from_buffer):
14647 Don't arbitrarily truncate the value of 'selective' to int.
14648
76031fad
PE
14649 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14650
5eb55db9
PE
14651 * composite.c: Don't truncate sizes to 'int'.
14652 (composition_gstring_p, composition_reseat_it)
14653 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
14654 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14655 not EMACS_UINT, for indexes.
5eb55db9 14656
0703a717
PE
14657 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14658
d6202519
PE
14659 * buffer.c: Include <verify.h>.
14660 (struct sortvec.priority, struct sortstr.priority):
8961a454 14661 Now EMACS_INT, not int.
c20998a7 14662 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
14663 (struct sortstr.size, record_overlay_string)
14664 (struct sortstrlist.size, struct sortlist.used):
14665 Don't truncate size to int.
14666 (record_overlay_string): Check for size-calculation overflow.
d6202519 14667 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 14668
d5a19415
JM
146692011-06-22 Jim Meyering <meyering@redhat.com>
14670
029529ac 14671 Don't leak an XBM-image-sized buffer
d5a19415
JM
14672 * image.c (xbm_load): Free the image buffer after using it.
14673
a9041e6c
PE
146742011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14675
14676 Port to Sun C.
14677 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14678 that Sun C diagnosed.
14679 * fns.c (secure_hash): Fix pointer signedness issue.
14680 * intervals.c (static_offset_intervals): New function.
14681 (offset_intervals): Use it.
14682
7f3f739f
LL
146832011-06-21 Leo Liu <sdl.web@gmail.com>
14684
14685 * deps.mk (fns.o):
14686 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14687 sha512.h.
14688
14689 * fns.c (secure_hash): Rename from crypto_hash_function and change
14690 the first arg to accept symbols.
5b66d427 14691 (Fsecure_hash): New primitive.
7f3f739f
LL
14692 (syms_of_fns): New symbols.
14693
76147d94
DD
146942011-06-20 Deniz Dogan <deniz@dogan.se>
14695
14696 * process.c (Fset_process_buffer): Clarify return value in
14697 docstring.
14698
7d7d0045
CY
146992011-06-18 Chong Yidong <cyd@stupidchicken.com>
14700
14701 * dispnew.c (add_window_display_history): Use BVAR.
14702
14703 * xdisp.c (debug_method_add): Use BVAR.
14704 (check_window_end, dump_glyph_matrix, dump_glyph)
14705 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14706
14707 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14708 Likewise.
14709
14710 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14711 check till after the cache is created in init_frame_faces.
14712
ff2bc410
SM
147132011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14714
14715 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14716
28177add
PE
147172011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14718
dd3482fe
PE
14719 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14720 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14721 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14722
393d71f3 14723 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
14724 * fileio.c (Finsert_file_contents):
14725 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14726 Remove the old (too-loose) buffer overflow checks.
14727 They weren't needed, since make_gap checks for buffer overflow.
14728 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14729 The old code merely checked for Emacs fixnum overflow, and relied
14730 on undefined (wraparound) behavior. The new code avoids undefined
14731 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14732
2e6813b0 14733 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
14734 Tune. Don't use wider integers than needed. Don't use alloca.
14735 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 14736
599a9e4f
PE
14737 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14738
99561444
PE
14739 * insdel.c, lisp.h (buffer_overflow): New function.
14740 (insert_from_buffer_1, replace_range, replace_range_2):
14741 * insdel.c (make_gap_larger):
14742 * editfns.c (Finsert_char):
14743 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14744
28177add
PE
14745 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14746
e69dafad
PE
147472011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14748
4baa020d 14749 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 14750
b1c46f02
PE
14751 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14752 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14753
e69dafad
PE
14754 * fileio.c: Don't assume EMACS_INT fits in off_t.
14755 (emacs_lseek): New static function.
14756 (Finsert_file_contents, Fwrite_region): Use it.
14757 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14758
566684ea
PE
14759 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14760
e6966cd6
PE
14761 * fns.c: Don't overflow int when computing a list length.
14762 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14763 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14764 truncation on 64-bit hosts. Check for QUIT every
14765 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14766 faster and is responsive enough.
14767 (Flength): Report an error instead of overflowing an integer.
14768 (Fsafe_length): Return a float if the value is not representable
14769 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 14770 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 14771 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 14772
dd0b0efb
PE
14773 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14774 (header_size, word_size): New constants.
14775 (allocate_vectorlike): Don't check size overflow here.
14776 (allocate_vector): Check it here instead, since this is the only
14777 caller of allocate_vectorlike that could cause overflow.
14778 Check that the new vector's length is representable as a fixnum.
14779
86fe5cfe
PE
14780 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14781 The previous code was bogus. For example, next_almost_prime (32)
14782 returned 39, which is undesirable as it is a multiple of 3; and
14783 next_almost_prime (24) returned 25, which is a multiple of 5 so
14784 why was the code bothering to check for multiples of 7?
14785
80e88859
PE
14786 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14787
4a2f0ad6
PE
14788 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14789
f66c7cf8
PE
14790 Variadic C functions now count arguments with ptrdiff_t.
14791 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14792 Back then I didn't know that the Emacs coding style prefers signed int.
14793 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
14794 were being counted with int, which may truncate counts on 64-bit
14795 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
14796 * lisp.h (struct Lisp_Subr.function.aMANY)
14797 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14798 Arg counts are now ptrdiff_t, not size_t.
14799 All variadic functions and their callers changed accordingly.
14800 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14801 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14802 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14803 * callint.c (Fcall_interactively): Check arg count for overflow,
14804 to avoid potential buffer overrun. Use signed char, not 'int',
14805 for 'varies' array, so that we needn't bother to check its size
14806 calculation for overflow.
14807 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14808 * eval.c (apply_lambda):
14809 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14810 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14811 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14812
a1759b76
PE
14813 * callint.c (Fcall_interactively): Don't use index var as event count.
14814
d96be9fc
PE
14815 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14816 * mem-limits.h (SIZE): Remove; no longer used.
14817
a690a978 14818 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 14819
578c21e6
PE
14820 Remove unnecessary casts.
14821 * xterm.c (x_term_init):
14822 * xfns.c (x_set_border_pixel):
14823 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14824 These aren't needed now that we assume ANSI C.
14825
96f53c6c
PE
14826 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14827 It's more likely to cause problems (due to unsigned overflow)
14828 than to cure them.
14829
83c77d31
PE
14830 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14831
ee2079f1
PE
14832 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14833
6da65536
PE
14834 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14835
7147c4a4
PE
14836 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14837
193e32d9
PE
14838 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14839
e5533da6
PE
14840 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14841
9910e595
PE
14842 GLYPH_CODE_FACE returns EMACS_INT, not int.
14843 * dispextern.h (merge_faces):
14844 * xfaces.c (merge_faces):
01103c44
PE
14845 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14846 Don't assume EMACS_INT fits in int.
9910e595 14847
2638320e
PE
14848 * character.h (CHAR_VALID_P): Remove unused parameter.
14849 * fontset.c, lisp.h, xdisp.c: All uses changed.
14850
045eb8d9
PE
14851 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14852
c1f134b5
PE
14853 * fns.c (concat): Minor tuning based on overflow analysis.
14854 This doesn't fix any bugs. Use int to hold character, instead
14855 of constantly refetching from Emacs object. Use XFASTINT, not
14856 XINT, for value known to be a character. Don't bother comparing
14857 a single byte to 0400, as it's always less.
14858
395fcb93 14859 * floatfns.c (Fexpt):
327eeec8
PE
14860 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14861
abbd3d23
PE
14862 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14863 for characters.
14864
684a03ef
PE
14865 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14866
0fed43f3
PE
14867 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14868 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14869 incorrectly succeed when S was a string, because 4294967386 was
14870 truncated before it was used.
14871
8fd02eb7
PE
14872 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14873 Otherwise, an out-of-range integer could cause undefined behavior
14874 on a 64-bit host.
14875
f8c86b69
PE
14876 * composite.c: Use int, not EMACS_INT, for characters.
14877 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14878 EMACS_INT, for values that are known to be in character range.
14879 This doesn't fix any bugs but is the usual style inside Emacs and
14880 may generate better code on 32-bit machines.
14881
34206dd2
PE
14882 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14883 This is for reasons similar to the recent CHAR_STRING fix.
14884 * charset.c (Fencode_char): Check that character arg is actually
14885 a character. Pass an int to ENCODE_CHAR.
14886 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14887 wider than 'int', as a compile-time check to prevent future regressions
14888 in this area.
14889
c5958d4c 14890 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
14891
14892 Make sure a 64-bit char is never passed to CHAR_STRING.
14893 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14894 by silently ignoring the top 32 bits, allowing some values
14895 that were far too large to be valid characters.
14896 * character.h: Include <verify.h>.
14897 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14898 arguments are no wider than unsigned, as a compile-time check
14899 to prevent future regressions in this area.
14900 * data.c (Faset):
01103c44 14901 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
14902 (Fsubst_char_in_region):
14903 * fns.c (concat):
14904 * xdisp.c (decode_mode_spec_coding):
14905 Adjust to CHAR_STRING's new requirement.
14906 * editfns.c (Finsert_char, Fsubst_char_in_region):
14907 * fns.c (concat): Check that character args are actually
14908 characters. Without this test, these functions did the wrong
14909 thing with wildly out-of-range values on 64-bit hosts.
14910
d37ca623
PE
14911 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14912 These casts should not be needed on 32-bit hosts, either.
14913 * keyboard.c (read_char):
14914 * lread.c (Fload): Remove casts to unsigned.
14915
ea204efb
PE
14916 * lisp.h (UNSIGNED_CMP): New macro.
14917 This fixes comparison bugs on 64-bit hosts.
14918 (ASCII_CHAR_P): Use it.
14919 * casefiddle.c (casify_object):
01103c44 14920 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
14921 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14922 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14923 * dispextern.h (FACE_FROM_ID):
14924 * keyboard.c (read_char): Use UNSIGNED_CMP.
14925
41cb286c
PE
14926 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14927 not to EMACS_INT, to avoid GCC warning.
14928
4a1b9832
PE
14929 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14930
55daad71
PE
14931 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14932 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14933 isn't needed on 32-bit machines.
8f95c75c 14934
01103c44
PE
14935 * buffer.c (Fgenerate_new_buffer_name):
14936 Use EMACS_INT for count, not int.
0ceccced 14937 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
14938
14939 * data.c (Qcompiled_function): Now static.
14940
c6f072e7
PE
14941 * window.c (window_body_lines): Now static.
14942
20ce5912
PE
14943 * image.c (gif_load): Rename local to avoid shadowing.
14944
9c4c5f81
PE
14945 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14946 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14947 * alloc.c (make_save_value): Integer argument is now of type
14948 ptrdiff_t, not int.
14949 (mark_object): Use ptrdiff_t, not int.
14950 * lisp.h (pD): New macro.
14951 * print.c (print_object): Use it.
14952
c0c5c8ae
PE
14953 * alloc.c: Use EMACS_INT, not int, to count objects.
14954 (total_conses, total_markers, total_symbols, total_vector_size)
14955 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
14956 (total_free_floats, total_floats, total_free_intervals)
14957 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
14958 Now EMACS_INT, not int. All uses changed.
14959 (Fgarbage_collect): Compute overall total using a double, so that
14960 integer overflow is less likely to be a problem. Check for overflow
14961 when converting back to an integer.
5a25e253
PE
14962 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14963 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14964 These were 'int' variables that could overflow on 64-bit hosts;
14965 they were never used, so remove them instead of repairing them.
211a0b2a 14966 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
14967 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14968 Previously, this ceilinged at INT_MAX, but that doesn't work on
14969 64-bit machines.
e46bb31a 14970 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 14971
c78baabf 14972 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 14973 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
14974 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14975 when a (possibly-narrower) signed value would do just as well.
14976 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 14977
c9d624c6
PE
14978 * alloc.c: Catch some string size overflows that we were missing.
14979 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14980 for convenience in STRING_BYTES_MAX.
14981 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14982 The definition here is exact; the one in lisp.h was approximate.
14983 (allocate_string_data): Check for string overflow. This catches
14984 some instances we weren't catching before. Also, it catches
14985 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14986 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14987 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 14988
c9d624c6
PE
14989 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14990 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 14991 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 14992
353032ce
PE
14993 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14994
2bccce07
PE
14995 * alloc.c (Fmake_string): Check for out-of-range init.
14996
0ac30604
SM
149972011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14998
14999 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15000
c195f2de
JD
150012011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15002
15003 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15004 xg_get_default_scrollbar_width.
15005
15006 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15007 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15008 (style_changed_cb): Call update_theme_scrollbar_width and call
15009 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15010 all frames (Bug#8505).
15011 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15012 Call gtk_window_set_resizable if HAVE_GTK3.
15013 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15014 and height if HAVE_GTK3 (Bug#8505).
15015 (scroll_bar_width_for_theme): New variable.
15016 (update_theme_scrollbar_width): New function.
15017 (xg_get_default_scrollbar_width): Move code to
15018 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15019 (xg_initialize): Call update_theme_scrollbar_width.
15020
15021 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15022
15023 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15024
e10ac9f1
MR
150252011-06-12 Martin Rudalics <rudalics@gmx.at>
15026
15027 * frame.c (make_frame): Call other_buffer_safely instead of
15028 other_buffer.
15029
15030 * window.c (temp_output_buffer_show): Call display_buffer with
15031 second argument Vtemp_buffer_show_specifiers and reset latter
15032 immediately after the call.
15033 (Vtemp_buffer_show_specifiers): New variable.
15034 (auto_window_vscroll_p, next_screen_context_lines)
15035 (Vscroll_preserve_screen_position): Remove leading asterisks from
15036 doc-strings.
15037
2d3c217e 150382011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 15039
7b7f97e8 15040 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
15041 * buffer.c (Qclone_number): Remove for now, as it's unused.
15042 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15043 (record_buffer): Remove unused local.
15044 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15045 (set_frame_buffer_list): Remove; unused.
15046 * frame.h (other_visible_frames): Remove decl.
15047 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15048 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15049 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15050 if HAVE_GPM.
15051 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15052 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15053 Define only if HAVE_GPM.
15054 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15055 (update_hints_inhibit): Remove; never set. All uses removed.
15056 * widgetprv.h (emacsFrameClassRec): Remove decl.
15057 * window.c (delete_deletable_window): Now returns void, since it
15058 wasn't returning anything.
15059 (compare_window_configurations): Remove unused locals.
15060 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15061 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
15062 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15063 the same widths as pointers. This follows up on the 2011-05-06 patch.
15064 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15065 * xterm.h: Likewise.
15066 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15067
1384b89e
JB
150682011-06-12 Juanma Barranquero <lekktu@gmail.com>
15069
15070 * makefile.w32-in: Update dependencies.
15071 (LISP_H): Add lib/intprops.h.
15072
1100a63c
CY
150732011-06-11 Chong Yidong <cyd@stupidchicken.com>
15074
15075 * image.c (gif_load): Add animation frame delay to the metadata.
15076 (syms_of_image): Use DEFSYM. New symbol `delay'.
15077
6198ccd0
MR
150782011-06-11 Martin Rudalics <rudalics@gmx.at>
15079
15080 * window.c (delete_deletable_window): Re-add.
15081 (Fset_window_configuration): Rewrite to handle dead buffers and
15082 consequently deletable windows.
15083 (window_tree, Fwindow_tree): Remove. Supply functionality in
15084 window.el.
15085 (compare_window_configurations): Simplify code.
15086
b6e3633c
AS
150872011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15088
1ab0dee5
AS
15089 * image.c (imagemagick_load_image): Fix type mismatch.
15090 (Fimagemagick_types): Likewise.
15091
b6e3633c
AS
15092 * window.h (replace_buffer_in_windows): Declare.
15093
9397e56f
MR
150942011-06-11 Martin Rudalics <rudalics@gmx.at>
15095
15096 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15097 Qclone_number. Remove external declaration of Qdelete_window.
15098 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15099 code.
640c8776
SM
15100 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15101 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
15102 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15103 buffer list implementation.
15104 (other_buffer_safely): New function.
15105 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15106 calls to replace_buffer_in_windows and
15107 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15108 if allowed.
15109 (record_buffer): Inhibit quitting and rewrite using quittable
15110 functions. Run Qbuffer_list_update_hook if allowed.
15111 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
15112 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15113 Move switch-to-buffer to window.el.
9397e56f
MR
15114 (bury-buffer): Move to window.el.
15115 (Vbuffer_list_update_hook): New variable.
15116
15117 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15118 section.
15119
15120 * window.h (resize_frame_windows): Move up in code.
15121 (Fwindow_frame): Remove EXFUN.
15122 (replace_buffer_in_all_windows): Remove prototype.
15123 (replace_buffer_in_windows_safely): Add prototype.
15124
15125 * window.c: Declare Qdelete_window static again. Move down
15126 declaration of select_count.
15127 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15128 (Fother_window): Move to window.el.
15129 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15130 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15131 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15132 window.el.
15133 (replace_buffer_in_windows): Implement by calling
15134 Qreplace_buffer_in_windows.
15135 (replace_buffer_in_all_windows): Remove with some functionality
15136 moved into replace_buffer_in_windows_safely.
15137 (replace_buffer_in_windows_safely): New function.
15138 (select_window_norecord, select_frame_norecord): Move in front
15139 of run_window_configuration_change_hook. Remove now obsolete
15140 declarations.
640c8776
SM
15141 (Fset_window_buffer): Rewrite doc-string.
15142 Call Qrecord_window_buffer.
9397e56f
MR
15143 (keys_of_window): Move binding for other-window to window.el.
15144
b50691aa
CY
151452011-06-11 Chong Yidong <cyd@stupidchicken.com>
15146
15147 * dispextern.h (struct image): Replace data member, whose int_val
15148 and ptr_val fields were not used by anything, with a single
15149 lisp_val object.
15150
15151 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15152 (gif_clear_image, gif_load, imagemagick_load_image)
15153 (gs_clear_image, gs_load): Callers changed.
15154
3f754b86
PE
151552011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15156
cca69397
PE
15157 * buffer.h: Include <time.h>, for time_t.
15158 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15159
109e28d0
PE
15160 Fix minor problems found by static checking.
15161
60737f02
PE
15162 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15163
4b66faf3
PE
15164 Make identifiers static if they are not used in other modules.
15165 * data.c (Qcompiled_function, Qframe, Qvector):
15166 * image.c (QimageMagick, Qsvg):
15167 * minibuf.c (Qmetadata):
15168 * window.c (resize_window_check, resize_root_window): Now static.
15169 * window.h (resize_window_check, resize_root_window): Remove decls.
15170
109e28d0
PE
15171 * window.c (window_deletion_count, delete_deletable_window):
15172 Remove; unused.
46a4ce9e
PE
15173 (window_body_lines): Now static.
15174 (Fdelete_other_windows_internal): Mark vars as initialized.
15175 Make sure 'resize_failed' is initialized.
15176 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15177 (resize_window_apply): Remove unused local.
15178 * window.h (delete_deletable_window): Remove decl.
15179
109e28d0 15180 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
15181 (imagemagick_load_image): Fix pointer signedness problem by changing
15182 last arg from unsigned char * to char *. All uses changed.
15183 Also, fix a local for similar reasons.
15184 Remove unused locals. Remove locals to avoid shadowing.
15185 (fn_rsvg_handle_free): Remove; unused.
15186 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 15187 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 15188
3f754b86
PE
15189 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15190
2547adb1
CY
151912011-06-10 Chong Yidong <cyd@stupidchicken.com>
15192
15193 * image.c (gif_load): Fix omitted cast error introduced by
15194 2011-06-06 change.
15195
2c8e37d4
MR
151962011-06-10 Martin Rudalics <rudalics@gmx.at>
15197
15198 * window.h (resize_proportionally, orig_total_lines)
15199 (orig_top_line): Remove from window structure.
15200 (set_window_height, set_window_width, change_window_heights)
15201 (Fdelete_window): Remove prototypes.
15202 (resize_frame_windows): Remove duplicate declaration.
15203
440a42e3
EZ
152042011-06-10 Eli Zaretskii <eliz@gnu.org>
15205
15206 * window.h (resize_frame_windows, resize_window_check)
15207 (delete_deletable_window, resize_root_window)
15208 (resize_frame_windows): Declare prototypes.
15209
15210 * window.c (resize_window_apply): Make definition be "static" to
15211 match the prototype.
15212
562dd5e9
MR
152132011-06-10 Martin Rudalics <rudalics@gmx.at>
15214
15215 * window.c: Remove declarations of Qwindow_size_fixed,
15216 window_min_size_1, window_min_size_2, window_min_size,
15217 size_window, window_fixed_size_p, enlarge_window, delete_window.
15218 Remove static from declaration of Qdelete_window, it's
15219 temporarily needed by Fbury_buffer.
15220 (replace_window): Don't assign orig_top_line and
15221 orig_total_lines.
15222 (Fdelete_window, delete_window): Remove. Window deletion is
15223 handled by window.el.
640c8776
SM
15224 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15225 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
15226 (Fdelete_other_windows): Remove. Deleting other windows is
15227 handled by window.el.
15228 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15229 handled in window.el.
15230 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15231 Window minimum sizes are handled in window.el.
15232 (shrink_windows, size_window, set_window_height)
15233 (set_window_width, change_window_heights, window_height)
15234 (window_width, CURBEG, CURSIZE, enlarge_window)
15235 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15236 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15237 handled in window.el.
15238 (make_dummy_parent): Rename to make_parent_window and give it a
15239 second argument horflag.
15240 (make_window): Don't set resize_proportionally any more.
15241 (Fsplit_window): Remove. Windows are split in window.el.
15242 (save_restore_action, save_restore_orig_size)
15243 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15244 Resize mini windows in window.el.
15245 (grow_mini_window, shrink_mini_window): Implement by calling
15246 Qresize_root_window_vertically, resize_window_check and
15247 resize_window_apply.
640c8776
SM
15248 (saved_window, Fset_window_configuration, save_window_save):
15249 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
15250 resize_proportionally.
15251 (window_min_height, window_min_width): Move to window.el.
15252 (keys_of_window): Move bindings for delete-other-windows,
15253 split-window, delete-window and enlarge-window to window.el.
15254
15255 * buffer.c: Temporarily extern Qdelete_window.
15256 (Fbury_buffer): Temporarily call Qdelete_window instead of
15257 Fdelete_window (Fbury_buffer will move to window.el soon).
15258
15259 * frame.c (set_menu_bar_lines_1): Remove code handling
15260 orig_top_line and orig_total_lines.
15261
15262 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15263 set_window_height but set heights directly.
15264 (change_frame_size_1): Use resize_frame_windows.
15265
15266 * xdisp.c (init_xdisp): Don't use set_window_height but set
15267 heights directly.
15268
640c8776
SM
15269 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15270 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
15271 run_window_configuration_change_hook.
15272
15273 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15274 instead of change_window_heights and run
15275 run_window_configuration_change_hook.
15276
1a13852e
MR
152772011-06-09 Martin Rudalics <rudalics@gmx.at>
15278
15279 * window.c (replace_window): Rename second argument REPLACEMENT to
15280 NEW. New third argument SETFLAG. Rewrite.
15281 (delete_window, make_dummy_parent): Call replace_window with
15282 third argument 1.
15283 (window_list_1): Move down in code.
15284 (run_window_configuration_change_hook): Move set_buffer part
15285 before select_frame_norecord part in order to unwind correctly.
15286 Rename count1 to count.
15287 (recombine_windows, delete_deletable_window, resize_root_window)
15288 (Fdelete_other_windows_internal)
15289 (Frun_window_configuration_change_hook, make_parent_window)
15290 (resize_window_check, resize_window_apply, Fresize_window_apply)
15291 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
15292 (Fdelete_window_internal, Fresize_mini_window_internal):
15293 New functions.
1a13852e
MR
15294 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15295
f3d1777e
MR
152962011-06-08 Martin Rudalics <rudalics@gmx.at>
15297
496e208e
MR
15298 * window.h (window): Add some new members to window structure -
15299 normal_lines, normal_cols, new_total, new_normal, clone_number,
15300 splits, nest, prev_buffers, next_buffers.
15301 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 15302 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 15303
f3d1777e
MR
15304 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15305 Remove.
496e208e
MR
15306 (make_dummy_parent): Set new members of windows structure.
15307 (make_window): Move down in code. Handle new members of window
15308 structure.
15309 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15310 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15311 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15312 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
15313 (Fset_window_next_buffers, Fset_window_clone_number):
15314 New functions.
496e208e
MR
15315 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15316 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15317 Doc-string fixes.
15318 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15319 Argument WINDOW can be now internal window too.
15320 (Fwindow_use_time): Move up in code.
15321 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15322 Rewrite doc-string.
15323 (Fset_window_configuration, saved_window)
15324 (Fcurrent_window_configuration, save_window_save): Handle new
15325 members of window structure.
b9e809c2
MR
15326 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15327 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15328 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15329 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15330 Qget_mru_window, Qresize_root_window,
15331 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15332 Qauto_buffer_name; staticpro them.
f3d1777e 15333
abde8f8c
MR
153342011-06-07 Martin Rudalics <rudalics@gmx.at>
15335
15336 * window.c (Fwindow_total_size, Fwindow_left_column)
15337 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15338 (Fwindow_list_1): New functions.
15339 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
15340 (Fwindow_width, Fscroll_left, Fscroll_right):
15341 Use window_body_cols instead of window_box_text_cols.
15342 (delete_window, Fset_window_configuration):
15343 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
15344 (delete_all_subwindows): Take a window as argument and not a
15345 structure. Rewrite.
190b47e6
MR
15346 (window_loop): Remove handling of GET_LRU_WINDOW and
15347 GET_LARGEST_WINDOW.
15348 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
15349
15350 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
15351 window_box_text_cols. delete_all_subwindows now takes a
15352 Lisp_Object as argument.
abde8f8c 15353
640c8776
SM
15354 * indent.c (compute_motion, Fcompute_motion):
15355 Use window_body_cols instead of window_box_text_cols.
abde8f8c 15356
fa8a67e6
MR
15357 * frame.c (delete_frame): Call delete_all_subwindows with root
15358 window as argument.
15359
a54e3482
DC
153602011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15361
15362 * fns.c (Fputhash): Document return value.
15363
60002bf5
CY
153642011-06-06 Chong Yidong <cyd@stupidchicken.com>
15365
15366 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15367
0c671da6 153682011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 15369
b862a52a 15370 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 15371
be44ca6c
PE
15372 Check for overflow when converting integer to cons and back.
15373 * charset.c (Fdefine_charset_internal, Fdecode_char):
15374 Use cons_to_unsigned to catch overflow.
15375 (Fencode_char): Use INTEGER_TO_CONS.
15376 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15377 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15378 * data.c (long_to_cons, cons_to_long): Remove.
15379 (cons_to_unsigned, cons_to_signed): New functions.
15380 These signal an error for invalid or out-of-range values.
15381 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15382 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15383 * font.c (Ffont_variation_glyphs):
15384 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15385 * lisp.h: Include <intprops.h>.
15386 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15387 (cons_to_signed, cons_to_unsigned): New decls.
15388 (long_to_cons, cons_to_long): Remove decls.
15389 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15390 (Fprimitive_undo): Use CONS_TO_INTEGER.
15391 * xfns.c (Fx_window_property): Likewise.
15392 * xselect.c: Include <limits.h>.
15393 (x_own_selection, selection_data_to_lisp_data):
15394 Use INTEGER_TO_CONS.
15395 (x_handle_selection_request, x_handle_selection_clear)
15396 (x_get_foreign_selection, Fx_disown_selection_internal)
15397 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15398 (lisp_data_to_selection_data): Use cons_to_unsigned.
15399 (x_fill_property_data): Use cons_to_signed.
15400 Report values out of range.
15401
d1f3d2af
PE
15402 Check for buffer and string overflow more precisely.
15403 * buffer.h (BUF_BYTES_MAX): New macro.
15404 * lisp.h (STRING_BYTES_MAX): New macro.
15405 * alloc.c (Fmake_string):
15406 * character.c (string_escape_byte8):
15407 * coding.c (coding_alloc_by_realloc):
15408 * doprnt.c (doprnt):
15409 * editfns.c (Fformat):
15410 * eval.c (verror):
15411 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15412 since they may not be the same number.
15413 * editfns.c (Finsert_char):
15414 * fileio.c (Finsert_file_contents):
15415 Likewise for BUF_BYTES_MAX.
15416
dd52fcea
PE
15417 * image.c: Use ptrdiff_t, not int, for sizes.
15418 (slurp_file): Switch from int to ptrdiff_t.
15419 All uses changed.
15420 (slurp_file): Check that file size fits in both size_t (for
15421 malloc) and ptrdiff_t (for sanity and safety).
15422
7f9bbdbb
PE
15423 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15424 if b->modtime has its maximal value.
15425
dfe18f82
PE
15426 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15427
84acfcf0
PE
15428 Don't assume time_t can fit into int.
15429 * buffer.h (struct buffer.modtime): Now time_t, not int.
15430 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15431 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15432
ccd9a01a
PE
15433 Minor fixes for signed vs unsigned integers.
15434 * character.h (MAYBE_UNIFY_CHAR):
15435 * charset.c (maybe_unify_char):
15436 * keyboard.c (read_char, reorder_modifiers):
15437 XINT -> XFASTINT, since the integer must be nonnegative.
15438 * ftfont.c (ftfont_spec_pattern):
15439 * keymap.c (access_keymap, silly_event_symbol_error):
15440 XUINT -> XFASTINT, since the integer must be nonnegative.
15441 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15442 since it makes no difference and we prefer signed.
15443 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15444 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15445 nonnegative.
15446
d6d100dd
SM
154472011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15448
15449 * window.h (Fwindow_frame): Declare.
15450
2b6148e4
PE
154512011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15452
15453 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15454 (SPARE_MEMORY): Always define.
15455 (LARGE_REQUEST): Remove.
15456 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15457
f230ecc9
MR
154582011-06-06 Martin Rudalics <rudalics@gmx.at>
15459
727e958e
MR
15460 * lisp.h: Move EXFUNS for Fframe_root_window,
15461 Fframe_first_window and Fset_frame_selected_window to window.h.
15462
15463 * window.h: Move EXFUNS for Fframe_root_window,
15464 Fframe_first_window and Fset_frame_selected_window here from
15465 lisp.h.
15466
15467 * frame.c (Fwindow_frame, Fframe_first_window)
15468 (Fframe_root_window, Fframe_selected_window)
15469 (Fset_frame_selected_window): Move to window.c.
15470 (Factive_minibuffer_window): Move to minibuf.c.
15471 (Fother_visible_frames_p): New function.
15472
15473 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15474
f230ecc9
MR
15475 * window.c (decode_window, decode_any_window): Move up in code.
15476 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15477 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
15478 (Fwindow_buffer): Move up and rewrite doc-string.
15479 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15480 (Fwindow_prev): New functions.
727e958e
MR
15481 (Fwindow_frame): Move here from frame.c. Accept any window as
15482 argument.
15483 (Fframe_root_window, Fframe_first_window)
15484 (Fframe_selected_window): Move here from frame.c. Accept frame
15485 or arbitrary window as argument. Update doc-strings.
15486 (Fminibuffer_window): Move up in code.
15487 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
15488 (Fset_frame_selected_window): Move here from frame.c.
15489 Marginal rewrite.
727e958e
MR
15490 (Fselected_window, select_window, Fselect_window): Move up in
15491 code. Minor doc-string fixes.
f230ecc9 15492
4d09bcf6
PE
154932011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15494
15495 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15496 Do not assume that spare memory exists; that assumption is valid
15497 only if SYSTEM_MALLOC.
15498 (LARGE_REQUEST): New macro, so that the issue of large requests
15499 is separated from the issue of spare memory.
15500
810928a2
AS
155012011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15502
172418ad
AS
15503 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15504 format. (Bug#8806)
15505
43f862f7
AS
15506 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15507
810928a2
AS
15508 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15509 before statements.
15510
a059fe24
JD
155112011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15512
15513 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15514
15515 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15516
15517 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15518 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15519
989bf368
JB
155202011-06-05 Juanma Barranquero <lekktu@gmail.com>
15521
15522 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15523
4b80f674
CY
155242011-06-04 Chong Yidong <cyd@stupidchicken.com>
15525
15526 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15527 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
15528 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15529 New error handlers.
4b80f674
CY
15530 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15531 Obey Vx_select_enable_clipboard_manager. Catch errors in
15532 x_clipboard_manager_save (Bug#8779).
15533 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15534 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15535
99a33b77 155362011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15537
15538 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15539
99a33b77 155402011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15541
15542 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15543 in the current matrix if keep_current_p is non-zero.
15544
8264569d
EZ
155452011-06-04 Eli Zaretskii <eliz@gnu.org>
15546
15547 * bidi.c (bidi_level_of_next_char): Fix last change.
15548
57f97249
EZ
155492011-06-03 Eli Zaretskii <eliz@gnu.org>
15550
fec2107c 15551 Support bidi reordering of text covered by display properties.
57f97249 15552
fec2107c
EZ
15553 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15554 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15555 (bidi_cache_search, bidi_cache_iterator_state)
15556 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15557 (bidi_level_of_next_char, bidi_move_to_visually_next):
15558 Support character positions inside a run of characters covered by a
fec2107c
EZ
15559 display string.
15560 (bidi_paragraph_init, bidi_resolve_explicit_1)
15561 (bidi_level_of_next_char): Call bidi_fetch_char and
15562 bidi_fetch_char_advance instead of FETCH_CHAR and
15563 FETCH_CHAR_ADVANCE.
15564 (bidi_init_it): Initialize new members.
15565 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15566 definitions.
15567 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15568 instead of using explicit *_CHAR codes.
d6d100dd
SM
15569 (bidi_resolve_explicit, bidi_resolve_weak):
15570 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15571 bidirectional text is supported only in multibyte buffers.
15572 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15573 it to initialize the frame_window_p member of struct bidi_it.
15574 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15575 (bidi_resolve_explicit, bidi_resolve_weak)
15576 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15577 bidi_it->nchars is non-positive.
15578 (bidi_level_of_next_char): Don't try to lookup the cache for the
15579 next/previous character if nothing is cached there yet, or if we
15580 were just reseat()'ed to a new position.
c40e2fb2 15581
0e14fe90
EZ
15582 * xdisp.c (set_cursor_from_row): Set start and stop points
15583 according to the row's direction when priming the loop that looks
15584 for the glyph on which to display cursor.
15585 (single_display_spec_intangible_p): Function deleted.
15586 (display_prop_intangible_p): Reimplement to call
15587 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15588 Accept 3 additional arguments needed by handle_display_spec.
15589 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15590 values: lists, `(when COND...)' forms, etc.
15591 (single_display_spec_string_p): Support property values that are
15592 lists with the argument STRING its top-level element.
15593 (display_prop_string_p): Fix the condition for processing a
15594 property that is a list to be consistent with handle_display_spec.
fec2107c 15595 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15596 last portion of handle_display_prop.
15597 (compute_display_string_pos): Accept additional argument
15598 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15599 value of a `display' property is a "replacing spec".
15600 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15601 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15602 the display property, but just return a value indicating whether
15603 the display property will replace the characters it covers.
15604 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15605 frame_window_p members of struct bidi_it.
d6d100dd
SM
15606 (compute_display_string_pos, compute_display_string_end):
15607 New functions.
fec2107c
EZ
15608 (push_it): Accept second argument POSITION, where pop_it should
15609 jump to continue iteration.
15610 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15611
fec2107c
EZ
15612 * keyboard.c (adjust_point_for_property): Adjust the call to
15613 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
15614
15615 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
15616 (bidi_init_it): Update prototypes.
15617 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
15618 (compute_display_string_pos, compute_display_string_end):
15619 Declare prototypes.
fec2107c
EZ
15620 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15621 EMACS_INT.
fc6f18ce 15622
40087514 156232011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 15624
57f53182
PE
15625 Malloc failure behavior now depends on size of allocation.
15626 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15627 * lisp.h: Change signatures accordingly.
15628 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15629 All callers changed. (Bug#8762)
15630
15631 * gnutls.c: Use Emacs's memory allocators.
15632 Without this change, the gnutls library would invoke malloc etc.
15633 directly, which causes problems on non-SYNC_INPUT hosts, and which
15634 runs afoul of improving memory_full behavior. (Bug#8761)
15635 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15636 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15637 xfree instead of the default malloc, realloc, free.
15638 (Fgnutls_boot): No need to check for memory allocation failure,
15639 since xmalloc does that for us.
15640
ac32cd99 15641 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
15642 * category.c (hash_get_category_set):
15643 * ccl.c (ccl_driver):
15644 * charset.c (Fdefine_charset_internal):
15645 * charset.h (struct charset.hash_index):
15646 * composite.c (get_composition_id, gstring_lookup_cache)
15647 (composition_gstring_put_cache):
15648 * composite.h (struct composition.hash_index):
15649 * dispextern.h (struct image.hash):
15650 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15651 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15652 (hashfn_equal, hashfn_user_defined, make_hash_table)
15653 (maybe_resize_hash_table, hash_lookup, hash_put)
15654 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15655 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15656 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15657 * image.c (make_image, search_image_cache, lookup_image)
15658 (xpm_put_color_table_h):
15659 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 15660 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 15661 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 15662 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
15663 * alloc.c (allocate_vectorlike):
15664 Check for overflow in vector size calculations.
15665 * ccl.c (ccl_driver):
15666 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
15667 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15668 need to be updated by these changes.
40087514
PE
15669 * fns.c (make_hash_table, maybe_resize_hash_table):
15670 Check for integer overflow with large hash tables.
0de4bb68
PE
15671 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15672 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15673 (SXHASH_REDUCE): New macro.
15674 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15675 Use it instead of discarding useful hash info with large hash values.
15676 (sxhash_float): New function.
15677 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15678 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
15679 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15680 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
15681 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15682 Adjust signatures to match updated version of code.
15683 (consing_since_gc): Now EMACS_INT, since a single hash table can
15684 use more than INT_MAX bytes.
15685
698d32e2
DN
156862011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15687
15688 Make it possible to build with GCC-4.6+ -O2 -flto.
15689
15690 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15691
fd6fa53f
SM
156922011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15693
15694 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15695 Call minibuffer-inactive-mode.
15696
864db017
JB
156972011-05-31 Juanma Barranquero <lekktu@gmail.com>
15698
15699 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15700 Update dependencies.
15701
2ad0baf4
DN
157022011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15703
15704 * data.c (init_data): Remove code for UTS, this system is not
15705 supported anymore.
15706
4fcc2638
DN
157072011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15708
15709 Don't force ./temacs to start in terminal mode.
15710
15711 * frame.c (make_initial_frame): Initialize faces in all cases, not
15712 only when CANNOT_DUMP is defined.
15713 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15714
c56e0fd5
DN
157152011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15716
15717 * dispnew.c (add_window_display_history): Use const for the string
15718 pointer. Remove declaration, not needed.
15719
333d54da 157202011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 15721
55d4c1b2 15722 Use 'inline', not 'INLINE'.
333d54da 15723 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
15724 * alloc.c, fontset.c (INLINE): Remove.
15725 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15726 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15727 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15728 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15729 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15730
738db178
DN
157312011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15732
15733 Make it possible to run ./temacs.
15734
15735 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15736 syms_of_callproc does the same thing. Remove test for
15737 "initialized", do it in the caller.
15738 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15739
620c53a6
SM
157402011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15741
15742 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15743 (read_minibuf): Use get_minibuffer.
15744 (syms_of_minibuf): Use DEFSYM.
15745 (Qmetadata): New var.
15746 * data.c (Qbuffer): Don't make it static.
15747 (syms_of_data): Use DEFSYM.
15748
e003a292
PE
157492011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15750
15751 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15752 (CCL_CODE_MIN): New macro.
15753
ed008a6d
PE
157542011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15755
3687c2ef
PE
15756 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15757
ed008a6d
PE
15758 * eval.c (Qdebug): Now static.
15759 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15760 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15761 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15762
d66c4c7c
CY
157632011-05-29 Chong Yidong <cyd@stupidchicken.com>
15764
15765 * image.c: Various fixes to ImageMagick code comments.
15766 (Fimagemagick_types): Doc fix.
15767
5fbc2025
PE
157682011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15769
0196f88a
PE
15770 Minor fixes prompted by GCC 4.6.0 warnings.
15771
15772 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15773
5fbc2025
PE
15774 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15775 (x_clipboard_manager_save_all): Move extern decl to ...
15776 * xterm.h: ... here, so that it can be checked for consistency.
15777
1dd3c2d9
CY
157782011-05-29 Chong Yidong <cyd@stupidchicken.com>
15779
15780 * xselect.c (x_clipboard_manager_save_frame)
15781 (x_clipboard_manager_save_all): New functions.
15782 (Fx_clipboard_manager_save): Lisp function deleted.
15783
15784 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15785 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15786
15787 * xterm.h: Update prototype.
15788
5ba6571d
WX
157892011-05-28 William Xu <william.xwl@gmail.com>
15790
15791 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15792 exiting (Bug#8239).
15793
3eaff834
JM
157942011-05-28 Jim Meyering <meyering@redhat.com>
15795
e1900994 15796 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
15797 * fns.c (to_uchar): Define.
15798 (crypto_hash_function): Use it to convert some newly-signed
15799 variables to unsigned, to avoid sign-extension bugs. For example,
15800 without this change, (md5 "truc") would evaluate to
15801 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15802 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 15803 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 15804
0f6990a7
PE
158052011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15806
15807 Integer overflow fixes.
c8a9ca5a 15808
08686060
PE
15809 * dbusbind.c: Serial number integer overflow fixes.
15810 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
15811 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15812 to hold a serial number that is too large for a fixnum.
15813 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15814 Check for serial numbers out of range. Decode any serial number
59568bf0 15815 that was so large that it became a float. (Bug#8722)
08686060 15816
2d1fc3c7
PE
15817 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15818 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15819 Use XFASTINT rather than XUINT when numbers are nonnegative.
15820 (xd_append_arg, Fdbus_method_return_internal):
15821 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15822 arguments, check that Lisp number is nonnegative, rather than
59568bf0 15823 silently wrapping negative numbers around. (Bug#8722)
30217ff0 15824 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 15825 (Bug#8722)
2d1fc3c7 15826
c8a9ca5a
PE
15827 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15828
519e1d69
PE
15829 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15830
6df6ae42 15831 ccl: Add integer overflow checks.
30569699
PE
15832 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15833 (IN_INT_RANGE): New macros.
15834 (ccl_driver): Use them to check for integer overflow when
15835 decoding a CCL program. Many of the new checks are whether XINT (x)
15836 fits in int; it doesn't always, on 64-bit hosts. The new version
15837 doesn't catch all possible integer overflows, but it's an
847044ea 15838 improvement. (Bug#8719)
30569699 15839
c11285dc
PE
15840 * alloc.c (make_event_array): Use XINT, not XUINT.
15841 There's no need for unsigned here.
15842
fdccd48e
PE
15843 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15844 This follows up to the 2011-05-06 change that substituted uintptr_t
15845 for EMACS_INT. This case wasn't caught back then.
15846
37910ab2
PE
15847 Rework Fformat to avoid integer overflow issues.
15848 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15849 now (part of C89). Include <verify.h>.
15850 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15851 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15852 (Fformat): Avoid the prepass trying to compute sizes; it was only
15853 approximate and thus did not catch overflow reliably. Instead, walk
15854 through the format just once, formatting and computing sizes as we go,
15855 checking for integer overflow at every step, and allocating a larger
15856 buffer as needed. Keep track separately whether the format is
15857 multibyte. Keep only the most-recently calculated precision, rather
15858 than them all. Record whether each argument has been converted to
15859 string. Use EMACS_INT, not int, for byte and char and arg counts.
15860 Support field widths and precisions larger than INT_MAX. Avoid
15861 sprintf's undefined behavior with conversion specifications such as %#d
15862 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15863 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15864 formatting out-of-range floating point numbers with int
9173deec 15865 formats. (Bug#8668)
37910ab2 15866
2e6578fb
PE
15867 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15868
0ae6bdee
PE
15869 * data.c: Avoid integer truncation in expressions involving floats.
15870 * data.c: Include <intprops.h>.
15871 (arith_driver): When there's an integer overflow in an expression
15872 involving floating point, convert the integers to floating point
15873 so that the resulting value does not suffer from catastrophic
15874 integer truncation. For example, on a 64-bit host (* 4
15875 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15876 Do not rely on undefined behavior after integer overflow.
15877
de883a70
PE
15878 merge count_size_as_multibyte, parse_str_to_multibyte
15879 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 15880 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
15881 Check for integer overflow.
15882 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15883 since it's now a duplicate of the other. This is more of
15884 a character than a buffer op, so better that it's in character.c.
15885 * fns.c, print.c: Adjust to above changes.
15886
2ff916cb
PE
158872011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15888
15889 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15890
f1b54466
PE
158912011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15892
fb1ac845
PE
15893 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15894 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15895 (x_clipboard_manager_save): Now static.
15896 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15897
f1b54466
PE
15898 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15899 (crypto_hash_function): Now static.
15900 Fix pointer signedness problems. Avoid unnecessary initializations.
15901
a9f737ee
CY
159022011-05-27 Chong Yidong <cyd@stupidchicken.com>
15903
15904 * termhooks.h (Vselection_alist): Make it terminal-local.
15905
15906 * terminal.c (create_terminal): Initialize it.
15907
15908 * xselect.c: Support for clipboard managers.
15909 (Vselection_alist): Move to termhooks.h as terminal-local var.
15910 (LOCAL_SELECTION): New macro.
15911 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15912 (symbol_to_x_atom): Remove gratuitous arg.
15913 (x_handle_selection_request, lisp_data_to_selection_data)
15914 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
15915 (x_own_selection, x_get_local_selection, x_convert_selection):
15916 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
15917 (some_frame_on_display): Delete unused function.
15918 (Fx_own_selection_internal, Fx_get_selection_internal)
15919 (Fx_disown_selection_internal, Fx_selection_owner_p)
15920 (Fx_selection_exists_p): New optional frame arg.
15921 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15922 (x_handle_selection_clear): Don't treat other terminals with the
15923 same keyboard specially. Use the terminal-local Vselection_alist.
15924 (x_clear_frame_selections): Use Frun_hook_with_args.
15925
15926 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15927
15928 * xterm.h: Add support for those atoms.
15929
e067f0c1
CY
159302011-05-26 Chong Yidong <cyd@stupidchicken.com>
15931
15932 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15933 (converted_selections, conversion_fail_tag): New global variables.
15934 (x_selection_request_lisp_error): Free the above.
15935 (x_get_local_selection): Remove unnecessary code.
15936 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
15937 of converted selections stored in converted_selections.
15938 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
15939 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15940 (x_convert_selection): New function.
15941 (x_handle_selection_event): Simplify.
15942 (x_get_foreign_selection): Don't ignore incoming requests while
15943 waiting for an answer; this will fail when we implement
15944 SAVE_TARGETS, and seems unnecessary anyway.
15945 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15946 (Vx_sent_selection_functions): Doc fix.
15947
0f4aebc0
LL
159482011-05-26 Leo Liu <sdl.web@gmail.com>
15949
15950 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15951
e61124cd
YM
159522011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15953
15954 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15955
15956 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15957 for fringe update if it has periodic bitmap.
ac389d0c 15958 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
15959 and fringe_bitmap_periodic_p.
15960
15961 * fringe.c (get_fringe_bitmap_data): New function.
15962 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15963 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15964 row. Mark glyph row for fringe update if periodicity changed.
15965
15966 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15967 for fringe update unless it has periodic bitmap.
15968
f16d9837
KH
159692011-05-25 Kenichi Handa <handa@m17n.org>
15970
15971 * xdisp.c (get_next_display_element): Set correct it->face_id for
15972 a static composition.
15973
e1b90ef6
LL
159742011-05-24 Leo Liu <sdl.web@gmail.com>
15975
15976 * deps.mk (fns.o):
15977 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15978
15979 * fns.c (crypto_hash_function, Fsha1): New function.
15980 (Fmd5): Use crypto_hash_function.
15981 (syms_of_fns): Add Ssha1.
15982
7400048f
PE
159832011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15984
15985 * gnutls.c: Remove unused macros.
15986 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15987 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15988 Remove macros that are defined and never used.
15989 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15990
abb71cf4
CY
159912011-05-22 Chong Yidong <cyd@stupidchicken.com>
15992
15993 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15994 (Fx_get_selection_internal): Minor cleanup.
15995 (Fx_own_selection_internal): Rename arguments for consistency with
15996 select.el.
15997
6307db39
PE
159982011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15999
16000 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16001
f3d4e0a4
CY
160022011-05-22 Chong Yidong <cyd@stupidchicken.com>
16003
16004 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16005
4d8ade89
YM
160062011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16007
16008 * dispnew.c (scrolling_window): Don't exclude the case that the
16009 last enabled row in the desired matrix touches the bottom boundary.
16010
32078c8d
GM
160112011-05-21 Glenn Morris <rgm@gnu.org>
16012
16013 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
16014 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16015 and add some more files.
32078c8d 16016
7285dc67
EZ
160172011-05-20 Eli Zaretskii <eliz@gnu.org>
16018
16019 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16020 report_file_error introduced by the change from 2011-05-07.
16021
89d1bd22
PE
160222011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16023
16024 * systime.h (Time): Define only if emacs is defined.
16025 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16026 where the include path doesn't have X11/X.h by default. See
16027 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16028
cd394be1 160292011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
16030
16031 * composite.c (find_automatic_composition): Fix previous change.
16032
b9704ad9
GM
160332011-05-20 Glenn Morris <rgm@gnu.org>
16034
16035 * lisp.mk: New file, split from Makefile.in.
16036 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16037 (shortlisp): Remove.
16038 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16039
4a720484
GM
160402011-05-19 Glenn Morris <rgm@gnu.org>
16041
16042 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16043 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16044 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16045 (lisp): Set the order to that of loadup.el.
16046 (shortlisp): Make it a copy of $lisp.
16047 (SOME_MACHINE_LISP): Remove.
16048 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16049 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16050
a28d4396
KH
160512011-05-18 Kenichi Handa <handa@m17n.org>
16052
16053 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16054 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16055 (find_automatic_composition): Mostly rewrite for efficiency.
16056
a2b1fa8e
JB
160572011-05-18 Juanma Barranquero <lekktu@gmail.com>
16058
16059 * makefile.w32-in: Update dependencies.
16060
8e1f5610
CS
160612011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16062
16063 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 16064 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 16065
7025ee00 160662011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 16067
cdfa6eab
PE
16068 Fix some integer overflow issues, such as string length overflow.
16069
06d6db33
PE
16070 * insdel.c (count_size_as_multibyte): Check for string overflow.
16071
2b4560a8
PE
16072 * character.c (lisp_string_width): Check for string overflow.
16073 Use EMACS_INT, not int, for string indexes and lengths; in
16074 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16075 the resulting string length overflows an EMACS_INT; instead,
16076 report a string overflow if no precision given. When checking for
16077 precision exhaustion, use a check that cannot possibly have
16078 integer overflow. (Bug#8675)
16079 * character.h (lisp_string_width): Adjust to new signature.
16080
cb93f9be
PE
16081 * alloc.c (string_overflow): New function.
16082 (Fmake_string): Use it. This doesn't change behavior, but saves
16083 a few bytes and will simplify future changes.
16084 * character.c (string_escape_byte8): Likewise.
16085 * lisp.h (string_overflow): New decl.
16086
1a1f3366
PE
16087 Fixups, following up to the user-interface timestamp change.
16088 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16089 for UI timestamps, instead of unsigned long.
9fbd6841
PE
16090 * msdos.c (mouse_get_pos): Likewise.
16091 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
16092 * w32gui.h (Time): Define by including "systime.h" rather than by
16093 declaring it ourselves. (Bug#8664)
16094
d4e3e4d3
PE
16095 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16096 * image.c (clear_image_cache): Likewise.
16097
f6a24d19
PE
16098 * term.c (term_mouse_position): Don't assume time_t wraparound.
16099
08dc5ae6
PE
16100 Be more systematic about user-interface timestamps.
16101 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
16102 and sometimes 'EMACS_UINT', to represent these timestamps.
16103 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
16104 This makes the code easier to follow, and makes it easier to catch
16105 integer overflow bugs such as Bug#8664.
16106 * frame.c (Fmouse_position, Fmouse_pixel_position):
16107 Use Time, not unsigned long, for user-interface timestamps.
16108 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16109 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16110 * keyboard.h (last_event_timestamp): Likewise.
16111 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16112 * menu.h (xmenu_show): Likewise.
16113 * term.c (term_mouse_position): Likewise.
16114 * termhooks.h (struct input_event.timestamp): Likewise.
16115 (struct terminal.mouse_position_hook): Likewise.
16116 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16117 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16118 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16119 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16120 what it was before.
16121 * menu.h, termhooks.h: Include "systime.h", for Time.
16122
8e55734a
PE
16123 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16124 Don't assume that the difference between two unsigned long values
16125 can fit into an integer. At this point, we know button_down_time
16126 <= event->timestamp, so the difference must be nonnegative, so
16127 there's no need to cast the result if double-click-time is
16128 nonnegative, as it should be; check that it's nonnegative, just in
16129 case. This bug is triggered when events are more than 2**31 ms
86db42d2 16130 apart (about 25 days). (Bug#8664)
8e55734a 16131
841f1b75 16132 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 16133 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 16134
3e26f69c
PE
16135 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16136 that always fit in int. Use a sentinel instead of a counter, to
16137 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
16138 * frame.h (struct frame): Use int for menu_bar_items_used
16139 instead of EMACS_INT, since it always fits in int.
3e26f69c 16140
5cc152c0
PE
16141 * menu.c (grow_menu_items): Check for int overflow.
16142
d89eb65e
PE
16143 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16144
5235bd3e
PE
16145 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16146 Before, the code was not consistent. These values cannot exceed
16147 2**31 - 1 so there's no need to make them unsigned.
16148 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16149 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16150 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16151 as modifiers.
16152 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16153
bc827e23
PE
16154 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16155 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16156 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16157 presumably because the widths might not match.
16158
78eb494e
PE
16159 * window.c (size_window): Avoid needless test at loop start.
16160
04f2d78b
CB
161612011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16162
16163 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16164
d2fc7e3d 161652011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
16166
16167 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16168
d2fc7e3d 161692011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
16170
16171 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16172 `width' to `bar_area_x' and `bar_area_width', respectively.
16173 (x_scroll_run): Take account of fringe background extension.
16174
04f2d78b
CB
16175 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16176 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
16177 `bar_area_width', respectively.
16178 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16179 background extension.
16180
79b70037
GM
161812011-05-10 Jim Meyering <meyering@redhat.com>
16182
16183 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16184
2f142cc5
JB
161852011-05-10 Juanma Barranquero <lekktu@gmail.com>
16186
16187 * image.c (Finit_image_library): Return t for built-in image types,
16188 like pbm and xbm. (Bug#8640)
16189
57679c86
AS
161902011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16191
16192 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16193
888c9e86
EZ
161942011-05-07 Eli Zaretskii <eliz@gnu.org>
16195
b0512a1d
EZ
16196 * w32console.c (Fset_screen_color): Doc fix.
16197 (Fget_screen_color): New function.
16198 (syms_of_ntterm): Defsubr it.
16199
7285dc67
EZ
16200 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16201 unlink the temporary file if Fcall_process didn't create it in the
16202 first place.
16203 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16204 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
16205 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16206 cue to call_process_cleanup not to close that handle.
16207
4d3fcc8e
BK
162082011-05-07 Ben Key <bkey76@gmail.com>
16209
16210 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16211 one of two shell specific rules, either bootstrap-temacs-CMD or
16212 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16213 to the previous implementation of the bootstrap-temacs rule.
16214 The bootstrap-temacs-CMD rule is similar to the previous
16215 implementation of the bootstrap-temacs rule except that it
16216 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16217 variable.
16218
16219 These changes, along with some changes to nt/configure.bat,
16220 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16221 earlier fix to add support for --cflags and --ldflags options
16222 that include quotes so that it works whether make uses cmd or
16223 sh as the shell.
16224
b4289b64
MA
162252011-05-06 Michael Albinus <michael.albinus@gmx.de>
16226
16227 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16228 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16229 is a constant.
16230 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16231 a string. Handle both cases.
16232 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16233 (Fdbus_register_method): Use Qinvalid_function.
16234
af4c0e28
JB
162352011-05-06 Juanma Barranquero <lekktu@gmail.com>
16236
16237 * makefile.w32-in: Update dependencies.
16238 (LISP_H): Add inttypes.h and stdin.h.
16239 (PROCESS_H): Add unistd.h.
16240
c51453d9
EZ
162412011-05-06 Eli Zaretskii <eliz@gnu.org>
16242
16243 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16244 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16245
8ff0ac3c 162462011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 16247
4c4b566b
PE
16248 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16249
aab2b9b5
PE
16250 * term.c (vfatal): Remove stray call to va_end.
16251 It's not needed and the C Standard doesn't allow it here anyway.
16252
c378da0b
PE
16253 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16254 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16255
288b08c7
PE
16256 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16257 bytes.
16258
e3601888
PE
16259 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16260
db6c0e74
PE
16261 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16262
dd5963ea
PE
16263 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16264
88c9450f
PE
16265 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16266
2f9442b8
PE
16267 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16268
c032b5f8
PE
16269 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16270 * charset.c (Fdefine_charset_internal): Don't initialize
16271 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 16272 32-bit int (Bug#8600).
a108c10b
PE
16273
16274 * lread.c (read_integer): Be more consistent with string-to-number.
16275 Use string_to_number to do the actual conversion; this avoids
16276 rounding errors and fixes some other screwups. Without this fix,
16277 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16278 (digit_to_number): Move earlier, for benefit of read_integer.
16279 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 16280 not a digit in any supported base. (Bug#8602)
a108c10b 16281
ad5f9eea
PE
16282 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16283
aec1708a
PE
16284 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16285 to match comment at start of function. This also removes a
16286 GCC warning about overflow in a 32+64-bit port.
16287
47be4ab5
PE
16288 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16289
371cac43
PE
16290 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16291 Reported by Stefan Monnier in
16292 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
16293 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16294 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 16295
d01a7826
PE
16296 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16297 (EMACS_UINTPTR): Likewise, with uintptr_t.
16298
7fd47d5c
PE
16299 * lisp.h: Prefer 64-bit EMACS_INT if available.
16300 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16301 on 32-bit hosts that have 64-bit int, so that they can access
16302 large files.
122b0c86
PE
16303 However, temporarily disable this change unless the temporary
16304 symbol WIDE_EMACS_INT is defined.
7fd47d5c 16305
8727937b
PE
16306 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16307
8ac068ac
PE
16308 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16309 This removes an assumption that EMACS_INT and long are the same
16310 width as pointers. The assumption is true for Emacs porting targets
16311 now, but we want to make other targets possible.
16312 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16313 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16314 In the rest of the code, change types of integers that hold casted
16315 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16316 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16317 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16318 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16319 No need to cast type when ORing.
16320 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16321 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16322 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16323 assume EMACS_INT is the same width as char *.
16324 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16325 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16326 Remove no-longer-needed casts.
16327 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16328 (xg_tool_bar_help_callback, xg_make_tool_item):
16329 Use EMACS_INTPTR to hold an integer
16330 that will be cast to void *; this can avoid a GCC warning
16331 if EMACS_INT is not the same width as void *.
16332 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16333 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16334 (current_message_1, set_message_1):
16335 Use a local to convert to proper width without a cast.
16336 * xmenu.c (dialog_selection_callback): Likewise.
16337
ede49d71
PE
16338 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16339 Also, don't assume VALBITS / RAND_BITS is less than 5,
16340 and don't rely on undefined behavior when shifting a 1 left into
16341 the sign bit.
16342 * lisp.h (get_random): Change signature to match.
16343
2f30ecd0
PE
16344 * lread.c (hash_string): Use size_t, not int, for hash computation.
16345 Normally we prefer signed values; but hashing is special, because
16346 it's better to use unsigned division on hash table sizes so that
16347 the remainder is nonnegative. Also, size_t is the natural width
16348 for hashing into memory. The previous code used 'int', which doesn't
16349 retain enough info to hash well into very large tables.
16350 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16351
2a866e7b
PE
16352 * dbusbind.c: Don't possibly lose pointer info when converting.
16353 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16354 Use XPNTR rather than XHASH, so that the high-order bits of
16355 the pointer aren't lost when converting through void *.
16356
51639eac
PE
16357 * eval.c (Fautoload): Don't double-shift a pointer.
16358
92394119
PE
16359 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16360
dbdb9a7c
JB
163612011-05-06 Juanma Barranquero <lekktu@gmail.com>
16362
16363 * gnutls.c (DEF_GNUTLS_FN):
16364 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16365
db7a0b4f
AS
163662011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16367
16368 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16369 marker. (Bug#8610)
16370
cd394be1 163712011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
16372
16373 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16374 New version that can reserve upto 2GB of heap space.
16375
f7ff1b0f 163762011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
16377
16378 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16379
639c109b
TZ
163802011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16381
16382 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16383 `gnutls_certificate_set_x509_key_file'.
16384
d2127135
JB
163852011-05-05 Juanma Barranquero <lekktu@gmail.com>
16386
16387 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16388 Update dependencies.
16389
e968f4f3
JB
163902011-05-04 Juanma Barranquero <lekktu@gmail.com>
16391
16392 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16393 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16394 Remove unused parameter `fildes'.
16395 * process.c (read_process_output, send_process): Don't pass it.
16396
84d358f0
JB
163972011-05-04 Juanma Barranquero <lekktu@gmail.com>
16398
16399 Fix previous change: the library cache is defined in w32.c.
16400 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16401 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16402
0898ca10
JB
164032011-05-04 Juanma Barranquero <lekktu@gmail.com>
16404
16405 Implement dynamic loading of GnuTLS on Windows.
16406
16407 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16408 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16409 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16410 Declare.
16411
16412 * gnutls.c (Qgnutls_dll): Define.
16413 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16414 (gnutls_*): Declare function pointers.
16415 (init_gnutls_functions): New function to initialize function pointers.
16416 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16417 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16418 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16419 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16420 (emacs_gnutls_write, emacs_gnutls_read)
16421 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16422 (Fgnutls_available_p): New function.
16423 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16424 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16425 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16426
16427 * image.c: Include w32.h.
16428 (Vimage_type_cache): Delete.
16429 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16430 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16431 (w32_delayed_load): Move to w32.c.
16432
16433 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16434
16435 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16436 (w32_delayed_load): Move from image.c. When loading a library, record
16437 its filename in the :loaded-from property of the library id.
16438 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16439 Initialize and staticpro them.
16440 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16441
16442 * process.c: Include lisp.h before w32.h, not after.
16443 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16444 instead of gnutls_record_check_pending.
16445
16446 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16447
ff4de4aa
TZ
164482011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16449
16450 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16451 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16452 as passed in.
16453
abe95abb
JD
164542011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16455
16456 * xterm.c (x_set_frame_alpha): Do not set property on anything
16457 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16458
e16e55d4
JB
164592011-05-02 Juanma Barranquero <lekktu@gmail.com>
16460
16461 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16462
bafcf6a5
JB
164632011-05-02 Juanma Barranquero <lekktu@gmail.com>
16464
16465 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16466 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16467 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16468 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16469 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16470 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16471 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16472 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16473 (Qgnutls_bootprop_callbacks_verify): Make static.
16474
e7a6747f
AS
164752011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16476
19ed11ba
AS
16477 * callproc.c: Indentation fixup.
16478
e7a6747f 16479 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
16480 (wait_for_termination, interruptible_wait_for_termination):
16481 Move after wait_for_termination_1.
e7a6747f 16482
1ef14cb4
LMI
164832011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16484
16485 * sysdep.c (interruptible_wait_for_termination): New function
16486 which is like wait_for_termination, but allows keyboard
16487 interruptions.
16488
16489 * callproc.c (Fcall_process): Add (:file "file") as an option for
16490 the STDOUT buffer.
16491 (Fcall_process_region): Ditto.
16492
330d880c
EZ
164932011-04-30 Eli Zaretskii <eliz@gnu.org>
16494
8db90b73
EZ
16495 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16496 rather than `XVECTOR (FOO)->size'.
16497
330d880c
EZ
16498 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16499 inttypes.h, as a gnulib replacement is used if it not available in
16500 system headers.
16501
15cbd324
EZ
165022011-04-21 Eli Zaretskii <eliz@gnu.org>
16503
16504 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16505 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16506 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16507
16508 * coding.c (coding_alloc_by_realloc): Error out if destination
16509 will grow beyond MOST_POSITIVE_FIXNUM.
16510 (decode_coding_emacs_mule): Abort if there isn't enough place in
16511 charbuf for the composition carryover bytes. Reserve an extra
16512 space for up to 2 characters produced in a loop.
16513 (decode_coding_iso_2022): Abort if there isn't enough place in
16514 charbuf for the composition carryover bytes.
16515
165162011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 16517
ae940cca
EZ
16518 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16519 aborting when %lld or %lll format is passed.
16520 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16521 %llo or %llx format is passed. (Bug#8545)
16522
03ab8921
EZ
16523 * window.c (window_scroll_line_based): Use a marker instead of
16524 simple variables to record original value of point. (Bug#7952)
16525
afda1437
EZ
16526 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16527 produced by %s or %c overflows available buffer space. (Bug#8545)
16528
f76dee0c
PE
165292011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16530
16531 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16532 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16533
fdc5744d
JB
165342011-04-28 Juanma Barranquero <lekktu@gmail.com>
16535
16536 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16537
638f053a
JB
165382011-04-28 Juanma Barranquero <lekktu@gmail.com>
16539
16540 * keyboard.c (Qdelayed_warnings_hook): Define.
16541 (command_loop_1): Run `delayed-warnings-hook'
16542 if Vdelayed_warnings_list is non-nil.
16543 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16544 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16545
d178f871
EZ
165462011-04-28 Eli Zaretskii <eliz@gnu.org>
16547
16548 * doprnt.c (doprnt): Don't return value smaller than the buffer
16549 size if the message was truncated. (Bug#8545).
16550
b124fd93
JB
165512011-04-28 Juanma Barranquero <lekktu@gmail.com>
16552
16553 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16554 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16555
e810457d
PE
165562011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16557
16558 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16559
ea51cceb
JB
165602011-04-27 Juanma Barranquero <lekktu@gmail.com>
16561
16562 * makefile.w32-in: Update dependencies.
16563
94dcfacf
EZ
165642011-04-27 Eli Zaretskii <eliz@gnu.org>
16565
16566 Improve `doprnt' and its usage. (Bug#8545)
16567 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16568 `format_end'. Remove support for %l as a conversion specifier.
16569 Don't use xrealloc. Improve diagnostics when the %l size modifier
16570 is used. Update the commentary.
16571
16572 * eval.c (verror): Simplify calculation of size_t.
16573
16574 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16575 messages.
16576
f61f41d7
PE
165772011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16578
16579 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16580 change.
16581
96fb4434
PE
165822011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16583
16584 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16585 This makes this file independent of the recent pseudovector change.
16586
671875da 165872011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16588
69e9b5a3
PE
16589 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16590
b5f869a7 16591 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16592 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16593 Remove unused local.
c8926152 16594 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16595
841a1577 16596 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16597 GCC 4.6.0 optimizes based on type-based alias analysis.
16598 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16599 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16600 != &v->size, and therefore "v->size = 1; b->size = 2; return
16601 v->size;" must therefore return 1. This assumption is incorrect
16602 for Emacs, since it type-puns struct Lisp_Vector * with many other
16603 types. To fix this problem, this patch adds a new type struct
f904488f 16604 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16605 and pseudovectors, and helps optimizing compilers not get fooled
16606 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16607 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16608 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16609 the size member.
eab3844f
PE
16610 (XSETPVECTYPE): Rewrite in terms of new macro.
16611 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16612 This is a bit clearer, and further avoids the possibility of
16613 undesirable aliasing.
16614 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 16615 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
16616 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16617 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
16618 (ASIZE): Now uses header.size rather than size.
16619 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
16620 to avoid the hassle of writing XVECTOR (foo)->header.size.
16621 (struct vectorlike_header): New type.
eab3844f
PE
16622 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16623 object, to help avoid aliasing.
16624 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16625 (SUBRP): Likewise, since Lisp_Subr is a special case.
16626 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16627 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16628 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 16629 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
16630 changed to be "header.size" and "header.next".
16631 * buffer.h (struct buffer): Likewise.
16632 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16633 * frame.h (struct frame): Likewise.
16634 * process.h (struct Lisp_Process): Likewise.
16635 * termhooks.h (struct terminal): Likewise.
16636 * window.c (struct save_window_data, struct saved_window): Likewise.
16637 * window.h (struct window): Likewise.
16638 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16639 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16640 * buffer.c (init_buffer_once): Likewise.
16641 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16642 special case.
16643 * process.c (Fformat_network_address): Use local var for size,
16644 for brevity.
16645
0df1eac5
PE
16646 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16647
847ab9d1 16648 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
16649 * data.c (atof): Remove decl; no longer used or needed.
16650 (digit_to_number): Move to lread.c.
16651 (Fstring_to_number): Use new string_to_number function, to be
16652 consistent with how the Lisp reader treats infinities and NaNs.
16653 Do not assume that floating-point numbers represent EMACS_INT
16654 without losing information; this is not true on most 64-bit hosts.
16655 Avoid double-rounding errors, by insisting on integers when
16656 parsing non-base-10 numbers, as the documentation specifies.
16657 * lisp.h (string_to_number): New decl, replacing ...
16658 (isfloat_string): Remove.
bc0a5c13 16659 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 16660 (read1): Do not accept +. and -. as integers; this
452f4150
PE
16661 appears to have been a coding error. Similarly, do not accept
16662 strings like +-1e0 as floating point numbers. Do not report
16663 overflow for integer overflows unless the base is not 10 which
16664 means we have no simple and reliable way to continue.
16665 Break out the floating-point parsing into a new
16666 function string_to_number, so that Fstring_to_number parses
16667 floating point numbers consistently with the Lisp reader.
04f2d78b 16668 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
16669 (E_CHAR, EXP_INT): Remove, replacing with ...
16670 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16671 (string_to_number): New function, replacing isfloat_string.
16672 This function checks for valid syntax and produces the resulting
16673 Lisp float number too. Rework it so that string-to-number
bc0a5c13 16674 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
16675 so that overflow for non-base-10 numbers is reported only when
16676 there's no portable and simple way to convert to floating point.
452f4150 16677
67769ffc
PE
16678 * textprop.c (set_text_properties_1): Rewrite for clarity,
16679 and to avoid GCC warning about integer overflow.
16680
c20db43f
PE
16681 * intervals.h (struct interval): Use EMACS_INT for members
16682 where EMACS_UINT might cause problems. See
16683 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16684 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16685 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16686 All uses changed.
37aa2f85
PE
16687 (offset_intervals): Tell GCC not to worry about length overflow
16688 when negating a negative length.
c20db43f 16689
2538aa2f
PE
16690 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16691 (overrun_check_free): Likewise.
16692
f2d3008d
PE
16693 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16694 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16695 word size.
16696
ec8df744
PE
16697 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16698 (gnutls_make_error): Rename local to avoid shadowing.
16699 (gnutls_emacs_global_deinit): ifdef out; not used.
16700 (Fgnutls_boot): Use const for pointer to readonly storage.
16701 Comment out unused local. Fix pointer signedness problems.
16702
640ee02d
PE
16703 * lread.c (openp): Don't stuff size_t into an 'int'.
16704 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16705 about possible signed overflow.
16706
6048fb2a
PE
16707 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16708 (GDK_KEY_g): Don't define if already defined.
16709 (xg_prepare_tooltip): Avoid pointer signedness problem.
16710 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16711
fa3c87e1
PE
16712 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16713 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16714
2172544b
PE
16715 * xfns.c (Fx_window_property): Simplify a bit,
16716 to make a bit faster and to avoid GCC 4.6.0 warning.
16717 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16718
9b821a21
PE
16719 * fns.c (internal_equal): Don't assume size_t fits in int.
16720
3c616cfa
PE
16721 * alloc.c (compact_small_strings): Tighten assertion a little.
16722
c2982e87
PE
16723 Replace pEd with more-general pI, and fix some printf arg casts.
16724 * lisp.h (pI): New macro, generalizing old pEd macro to other
16725 conversion specifiers. For example, use "...%"pI"d..." rather
16726 than "...%"pEd"...".
16727 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 16728 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
16729 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16730 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16731 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16732 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16733 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16734 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16735 64-bit hosts.
16736 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16737 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16738 * print.c (safe_debug_print, print_object): Likewise.
16739 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16740 to int.
6f04d126
PE
16741 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16742 avoiding the 0 flag, which is not portable.
c2982e87
PE
16743 * process.c (Fmake_network_process): Use pI to avoid cast.
16744 * region-cache.c (pp_cache): Likewise.
16745 * xdisp.c (decode_mode_spec): Likewise.
16746 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16747 behavior on 64-bit hosts with printf arg.
6f04d126 16748 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
16749 (x_stop_queuing_selection_requests): Likewise.
16750 (x_get_window_property): Don't truncate byte count to an 'int'
16751 when tracing.
0b432f21 16752
5e073ec7
PE
16753 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16754 here, since it parses constructs like leading '-' and spaces,
16755 which are not wanted; and it overflows with large numbers.
16756 Instead, simply match F[0-9]+, which is what is wanted anyway.
16757
36372bf9
PE
16758 * alloc.c: Remove unportable assumptions about struct layout.
16759 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16760 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16761 (allocate_vectorlike, make_pure_vector): Use the new macros,
16762 plus offsetof, to remove unportable assumptions about struct layout.
16763 These assumptions hold on all porting targets that I know of, but
16764 they are not guaranteed, they're easy to remove, and removing them
16765 makes further changes easier.
16766
0b432f21
PE
16767 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16768 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
16769 (string_overrun_cookie): Now const. Use initializers that
16770 don't formally overflow signed char, to avoid warnings.
000098c1
PE
16771 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16772 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
16773 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16774 multiple of sizeof (EMACS_INT); it need not be, if
16775 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 16776 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 16777
895009e1
JB
167782011-04-26 Juanma Barranquero <lekktu@gmail.com>
16779
16780 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16781
6a7a1b0b
TZ
167822011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16783
16784 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 16785 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
16786 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16787
841a1577 167882011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
16789
16790 * lisp.h (Qdebug): List symbol.
895009e1 16791 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
16792 * keyboard.c (debug-on-event): New variable.
16793 (handle_user_signal): Break into debugger when debug-on-event
16794 matches the current signal symbol.
16795
f2d3ba6f
DN
167962011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16797
16798 * alloc.c (check_sblock, check_string_bytes)
16799 (check_string_free_list): Convert to standard C.
16800
42ce4c63
TZ
168012011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16802
16803 * w32.c (emacs_gnutls_push): Fix typo.
16804
825cd63c
EZ
168052011-04-25 Eli Zaretskii <eliz@gnu.org>
16806
fb11d64d
EZ
16807 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16808 "cast to pointer from integer of different size".
16809
825cd63c
EZ
16810 Improve doprnt and its use in verror. (Bug#8545)
16811 * doprnt.c (doprnt): Document the set of format control sequences
16812 supported by the function. Use SAFE_ALLOCA instead of always
16813 using `alloca'.
16814
16815 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16816 is one byte too soon. Don't use xrealloc; instead xfree and
16817 xmalloc anew.
16818
e061a11b
TZ
168192011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16820
16821 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16822 callbacks stage.
16823
16824 * gnutls.c: Renamed global_initialized to
16825 gnutls_global_initialized. Added internals for the
16826 :verify-hostname-error, :verify-error, and :verify-flags
16827 parameters of `gnutls-boot' and documented those parameters in the
16828 docstring. Start callback support.
9173deec
JB
16829 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16830 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16831 on error. Return error code.
e061a11b
TZ
16832 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16833 (emacs_gnutls_read): Likewise.
16834 (Fgnutls_boot): Return handshake error code.
16835 (emacs_gnutls_handle_error): New function.
16836 (wsaerror_to_errno): Likewise.
16837
16838 * w32.h (emacs_gnutls_pull): Add prototype.
16839 (emacs_gnutls_push): Likewise.
16840
16841 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16842 (emacs_gnutls_push): Likewise.
16843
168442011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16845
16846 * process.c (wait_reading_process_output): Check if GnuTLS
16847 buffered some data internally if no FDs are set for TLS
16848 connections.
16849
16850 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16851 (LIBS): Link to USER_LIBS.
16852 ($(BLD)/gnutls.$(0)): New target.
16853
fa6996bc
EZ
168542011-04-24 Eli Zaretskii <eliz@gnu.org>
16855
eb35682e
EZ
16856 * xdisp.c (handle_single_display_spec): Rename the
16857 display_replaced_before_p argument into display_replaced_p, to
16858 make it consistent with the commentary. Fix typos in the
16859 commentary.
16860
e2ad650c
EZ
16861 * textprop.c (syms_of_textprop): Remove dead code.
16862 (copy_text_properties): Delete obsolete commentary about an
16863 interface that was deleted long ago. Fix typos in the description
16864 of arguments.
16865
1b2de274
EZ
16866 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16867 to changes in oldXMenu/XMenu.h from 2011-04-16.
16868 <menu_help_message, prev_menu_help_message>: Constify.
16869 (IT_menu_make_room): menu->help_text is now `const char **';
16870 adjust.
16871
16872 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16873 to changes in oldXMenu/XMenu.h from 2011-04-16.
16874 (struct XMenu): Declare `help_text' `const char **'.
16875
16876 * xfaces.c <Qunspecified>: Make extern again.
16877
16878 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 16879 required by POSIX.
1b2de274 16880
762b15be
EZ
16881 * doc.c (get_doc_string): Improve the format passed to `error'.
16882
16883 * doprnt.c (doprnt): Improve commentary.
16884
16885 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16886
16887 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16888 them with etags.
16889
f1052e5d
EZ
16890 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16891 changes in globals.h immediately force recompilation.
762b15be
EZ
16892 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16893 $(CURDIR)/s/ms-w32.h.
16894 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 16895
fa6996bc
EZ
16896 * character.c (Fchar_direction): Function deleted.
16897 (syms_of_character): Don't defsubr it.
16898 <char-direction-table>: Deleted.
16899
e6c3da20
EZ
169002011-04-23 Eli Zaretskii <eliz@gnu.org>
16901
16902 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16903 * doprnt.c: Include limits.h.
16904 (SIZE_MAX): New macro.
04f2d78b
CB
16905 (doprnt): Return a size_t value. 2nd arg is now size_t.
16906 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
16907 Improve overflow protection. Support `l' modifier for integer
16908 conversions. Support %l conversion. Don't assume an EMACS_INT
16909 argument for integer conversions and for %c.
16910
16911 * lisp.h (doprnt): Restore prototype.
16912
16913 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16914 $(SRC)/character.h.
16915
16916 * Makefile.in (base_obj): Add back doprnt.o.
16917
16918 * deps.mk (doprnt.o): Add back prerequisites.
16919 (callint.o): Depend on character.h.
16920
16921 * eval.c (internal_lisp_condition_case): Include the handler
16922 representation in the error message.
16923 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16924 when breaking from the loop.
16925
16926 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16927
16928 * callint.c (Fcall_interactively): When displaying error message
16929 about invalid control letter, pass the character's codepoint, not
16930 a pointer to its multibyte form. Improve display of the character
16931 in octal and display also its hex code.
16932
16933 * character.c (char_string): Use %x to display the (unsigned)
16934 codepoint of an invalid character, to avoid displaying a bogus
16935 negative value.
16936
16937 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16938 `error', not SYMBOL_NAME itself.
16939
16940 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16941 character arguments to `error'.
16942
16943 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16944 to `error' in error message about FINAL_CHAR argument. Make sure
16945 FINAL_CHAR is a character, and use %c when it is passed as
16946 argument to `error'.
16947
4ffd0d6b 169482011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
16949
16950 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16951
16952 * w32.c: Include <time.h>.
16953 (sys_localtime): New function.
16954
4ffd0d6b 169552011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
16956
16957 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16958
4ffd0d6b 16959 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 16960
4ffd0d6b 169612011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 16962
4ffd0d6b
GM
16963 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16964 zombies (Bug#8467).
aac0c6e3 16965
04c56954
EZ
169662011-04-19 Eli Zaretskii <eliz@gnu.org>
16967
16968 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16969 gl_state.e_property when gl_state.object is Qt.
16970
16971 * insdel.c (make_gap_larger): Remove limitation of buffer size
16972 to <= INT_MAX.
16973
16a43933
CY
169742011-04-18 Chong Yidong <cyd@stupidchicken.com>
16975
16976 * xdisp.c (lookup_glyphless_char_display)
16977 (produce_glyphless_glyph): Handle cons cell entry in
16978 glyphless-char-display.
16979 (Vglyphless_char_display): Document it.
16980
16981 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16982 glyphless-char-display.
16983
4581706e
CY
169842011-04-17 Chong Yidong <cyd@stupidchicken.com>
16985
16986 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16987
16988 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16989
16990 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16991 definition for no-X builds.
16992
4887c6e2 169932011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 16994
fd35b6f9
PE
16995 Static checks with GCC 4.6.0 and non-default toolkits.
16996
5c1ccb01
PE
16997 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16998
006c5daa
PE
16999 * process.c (keyboard_bit_set): Define only if SIGIO.
17000 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17001 (send_process): Repair possible setjmp clobbering.
17002
efc736d3
PE
17003 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17004
4e2fe2e6
PE
17005 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17006
f97334a2
PE
17007 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17008
4e75f29d
PE
17009 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17010 Define only if needed.
17011
90efadd1
PE
17012 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17013 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 17014 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 17015
3c647824
PE
17016 * dispextern.h (struct redisplay_interface): Rename param
17017 to avoid shadowing.
e264f262 17018 * termhooks.h (struct terminal): Likewise.
761383f4 17019 * xterm.c (xembed_send_message): Likewise.
3c647824 17020
b58c5c4a
PE
17021 * insdel.c (make_gap_smaller): Define only if
17022 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17023
cad59032
PE
17024 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17025 it.
17026
c339dc2e
PE
17027 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17028 so that we aren't warned about unused symbols.
17029
91a3e27b
PE
17030 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17031
399c71d3 17032 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 17033
8ffc96f5
PE
17034 * xfns.c (x_real_positions): Mark locals as initialized.
17035
eef9bc79
PE
17036 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17037
098db9dd
PE
17038 * xterm.c: Fix problems found by static analysis with other toolkits.
17039 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
17040 (x_dispatch_event): Declare static if USE_GTK, and
17041 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 17042 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 17043 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
17044 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17045 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 17046
eb18f6cc
PE
17047 * xmenu.c (menu_help_callback): Pointer type fixes.
17048 Use const pointers when pointing at readonly data. Avoid pointer
17049 signedness clashes.
17050 (FALSE): Remove unused macro.
17051 (update_frame_menubar): Remove unused decl.
17052
1fe72bf8
PE
17053 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17054
60d9e1db
PE
17055 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17056 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17057 (single_menu_item): Rename local to avoid shadowing.
17058
39261c26
PE
17059 * keyboard.c (make_lispy_event): Remove unused local var.
17060
018c5e19
PE
17061 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17062 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17063
63d2b86e
PE
17064 * bitmaps: Change bitmaps from unsigned char back to the X11
17065 compatible char. Avoid the old compiler warnings about
17066 out-of-range initializers by using, for example, '\xab' rather
17067 than 0xab.
17068
aefd87e1
PE
17069 * xgselect.c (xgselect_initialize): Check vs interface
17070 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17071
bf501fb9
PE
17072 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17073
e9829fdf
PE
17074 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17075 to read-only memory.
17076
1086c095
PE
17077 * fns.c (vector): Remove; this old hack is no longer needed.
17078
2baccd04 17079 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 17080 Remove unused var.
dde42981 17081 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 17082
72391843 17083 * xrdb.c (x_load_resources): Omit unused local.
3565b346 17084
436c16df 17085 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 17086 (x_window): Rename locals to avoid shadowing.
dc5ddd85 17087 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 17088
92bb796d 17089 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 17090 (x_term_init): Remove local to avoid shadowing.
92bb796d 17091
764430a3 17092 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
17093
17094 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17095 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17096
d1dfb56c
EZ
170972011-04-16 Eli Zaretskii <eliz@gnu.org>
17098
c4354cb4
EZ
17099 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17100
d1dfb56c
EZ
17101 Fix regex.c, syntax.c and friends for buffers > 2GB.
17102 * syntax.h (struct gl_state_s): Declare character position members
17103 EMACS_INT.
17104
17105 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17106
04f2d78b
CB
17107 * textprop.c (verify_interval_modification, interval_of):
17108 Declare arguments EMACS_INT.
d1dfb56c
EZ
17109
17110 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17111 EMACS_INT.
17112
17113 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17114
17115 * indent.c (Fvertical_motion): Local variable it_start is now
17116 EMACS_INT.
17117
17118 * regex.c (re_match, re_match_2, re_match_2_internal)
17119 (bcmp_translate, regcomp, regexec, print_double_string)
17120 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17121 (re_compile_pattern, re_exec): Declare arguments and local
17122 variables `size_t' and `ssize_t' and return values `regoff_t', as
17123 appropriate.
17124 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17125 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17126 <compile_stack_type>: `size' and `avail' are now `size_t'.
17127
17128 * regex.h <regoff_t>: Use ssize_t, not int.
17129 (re_search, re_search_2, re_match, re_match_2): Arguments that
17130 specify buffer/string position and length are now ssize_t and
17131 size_t. Return type is regoff_t.
17132
613052cd
BK
171332011-04-16 Ben Key <bkey76@gmail.com>
17134
17135 * nsfont.m: Fixed bugs in ns_get_family and
17136 ns_descriptor_to_entity that were caused by using free to
17137 deallocate memory blocks that were allocated by xmalloc (via
17138 xstrdup). This caused Emacs to crash when compiled with
17139 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17140 --enable-checking=xmallocoverrun). xfree is now used to
17141 deallocate these memory blocks.
17142
4170f62f 171432011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 17144
71b41406
PE
17145 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17146
9587a89d
PE
17147 emacs_write: Accept and return EMACS_INT for sizes.
17148 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17149 et seq.
17150 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17151 Accept and return EMACS_INT.
17152 (emacs_gnutls_write): Return the number of bytes written on
17153 partial writes.
17154 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
17155 (emacs_read, emacs_write): Remove check for negative size, as the
17156 Emacs source code has been audited now.
9587a89d
PE
17157 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17158 (emacs_read, emacs_write): Use it.
273a5f82
PE
17159 * process.c (send_process): Adjust to the new signatures of
17160 emacs_write and emacs_gnutls_write. Do not attempt to store
17161 a byte offset into an 'int'; it might overflow.
9587a89d 17162 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 17163
3e047f51
PE
17164 * sound.c: Don't assume sizes fit in 'int'.
17165 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 17166 Return EMACS_INT, not int.
3e047f51 17167 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
17168 Accept EMACS_INT, not int.
17169 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
17170 record read return values.
17171
cc39a9db
BK
171722011-04-15 Ben Key <bkey76@gmail.com>
17173
c9d0ec6d
JB
17174 * keyboard.c (Qundefined): Don't declare static since it is used
17175 in nsfns.m.
17176 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17177 static since they are used in nsfont.m.
cc39a9db 17178
6c60eb9f
SM
171792011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17180
17181 * process.c (Qprocessp): Don't declare static.
17182 * lisp.h (Qprocessp): Declare again.
17183
7990b61a
JB
171842011-04-15 Juanma Barranquero <lekktu@gmail.com>
17185
17186 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17187
5d4cb038
PE
171882011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17189
8bd7b830 17190 Improve C-level modularity by making more things 'static'.
cd64ea1d 17191
e3b27b31
PE
17192 Don't publish debugger-only interfaces to other modules.
17193 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17194 (verify_bytepos, count_markers): Move decls to the only modules
17195 that need them.
17196 * region-cache.h (pp_cache): Likewise.
17197 * window.h (check_all_windows): Likewise.
17198 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17199
5d4cb038
PE
17200 * sysdep.c (croak): Now static, if
17201 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17202 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
17203
17204 * alloc.c (refill_memory_reserve): Now static if
17205 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17206 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 17207
e87b6180
PE
17208 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17209 Define only if USE_LUCID.
17210
ac64929e
PE
17211 * xrdb.c (x_customization_string, x_rm_string): Now static.
17212
6f37259d
PE
17213 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17214 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17215
1683e3ab
PE
17216 * xdisp.c (draw_row_with_mouse_face): Now static.
17217 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17218
de9c2632
PE
17219 * window.h (check_all_windows): Mark externally visible.
17220
2b96acb7
PE
17221 * window.c (window_deletion_count): Now static.
17222
17223 * undo.c: Make symbols static if they're not exported.
17224 (last_undo_buffer, last_boundary_position, pending_boundary):
17225 Now static.
17226
50436f33
PE
17227 * textprop.c (interval_insert_behind_hooks): Now static.
17228 (interval_insert_in_front_hooks): Likewise.
17229
64520e5c
PE
17230 * term.c: Make symbols static if they're not exported.
17231 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17232 (max_frame_lines, tty_set_terminal_modes):
17233 (tty_reset_terminal_modes, tty_turn_off_highlight):
17234 (get_tty_terminal): Now static.
17235 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17236 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 17237 HAVE_WINDOW_SYSTEM.
64520e5c
PE
17238 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17239 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17240
1fa53021
PE
17241 * sysdep.c: Make symbols static if they're not exported.
17242 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17243 Now static.
17244 (sigprocmask_set, full_mask): Remove; unused.
17245 (wait_debugging): Mark as visible.
17246 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17247 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17248
d4b43b22
PE
17249 * syntax.c (syntax_temp): Define only if !__GNUC__.
17250
b7c513d0
PE
17251 * sound.c (current_sound_device, current_sound): Now static.
17252
989b29ad
PE
17253 * search.c (searchbufs, searchbuf_head): Now static.
17254
13a55a78
PE
17255 * scroll.c (scroll_cost): Remove; unused.
17256 * dispextern.h (scroll_cost): Remove decl.
17257
de68a1fc
PE
17258 * region-cache.h (pp_cache): Mark as externally visible.
17259
40ccffa6
PE
17260 * process.c: Make symbols static if they're not exported.
17261 (process_tick, update_tick, create_process, chan_process):
17262 (Vprocess_alist, proc_buffered_char, datagram_access):
17263 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17264 (deactivate_process): Mark defn as static, as well as decl.
17265 * lisp.h (create_process): Remove decl.
17266 * process.h (chan_process, Vprocess_alist): Remove decls.
17267
ad64fc97
PE
17268 * print.c: Make symbols static if they're not exported.
17269 (print_depth, new_backquote_output, being_printed, print_buffer):
17270 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17271 (print_interval, print_number_index, initial_stderr_stream):
17272 Now static.
17273 * lisp.h (Fprinc): Remove decl.
17274 (debug_output_compilation_hack): Mark as externally visible.
17275
adddb265
PE
17276 * sysdep.c (croak): Move decl from here to syssignal.h.
17277 * syssignal.h (croak): Put it here, so the API can be checked when
17278 'croak' is called from dissociate_if_controlling_tty.
17279
1717ede2
PE
17280 * minibuf.c: Make symbols static if they're not exported.
17281 (minibuf_save_list, choose_minibuf_frame): Now static.
17282 * lisp.h (choose_minibuf_frame): Remove decl.
17283
fa5fb2bc
PE
17284 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17285
1e3890d1
PE
17286 * lread.c: Make symbols static if they're not exported.
17287 (read_objects, initial_obarray, oblookup_last_bucket_number):
17288 Now static.
17289 (make_symbol): Remove; unused.
17290 * lisp.h (initial_obarray, make_symbol): Remove decls.
17291
8a1414fa
PE
17292 * keyboard.c: Make symbols static if they're not exported.
17293 (single_kboard, recent_keys_index, total_keys, recent_keys):
17294 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17295 (this_single_command_key_start, echoing, last_auto_save):
17296 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17297 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17298 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17299 (Vlispy_mouse_stem, double_click_count):
17300 Now static.
17301 (force_auto_save_soon): Define only if SIGDANGER.
17302 (ignore_mouse_drag_p): Now static if
17303 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17304 (print_help): Remove; unused.
17305 (stop_character, last_timer_event): Mark as externally visible.
17306 * keyboard.h (ignore_mouse_drag_p): Declare only if
17307 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17308 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17309 * lisp.h (echoing): Remove decl.
17310 (force_auto_save_soon): Declare only if SIGDANGER.
17311 * xdisp.c (redisplay_window): Simplify code, to make it more
17312 obvious that ignore_mouse_drag_p is not accessed if !defined
17313 USE_GTK && !defined HAVE_NS.
17314
93ea6e8f
PE
17315 * intervals.c: Make symbols static if they're not exported.
17316 (merge_properties_sticky, merge_interval_right, delete_interval):
17317 Now static.
17318 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17319
77382fcc
PE
17320 * insdel.c: Make symbols static if they're not exported.
17321 However, leave prepare_to_modify_buffer alone. It's never
17322 called from outside this function, but that appears to be a bug.
17323 (combine_after_change_list, combine_after_change_buffer):
4889fc82 17324 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
17325 (adjust_after_replace_noundo): Remove; unused.
17326 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 17327 (signal_before_change): Remove decls.
77382fcc 17328
9306c32e
PE
17329 * indent.c (val_compute_motion, val_vmotion): Now static.
17330
cd44d2eb
PE
17331 * image.c: Make symbols static if they're not exported.
17332 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17333 if USE_GTK.
17334 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17335 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17336
ad9a7a06
PE
17337 * fringe.c (standard_bitmaps): Now static.
17338 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17339
81626931
PE
17340 * frame.c: Make symbols static if they're not exported.
17341 (x_report_frame_params, make_terminal_frame): Now static.
17342 (get_frame_param): Now static, unless HAVE_NS.
17343 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17344 (x_get_resource_string): Remove; not used.
17345 * frame.h (make_terminal_frame, x_report_frame_params):
17346 (x_get_resource_string); Remove decls.
17347 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17348 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17349
239f9db9
PE
17350 * font.c, fontset.c: Make symbols static if they're not exported.
17351 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17352 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17353 * font.c (font_close_object): Now static.
17354 * font.h (font_close_object): Remove.
17355 * fontset.c (FONTSET_OBJLIST): Remove.
17356 (free_realized_fontset) #if-0 the body, which does nothing.
17357 (face_suitable_for_char_p): #if-0, as it's never called.
17358 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
17359 * xfaces.c (face_at_string_position):
17360 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
17361 since 0 is always ASCII.
17362
dfcf3579
PE
17363 * fns.c (weak_hash_tables): Now static.
17364
5045092b
PE
17365 * fileio.c: Make symbols static if they're not exported.
17366 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17367 (Vwrite_region_annotation_buffers): Now static.
17368
57a96f5c
PE
17369 * eval.c: Make symbols static if they're not exported.
17370 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17371 * lisp.h (backtrace_list): Remove decl.
17372
35f08c38
PE
17373 * emacs.c: Make symbols static if they're not exported.
17374 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17375 (fatal_error_code, fatal_error_signal_hook, standard_args):
17376 Now static.
17377 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17378 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17379 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17380 * lisp.h (fatal_error_signal_hook): Remove decl.
17381 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17382
f44bd759
PE
17383 * editfns.c: Move a (normally-unused) function to its only use.
17384 * editfns.c, lisp.h (get_operating_system_release): Remove.
17385 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17386 worth the hassle of breaking this out.
17387
b532497d
PE
17388 * xterm.c: Make symbols static if they're not exported.
17389 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17390 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17391 (x_destroy_window, x_delete_display):
17392 Now static.
17393 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17394 (x_mouse_leave): Remove; unused.
17395 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17396 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17397 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17398 Remove decls.
17399 (x_mouse_leave): Declare only if WINDOWSNT.
17400 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17401 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17402 USE_X_TOOLKIT.
17403
1675728f
PE
17404 * ftxfont.c: Make symbols static if they're not exported.
17405 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17406 HAVE_FREETYPE.
17407 * font.h (ftxfont_driver): Likewise.
17408
e4cebfca
PE
17409 * xfns.c: Make symbols static if they're not exported.
17410 (x_last_font_name, x_display_info_for_name):
17411 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17412 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17413 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17414 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17415 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17416 (last_show_tip_args): Now static.
17417 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17418 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17419 (x_screen_planes): Remove; unused.
17420 * dispextern.h (x_screen_planes): Remove decl.
17421
5bf46f05
PE
17422 * dispnew.c: Make symbols static if they're not exported.
17423 * dispextern.h (redraw_garbaged_frames, scrolling):
17424 (increment_row_positions): Remove.
17425 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17426 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17427 Now static.
17428 (redraw_garbaged_frames): Remove; unused.
17429
435f4c28
PE
17430 * xfaces.c: Make symbols static if they're not exported.
17431 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17432 Remove decls.
17433 * xterm.h (defined_color): Remove decls.
17434 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17435 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17436 (menu_face_changed_default, defined_color, free_realized_face):
17437 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17438 (ascii_face_of_lisp_face): Remove; unused.
17439
8524aef3
PE
17440 * xdisp.c: Make symbols static if they're not exported.
17441 * dispextern.h (scratch_glyph_row, window_box_edges):
17442 (glyph_to_pixel_coords, set_cursor_from_row):
17443 (get_next_display_element, set_iterator_to_next):
17444 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17445 (show_mouse_face): Remove decls
17446 * frame.h (message_buf_print): Likewise.
17447 * lisp.h (pop_message, set_message, check_point_in_composition):
17448 Likewise.
17449 * xterm.h (set_vertical_scroll_bar): Likewise.
17450 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17451 (message_buf_print, scratch_glyph_row, displayed_buffer):
17452 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17453 (get_next_display_element, show_mouse_face, window_box_edges):
17454 (frame_to_window_pixel_xy, check_point_in_composition):
17455 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17456 (glyph_to_pixel_coords): Remove; unused.
17457
16390cd2
PE
17458 * dired.c (file_name_completion): Now static.
17459
17460 * dbusbind.c (xd_in_read_queued_messages): Now static.
17461
a25f4dfa
PE
17462 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17463 * data.c (circular_list_error): Remove.
17464
14a9c8df
PE
17465 * commands.h (last_point_position, last_point_position_buffer):
17466 (last_point_position_window): Remove decls.
17467 * keyboard.c: Make these variables static.
17468
04f2d78b
CB
17469 * coding.h (coding, code_convert_region, encode_coding_gap):
17470 Remove decls.
74ab6df5
PE
17471 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17472 (iso_code_class, detect_coding, code_convert_region): Now static.
17473 (encode_coding_gap): Remove; unused.
17474
38dfbee1
PE
17475 * chartab.c (chartab_chars, chartab_bits): Now static.
17476
a2cb4e63
PE
17477 * charset.h (charset_iso_8859_1): Remove decl.
17478 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17479 Now static.
17480
127198fd
PE
17481 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17482 * ccl.c (Vccl_program_table): Now static.
17483 (check_ccl_update): Remove; unused.
17484
d85b608f
PE
17485 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17486 * category.h: ... from here.
17487 * category.c (check_category_table, set_category_set): Now static.
17488
31cd66f3
PE
17489 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17490 * lisp.h: Remove these decls.
17491
c358e587
PE
17492 * buffer.c (buffer_count): Remove unused var.
17493
e78aecca
PE
17494 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17495 so that it's not optimized away.
17496 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17497 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17498 exported only to the debugger.
17499
e192d7d3 17500 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 17501 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 17502
92470028
PE
17503 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17504 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17505 was inaccessible from Lisp.
17506 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17507 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17508
244ed907
PE
17509 alloc.c: Import and export fewer symbols, and remove unused items.
17510 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17511 is defined.
17512 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17513 it's not optimized away by whole-program optimization.
17514 (message_enable_multibyte, free_misc): Remove.
17515 (catchlist, handlerlist, mark_backtrace):
17516 Declare only if BYTE_MARK_STACK.
17517 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17518 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17519 (message_enable_multibyte): Remove decl.
17520 (free_misc, interval_free_list, float_block, float_block_index):
17521 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17522 (cons_free_list, last_marked_index):
17523 Now static.
17524 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17525 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17526 (mark_backtrace): Define only if BYTE_MARK_STACK.
17527 * xdisp.c (message_enable_multibyte): Now static.
17528
61c2b50e 17529 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17530 This makes it easier for human readers (and static analyzers)
17531 to see whether these variables are used from other modules.
17532 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17533 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17534 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17535 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17536 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17537 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17538 * xmenu.c, xselect.c:
17539 Declare Q* vars static if they are not used in other modules.
17540 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17541 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17542 Remove decls of unexported vars.
17543 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17544
95c82688
PE
17545 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17546
16a97296
PE
17547 Make Emacs functions such as Fatom 'static' by default.
17548 This makes it easier for human readers (and static analyzers)
17549 to see whether these functions can be called from other modules.
17550 DEFUN now defines a static function. To make the function external
17551 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17552 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17553 (Finit_image_library):
16a97296
PE
17554 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17555 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17556 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17557 Remove decls, since these functions are now static.
17558 (Funintern, Fget_internal_run_time): New decls, since these functions
17559 were already external.
95c82688 17560
16a97296
PE
17561 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17562 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17563 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17564 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17565 * keyboard.c, keymap.c, lread.c:
17566 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17567 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17568 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17569 Mark functions with DEFUE instead of DEFUN,
17570 if they are used in other modules.
17571 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17572 decls for now-static functions.
17573 * buffer.h (Fdelete_overlay): Remove decl.
17574 * callproc.c (Fgetenv_internal): Mark as internal.
17575 * composite.c (Fremove_list_of_text_properties): Remove decl.
17576 (Fcomposition_get_gstring): New forward static decl.
17577 * composite.h (Fcomposite_get_gstring): Remove decl.
17578 * dired.c (Ffile_attributes): New forward static decl.
17579 * doc.c (Fdocumntation_property): New forward static decl.
17580 * eval.c (Ffetch_bytecode): New forward static decl.
17581 (Funintern): Remove extern decl; now in .h file where it belongs.
17582 * fileio.c (Fmake_symbolic_link): New forward static decl.
17583 * image.c (Finit_image_library): New forward static decl.
17584 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17585 * intervals.h (Fprevious_property_change):
17586 (Fremove_list_of_text_properties): Remove decls.
17587 * keyboard.c (Fthis_command_keys): Remove decl.
17588 (Fcommand_execute): New forward static decl.
17589 * keymap.c (Flookup_key): New forward static decl.
17590 (Fcopy_keymap): Now static.
17591 * keymap.h (Flookup_key): Remove decl.
17592 * process.c (Fget_process): New forward static decl.
17593 (Fprocess_datagram_address): Mark as internal.
17594 * syntax.c (Fsyntax_table_p): New forward static decl.
17595 (skip_chars): Remove duplicate decl.
17596 * textprop.c (Fprevious_property_change): New forward static decl.
17597 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17598 Now internal.
17599 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17600 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17601
785bbd42
PE
17602 * editfns.c (Fformat): Remove unreachable code.
17603
8b913b57
AS
176042011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17605
17606 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17607 change. (Bug#8496)
17608
a6744a35
EZ
176092011-04-13 Eli Zaretskii <eliz@gnu.org>
17610
17611 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17612 when at ZV. (Bug#8487)
17613
e7974947
AS
176142011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17615
baad03f0
AS
17616 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17617 (Bug#8437)
17618 * keyboard.c (parse_tool_bar_item): Likewise.
17619 * sound.c (sound_cleanup, alsa_close): Likewise.
17620 * termcap.c (tgetent): Likewise.
17621 * xfns.c (x_default_font_parameter): Likewise.
17622 * xsettings.c (read_and_apply_settings): Likewise.
17623
e7974947
AS
17624 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17625 (overrun_check_free): Protoize.
17626
28272684
PE
176272011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17628
17629 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17630 since callers should never pass a negative size.
17631 Change the signature to match that of plain 'read' and 'write'; see
17632 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17633 * lisp.h: Update prototypes of emacs_write and emacs_read.
17634
11997c76
EZ
176352011-04-11 Eli Zaretskii <eliz@gnu.org>
17636
17637 * xdisp.c (redisplay_window): Don't try to determine the character
17638 position of the scroll margin if the window start point w->startp
e896f03c 17639 is outside the buffer's accessible region. (Bug#8468)
11997c76 17640
8a2cbd72
EZ
176412011-04-10 Eli Zaretskii <eliz@gnu.org>
17642
17643 Fix write-region and its subroutines for buffers > 2GB.
17644 * fileio.c (a_write, e_write): Modify declaration of arguments and
17645 local variables to support buffers larger than 2GB.
17646 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17647
17648 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17649 argument, local variables, and return value.
17650
17651 * lisp.h: Update prototypes of emacs_write and emacs_read.
17652
17653 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17654
4073e537 176552011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 17656
1ebfdcb6
PE
17657 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17658
b2ded58d
PE
17659 Fix more problems found by GCC 4.6.0's static checks.
17660
7d66342c
PE
17661 * xdisp.c (vmessage): Use a better test for character truncation.
17662
bbf47d44
PE
17663 * charset.c (load_charset_map): <, not <=, for optimization,
17664 and to avoid potential problems with integer overflow.
9248994d 17665 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 17666 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 17667 * editfns.c (Fformat): Likewise.
1e69125e 17668 * syntax.c (skip_chars): Likewise.
3befa583 17669
e3019616
PE
17670 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17671 This also lets GCC 4.6.0 generate slightly better loop code.
17672
becfa255
PE
17673 * callint.c (Fcall_interactively): <, not <=, for optimization.
17674 (Fcall_interactively): Count the number of arguments produced,
17675 not the number of arguments given. This is simpler and lets GCC
17676 4.6.0 generate slightly better code.
17677
dae0cd48
PE
17678 * ftfont.c: Distingish more carefully between FcChar8 and char.
17679 The previous code passed unsigned char * to a functions like
17680 strlen and xstrcasecmp that expect char *, which does not
17681 conform to the C standard.
17682 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17683 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17684 char * when the C standard requires it.
17685
76032d70
PE
17686 * keyboard.c (read_char): Remove unused var.
17687
eb3f1cc8
PE
17688 * eval.c: Port to Windows vsnprintf (Bug#8435).
17689 Include <limits.h>.
17690 (SIZE_MAX): Define if the headers do not.
17691 (verror): Do not give up if vsnprintf returns a negative count.
17692 Instead, grow the buffer. This ports to Windows vsnprintf, which
17693 does not conform to C99. Problem reported by Eli Zaretskii.
17694 Also, simplify the allocation scheme, by avoiding the need for
17695 calling realloc, and removing the ALLOCATED variable.
17696
70476b54
PE
17697 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17698
12020a9e
PE
17699 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17700 But keep the doprint source code for now, as we might revamp it
17701 and use it again (Bug#8435).
ea6c7ae6
PE
17702 * lisp.h (doprnt): Remove.
17703 * Makefile.in (base_obj): Remove doprnt.o.
17704 * deps.mk (doprnt.o): Remove.
17705
5fdb398c
PE
17706 error: Print 32- and 64-bit integers portably (Bug#8435).
17707 Without this change, on typical 64-bit hosts error ("...%d...", N)
17708 was used to print both 32- and 64-bit integers N, which relied on
17709 undefined behavior.
61bdb816 17710 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
17711 * lisp.h (error, verror): Mark as printf-like functions.
17712 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17713 Report overflow in size calculations when allocating printf buffer.
17714 Do not truncate output string at its first null byte.
17715 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17716 Truncate the output at a character boundary, since vsnprintf does not
17717 do that.
17718 * charset.c (check_iso_charset_parameter): Convert internal
17719 character to string before calling 'error', since %c now has the
17720 printf meaning.
17721 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17722 overflow when computing char to be passed to 'error'. Do not
17723 pass Lisp_Object to 'error'; pass the integer instead.
17724 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17725 formatted with plain %d.
17726
b189fa66
PE
17727 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17728
bff87ef0
PE
17729 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17730
7e2cac20
PE
17731 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17732
ce4d90b5
PE
17733 * xterm.c (x_catch_errors): Remove duplicate declaration.
17734
266c9547
PE
17735 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17736
79c49ad2
PE
17737 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17738
368f4090
JM
177392011-04-10 Jim Meyering <meyering@redhat.com>
17740
17741 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17742 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17743 return ssize_t not "int", and use size_t as the buffer length.
17744 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17745 * gnutls.h: Update declarations.
17746 * process.c (read_process_output): Use ssize_t, to match.
17747 (send_process): Likewise.
17748
a32d4040
CY
177492011-04-09 Chong Yidong <cyd@stupidchicken.com>
17750
17751 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17752
8546720e 177532011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 17754
04f2d78b
CB
17755 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17756 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 17757
8546720e
GM
17758 * xterm.c (handle_one_xevent):
17759 * xmenu.c (create_and_show_popup_menu):
17760 * xselect.c (x_decline_selection_request)
17761 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 17762
0a2f5c1a 177632011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
17764
17765 Fix some uses of `int' instead of EMACS_INT.
17766 * search.c (string_match_1, fast_string_match)
17767 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17768 (scan_buffer, find_next_newline_no_quit)
17769 (find_before_next_newline, search_command, Freplace_match)
17770 (Fmatch_data): Make some `int' variables be EMACS_INT.
17771
17772 * xdisp.c (display_count_lines): 3rd argument and return value now
17773 EMACS_INT. All callers changed.
17774 (pint2hrstr): Last argument is now EMACS_INT.
17775
17776 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17777 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17778 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17779 (decode_coding_utf_16, decode_coding_emacs_mule)
17780 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17781 (decode_coding_ccl, decode_coding_charset)
17782 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17783 (decode_coding_iso_2022, decode_coding_emacs_mule)
17784 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17785 <char_offset, last_offset>: Declare EMACS_INT.
17786 (encode_coding_utf_8, encode_coding_utf_16)
17787 (encode_coding_emacs_mule, encode_invocation_designation)
17788 (encode_designation_at_bol, encode_coding_iso_2022)
17789 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17790 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17791 Declare EMACS_INT.
17792 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17793 (encode_invocation_designation): Last argument P_NCHARS is now
17794 EMACS_INT.
17795 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17796 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17797
17798 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17799 All users changed.
17800
17801 * ccl.c (Fccl_execute_on_string): Declare some variables
17802 EMACS_INT.
17803
8546720e 178042011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
17805
17806 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17807
4e19a977
CS
178082011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17809
17810 * process.c (Fformat_network_address): Doc fix.
17811
87302331
R
178122011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17813
ee7683eb 17814 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 17815
cbb59342
CY
178162011-04-08 Chong Yidong <cyd@stupidchicken.com>
17817
17818 * keyboard.c (read_char): Call Lisp function help-form-show,
17819 instead of using internal_with_output_to_temp_buffer.
17820 (Qhelp_form_show): New var.
e0d38eeb 17821 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
17822
17823 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17824
17825 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17826
e67a13ab
CY
178272011-04-06 Chong Yidong <cyd@stupidchicken.com>
17828
04f2d78b
CB
17829 * process.c (Flist_processes): Remove to Lisp.
17830 (list_processes_1): Delete.
e67a13ab 17831
973f782d
EZ
178322011-04-06 Eli Zaretskii <eliz@gnu.org>
17833
7c106b1e
EZ
17834 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17835
973f782d
EZ
17836 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17837
41cf7d1a 178382011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 17839
ca23cc88
PE
17840 Fix more problems found by GCC 4.6.0's static checks.
17841
f390e2d5
PE
17842 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17843
42eea0d0
PE
17844 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17845
b69769da 17846 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 17847
f9541e84
PE
17848 * xdisp.c (vmessage): Mark as a printf-like function.
17849
13841b55
PE
17850 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17851
c136c10f
PE
17852 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17853
5e2d4a30
PE
17854 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17855 printf-like functions.
17856 (tiff_load): Add casts to remove these marks before passing them
17857 to system-supplied API.
17858
583f48b9
PE
17859 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17860
b25d760e
PE
17861 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17862 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
17863 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17864 directly, rather than having caller test rule sign. This avoids
17865 some unnecessary tests.
17866 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17867 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17868 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 17869
bc7b6697 17870 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 17871 (xfont_open): Avoid unnecessary tests.
bc7b6697 17872
27ccc379
PE
17873 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17874
dcd5c89a
PE
17875 * composite.h, composite.c (composition_gstring_put_cache):
17876 Use EMACS_INT, not int, for length.
17877
b13a45c6
PE
17878 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17879 breaking out part of COMPOSITION_DECODE_RULE.
17880 (COMPOSITION_DECODE_RULE): Use it.
17881 * composite.c (get_composition_id): Remove unused local vars,
17882 by using the new macro.
17883
1e792e4d
PE
17884 * textprop.c (set_text_properties_1): Change while to do-while,
17885 since the condition is always true at first.
17886
dc6c6455 17887 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
17888 (interval_deletion_adjustment): Return unsigned value.
17889 All uses changed.
dc6c6455 17890
aba7731a
PE
17891 * process.c (list_processes_1, create_pty, read_process_output):
17892 (exec_sentinel): Remove vars that were set but not used.
afd4052b 17893 (create_pty): Remove unnecessary "volatile"s.
bc57d757 17894 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 17895 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 17896 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 17897
fdfc4bf3
PE
17898 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17899
fca8fe46 17900 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 17901 (update_syntax_table): Use unsigned instead of int.
fca8fe46 17902
06a0259a 17903 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 17904 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 17905 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 17906
e7b9e80f
PE
17907 * print.c (print_error_message): Avoid int overflow.
17908
56201685
PE
17909 * font.c (font_list_entities): Redo for clarity,
17910 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17911
78834453 17912 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 17913 (font_score): Avoid potential overflow in diff calculation.
78834453 17914
0bc0b309 17915 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 17916 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 17917
e610eaca
PE
17918 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17919
b895abce
PE
17920 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17921 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17922 can always succeed if overflow has undefined behavior.
17923
1f1d9321 17924 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 17925 (wordify): Omit three unnecessary tests.
1f1d9321 17926
c59478bc
PE
17927 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17928 All callers changed. This avoids the need for an unused var.
17929
79b73827
PE
17930 * casefiddle.c (casify_region): Remove var that is set but not used.
17931
a4db5dfe
PE
17932 * dired.c (file_name_completion): Remove var that is set but not used.
17933
43aae36e
PE
17934 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17935
2a47c44d 17936 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 17937 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 17938
a37c69bf
PE
17939 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17940 Check for integer overflow on size calculations.
17941
328ab8e7
PE
17942 * buffer.c (Fprevious_overlay_change): Remove var that is set
17943 but not used.
17944
e5a2a5cb
PE
17945 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17946 Remove vars that are set but not used.
8d84a6eb 17947 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 17948 (timer_check_2): Mark vars as initialized.
e5a2a5cb 17949
a60e5f68
PE
17950 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17951
f661cb61 17952 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 17953 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 17954
f0397f5a
PE
17955 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17956 that are set but not used.
17957
8664db06 17958 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 17959 if XCreateBitmapFromData fails (Bug#8410).
8664db06 17960
6abdaa4a
PE
17961 * xselect.c (x_get_local_selection, x_handle_property_notify):
17962 Remove vars that are set but not used.
17963
0ce7538d 17964 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 17965 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 17966
9ae848fc
PE
17967 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17968 Remove var that is set but not used.
0b918413
PE
17969 (scroll_bar_windows_size): Now size_t, not int.
17970 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17971 Check for overflow.
9ae848fc 17972
a5a62657
PE
17973 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17974 (map_tty_color) [!defined MSDOS]: Likewise.
17975
5c5cdd39
PE
17976 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17977
66ebf983
PE
17978 * coding.c: Remove vars that are set but not used.
17979 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17980 All callers changed.
17981 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17982 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17983 (decode_coding_charset): Remove vars that are set but not used.
17984
1be4d761
PE
17985 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17986 that is set but not used.
17987
47553fa8
PE
17988 * print.c (print_object): Remove var that is set but not used.
17989
1f7196bf 17990 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
17991 The gnulib version avoids calling malloc in the usual case,
17992 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17993 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17994 * filelock.c (current_lock_owner): Likewise.
17995 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17996 * sysdep.c: Include allocator.h, careadlinkat.h.
17997 (emacs_no_realloc_allocator): New static constant.
17998 (emacs_readlink): New function.
fdb61804
PE
17999 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18000 ../lib/careadlinkat.h.
d1fdcab7 18001
f84c17c7
SM
180022011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18003
18004 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18005 first non-nil return value).
18006
ef3862ad
JD
180072011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18008
18009 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18010 if not defined (Bug#8403).
18011
376a7006
JB
180122011-04-02 Juanma Barranquero <lekktu@gmail.com>
18013
18014 * xdisp.c (display_count_lines): Remove parameter `start',
18015 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18016 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18017 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18018 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18019 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18020 and thereabouts. All callers changed.
18021 (get_per_char_metric): Remove parameter `f', unused since
18022 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18023
6ca3801d
JM
180242011-04-02 Jim Meyering <meyering@redhat.com>
18025
18026 do not dereference NULL upon failed strdup
18027 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18028 (ns_get_family): Likewise.
18029
d8e2b5ba
JB
180302011-04-02 Juanma Barranquero <lekktu@gmail.com>
18031
18032 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18033
8c74fcbd
JD
180342011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18035
18036 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18037 later (Bug#8403).
18038
7200d79c
SM
180392011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18040
03408648 18041 Add lexical binding.
7200d79c 18042
03408648
SM
18043 * window.c (Ftemp_output_buffer_show): New fun.
18044 (Fsave_window_excursion):
18045 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18046
18047 * lread.c (lisp_file_lexically_bound_p): New function.
18048 (Fload): Bind Qlexical_binding.
18049 (readevalloop): Remove `evalfun' arg.
18050 Bind Qinternal_interpreter_environment.
18051 (Feval_buffer): Bind Qlexical_binding.
18052 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18053 Mark as dynamic.
18054 (syms_of_lread): Declare `lexical-binding'.
18055
18056 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18057
18058 * keyboard.c (eval_dyn): New fun.
18059 (menu_item_eval_property): Use it.
ca105506
SM
18060
18061 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 18062
03408648
SM
18063 * fns.c (concat, mapcar1): Accept byte-code-functions.
18064
18065 * eval.c (Fsetq): Handle lexical vars.
18066 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18067 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18068 (FletX, Flet): Obey lexical binding.
18069 (Fcommandp): Handle closures.
18070 (Feval): New `lexical' arg.
18071 (eval_sub): New function extracted from Feval. Use it almost
18072 everywhere where Feval was used. Look up vars in lexical env.
18073 Handle closures.
18074 (Ffunctionp): Move from subr.el.
18075 (Ffuncall): Handle closures.
18076 (apply_lambda): Remove `eval_flags'.
18077 (funcall_lambda): Handle closures and new byte-code-functions.
18078 (Fspecial_variable_p): New function.
18079 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18080 but without exporting it to Lisp.
23aba0ea 18081
23aba0ea 18082 * doc.c (Fdocumentation, store_function_docstring):
03408648 18083 * data.c (Finteractive_form): Handle closures.
23aba0ea 18084
03408648
SM
18085 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18086 interactive spec.
ba83908c 18087
04f2d78b
CB
18088 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18089 New byte-codes.
03408648
SM
18090 (exec_byte_code): New function extracted from Fbyte_code to handle new
18091 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 18092
03408648 18093 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 18094
03408648 18095 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 18096
e2abce01
JB
180972011-03-31 Juanma Barranquero <lekktu@gmail.com>
18098
18099 * xdisp.c (redisplay_internal): Fix prototype.
18100
63696a73 181012011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 18102
63696a73 18103 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
18104 (try_scrolling): Use it when setting scroll_limit.
18105 Limit scrolling to 100 screen lines.
63696a73
EZ
18106 (redisplay_window): Even when falling back on "recentering",
18107 position point in the window according to scroll-conservatively,
18108 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18109
18110 (try_scrolling): When point is above the window, allow searching
18111 as far as scroll_max, or one screenful, to compute vertical
18112 distance from PT to the scroll margin position. This prevents
18113 try_scrolling from unnecessarily failing when
18114 scroll-conservatively is set to a value slightly larger than the
18115 window height. Clean up the case of PT below the margin at bottom
18116 of window: scroll_max can no longer be INT_MAX. When aggressive
18117 scrolling is in use, don't let point enter the opposite scroll
18118 margin as result of the scroll.
18119 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
18120 threshold of 100 lines for never-recentering scrolling.
18121
e4cc2dfc
JB
181222011-03-31 Juanma Barranquero <lekktu@gmail.com>
18123
18124 * dispextern.h (move_it_by_lines):
18125 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18126 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18127 (message_log_check_duplicate): Remove parameters `prev_bol' and
18128 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18129 (redisplay_internal): Remove parameter `preserve_echo_area',
18130 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18131
18132 * indent.c (Fvertical_motion):
18133 * window.c (window_scroll_pixel_based, Frecenter):
18134 Don't pass `need_y_p' to `move_it_by_lines'.
18135
1c470562
SM
181362011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18137
44f230aa
SM
18138 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18139 steal a few bits to be more compact.
18140 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18141 Remove unneeded casts.
18142
1c470562
SM
18143 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18144
888adce9
ZK
181452011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18146
18147 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18148 binding" message (bug#7967).
18149
f838ed7b
PE
181502011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18151
77861b95
PE
18152 Fix more problems found by GCC 4.6.0's static checks.
18153
de6dbc14
PE
18154 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18155 Remove unused local var.
18156
f838ed7b
PE
18157 * editfns.c (Fmessage_box): Remove unused local var.
18158
792c7b2b
PE
18159 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18160 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18161 Omit unused local vars.
c499e557 18162 * window.c (shrink_windows): Omit unused local var.
b01a1c29 18163 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
18164 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18165 Omit unused local var.
18166
ba0165e1
PE
18167 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18168 Don't assume string length fits in int.
32ad8845 18169 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 18170 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 18171
3c59b4c9
PE
18172 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18173 instead of alloca (Bug#8344).
18174
a3eed478 18175 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 18176 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 18177
eb4d412d
PE
18178 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18179
1658b401
PE
18180 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18181 concerns.
18182
18183 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18184
18185 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 18186
9a2c6e05
PE
18187 * keyboard.c (syms_of_keyboard): Use the same style as later
18188 in this function when indexing through an array. This also
18189 works around GCC bug 48267.
18190
03d0a109
PE
18191 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18192
44f730c8
PE
18193 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18194
fe75f926
PE
18195 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18196 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18197
ffa8c828
PE
18198 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18199 This avoids undefined behavior on integer overflow, and is a bit
18200 more convenient anyway since it is compared to a size_t variable.
18201
c5101a77
PE
18202 Variadic C functions now count arguments with size_t, not int.
18203 This avoids an unnecessary limitation on 64-bit machines, which
18204 caused (substring ...) to crash on large vectors (Bug#8344).
18205 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18206 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 18207 All variadic functions and their callers changed accordingly.
c5101a77
PE
18208 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18209 * data.c (arith_driver, float_arith_driver): Likewise.
18210 * editfns.c (general_insert_function): Likewise.
18211 * eval.c (struct backtrace.nargs, interactive_p)
18212 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18213 (funcall_lambda, mark_backtrace): Likewise.
18214 * fns.c (concat): Likewise.
18215 * frame.c (x_set_frame_parameters): Likewise.
18216 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18217 0 if not found, not -1. All callers changed.
18218
dd3f25f7
PE
18219 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18220 (stack_copy_size): Now size_t, not int.
18221 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18222
461c2ab9
JB
182232011-03-28 Juanma Barranquero <lekktu@gmail.com>
18224
18225 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18226 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18227 All callers changed.
18228
18229 * lisp.h (multibyte_char_to_unibyte):
18230 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18231 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18232 * character.h (CHAR_TO_BYTE8):
18233 * cmds.c (internal_self_insert):
18234 * editfns.c (general_insert_function):
18235 * keymap.c (push_key_description):
18236 * search.c (Freplace_match):
18237 * xdisp.c (message_dolog, set_message_1): All callers changed.
18238
f6d62986
SM
182392011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18240
18241 * keyboard.c (safe_run_hook_funcall): New function.
18242 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18243 don't set the hook to nil, but remove the offending function instead.
18244 (Qcommand_hook_internal): Remove, unused.
18245 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18246 Vcommand_hook_internal.
18247
18248 * eval.c (enum run_hooks_condition): Remove.
18249 (funcall_nil, funcall_not): New functions.
18250 (run_hook_with_args): Call each function through a `funcall' argument.
18251 Remove `cond' argument, now redundant.
18252 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18253 (Frun_hook_with_args_until_failure): Adjust accordingly.
18254 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18255
1db5b1ad
JB
182562011-03-28 Juanma Barranquero <lekktu@gmail.com>
18257
18258 * dispextern.h (string_buffer_position): Remove declaration.
18259
18260 * print.c (strout): Remove parameter `multibyte', unused since
18261 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18262
18263 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18264 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18265 All callers changed.
18266
18267 * w32.c (_wsa_errlist): Use braces for struct initializers.
18268
18269 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18270 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18271 All callers changed.
18272 (string_buffer_position): Likewise. Also, make static (it's never
18273 used outside xdisp.c).
18274 (cursor_row_p): Remove parameter `w', unused since
18275 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18276 (decode_mode_spec): Remove parameter `precision', introduced during
18277 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18278 All callers changed.
18279
5ffb62aa
JD
182802011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18281
18282 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18283
461c2ab9 182842011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
18285
18286 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18287 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18288 (ns_update_auto_hide_menu_bar): New functions.
18289 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18290 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18291 ns_constrain_all_frames.
18292 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18293 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18294
5c380ffb
JD
182952011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18296
18297 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18298
9af30bdf
GM
182992011-03-27 Glenn Morris <rgm@gnu.org>
18300
18301 * syssignal.h: Replace RETSIGTYPE with void.
18302 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18303 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18304 Replace SIGTYPE with void everywhere.
18305 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18306 * s/template.h (SIGTYPE): Remove commented out definition.
18307
e2abce01
JB
183082011-03-26 Eli Zaretskii <eliz@gnu.org>
18309
18310 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18311 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18312
f868cd8a
JB
183132011-03-26 Juanma Barranquero <lekktu@gmail.com>
18314
59eb0929
JB
18315 * w32.c (read_unc_volume): Use parameter `henum', instead of
18316 global variable `wget_enum_handle'.
18317
18318 * keymap.c (describe_vector): Remove parameters `indices' and
18319 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18320 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18321
f868cd8a
JB
18322 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18323
18324 * keyboard.c (timer_check): Remove parameter `do_it_now',
18325 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18326 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18327 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18328
18329 * keyboard.c (read_char):
18330 * w32menu.c (w32_menu_display_help):
18331 * xmenu.c (show_help_event, menu_help_callback):
18332 Adjust calls to `show_help_echo'.
18333
18334 * gtkutil.c (xg_maybe_add_timer):
18335 * keyboard.c (readable_events):
18336 * process.c (wait_reading_process_output):
18337 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18338
18339 * insdel.c (adjust_markers_gap_motion):
18340 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18341 (gap_left, gap_right): Don't call it.
18342
2ecf6fdb
CY
183432011-03-25 Chong Yidong <cyd@stupidchicken.com>
18344
18345 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18346 incurred during fontification.
18347
6b1f9ba4
JB
183482011-03-25 Juanma Barranquero <lekktu@gmail.com>
18349
18350 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18351 (DEFVAR_PER_BUFFER): Don't pass it.
18352
18353 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18354 (scrolling_window): Don't pass it.
18355
0f4a96b5
JB
183562011-03-25 Juanma Barranquero <lekktu@gmail.com>
18357
18358 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18359
18360 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18361 and `suffix'.
18362 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18363 of variables specific to SELinux and computation of `encoded_absname'.
18364
18365 * image.c (XPutPixel): Remove unused variable `height'.
18366
18367 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18368
18369 * unexw32.c (get_section_info): Remove unused variable `section'.
18370
18371 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18372 (system_process_attributes): Remove unused variable `sess'.
18373 (sys_read): Remove unused variable `err'.
18374
18375 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18376 (w32_wnd_proc): Remove unused variable `isdead'.
18377 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18378 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18379 (x_create_tip_frame): Remove unused variable `tem'.
18380
18381 * w32inevt.c (w32_console_read_socket):
18382 Remove unused variable `no_events'.
18383
18384 * w32term.c (x_draw_composite_glyph_string_foreground):
18385 Remove unused variable `width'.
18386
1149507c
JB
183872011-03-24 Juanma Barranquero <lekktu@gmail.com>
18388
18389 * w32term.c (x_set_glyph_string_clipping):
18390 Don't pass uninitialized region to CombineRgn.
18391
9c88f339
JB
183922011-03-23 Juanma Barranquero <lekktu@gmail.com>
18393
18394 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18395 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18396 (Fx_close_connection): Remove unused variable `i'.
18397
18398 * w32font.c (w32font_draw): Return number of glyphs.
18399 (w32font_open_internal): Remove unused variable `i'.
18400 (w32font_driver): Add missing initializer.
18401
18402 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18403 (fill_in_menu): Remove unused variable `items_added'.
18404
18405 * w32term.c (last_mouse_press_frame): Remove static global variable.
18406 (w32_clip_to_row): Remove unused variable `f'.
18407 (x_delete_terminal): Remove unused variable `i'.
18408
18409 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18410 (NOTHING): Remove unused static global variable.
18411 (uniscribe_check_otf): Remove unused variable `table'.
18412 (uniscribe_font_driver): Add missing initializers.
18413
dee091a3
JD
184142011-03-23 Julien Danjou <julien@danjou.info>
18415
18416 * term.c (Fsuspend_tty, Fresume_tty):
18417 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18418 * window.c (temp_output_buffer_show):
18419 * insdel.c (signal_before_change):
18420 * frame.c (Fhandle_switch_frame):
18421 * fileio.c (Fdo_auto_save):
18422 * emacs.c (Fkill_emacs):
18423 * editfns.c (save_excursion_restore):
18424 * cmds.c (internal_self_insert):
18425 * callint.c (Fcall_interactively):
18426 * buffer.c (Fkill_all_local_variables):
18427 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18428 Use Frun_hooks.
0f4a96b5 18429 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 18430 unconditionally since it does the check itself.
dee091a3 18431
2c520ab5 184322011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 18433
c9c49752
PE
18434 Fix more problems found by GCC 4.5.2's static checks.
18435
8abc3f12
PE
18436 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18437 the first time through the loop, since we know p0 < p1 then.
18438 This also avoids a gcc -Wstrict-overflow warning.
18439
a2d26660
PE
18440 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18441 leading to a memory leak, possible in functions like
18442 load_charset_map_from_file that can allocate an unbounded number
b12ef411 18443 of objects (Bug#8318).
a2d26660 18444
916c72e9
PE
18445 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18446 that could (at least in theory) be that large.
18447
19ab8a18
PE
18448 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18449 This is less likely to overflow, and avoids undefined behavior if
18450 overflow does occur. All callers changed. Use strtoul to scan
18451 for the unsigned long integer.
b7cbbd6f
PE
18452 (pint2hrstr): Simplify and tune code slightly.
18453 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 18454
f0641eff
PE
18455 * scroll.c (do_scrolling): Work around GCC bug 48228.
18456 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18457
7f650bb9
PE
18458 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18459 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
18460 (validate_x_resource_name): Simplify count usage.
18461 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 18462
37dd57d1
PE
18463 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18464 fail (Bug#8306).
81e56e61 18465
699979fc 18466 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 18467
401bf9b4
PE
18468 * process.c (Fmake_network_process): Use socklen_t, not int,
18469 where POSIX says socklen_t is required in portable programs.
18470 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 18471 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
18472 (Fmake_network_process, server_accept_connection):
18473 (wait_reading_process_output, read_process_output):
18474 Likewise.
18475
b93aacde
PE
18476 * process.c: Rename or move locals to avoid shadowing.
18477 (list_processes_1, Fmake_network_process):
18478 (read_process_output_error_handler, exec_sentinel_error_handler):
18479 Rename or move locals.
4dc343ee 18480 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 18481 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 18482 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 18483 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 18484 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 18485
af8a867c 18486 Make tparam.h and terminfo.c consistent.
44f230aa
SM
18487 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18488 Include tparam.h instead, since it declares them.
af8a867c
PE
18489 * cm.h (PC): Remove extern decl; tparam.h now does this.
18490 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18491 * terminfo.c: Include tparam.h, to check interfaces.
18492 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18493 (tparam): Adjust signature to match interface in tparam.h;
18494 this removes some undefined behavior. Check that outstring and len
18495 are zero, which they always are with Emacs.
18496 * tparam.h (PC, BC, UP): New extern decls.
18497
0248044d 18498 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 18499 (xftfont_open): Rename locals to avoid shadowing.
0248044d 18500
8ff096c1 18501 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
18502 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18503 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 18504 (ftfont_list): Remove unused local.
49eaafba
PE
18505 (get_adstyle_property, ftfont_pattern_entity):
18506 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18507 Rename locals to avoid shadowing.
8ff096c1 18508
e2be39f6
PE
18509 * xfont.c (xfont_list_family): Mark var as initialized.
18510
c9735e30
PE
18511 * xml.c (make_dom): Now static.
18512
8f5201ae
PE
18513 * composite.c (composition_compute_stop_pos): Rename local to
18514 avoid shadowing.
b246f932
PE
18515 (composition_reseat_it): Remove unused locals.
18516 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 18517 (composition_update_it): Mark var as initialized.
11b61122
PE
18518 (find_automatic_composition): Mark vars as initialized,
18519 with a FIXME (Bug#8290).
8f5201ae 18520
760fbc2c
PE
18521 character.h: Rename locals to avoid shadowing.
18522 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18523 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18524 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18525 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18526 to avoid shadowing.
18527
ff08eb85
PE
18528 * textprop.c (property_change_between_p): Remove; unused.
18529
fc7bf025
PE
18530 * intervals.c (interval_start_pos): Now static.
18531
235d7abc
PE
18532 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18533
44f230aa
SM
18534 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18535 Rename locals to avoid shadowing.
3e7d6594 18536
50060332
PE
18537 * sound.c (wav_play, au_play, Fplay_sound_internal):
18538 Fix pointer signedness.
d01f234b 18539 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18540 (wav_play): Initialize a variable to 0, to prevent undefined
18541 behavior (Bug#8278).
50060332 18542
c4fc4e30
PE
18543 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18544
918436ed
PE
18545 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18546
c939f91b
PE
18547 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18548 clobbering (Bug#8298).
b9c7f648
PE
18549 * sysdep.c (sys_subshell): Likewise.
18550 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18551
6bd8c144
PE
18552 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18553 This should get cleaned up, so that child_setup has the
18554 same signature on all platforms.
18555
7710357c 18556 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18557 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18558
c59da222
CY
185592011-03-22 Chong Yidong <cyd@stupidchicken.com>
18560
18561 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18562 not to be necessary, and produces flickering.
18563
66b87493
GM
185642011-03-20 Glenn Morris <rgm@gnu.org>
18565
18566 * config.in: Remove file.
18567
45b6f6d5
JB
185682011-03-20 Juanma Barranquero <lekktu@gmail.com>
18569
18570 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18571 are now in src/globals.h.
18572 (syms_of_minibuf): Remove spurious & from previous change.
18573
cd394be1 185742011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18575
18576 * minibuf.c (completing-read-function): New variable.
18577 (completing-read-default): Rename from completing-read.
18578 (completing-read): Call completing-read-function.
18579
b14e3e21
CY
185802011-03-19 Juanma Barranquero <lekktu@gmail.com>
18581
18582 * xfaces.c (Fx_load_color_file):
18583 Read color file from absolute filename (bug#8250).
18584
f2b726e6
JB
185852011-03-19 Juanma Barranquero <lekktu@gmail.com>
18586
18587 * makefile.w32-in: Update dependencies.
18588
09f6ff02
EZ
185892011-03-17 Eli Zaretskii <eliz@gnu.org>
18590
18591 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18592
29a6015a
PE
185932011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18594
a3a6c54e
PE
18595 Fix more problems found by GCC 4.5.2's static checks.
18596
b766f867
PE
18597 * process.c (make_serial_process_unwind, send_process_trap):
18598 (sigchld_handler): Now static.
18599
be02381c
PE
18600 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18601 That way, the code declares only the vars that it needs.
18602 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18603 * s/cygwin.h (PTY_ITERATION): Likewise.
18604 * s/darwin.h (PTY_ITERATION): Likewise.
18605 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18606
57048744
PE
18607 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18608 * process.c (allocate_pty): Don't declare stb unless it's needed.
18609
7914961c 18610 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18611 (CONSTANTLIM): Remove; unused.
18612 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18613 Define only if needed.
7914961c 18614
b3967b18
PE
18615 * unexelf.c (unexec): Name an expression,
18616 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
18617 Use a different way to cause a compilation error if anyone uses
18618 n rather than nn, a way that does not involve shadowing.
73366a00 18619 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 18620
29a6015a
PE
18621 * deps.mk (unexalpha.o): Remove; unused.
18622
43cfc33e 18623 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 18624 * unexec.h: New file.
ce701a33
PE
18625 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18626 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18627 Depend on unexec.h.
18628 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18629 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18630 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 18631 Change as necessary to match prototype in unexec.h.
ce701a33 18632
01f44d5a
PE
18633 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18634 shadowing.
4f63c6bb 18635 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 18636
a6670b0b
PE
18637 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18638 Rename locals to avoid shadowing.
18639
cef2010d 18640 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 18641 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 18642
d4d7173a
PE
18643 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18644
f08b802a
PE
18645 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18646 warning when compiling print.c.
18647
3ddb0639
PE
18648 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18649 instead of using an uninitialized var.
5ad03b97 18650 (font_sort_entities): Mark var as initialized.
3ddb0639 18651
170a2692
PE
18652 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18653
e663c700
PE
18654 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18655 pointers to constants.
89bc529a 18656 (font_parse_fcname): Remove unused vars.
7b81e2d0 18657 (font_delete_unmatched): Now static.
ea838e10 18658 (font_get_spec): Remove; unused.
13a547c6
PE
18659 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18660 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18661 Rename or move locals to avoid shadowing.
e663c700 18662
2a80c887 18663 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 18664 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 18665
1384fa33 18666 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 18667 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 18668
8b2c52e9
PE
18669 * alloc.c (mark_backtrace): Move decl from here ...
18670 * lisp.h: ... to here, so that it can be checked.
18671
475545b5 18672 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 18673 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
18674 (lisp_indirect_variable): Name an expression,
18675 to avoid gcc -Wbad-function-cast warning.
1faed8ae 18676 (Fdefvar): Rename locals to avoid shadowing.
475545b5 18677
b1349114 18678 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 18679 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 18680 Use const pointer when appropriate.
b1349114 18681
a2928364
PE
18682 * lisp.h (get_system_name, get_operating_system_release):
18683 Move decls here, to check interfaces.
18684 * process.c (get_operating_system_release): Move decl to lisp.h.
18685 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
18686 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18687 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18688 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
18689 (Fformat_time_string, Fencode_time, Finsert_char):
18690 (Ftranslate_region_internal, Fformat):
18691 Rename or remove local vars to avoid shadowing.
9710023e 18692 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 18693
a415e694
PE
18694 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18695 avoid shadowing.
18696
8ef4622d
PE
18697 * lisp.h (eassert): Check that the argument compiles, even if
18698 ENABLE_CHECKING is not defined.
18699
946f9a5b
PE
18700 * data.c (Findirect_variable): Name an expression, to avoid
18701 gcc -Wbad-function-cast warning.
112396d6 18702 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 18703 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
18704 (Fmake_variable_buffer_local, Fmake_local_variable):
18705 Mark variables as initialized.
52746918 18706 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 18707
e5aab7e7 18708 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
18709 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18710 Rename locals to avoid shadowing.
dff45157
PE
18711 (mark_stack): Move local variables into the #ifdef region where
18712 they're used.
7bc26fdb
PE
18713 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18714 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18715 needed otherwise.
18716 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18717 (GC_STRING_CHARS): Remove; not used.
d40d4be1 18718 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 18719
e5aab7e7
PE
18720 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18721 avoids undefined behavior in theory.
18722
4da60324
PE
18723 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18724
88043301
PE
18725 Use functions, not macros, for up- and down-casing (Bug#8254).
18726 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18727 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18728 to use the following functions instead of these macros.
18729 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18730 EMACS_INT, since callers assume the returned value fits in int.
18731 (upcase1): Likewise, for UPCASE_TABLE.
18732 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 18733 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 18734 the race-condition problem in the old DOWNCASE.
88043301 18735
19ed5445
PE
18736 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18737 Rename locals to avoid shadowing.
18738 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
18739 (regex_compile, re_search_2, re_match_2_internal):
18740 Remove unused local vars.
952db0d7
PE
18741 (FREE_VAR): Rewrite so as not to use empty "else",
18742 which gcc can warn about.
da053e48 18743 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
18744 (RETALLOC_IF): Define only if needed.
18745 (WORDCHAR_P): Likewise. This one is never needed, but is used
18746 only in a comment talking about a compiler bug, so put inside
18747 the #if 0 of that comment.
18748 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18749 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18750 Remove; unused.
19ed5445 18751
1f3561e4 18752 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
18753 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18754 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 18755
ded6f8f7
PE
18756 * search.c (simple_search): Remove unused var.
18757
dbd37a95
PE
18758 * dired.c (compile_pattern): Move decl from here ...
18759 * lisp.h: ... to here, so that it can be checked.
18760 (struct re_registers): New forward decl.
18761
7e47afad
PE
18762 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18763
85f24f61
PE
18764 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18765 All uses changed.
18766 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18767 Rename locals to avoid shadowing.
5671df8f 18768 (Fvertical_motion): Mark locals as initialized.
85f24f61 18769
181aa2be 18770 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 18771 (casify_region): Mark local as initialized.
181aa2be 18772
930d429c
PE
18773 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18774
7082eac6
PE
18775 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18776 New macros, so that the caller can use some names other than
18777 gcpro1, gcpro2, etc.
18778 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18779 of the new macros.
18780 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18781 argument, for consistency with GCPRO2_VAR, etc: it is now the
18782 prefix of the variable, not the variable itself. All uses
18783 changed.
38b2c076
PE
18784 * dired.c (directory_files_internal, file_name_completion):
18785 Rename locals to avoid shadowing.
18786
15206ed9
PE
18787 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18788 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18789 dired.c's scmp function, had undefined behavior.
18790 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18791 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18792 * buffer.h: ... to here, because these macros use current_buffer,
18793 and the new implementation with inline functions needs to have
18794 current_buffer in scope now, rather than later when the macros
18795 are used.
18796 (downcase, upcase1): New static inline functions.
18797 (DOWNCASE, UPCASE1): Reimplement using these functions.
18798 This avoids undefined behavior in expressions like
18799 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18800 from race conditions in accessing the global variables
18801 case_temp1 and case_temp2.
18802 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18803 * lisp.h (case_temp1, case_temp2): Remove their decls.
18804 * character.h (ASCII_CHAR_P): Move from here ...
18805 * lisp.h: ... to here, so that the inline functions mentioned
18806 above can use them.
18807
4a6bea26
PE
18808 * dired.c (directory_files_internal_unwind): Now static.
18809
f14b7e14
PE
18810 * fileio.c (file_name_as_directory, directory_file_name):
18811 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18812 Now static.
2893f146
PE
18813 (file_name_as_directory): Use const pointers when appropriate.
18814 (Fexpand_file_name): Likewise. In particular, newdir might
18815 point at constant storage, so make it a const pointer.
fd4ead52 18816 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
18817 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18818 signedness issues.
f839df0c
PE
18819 (Fset_file_times, Finsert_file_contents, auto_save_error):
18820 Rename locals to avoid shadowing.
f14b7e14 18821
5716756e 18822 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
18823 (Ftry_completion, Fall_completions): Rename or remove locals
18824 to avoid shadowing.
5716756e 18825
b4c3046a
PE
18826 * marker.c (bytepos_to_charpos): Remove; unused.
18827
b45db522
PE
18828 * lisp.h (verify_bytepos, count_markers): New decls,
18829 so that gcc does not warn that these functions aren't declared.
18830
85876d07
PE
18831 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18832 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 18833 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 18834 (copy_text): Remove unused local var.
85876d07 18835
03d78a21 18836 * filelock.c (within_one_second): Now static.
b3dd38ab 18837 (lock_file_1): Rename local to avoid shadowing.
03d78a21 18838
5df8f01b
PE
18839 * buffer.c (fix_overlays_before): Mark locals as initialized.
18840 (fix_start_end_in_overlays): Likewise. This function should be
18841 simplified by using pointers-to-pointers, but that's a different
18842 matter.
b1d876f1 18843 (switch_to_buffer_1): Now static.
8f54f30a
PE
18844 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18845 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 18846
a70072c9 18847 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 18848 Fix pointer signedness issue.
edced198
PE
18849 (sys_subshell): Mark local as volatile if checking for lint,
18850 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 18851 (MAXPATHLEN): Define only if needed.
a70072c9 18852
a0977c44
PE
18853 * process.c (serial_open, serial_configure): Move decls from here ...
18854 * systty.h: ... to here, so that they can be checked.
18855
a884fdcc
PE
18856 * fns.c (get_random, seed_random): Move extern decls from here ...
18857 * lisp.h: ... to here, so that they can be checked.
18858
604efe86 18859 * sysdep.c (reset_io): Now static.
b8950c94 18860 (wait_for_termination_signal): Remove; unused.
604efe86 18861
38fc62d9
PE
18862 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18863 (copy_keymap_item, append_key, push_text_char_description):
18864 Now static.
1004a21a 18865 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 18866 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
18867 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18868 (describe_map_tree):
18869 Rename locals to avoid shadowing.
38fc62d9 18870
2f2650da
PE
18871 * keyboard.c: Declare functions static if they are not used elsewhere.
18872 (echo_char, echo_dash, cmd_error, top_level_2):
18873 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
18874 (read_char, kbd_buffer_get_event, make_lispy_position):
18875 (make_lispy_event, make_lispy_movement, apply_modifiers):
18876 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18877 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18878 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 18879 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 18880 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 18881
a053e86c 18882 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
18883 (mark_kboards): Move decl here ...
18884 * alloc.c (mark_kboards): ... from here.
a053e86c 18885
4752793e
PE
18886 * lisp.h (force_auto_save_soon): New decl.
18887
74f10ca7 18888 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
18889 (DEFINE_DUMMY_FUNCTION): New macro.
18890 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18891 Use it.
c03cd23f
PE
18892 (main): Add casts to avoid warnings
18893 if GCC considers string literals to be constants.
74f10ca7 18894
022e70d4
PE
18895 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18896
59d6fe83
PE
18897 * dbusbind.c: Pointer signedness fixes.
18898 (xd_signature, xd_append_arg, xd_initialize):
18899 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18900 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18901 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18902 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18903
78320123
PE
18904 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18905 if GCC considers string literals to be constants.
49cebcca 18906 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 18907
35ac2a97
SM
189082011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18909
fb103ca9
SM
18910 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18911 (print_preprocess, print_object): New macro to fix last change.
18912
35ac2a97
SM
18913 * print.c (print_preprocess): Don't forget font objects.
18914
62973b41
JB
189152011-03-16 Juanma Barranquero <lekktu@gmail.com>
18916
18917 * emacs.c (USAGE3): Doc fixes.
18918
0e48bb22
AS
189192011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18920
18921 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18922 structure.
18923
7684e57b
JB
189242011-03-14 Juanma Barranquero <lekktu@gmail.com>
18925
18926 * lisp.h (VWindow_system, Qfile_name_history):
18927 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18928 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18929 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18930
18931 * w32select.c: Don't #include "keyboard.h".
c96bbc66 18932 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
18933
18934 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18935 * w32console.c (detect_input_pending, read_input_pending)
18936 (encode_terminal_code):
18937 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18938 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18939 (w32_system_caret_y, Qfile_name_history):
18940 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18941 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18942 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18943 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18944 * w32proc.c (Qlocal, report_file_error):
18945 * w32term.c (Vwindow_system, updating_frame):
18946 * w32uniscribe.c (initialized, uniscribe_font_driver):
18947 Remove unneeded extern declarations.
18948
2aa46d6c
CY
189492011-03-14 Chong Yidong <cyd@stupidchicken.com>
18950
c96bbc66 18951 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 18952
cffc6f3b
CY
189532011-03-13 Chong Yidong <cyd@stupidchicken.com>
18954
18955 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18956 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18957 These macros can no longer be used for assignment.
18958
44f230aa
SM
18959 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18960 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
18961 (record_buffer_markers, fetch_buffer_markers): New functions for
18962 recording and fetching special buffer markers.
18963 (set_buffer_internal_1, set_buffer_temp): Use them.
18964
18965 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18966
18967 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18968
18969 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18970 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18971
18972 * xdisp.c (hscroll_window_tree):
18973 (reconsider_clip_changes): Use PT instead of BUF_PT.
18974
d251f04b
EZ
189752011-03-13 Eli Zaretskii <eliz@gnu.org>
18976
18977 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18978 $(EMACS_ROOT)/lib/intprops.h.
18979
f0c77cd1
PE
189802011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18981
3eca4629
PE
18982 Fix more problems found by GCC 4.5.2's static checks.
18983
7c86ee98
PE
18984 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18985 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
18986 (xg_free_frame_widgets): Make it clear that a local variable is
18987 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
18988 (gdk_window_get_screen): Make it clear that this macro is needed
18989 only if USE_GTK_TOOLTIP.
1e5524e7
PE
18990 (int_gtk_range_get_value): New function, which avoids a diagnostic
18991 from gcc -Wbad-function-cast.
18992 (xg_set_toolkit_scroll_bar_thumb): Use it.
18993 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18994 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
18995 (get_utf8_string, xg_get_file_with_chooser):
18996 Rename locals to avoid shadowing.
18997 (create_dialog): Move locals to avoid shadowing.
7c86ee98 18998
41729b81
PE
18999 * xgselect.c (xg_select): Remove unused var.
19000
f0c77cd1
PE
19001 * image.c (four_corners_best): Mark locals as initialized.
19002 (gif_load): Initialize transparent_p to zero (Bug#8238).
19003 Mark another local as initialized.
ec6cf4c6 19004 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 19005
ce0ad53d 19006 * image.c (clear_image_cache): Now static.
d5d5a617 19007 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 19008 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
19009 (x_edge_detection): Remove unnecessary cast that
19010 gcc -Wbad-function-cast diagnoses.
2037898d 19011 (gif_load): Fix pointer signedness.
6ae141d6
PE
19012 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19013 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 19014
33383987 190152011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 19016
d32df629
PE
19017 Improve quality of tests for time stamp overflow.
19018 For example, without this patch (encode-time 0 0 0 1 1
19019 1152921504606846976) returns the obviously-bogus value (-948597
19020 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19021 reports time overflow. See
19022 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
19023 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19024 * editfns.c: Include limits.h and intprops.h.
19025 (TIME_T_MIN, TIME_T_MAX): New macros.
19026 (time_overflow): Move earlier, to before first use.
19027 (hi_time, lo_time): New functions, for an accurate test for
19028 out-of-range times.
19029 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19030 (Fget_internal_run_time): Don't assume time_t fits in int.
19031 (make_time): Use list2 instead of Fcons twice.
19032 (Fdecode_time): More accurate test for out-of-range times.
19033 (check_tm_member): New function.
19034 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
19035 (lisp_time_argument): Don't rely on undefined left-shift and
19036 right-shift behavior when checking for time stamp overflow.
8be6f318 19037
fe31d94c
PE
19038 * editfns.c (time_overflow): New function, refactoring common code.
19039 (Fformat_time_string, Fdecode_time, Fencode_time):
19040 (Fcurrent_time_string): Use it.
19041
8be6f318
PE
19042 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19043 * dired.c (make_time): Move to ...
19044 * editfns.c (make_time): ... here.
19045 * systime.h: Note the move.
19046
09d9db2c 190472011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 19048
126bc0dc
YM
19049 * fringe.c (update_window_fringes): Remove unused variables.
19050
c47cbdfd
YM
19051 * unexmacosx.c (copy_data_segment): Also copy __got section.
19052 (Bug#8223)
19053
7ac80be9
EZ
190542011-03-12 Eli Zaretskii <eliz@gnu.org>
19055
c96bbc66 19056 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
19057 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19058 Constify `char *' arguments and their references according to
19059 prototypes in tparam.h.
19060
ecb0f94d 19061 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 19062
7ac80be9
EZ
19063 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19064 Adapt all references accordingly.
19065
19066 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19067
ef1fd07e
TT
190682011-03-11 Tom Tromey <tromey@redhat.com>
19069
19070 * buffer.c (syms_of_buffer): Remove obsolete comment.
19071
7ef4b50c
EZ
190722011-03-11 Eli Zaretskii <eliz@gnu.org>
19073
19074 * termhooks.h (encode_terminal_code): Declare prototype.
19075
19076 * msdos.c (encode_terminal_code): Don't declare prototype.
19077
19078 * term.c (encode_terminal_code): Now external again, used by
19079 w32console.c and msdos.c.
19080
44f230aa
SM
19081 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19082 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 19083
4b1ec863 190842011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 19085
1714f52b 19086 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 19087
4b1ec863
PE
19088 * fringe.c (update_window_fringes): Mark locals as initialized
19089 (Bug#8227).
19090 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 19091
524c7aa6
PE
19092 * alloc.c (mark_fringe_data): Move decl from here ...
19093 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19094 to check its interface.
19095 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19096
a5c0af81 19097 * fontset.c (free_realized_fontset): Now static.
7519b8cd 19098 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 19099 (fontset_font): Mark local as initialized.
a9a06e0b 19100 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 19101
b4716021
PE
19102 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19103
811e9bac 19104 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 19105 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
19106 (x_own_selection, Fx_disown_selection_internal): Rename locals
19107 to avoid shadowing.
19108 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 19109
7e3ab302
PE
19110 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19111 so that the caller can use some name other than gcpro1.
19112 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
19113 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19114 (Fx_backspace_delete_keys_p):
19115 Use them to avoid shadowing, and rename vars to avoid shadowing.
19116 (x_decode_color, x_set_name, x_window): Now static.
6b437900 19117 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 19118 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
19119 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19120 Remove unused locals.
7e3ab302
PE
19121 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19122 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19123 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19124 macros.
f78faa98 19125
e2b13473
PE
19126 * xterm.h (x_mouse_leave): New decl.
19127
77f23912
PE
19128 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19129 Remove unused functions.
cdf4ba58
PE
19130 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19131 (x_calc_absolute_position): Now static.
7411c686 19132 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 19133 Don't declare local "event" unless it's used.
ed7bf3a5
PE
19134 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19135 unless they are used.
38d0b34a
PE
19136 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19137 (x_fatal_error_signal): Remove; not used.
a6067996
PE
19138 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19139 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19140 (x_error_catcher, x_connection_closed, x_error_handler):
19141 (x_error_quitter, xembed_send_message, x_iconify_frame):
19142 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 19143 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 19144 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 19145
44f230aa
SM
19146 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19147 Rename or move locals to avoid shadowing.
6b463e58 19148 (tty_defined_color, merge_face_heights): Now static.
5967d051 19149 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
19150 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19151 does not deduce is never used uninitialized.
73719eba
PE
19152 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19153 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 19154
426994c3 19155 * terminal.c (store_terminal_param): Now static.
5489860b 19156
032f1620 19157 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 19158 (set_frame_menubar): Remove unused local.
d4323972 19159 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
19160 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19161 since they might point to immutable storage.
281585b0
PE
19162 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19163 since it's unused otherwise.
032f1620 19164
367c19e5 19165 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 19166 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
19167 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19168 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 19169 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
19170 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19171 does not deduce are never used uninitialized.
70739cbe 19172
07b48fa9
PE
19173 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19174
8868a238 19175 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
19176 * window.c (window_loop, size_window):
19177 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 19178
7e5cf297 19179 * window.c (display_buffer): Now static.
d6550a9f
PE
19180 (size_window): Mark variables that gcc -Wuninitialized
19181 does not deduce are never used uninitialized.
a586633d
PE
19182 * window.h (check_all_windows): New decl, to forestall
19183 gcc -Wmissing-prototypes diagnostic.
5b555da1 19184 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 19185
f6095868
PE
19186 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19187 shadowing.
19188 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
19189 Include <limits.h>.
19190 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19191 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
19192 (load_charset_map): Mark variables that gcc -Wuninitialized
19193 does not deduce are never used uninitialized.
53df7c11 19194 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 19195
f38b440c
PE
19196 * coding.c (coding_set_source, coding_set_destination):
19197 Use "else { /* comment */ }" rather than "else /* comment */;"
19198 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
19199 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19200 a block, when the outer 'i' will do.
19201 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19202 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19203 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19204 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19205 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19206 Rename locals to avoid shadowing.
19207 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
19208 * coding.c (emacs_mule_char, encode_invocation_designation):
19209 Now static, since they're not used elsewhere.
413bb2db 19210 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 19211 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
19212 (decode_coding_emacs_mule): Mark variables that gcc
19213 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
19214 (detect_coding_iso_2022): Initialize a local variable that might
19215 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 19216 this initialization is needed. (Bug#8211)
5f58e762
PE
19217 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19218 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19219 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19220 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19221 Remove unused macros.
f38b440c 19222
232b38b9 19223 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 19224 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 19225 * character.c (string_count_byte8): Likewise.
232b38b9 19226
fb90da1b
PE
19227 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19228 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19229
fb93dbc2
PE
19230 * chartab.c (copy_sub_char_table): Now static, since it's not used
19231 elsewhere.
5c156ace
PE
19232 (sub_char_table_ref_and_range, char_table_ref_and_range):
19233 Rename locals to avoid shadowing.
bbcd0949 19234 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 19235
7d3b3862 19236 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 19237 (BIDI_BOB): Remove unused macro.
7d3b3862 19238
6be7d3da
PE
19239 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19240 deduce are never used uninitialized.
c2ed9c8b 19241 * term.c (encode_terminal_code): Likewise.
6be7d3da 19242
75f8807f 19243 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 19244
50938595
PE
19245 * tparam.h: New file.
19246 * term.c, tparam.h: Include it.
19247 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19248 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19249 Move these decls to tparam.h, and make them agree with what
19250 is actually in tparam.c. The previous trick of using incompatible
19251 decls in different modules does not conform to the C standard.
19252 All callers of tparam changed to use tparam's actual API.
19253 * tparam.c (tparam1, tparam, tgoto):
19254 Use const pointers where appropriate.
19255
fbceeba2
PE
19256 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19257 * cm.h (struct cm): Likewise.
19258 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19259 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19260 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19261 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19262 (turn_on_face, init_tty): Likewise.
19263 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 19264
7f3f1250
PE
19265 * term.c (term_mouse_position): Rename local to avoid shadowing.
19266
e6ca6543
PE
19267 * alloc.c (mark_ttys): Move decl from here ...
19268 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19269
c40f8d15
AS
192702011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19271
19272 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19273
cfe0661d
JB
192742011-03-09 Juanma Barranquero <lekktu@gmail.com>
19275
19276 * search.c (compile_pattern_1): Remove argument regp, unused since
19277 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19278 (compile_pattern): Don't pass it.
19279
0afb4571
J
192802011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19281
19282 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19283 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19284 for ! HAVE_GTK3.
19285 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19286
19287 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19288
19289 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19290 gdk_window_get_screen, gdk_window_get_geometry,
19291 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19292 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19293 (xg_get_pixbuf_from_pixmap): New function.
19294 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19295 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19296 Call xg_get_pixbuf_from_pixmap instead of
19297 gdk_pixbuf_get_from_drawable.
19298 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19299 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19300 (xg_check_special_colors): Use GtkStyleContext and its functions
19301 for HAVE_GTK3.
19302 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19303 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19304 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
19305 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19306 Call gtk_widget_get_preferred_size.
0afb4571
J
19307 (xg_frame_resized): gdk_window_get_geometry only takes 5
19308 parameters.
44f230aa
SM
19309 (xg_win_to_widget, xg_event_is_for_menubar):
19310 Call gdk_x11_window_lookup_for_display.
0afb4571
J
19311 (xg_set_widget_bg): New function.
19312 (delete_cb): New function.
895009e1 19313 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 19314 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
19315 (xg_set_background_color): Call xg_set_widget_bg.
19316 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19317 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19318 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19319 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19320 if ! HAVE_GTK3.
19321 (update_frame_tool_bar): Call gtk_widget_hide.
19322 (xg_initialize): Use GDK_KEY_g.
19323
19324 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19325 if ! HAVE_GTK3
19326 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19327
19328 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19329 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19330 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19331
1c2cc4ef
JB
193322011-03-08 Juanma Barranquero <lekktu@gmail.com>
19333
19334 * w32xfns.c (select_palette): Check success of RealizePalette against
19335 GDI_ERROR, not zero.
19336
33383987 19337See ChangeLog.11 for earlier changes.
aac0c6e3
MR
19338
19339;; Local Variables:
19340;; coding: utf-8
aac0c6e3
MR
19341;; End:
19342
2f097256 19343 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
19344
19345 This file is part of GNU Emacs.
19346
19347 GNU Emacs is free software: you can redistribute it and/or modify
19348 it under the terms of the GNU General Public License as published by
19349 the Free Software Foundation, either version 3 of the License, or
19350 (at your option) any later version.
19351
19352 GNU Emacs is distributed in the hope that it will be useful,
19353 but WITHOUT ANY WARRANTY; without even the implied warranty of
19354 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19355 GNU General Public License for more details.
19356
19357 You should have received a copy of the GNU General Public License
19358 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.